Draw2d is a lightweight toolkit of
graphical components called
. Lightweight means that a
figure is simply a java object, with no corresponding resource in the operating
system. Figures can be composed via a parent-child relationship. Every figure
has a rectangular
inside which it, and its children, paint.
A layout manager can be used to place children based on their index and/or
LightweightSystem associates a figure composition with an SWT
Canvas. The lightweight system hooks listeners for most SWT events, and forwards
most of them to an
EventDispatcher, which translates them into
events on the appropriate figure.
Paint events, however, are forwarded to the
coordinates painting and layout. Figures can be updated in ways which affect
their appearance or size, and the update manager ensures that only one layout
occurs, followed by a repaint of only the region which was updated.
Any type of diagram, document, or drawing can be easily constructed and
efficiently updated by combining the provided figure and layout implementations
along with the use of custom figures or layouts when needed.
Painting - details of the paint process and
how nesting affects painting
Layout - preferred size, layout, validating
Hit Testing - finding figures, correcting
coordinates, modifying the space occupied by a figure
Connections and Routing - connections,
anchors, decorations, and routing
Coordinate Systems - absolute and relative
coordinates, working with absolute coordinates