tags:

views:

41

answers:

2

My team is short on time in implementing a simple shape editor. We have to be able to create, delete, move, and copy simple shapes like rectangles and lines. This has to be a stand-alone application (may not use applets). We've fully implemented our model underpinning the application, as well as the controllers. Any advice?

Edit: This is part of a much larger application. Just missing the presentation element, to clarify.

A: 

If you're just wanting to display graphics, check out the Java2D library.

Here is the API: http://download-llnw.oracle.com/javase/1.4.2/docs/guide/2d/spec.html There are also many many tutorials: (here is one) http://download.oracle.com/javase/tutorial/2d/index.html

Just try Googling Java 2D examples or some similar query.

I think you'll find it's actually pretty easy to draw 2D shape in Java :)

KennyCason
A: 

I had been using JHotDraw, a figure editor in my own application. You may refer to their source code. They are using design pattern quite extensively.

It is a not too bad figure editor, and it is originated by Erich Gamma, one of the author of classic design pattern.

JHotDraw is a two-dimensional graphics framework for structured drawing editors that is written in Java. It is based on Erich Gamma's JHotDraw, which is copyright 1996, 1997 by IFA Informatik and Erich Gamma.

Yan Cheng CHEOK