Package org.eclipse.gef.tools
Class PanningSelectionTool
java.lang.Object
org.eclipse.gef.util.FlagSupport
org.eclipse.gef.tools.AbstractTool
org.eclipse.gef.tools.TargetingTool
org.eclipse.gef.tools.SelectionTool
org.eclipse.gef.tools.PanningSelectionTool
- All Implemented Interfaces:
- RequestConstants,- Tool
A subclass of the SelectionTool that allows panning by holding down the space
 bar.
- 
Nested Class SummaryNested classes/interfaces inherited from class org.eclipse.gef.tools.AbstractToolAbstractTool.Input
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected static final intMax stateprotected static final intThe state to indicate that the space bar has been pressed but no drag has been initiated.protected static final intThe state to indicate that a pan is in progress.Fields inherited from class org.eclipse.gef.tools.SelectionToolMAX_FLAG, STATE_TRAVERSE_HANDLEFields inherited from class org.eclipse.gef.tools.AbstractToolMOUSE_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_TERMINALFields inherited from interface org.eclipse.gef.RequestConstantsREQ_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 SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected booleanReturnstrueif spacebar condition was accepted.protected StringReturns the debug name for this tool.protected StringgetDebugNameForState(int state) Returns a String representation of the given state for debug purposes.protected CursorReturns the cursor used under normal conditions.protected booleanhandleButtonDown(int which) If there is aHandleunder the mouse, this method sets the drag tracker returned from the handle.protected booleanhandleButtonUp(int which) Resets this tool when the last button is released.protected booleanCalled whenever the mouse is being dragged.protected booleanSets the drag tracker tonulland goes into the initial state when focus is lost.protected booleanProcesses key down events.protected booleanIf in the initial state and the viewer has aKeyHandler, callsKeyHandler.keyReleased(KeyEvent)sending it the given key event.Methods inherited from class org.eclipse.gef.tools.SelectionToolcreateHoverRequest, createTargetRequest, deactivate, eraseHoverFeedback, getCommandName, getDragTracker, getTargetHoverRequest, getTargetingConditional, getTargetRequest, handleCommandStackChanged, handleHover, handleHoverStop, handleMove, handleNativeDragFinished, handleNativeDragStarted, handleViewerExited, keyDown, keyUp, mouseDoubleClick, mouseDown, mouseDrag, mouseHover, mouseMove, mouseUp, mouseWheelScrolled, refreshCursor, setDragTracker, showHoverFeedback, updateHoverRequest, updateTargetRequestMethods inherited from class org.eclipse.gef.tools.TargetingTooldoAutoexpose, eraseTargetFeedback, getAutoexposeHelper, getCommand, getDirection, getExclusionSet, getTargetEditPart, handleAutoexpose, handleEnteredEditPart, handleExitingEditPart, handleInvalidInput, handleLeavingEditPart, isShowingTargetFeedback, isTargetLocked, lockTargetEditPart, resetFlags, resetHover, setAutoexposeHelper, setRefreshRate, setTargetEditPart, setTargetRequest, showTargetFeedback, unlockTargetEditPart, updateAutoexposeHelper, updateTargetUnderMouseMethods inherited from class org.eclipse.gef.tools.AbstractToolacceptArrowKey, accGetStep, accStepIncrement, accStepReset, activate, addFeedback, applyProperty, calculateCursor, commitDrag, createOperationSet, debug, executeCommand, executeCurrentCommand, focusGained, focusLost, getCurrentCommand, getCurrentInput, getCurrentViewer, getDisabledCursor, getDomain, getDragMoveDelta, getLocation, getOperationSet, getStartLocation, getState, handleDoubleClick, handleDragInProgress, handleDragStarted, handleFinished, handleFocusGained, handleKeyTraversed, handleViewerEntered, isActive, isHoverActive, isInState, isViewerImportant, keyTraversed, movedPastThreshold, nativeDragFinished, nativeDragStarted, performViewerMouseWheel, placeMouseInViewer, reactivate, releaseToolCapture, removeFeedback, setCurrentCommand, setCursor, setDefaultCursor, setDisabledCursor, setEditDomain, setHoverActive, setProperties, setStartLocation, setState, setToolCapture, setUnloadWhenFinished, setViewer, stateTransition, unloadWhenFinished, viewerEntered, viewerExitedMethods inherited from class org.eclipse.gef.util.FlagSupportgetFlag, setFlag
- 
Field Details- 
PANprotected static final int PANThe state to indicate that the space bar has been pressed but no drag has been initiated.- See Also:
 
- 
PAN_IN_PROGRESSprotected static final int PAN_IN_PROGRESSThe state to indicate that a pan is in progress.- See Also:
 
- 
MAX_STATEprotected static final int MAX_STATEMax state- See Also:
 
 
- 
- 
Constructor Details- 
PanningSelectionToolpublic PanningSelectionTool()
 
- 
- 
Method Details- 
acceptSpaceBarReturnstrueif spacebar condition was accepted.- Parameters:
- e- the key event
- Returns:
- true if the space bar was the key event.
 
- 
getDebugNameDescription copied from class:AbstractToolReturns the debug name for this tool.- Overrides:
- getDebugNamein class- SelectionTool
- Returns:
- the debug name
- See Also:
 
- 
getDebugNameForStateDescription copied from class:AbstractToolReturns a String representation of the given state for debug purposes.- Overrides:
- getDebugNameForStatein class- SelectionTool
- Parameters:
- state- the state
- Returns:
- the string for the given state
- See Also:
 
- 
getDefaultCursorReturns the cursor used under normal conditions.- Overrides:
- getDefaultCursorin class- AbstractTool
- Returns:
- the default cursor
- See Also:
 
- 
handleButtonDownprotected boolean handleButtonDown(int which) Description copied from class:SelectionToolIf there is aHandleunder the mouse, this method sets the drag tracker returned from the handle. If there's anEditPartunder the mouse, this method sets the drag tracker returned from the edit part.- Overrides:
- handleButtonDownin class- SelectionTool
- Parameters:
- which- which button went down
- Returns:
- trueif the buttonDown was handled
- See Also:
 
- 
handleButtonUpprotected boolean handleButtonUp(int which) Description copied from class:SelectionToolResets this tool when the last button is released.- Overrides:
- handleButtonUpin class- SelectionTool
- Parameters:
- which- the button being released
- Returns:
- trueif the button up was handled
- See Also:
 
- 
handleDragprotected boolean handleDrag()Description copied from class:AbstractToolCalled whenever the mouse is being dragged. This method continues to be called even onceAbstractTool.handleDragInProgress()starts getting called. By default, nothing happens, andfalseis returned. Subclasses may override this method to interpret a drag. Returningtrueindicates that the drag was handled in some way.- Overrides:
- handleDragin class- AbstractTool
- Returns:
- trueif the drag is handled
- See Also:
 
- 
handleFocusLostprotected boolean handleFocusLost()Description copied from class:SelectionToolSets the drag tracker tonulland goes into the initial state when focus is lost.- Overrides:
- handleFocusLostin class- SelectionTool
- Returns:
- trueif the event was handled
- See Also:
 
- 
handleKeyDownDescription copied from class:SelectionToolProcesses key down events. Specifically, arrow keys for moving edit parts, the ESC key for aborting a drag, the period '.' key for traversing handles, and the ENTER key for committing a drag. If none of these keys were pressed and the current viewer has aKeyHandler, it callsKeyHandler.keyPressed(KeyEvent).- Overrides:
- handleKeyDownin class- SelectionTool
- Parameters:
- e- the key event
- Returns:
- trueif the key down was handled.
- See Also:
 
- 
handleKeyUpDescription copied from class:SelectionToolIf in the initial state and the viewer has aKeyHandler, callsKeyHandler.keyReleased(KeyEvent)sending it the given key event.- Overrides:
- handleKeyUpin class- SelectionTool
- Parameters:
- e- the key event
- Returns:
- trueif the event was handled
- See Also:
 
 
-