Java Reference
In-Depth Information
Viewer
SelectionTool
DragTracker
EditPart
1: buttonDown
1.1: getDragTracker
1.2: buttonDown
2: buttonUp
2.1: buttonUp
2.1.1: select part
Figure 9-11
GEF mouse interaction
Closely related to selection is focus. Focus is a single
EditPart
that the
EditPartViewer
maintains. Focus is used when manipulating selection via key-
board. By moving focus, the user can navigate from one
EditPart
to another
without changing the current selection. The user can add or remove the focused
EditPart
from the selection. If focus is not explicitly set, it is the same as the
primary selected part.
Selection Handles
The
EditPart
is responsible for showing its selected and focused state to the
user. The viewer tells
EditPart
s when they are selected, when they are focused,
or when they have primary selection. Typically, selection is shown by one or more
EditPolicies adding selection handles. In Figure 9-12,
ResizableEditPolicy
added the handles. The black handles on the leftmost connection indicate primary
selection.
Because selection handles are related to how a part can be dragged or sized—
which, in turn, is related to the containing figure's layout manager—usually the
parent part's
EditPolicy
installs a policy on the children for displaying the
appropriate handles. For example, an
XYLayoutEditPolicy
would install a
ResizableEditPolicy
on each child of its host
EditPart
.
Search WWH ::
Custom Search