JHotDraw Pattern Language

Identifying Existing Figures

The Figure hierarchy defines the common graphical elements that can be added to a JHotDraw Application. At its root the interface Figure defines the common operations that a figure can be asked to perform. The direct descendant of Figure is AbstractFigure which defines much of the default behaviour of Figures in JHotDraw.

The Figures that are available for immediate reuse in JHotDraw applications are defined in two subclasses of AbstractFigure. AttributeFigure contains the majority with subclasses for all the common geometrical figures (i.e. rectangles, ellipses, polygons etc) while PolyLineFigure contains one class, LineFigure that represents lines on the drawing.

All figures in JHotDraw are defined as rectangular areas within which a visual element that represents the Figure is displayed. The rectangular area is called the figure's display box and it is used to set the size and the position of a figure on the Drawing. Figures can have other attributes as well and the developer should familiarise themselves with AbstractFigure and AttributeFigure where many common attributes and behaviours are defined.

The example applications provided with JHotDraw showcase many of the Figures available for reuse in other applications. The application JavaDraw (JHotDraw5.1/CH/ifa/draw/samples/javadraw) provides a particularly good example of the types of figure available. Developers interested in reusing existing figures should run this application to observe the appearance and behaviour available for each figure.

Copyright Douglas Kirk