A DrawingView has (or is) a JComponent that provides the screen estate for a Drawing as well as for the visual components of a DrawingEditor.

A Drawing can be part of multiple DrawingView's at the same time.
A DrawingView organizes its screen estate into a list of layers from back to front. A DrawingView has the following layers: constrainer, drawing, handles, tool. The DrawingView paints the background first, and then draws each of its layers by invoking the draw method of each object responsible for that specific layer.

A Drawing has a draw method that takes a java.awt.Graphics2D object as an argument. A Drawing draws all its Figures from back to front onto the Graphics2D object by invoking the draw methods of each of its Figures.

Complex Figures can delegate the drawing to other objects. These are often Shape objects of the java.awt.geom package or the org.jhotdraw.geom package, but not always, a CompositeFigure typically delegates the drawing to each of its child Figures by invoking the draw method on its Figures from back to front.

All Figures in a Drawing share the same coordinate space. The coordinate space is expressed in double precision real numbers. Typically a unit in the coordinate space is equivalent to a Pixel on the computer screen. A DrawingView can transform the coordinate space of a Drawing to achieve zooming. The render a zoomed Drawing, the DrawingView creates a transformed Graphics2D object before it invokes the draw method on its Drawing object. The other layers are drawn with an untransformed Graphics2D object.

 

Viewing a Drawing

JHotDraw 7