JHotDraw Pattern Language

Customising the GUI


The graphical user interface (GUI) of JHotDraw is defined within the DrawApplication class. Many parts of this GUIs appearance and behaviour can be customised to suit specific applications.



The JHotDraw Application GUI

The above image shows an example of a JHotDraw application. It illustrates the various parts that comprise the interface to a JHotDraw application: the menu bar, the tool bar and the status bar.

Menu bar: The menu bar runs along the top of the window just below the title bar. It contains menus for File, Edit, Align, Attributes and Debug operations. The menu bar is customisable, elements can be added to the menus, some elements can be removed and the behaviours of existing elements can be changed as required by the application.

Tool bar: The tool bar runs down the left-hand side of the window. The tool bar contains icons for the different kinds of tools available to the application. By default the framework offers the selection tool but as the example above shows it is possible to add other tools to create elements or to edit parts of the drawing.

Status bar: The status bar is the white area running along the bottom of the window. It displays information about the current state of the application (i.e. currently selected tool). This is customisable to display specific information about an application. The showStatus(String) method in DrawApplication can be used to pass status information to the status bar.


Copyright Douglas Kirk.