|
GEF (MVC) 3.9.0.201308190730 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Tool
A Tool
interprets Mouse and Keyboard input from an
EditDomain
and its EditPartViewers
. The active
Tool and its state determines how the EditDomain will interpret input. Input
flows from a Viewer, to the EditDomain, to the EditDomain's active Tool.
Tools
process low-level events and turn them into higher-level
operations. These operations are encapsulated by Requests
.
The Requests are then used to communicate with EditParts in the Viewer to
perform the User's operation. Using Requests, Tools will:
Commands
to
perform changes on the model.
EditPart.performRequest(Request)
.
Tools also perform operations that do not involve the EditParts directly,
such as changing the Viewer's selection, scrolling the viewer, or invoking an
Action
.
![]() | All feedback should be erased and temporary changes reverted prior to executing any command. |
![]() | Tools should process most keystrokes. For example, the DELETE key should
not be handled by adding a KeyListener to the Viewer's Control.
Doing so would mean that pressing DELETE would not be sensitive to
which Tool is currently active, and the state of the Tool. See
KeyHandler for how keystrokes are generally
processed.
|
IMPORTANT: This interface is not intended to be implemented by
clients. Clients should inherit from
AbstractTool
. New methods may be added in the
future.
Method Summary | |
---|---|
void |
activate()
Called when this tool becomes the active tool for the EditDomain. |
void |
deactivate()
Called when another Tool becomes the active tool for the EditDomain. |
void |
focusGained(FocusEvent event,
EditPartViewer viewer)
Called when a Viewer's Control gains keyboard focus. |
void |
focusLost(FocusEvent event,
EditPartViewer viewer)
Called when a Viewer's Control loses keyboard focus. |
void |
keyDown(KeyEvent keyEvent,
EditPartViewer viewer)
Called when a Viewer receives a key press. |
void |
keyTraversed(TraverseEvent event,
EditPartViewer viewer)
Called when a viewer receives a key traversal. |
void |
keyUp(KeyEvent keyEvent,
EditPartViewer viewer)
Called when a Viewer receives a key up. |
void |
mouseDoubleClick(MouseEvent mouseEvent,
EditPartViewer viewer)
Called when a Viewer receives a double-click. |
void |
mouseDown(MouseEvent mouseEvent,
EditPartViewer viewer)
Called when a Viewer receives a mouse down. |
void |
mouseDrag(MouseEvent mouseEvent,
EditPartViewer viewer)
Called when a Viewer receives a mouse drag. |
void |
mouseHover(MouseEvent mouseEvent,
EditPartViewer viewer)
Called when a Viewer receives a mouse hover. |
void |
mouseMove(MouseEvent mouseEvent,
EditPartViewer viewer)
Called when a Viewer receives a mouse move. |
void |
mouseUp(MouseEvent mouseEvent,
EditPartViewer viewer)
Called when a Viewer receives a mouse up. |
void |
mouseWheelScrolled(Event event,
EditPartViewer viewer)
Called when the mouse wheel has been scrolled. |
void |
nativeDragFinished(DragSourceEvent event,
EditPartViewer viewer)
Called when a native drag ends on a Viewer. |
void |
nativeDragStarted(DragSourceEvent event,
EditPartViewer viewer)
Called when a native drag begins on a Viewer. |
void |
setEditDomain(EditDomain domain)
Called to set the EditDomain for this Tool. |
void |
setProperties(java.util.Map properties)
This method can be invoked to set any properties of this tool. |
void |
setViewer(EditPartViewer viewer)
Called to set the current Viewer receiving events. |
void |
viewerEntered(MouseEvent mouseEvent,
EditPartViewer viewer)
Called when a Viewer receives a mouse enter. |
void |
viewerExited(MouseEvent mouseEvent,
EditPartViewer viewer)
Called when a Viewer receives a mouse exit. |
Method Detail |
---|
void activate()
deactivate()
void deactivate()
void focusGained(FocusEvent event, EditPartViewer viewer)
event
- The SWT focus eventviewer
- The Viewer which gained focusvoid focusLost(FocusEvent event, EditPartViewer viewer)
event
- The SWT focus eventviewer
- The viewer that is losing focusvoid keyDown(KeyEvent keyEvent, EditPartViewer viewer)
keyEvent
- the SWT KeyEventviewer
- the Viewer which received a key pressvoid keyTraversed(TraverseEvent event, EditPartViewer viewer)
false
.
event
- the SWT eventviewer
- the viewer which received the traversalvoid keyUp(KeyEvent keyEvent, EditPartViewer viewer)
keyEvent
- the SWT KeyEventviewer
- the Viewer which received a key upvoid mouseDoubleClick(MouseEvent mouseEvent, EditPartViewer viewer)
mouseEvent
- the SWT mouse eventviewer
- the Viewer which received a double-clickvoid mouseDown(MouseEvent mouseEvent, EditPartViewer viewer)
mouseEvent
- the SWT mouse eventviewer
- the Viewer which received a mouse downvoid mouseDrag(MouseEvent mouseEvent, EditPartViewer viewer)
mouseEvent
- the SWT mouse eventviewer
- the Viewer which received a dragvoid mouseHover(MouseEvent mouseEvent, EditPartViewer viewer)
mouseEvent
- the SWT mouse eventviewer
- the Viewer which received a mouse downMouseTrackListener.mouseHover(MouseEvent)
void mouseMove(MouseEvent mouseEvent, EditPartViewer viewer)
mouseEvent
- the SWT mouse eventviewer
- the Viewer which received a mouse movemouseDrag(MouseEvent, EditPartViewer)
void mouseUp(MouseEvent mouseEvent, EditPartViewer viewer)
mouseEvent
- the SWT mouse eventviewer
- the Viewer which received a mouse upvoid mouseWheelScrolled(Event event, EditPartViewer viewer)
event
- The SWT eventviewer
- The source of the eventvoid nativeDragFinished(DragSourceEvent event, EditPartViewer viewer)
mouseUp(..)
will not occur once a native drag has started. The Tool should correct
its state to handle this lost Event.
event
- the SWT DragSourceEventviewer
- the Viewer on which a native drag startedvoid nativeDragStarted(DragSourceEvent event, EditPartViewer viewer)
mouseUp(..)
will not occur once a native drag has started. The Tool should correct
its state to handle this lost Event.
event
- the SWT DragSourceEventviewer
- the Viewer on which a native drag startedvoid setEditDomain(EditDomain domain)
activate()
.
domain
- The EditDomain to which this Tool belongsvoid setViewer(EditPartViewer viewer)
DragTrackers
.
viewer
- The current Viewervoid viewerEntered(MouseEvent mouseEvent, EditPartViewer viewer)
mouseEvent
- the SWT mouse eventviewer
- the Viewer which received a mouse entervoid viewerExited(MouseEvent mouseEvent, EditPartViewer viewer)
mouseEvent
- the SWT mouse eventviewer
- the Viewer which received a mouse exitvoid setProperties(java.util.Map properties)
This method should only be invoked once when the tool is first constructed and is being initialized. Invoking this method at other times may have undesired effects.
properties
- a mapping of the properties to be set and their new values;
can be null
|
GEF (MVC) 3.9.0.201308190730 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |