|
Eclipse GEF 3.2 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.eclipse.gef.util.FlagSupport
org.eclipse.gef.tools.AbstractTool
org.eclipse.gef.tools.TargetingTool
org.eclipse.gef.tools.SelectionTool
Tool to select and manipulate figures. A selection tool is in one of three states, e.g., background selection, figure selection, handle manipulation. The different states are handled by different child tools.
| Nested Class Summary |
| Nested classes inherited from class org.eclipse.gef.tools.AbstractTool |
AbstractTool.Input |
| Field Summary | |
protected static int |
MAX_FLAG
Max flag |
protected static int |
MAX_STATE
Max state |
protected static int |
STATE_TRAVERSE_HANDLE
Traverse handle state |
| Fields inherited from class org.eclipse.gef.tools.AbstractTool |
MOUSE_BUTTON_ANY, MOUSE_BUTTON1, MOUSE_BUTTON2, MOUSE_BUTTON3, PROPERTY_UNLOAD_WHEN_FINISHED, STATE_ACCESSIBLE_DRAG, STATE_ACCESSIBLE_DRAG_IN_PROGRESS, STATE_DRAG, STATE_DRAG_IN_PROGRESS, STATE_INITIAL, STATE_INVALID, STATE_TERMINAL |
| Fields inherited from interface org.eclipse.gef.RequestConstants |
REQ_ADD, REQ_ALIGN, REQ_ALIGN_CHILDREN, REQ_CLONE, REQ_CONNECTION_END, REQ_CONNECTION_START, REQ_CREATE, REQ_CREATE_BENDPOINT, REQ_DELETE, REQ_DELETE_DEPENDANT, REQ_DIRECT_EDIT, REQ_MOVE, REQ_MOVE_BENDPOINT, REQ_MOVE_CHILDREN, REQ_OPEN, REQ_ORPHAN, REQ_ORPHAN_CHILDREN, REQ_RECONNECT_SOURCE, REQ_RECONNECT_TARGET, REQ_RESIZE, REQ_RESIZE_CHILDREN, REQ_SELECTION, REQ_SELECTION_HOVER |
| Constructor Summary | |
SelectionTool()
Default constructor. |
|
| Method Summary | |
protected void |
createHoverRequest()
Creates the hover request (a LocationRequest) and sets its type to
RequestConstants.REQ_SELECTION_HOVER. |
protected Request |
createTargetRequest()
Creates a SelectionRequest for the target request. |
void |
deactivate()
Deactivates the tool. |
protected void |
eraseHoverFeedback()
Erases the hover feedback by calling EditPart.eraseTargetFeedback(Request). |
protected String |
getCommandName()
Returns the identifier of the command that is being sought. |
protected String |
getDebugName()
Returns the debug name for this tool. |
protected String |
getDebugNameForState(int state)
Returns a String representation of the given state for debug purposes. |
protected DragTracker |
getDragTracker()
Returns the current drag tracker. |
protected Request |
getTargetHoverRequest()
Returns the target hover request. |
protected EditPartViewer.Conditional |
getTargetingConditional()
Returns a new Conditional that evaluates to true if the queried edit
part's EditPart.isSelectable() method returns true. |
protected boolean |
handleButtonDown(int button)
If there is a Handle under the mouse, this method sets the drag tracker
returned from the handle. |
protected boolean |
handleButtonUp(int button)
Resets this tool when the last button is released. |
protected boolean |
handleCommandStackChanged()
Called when the command stack has changed, for instance, when a delete or undo command has been executed. |
protected boolean |
handleFocusLost()
Sets the drag tracker to null and goes into the initial state when focus
is lost. |
protected boolean |
handleHover()
Called when the mouse hovers. |
protected boolean |
handleHoverStop()
Called when the mouse hover stops (i.e. the mouse moves or a button is clicked). |
protected boolean |
handleKeyDown(KeyEvent e)
Processes key down events. |
protected boolean |
handleKeyUp(KeyEvent e)
If in the initial state and the viewer has a KeyHandler, calls
KeyHandler.keyReleased(KeyEvent) sending it the given key event. |
protected boolean |
handleMove()
If in the initial state, updates the request and the mouse target and asks to show target feedback. |
boolean |
handleNativeDragFinished(DragSourceEvent event)
If there's a drag tracker, calls handleNativeDragFinished() on the drag tracker and then sets the drag tracker to null. |
boolean |
handleNativeDragStarted(DragSourceEvent event)
If there's a drag tracker, calls nativeDragStarted() on the drag tracker. |
protected boolean |
handleViewerExited()
If there's a drag tracker, sets it to null and then sets this tool's
state to the initial state. |
void |
keyDown(KeyEvent evt,
EditPartViewer viewer)
Forwards the key down event to the drag tracker, if one exists. |
void |
keyUp(KeyEvent evt,
EditPartViewer viewer)
Forwards the key up event to the drag tracker, if one exists. |
void |
mouseDoubleClick(MouseEvent e,
EditPartViewer viewer)
Forwards the mouse double clicked event to the drag tracker, if one exists. |
void |
mouseDown(MouseEvent e,
EditPartViewer viewer)
Forwards the mouse down event to the drag tracker, if one exists. |
void |
mouseDrag(MouseEvent e,
EditPartViewer viewer)
Forwards the mouse drag event to the drag tracker, if one exists. |
void |
mouseHover(MouseEvent me,
EditPartViewer viewer)
Forwards the mouse hover event to the drag tracker, if one exists. |
void |
mouseMove(MouseEvent me,
EditPartViewer viewer)
Forwards the mouse move event to the drag tracker, if one exists. |
void |
mouseUp(MouseEvent e,
EditPartViewer viewer)
Forwards the mouse up event to the drag tracker, if one exists. |
void |
mouseWheelScrolled(Event event,
EditPartViewer viewer)
Delegates the scrolling to the DragTracker (if there is one). |
protected void |
refreshCursor()
If there is a drag tracker, this method does nothing so that the drag tracker can take care of the cursor. |
void |
setDragTracker(DragTracker newDragTracker)
Sets the drag tracker for this SelectionTool. |
protected void |
showHoverFeedback()
Asks the target edit part (if there is one) to show hover feedback via EditPart.showTargetFeedback(Request) with a hover request. |
protected void |
updateHoverRequest()
Updates the location of the hover request. |
protected void |
updateTargetRequest()
Sets the modifiers , type and location of the target request (which is a SelectionRequest) and then calls updateHoverRequest(). |
| Methods inherited from class org.eclipse.gef.util.FlagSupport |
getFlag, setFlag |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static final int MAX_FLAG
protected static final int STATE_TRAVERSE_HANDLE
protected static final int MAX_STATE
| Constructor Detail |
public SelectionTool()
| Method Detail |
protected void createHoverRequest()
LocationRequest) and sets its type to
RequestConstants.REQ_SELECTION_HOVER.
protected Request createTargetRequest()
SelectionRequest for the target request.
createTargetRequest in class TargetingToolTargetingTool.createTargetRequest()public void deactivate()
null.
deactivate in interface Tooldeactivate in class TargetingToolTool.deactivate()protected void eraseHoverFeedback()
EditPart.eraseTargetFeedback(Request).
protected String getCommandName()
AbstractTool
getCommandName in class AbstractToolAbstractTool.getCommandName()protected String getDebugName()
AbstractTool
getDebugName in class AbstractToolAbstractTool.getDebugName()protected DragTracker getDragTracker()
protected EditPartViewer.Conditional getTargetingConditional()
true if the queried edit
part's EditPart.isSelectable() method returns true.
getTargetingConditional in class TargetingToolTargetingTool.getTargetingConditional()protected Request getTargetHoverRequest()
null, it will be created via
createHoverRequest().
protected boolean handleButtonDown(int button)
Handle under the mouse, this method sets the drag tracker
returned from the handle. If there's an EditPart under the mouse, this method
sets the drag tracker returned from the edit part.
handleButtonDown in class AbstractToolbutton - which button went down
true if the buttonDown was handledAbstractTool.handleButtonDown(int)protected boolean handleButtonUp(int button)
handleButtonUp in class AbstractToolbutton - the button being released
true if the button up was handledAbstractTool.handleButtonUp(int)protected boolean handleCommandStackChanged()
AbstractToolSTATE_INVALID and
handleInvalidInput is called. Subclasses may override this method to change what
happens when the command stack changes. Returning true indicates that the
change was handled in some way.
handleCommandStackChanged in class AbstractTooltrue if the change was handled in some wayAbstractTool.handleCommandStackChanged()protected boolean handleFocusLost()
null and goes into the initial state when focus
is lost.
handleFocusLost in class AbstractTooltrue if the event was handledAbstractTool.handleFocusLost()protected boolean handleHover()
showHoverFeedback().
handleHover in class AbstractTooltrue if the hover was handledAbstractTool.handleHover()protected boolean handleHoverStop()
eraseHoverFeedback().
handleHoverStop in class TargetingTooltrue if the hover stop is processed in some wayTargetingTool.handleHoverStop()protected boolean handleKeyDown(KeyEvent e)
KeyHandler, it calls KeyHandler.keyPressed(KeyEvent).
handleKeyDown in class AbstractToole - the key event
true if the key down was handled.AbstractTool.handleKeyDown(KeyEvent)protected boolean handleKeyUp(KeyEvent e)
KeyHandler, calls
KeyHandler.keyReleased(KeyEvent) sending it the given key event.
handleKeyUp in class AbstractToole - the key event
true if the event was handledAbstractTool.handleKeyUp(KeyEvent)protected boolean handleMove()
handleMove in class AbstractTooltrue if the mouse move was handledAbstractTool.handleMove()public boolean handleNativeDragFinished(DragSourceEvent event)
null.
handleNativeDragFinished in class AbstractToolevent - the drag event
true if the native drag finished was handledAbstractTool.handleNativeDragFinished(DragSourceEvent)public boolean handleNativeDragStarted(DragSourceEvent event)
handleNativeDragStarted in class AbstractToolevent - the drag event
true if the native drag start was handledAbstractTool.handleNativeDragStarted(DragSourceEvent)protected boolean handleViewerExited()
null and then sets this tool's
state to the initial state.
handleViewerExited in class TargetingToolAbstractTool.handleViewerExited()
public void keyDown(KeyEvent evt,
EditPartViewer viewer)
keyDown in interface ToolkeyDown in class AbstractToolevt - the key eventviewer - the originating viewerTool.keyDown(KeyEvent,
org.eclipse.gef.EditPartViewer)
public void keyUp(KeyEvent evt,
EditPartViewer viewer)
keyUp in interface ToolkeyUp in class AbstractToolevt - the key eventviewer - the originating viewerTool.keyUp(KeyEvent,
org.eclipse.gef.EditPartViewer)
public void mouseDown(MouseEvent e,
EditPartViewer viewer)
mouseDown in interface ToolmouseDown in class AbstractToole - the mouse eventviewer - the originating viewerTool.mouseDown(MouseEvent,
org.eclipse.gef.EditPartViewer)
public void mouseDoubleClick(MouseEvent e,
EditPartViewer viewer)
mouseDoubleClick in interface ToolmouseDoubleClick in class AbstractToole - the mouse eventviewer - the originating viewerTool.mouseDoubleClick(MouseEvent,
org.eclipse.gef.EditPartViewer)
public void mouseDrag(MouseEvent e,
EditPartViewer viewer)
mouseDrag in interface ToolmouseDrag in class AbstractToole - the mouse eventviewer - the originating viewerTool.mouseDrag(MouseEvent,
org.eclipse.gef.EditPartViewer)
public void mouseHover(MouseEvent me,
EditPartViewer viewer)
mouseHover in interface ToolmouseHover in class AbstractToolme - the mouse eventviewer - the originating viewerTool.mouseHover(MouseEvent,
org.eclipse.gef.EditPartViewer)
public void mouseMove(MouseEvent me,
EditPartViewer viewer)
mouseMove in interface ToolmouseMove in class AbstractToolme - the mouse eventviewer - the originating viewerTool.mouseMove(MouseEvent,
org.eclipse.gef.EditPartViewer)
public void mouseUp(MouseEvent e,
EditPartViewer viewer)
mouseUp in interface ToolmouseUp in class AbstractToole - the mouse eventviewer - the originating viewerTool.mouseUp(MouseEvent,
org.eclipse.gef.EditPartViewer)
public void mouseWheelScrolled(Event event,
EditPartViewer viewer)
mouseWheelScrolled in interface ToolmouseWheelScrolled in class AbstractToolevent - the SWT scroll eventviewer - the originating viewerTool.mouseWheelScrolled(org.eclipse.swt.widgets.Event, org.eclipse.gef.EditPartViewer)protected void refreshCursor()
super.
refreshCursor in class AbstractToolAbstractTool.refreshCursor()public void setDragTracker(DragTracker newDragTracker)
null, this method deactivates it. If the new drag tracker is not
null, this method will activate it and set the EditDomain and
EditPartViewer.
newDragTracker - the new drag trackerprotected void showHoverFeedback()
EditPart.showTargetFeedback(Request) with a hover request.
protected void updateHoverRequest()
protected void updateTargetRequest()
SelectionRequest) and then calls updateHoverRequest().
updateTargetRequest in class TargetingToolTargetingTool.updateTargetRequest()protected String getDebugNameForState(int state)
AbstractTool
getDebugNameForState in class AbstractToolstate - the state
AbstractTool.getDebugNameForState(int)
|
Eclipse GEF 3.2 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||