Mauro Marinilli's JDrawing Application
marinilli.com > Projects > JDrawing Didactical Application
The JDrawing Application
About the Project
JDrawing is a simple Java drawing editor.
It allows adding symbols onto a canvas, editing and saving them.
It has been developed for an Earthweb.com three article series.
This website hosts only the source & executable code
(thanks of a courtesy from Earthweb Inc.) while the articles are freely available at the
To try it out just download the above-mentioned file
and type from a command line prompt: "java -jar jdrawing.zip"
(of course you need Java2 properly installed).
Here is a screenshot of the application at work.
figure 1. a screenshot from the JDrawing Application
How to Use it
To add a symbol to the canvas just select it from the palette
(menu Add) and then clicking on the canvas will add a symbol with default values to the current draw.
Then, using the show properties command the default values can be modified.
Note that there's a distinction between the selected / editing states.
For example, during editing the dragging facility is disabled. For more information please read the related articles.
The following symbols are implemented:
- Line A polyline; use the right mouse button to add new control points. The show properties command is used to edit the color and the stroke width.
- BitmapIcon A simple bitmap image, without the edit state (i.e. double-clicking on it doesn't change its internal state to the editing one). The only property that can be changed is the gif/jpg image file, clicking on it in the property dialog.
- Curve The same behavior of the Line symbol.
- Ellipse It can be modified using the two control points. The mouse right button doesn't work.
Some people helped this page and this little piece of software to be available as it is, free to all.
Firstly, Kieron Murphy at Earthweb.com for his kind help throughout all the steps, from the articles to this final page.
Finally, a warm thanks to all the readers that contacted me, supporting this project.
A brief description of the article series
(See the related articles).
Part 1 Describes the symbol ontology for this domain.
Part 2 Discusses the Draw class and the action framework.
Part 3 Introduces the control classes, using the Mediator design pattern, and concludes showing the static class diagram of the whole editor (as of version 1.0).
Nov.2000 Fixed the downloadable file, that now contains both source and executable.
Oct.2000 Written the essential classes and the UI fully working (version 1.0).
Everything was available at Gamelan's web site
(I was contacted by readers that couldn't find the articles on Gamelan's Website anymore.
I don't know hot to help in this case.)
Many features needs to be refined:
- the Rotate action isn't implemented for other symbols than BitmapIcon
- Print is not implemented yet.
- Saving and restoring preferences isn't implemented properly.
- Many other little details still need to be implemented.
Finally, thank you for your interest in JDrawing!
Java, is a trademark of SUN Microsystems inc., other material (articles and vers. 1.0 of the source code) is © of Earthweb Inc.
© 1998-2008 Mauro Marinilli