Java Reference
In-Depth Information
Figure 9-1
GEF dependencies
9.1 Draw2d
Figures lie at the heart of the Draw2d toolkit. Figures can consist of children fig-
ures, which are painted inside the parent's bounds and arranged by a layout man-
ager. A LightweightSystem coordinates the Canvas with the set of figures by
forwarding nonpaint events from SWT using an EventDispatcher . Paint
events are forwarded to the UpdateManager , which coordinates painting and
layout, as shown in Figure 9-2.
9.1.1 Figures
Because Figures figure so prominently in Draw2d, let's discuss their general
responsibilities as defined in their extensive API. Following are some highlights;
the rest of this section goes into more detail on their use. Figures are responsible
for the following:
Adding and removing child figures
Adding and removing listeners (for example, coordinate, figure, focus,
key, layout, ancestor, mouse, and property change listeners)
Calculating whether a point falls within the figure bounds (hit testing)
Locating a figure for a given location
Returning the figure's border, bounds, location, ToolTip, color, font,
transparency, visibility, and so on
 
Search WWH ::




Custom Search