|
Eclipse GEF 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
|
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 |
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 |
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 |
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 |
public void activate()
deactivate()
public void deactivate()
public void focusGained(FocusEvent event, EditPartViewer viewer)
event
- The SWT focus eventviewer
- The Viewer which gained focuspublic void focusLost(FocusEvent event, EditPartViewer viewer)
event
- The SWT focus eventviewer
- The viewer that is losing focuspublic void keyDown(KeyEvent keyEvent, EditPartViewer viewer)
keyEvent
- the SWT KeyEventviewer
- the Viewer which received a key presspublic void keyUp(KeyEvent keyEvent, EditPartViewer viewer)
keyEvent
- the SWT KeyEventviewer
- the Viewer which received a key uppublic void mouseDoubleClick(MouseEvent mouseEvent, EditPartViewer viewer)
mouseEvent
- the SWT mouse eventviewer
- the Viewer which received a double-clickpublic void mouseDown(MouseEvent mouseEvent, EditPartViewer viewer)
mouseEvent
- the SWT mouse eventviewer
- the Viewer which received a mouse downpublic void mouseDrag(MouseEvent mouseEvent, EditPartViewer viewer)
mouseEvent
- the SWT mouse eventviewer
- the Viewer which received a dragpublic void mouseHover(MouseEvent mouseEvent, EditPartViewer viewer)
mouseEvent
- the SWT mouse eventviewer
- the Viewer which received a mouse downMouseTrackListener.mouseHover(MouseEvent)
public void mouseMove(MouseEvent mouseEvent, EditPartViewer viewer)
mouseEvent
- the SWT mouse eventviewer
- the Viewer which received a mouse movemouseDrag(MouseEvent, EditPartViewer)
public void mouseUp(MouseEvent mouseEvent, EditPartViewer viewer)
mouseEvent
- the SWT mouse eventviewer
- the Viewer which received a mouse uppublic void 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 startedpublic void 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 startedpublic void setEditDomain(EditDomain domain)
activate()
.
domain
- The EditDomain to which this Tool belongspublic void setViewer(EditPartViewer viewer)
DragTrackers
.
viewer
- The current Viewerpublic void viewerEntered(MouseEvent mouseEvent, EditPartViewer viewer)
mouseEvent
- the SWT mouse eventviewer
- the Viewer which received a mouse enterpublic void viewerExited(MouseEvent mouseEvent, EditPartViewer viewer)
mouseEvent
- the SWT mouse eventviewer
- the Viewer which received a mouse exit
|
Eclipse GEF 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |