|
GEF (MVC) 3.9.100.201405261516 |
|||||||||
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
org.eclipse.gef.tools.PanningSelectionTool
public class PanningSelectionTool
A subclass of the SelectionTool that allows panning by holding down the space bar.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.eclipse.gef.tools.AbstractTool |
---|
AbstractTool.Input |
Field Summary | |
---|---|
protected static int |
MAX_STATE
Max state |
protected static int |
PAN
The state to indicate that the space bar has been pressed but no drag has been initiated. |
protected static int |
PAN_IN_PROGRESS
The state to indicate that a pan is in progress. |
Fields inherited from class org.eclipse.gef.tools.SelectionTool |
---|
MAX_FLAG, STATE_TRAVERSE_HANDLE |
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 | |
---|---|
PanningSelectionTool()
|
Method Summary | |
---|---|
protected boolean |
acceptSpaceBar(KeyEvent e)
Returns true if spacebar condition was accepted. |
protected java.lang.String |
getDebugName()
Returns the debug name for this tool. |
protected java.lang.String |
getDebugNameForState(int state)
Returns a String representation of the given state for debug purposes. |
protected Cursor |
getDefaultCursor()
Returns the cursor used under normal conditions. |
protected boolean |
handleButtonDown(int which)
If there is a Handle under the mouse, this method sets the drag
tracker returned from the handle. |
protected boolean |
handleButtonUp(int which)
Resets this tool when the last button is released. |
protected boolean |
handleDrag()
Called whenever the mouse is being dragged. |
protected boolean |
handleFocusLost()
Sets the drag tracker to null and goes into the initial
state when focus is lost. |
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. |
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 PAN
protected static final int PAN_IN_PROGRESS
protected static final int MAX_STATE
Constructor Detail |
---|
public PanningSelectionTool()
Method Detail |
---|
protected boolean acceptSpaceBar(KeyEvent e)
true
if spacebar condition was accepted.
e
- the key event
protected java.lang.String getDebugName()
AbstractTool
getDebugName
in class SelectionTool
AbstractTool.getDebugName()
protected java.lang.String getDebugNameForState(int state)
AbstractTool
getDebugNameForState
in class SelectionTool
state
- the state
AbstractTool.getDebugNameForState(int)
protected Cursor getDefaultCursor()
getDefaultCursor
in class AbstractTool
AbstractTool.setDefaultCursor(Cursor)
protected boolean handleButtonDown(int which)
SelectionTool
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 SelectionTool
which
- which button went down
true
if the buttonDown was handledSelectionTool.handleButtonDown(int)
protected boolean handleButtonUp(int which)
SelectionTool
handleButtonUp
in class SelectionTool
which
- the button being released
true
if the button up was handledSelectionTool.handleButtonUp(int)
protected boolean handleDrag()
AbstractTool
AbstractTool.handleDragInProgress()
starts getting called.
By default, nothing happens, and false
is returned.
Subclasses may override this method to interpret a drag. Returning
true
indicates that the drag was handled in some way.
handleDrag
in class AbstractTool
true
if the drag is handledAbstractTool.handleDrag()
protected boolean handleFocusLost()
SelectionTool
null
and goes into the initial
state when focus is lost.
handleFocusLost
in class SelectionTool
true
if the event was handledSelectionTool.handleFocusLost()
protected boolean handleKeyDown(KeyEvent e)
SelectionTool
KeyHandler
, it calls
KeyHandler.keyPressed(KeyEvent)
.
handleKeyDown
in class SelectionTool
e
- the key event
true
if the key down was handled.SelectionTool.handleKeyDown(org.eclipse.swt.events.KeyEvent)
protected boolean handleKeyUp(KeyEvent e)
SelectionTool
KeyHandler
, calls
KeyHandler.keyReleased(KeyEvent)
sending it the given key event.
handleKeyUp
in class SelectionTool
e
- the key event
true
if the event was handledSelectionTool.handleKeyUp(org.eclipse.swt.events.KeyEvent)
|
GEF (MVC) 3.9.100.201405261516 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |