Package org.eclipse.gef.tools
Class DragEditPartsTracker
java.lang.Object
org.eclipse.gef.util.FlagSupport
org.eclipse.gef.tools.AbstractTool
org.eclipse.gef.tools.TargetingTool
org.eclipse.gef.tools.SelectEditPartTracker
org.eclipse.gef.tools.DragEditPartsTracker
- All Implemented Interfaces:
- DragTracker,- RequestConstants,- Tool
A DragTracker that moves 
EditParts.- 
Nested Class SummaryNested classes/interfaces inherited from class org.eclipse.gef.tools.AbstractToolAbstractTool.Input
- 
Field SummaryFieldsFields inherited from class org.eclipse.gef.tools.SelectEditPartTrackerFLAG_SELECTION_PERFORMEDFields inherited from class org.eclipse.gef.tools.AbstractToolMAX_STATE, 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_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 SummaryConstructorsConstructorDescriptionDragEditPartsTracker(EditPart sourceEditPart) Constructs a new DragEditPartsTracker with the given source edit part.
- 
Method SummaryModifier and TypeMethodDescriptionvoidErases feedback and callsperformDrag().Returns a List of top-level edit parts excluding dependants (by callingToolUtilities.getSelectionWithoutDependants(EditPartViewer)that understand the current target request (by callingToolUtilities.filterEditPartsUnderstanding(List, Request).protected RequestCreates aChangeBoundsRequest.voidErases source feedback and sets the autoexpose helper tonull.protected voidAsks the edit parts in theoperation setto erase their source feedback.protected CommandAsks each edit part in theoperation setto contribute to aCompoundCommandafter first setting the request type to eitherRequestConstants.REQ_MOVEorRequestConstants.REQ_ORPHAN, depending on the result ofisMove().protected StringReturns the identifier of the command that is being sought.protected StringReturns the debug name for this tool.protected CursorReturns the cursor used under normal conditions.protected Collection<IFigure> Returns a list of all the edit parts in theoperation set, plus theConnectionLayer.protected PrecisionRectangleReturns the unioned bounds of theoperation set edit parts'figures in absolute coordinates.protected SnapToHelperReturns theSnapToHelperused by thisDragEditPartsTracker.protected PrecisionRectangleReturns the bounds of thesource edit part'sfigure in absolute coordinates.protected ChangeBoundsRequestLazily creates and returns the request used when communicating with the target editpart.protected voidThis method is called whenever an autoexpose occurs.protected booleanhandleButtonUp(int button) Erases feedback and callsperformDrag().protected booleanUpdates the target request and mouse target, asks to show feedback, and sets the current command.protected booleanCallsTargetingTool.updateAutoexposeHelper()if a drag is in progress.protected booleanErases source feedback.protected booleanProcesses arrow keys used to move edit parts.protected booleanInterprets and processes clone deactivation, constrained move deactivation, and accessibility navigation reset.protected booleanReturns true if the current drag is a clone operation.protected booleanisMove()Returnstrueif the source edit part is being moved within its parent.protected voidprotected voidIf auto scroll (also called auto expose) is being performed, the start location moves during the scroll.protected voidsetAutoexposeHelper(AutoexposeHelper helper) Sets the active autoexpose helper to the given helper, ornull.protected voidsetCloneActive(boolean cloneActive) Enables cloning if the value is true.protected voidsetState(int state) Extended to activate cloning and to update the captured source dimensions when applicable.protected voidsetTargetEditPart(EditPart editpart) Extended to update the current snap-to strategy.protected voidAsks the edit parts in theoperation setto show source feedback.protected voidsnapPoint(ChangeBoundsRequest request) This method can be overridden by clients to customize the snapping behavior.protected voidCallsrepairStartLocation()in case auto scroll is being performed.Methods inherited from class org.eclipse.gef.tools.SelectEditPartTrackercalculateCursor, getSourceEditPart, handleButtonDown, handleDoubleClick, handleDragStarted, hasSelectionOccurred, performConditionalSelection, performDirectEdit, performOpen, performSelection, resetFlags, setSourceEditPartMethods inherited from class org.eclipse.gef.tools.TargetingTooldoAutoexpose, eraseTargetFeedback, getAutoexposeHelper, getDirection, getTargetEditPart, getTargetingConditional, handleEnteredEditPart, handleExitingEditPart, handleHoverStop, handleLeavingEditPart, handleViewerExited, isShowingTargetFeedback, isTargetLocked, lockTargetEditPart, resetHover, setRefreshRate, setTargetRequest, showTargetFeedback, unlockTargetEditPart, updateAutoexposeHelper, updateTargetUnderMouseMethods inherited from class org.eclipse.gef.tools.AbstractToolacceptArrowKey, accGetStep, accStepIncrement, accStepReset, activate, addFeedback, applyProperty, debug, executeCommand, executeCurrentCommand, focusGained, focusLost, getCurrentCommand, getCurrentInput, getCurrentViewer, getDebugNameForState, getDisabledCursor, getDomain, getDragMoveDelta, getLocation, getOperationSet, getStartLocation, getState, handleCommandStackChanged, handleDrag, handleFinished, handleFocusGained, handleFocusLost, handleKeyTraversed, handleMove, handleNativeDragFinished, handleNativeDragStarted, handleViewerEntered, isActive, isHoverActive, isInState, isViewerImportant, keyDown, keyTraversed, keyUp, mouseDoubleClick, mouseDown, mouseDrag, mouseHover, mouseMove, mouseUp, mouseWheelScrolled, movedPastThreshold, nativeDragFinished, nativeDragStarted, performViewerMouseWheel, placeMouseInViewer, reactivate, refreshCursor, releaseToolCapture, removeFeedback, setCurrentCommand, setCursor, setDefaultCursor, setDisabledCursor, setEditDomain, setHoverActive, setProperties, setStartLocation, setToolCapture, setUnloadWhenFinished, setViewer, stateTransition, unloadWhenFinished, viewerEntered, viewerExitedMethods inherited from class org.eclipse.gef.util.FlagSupportgetFlag, setFlagMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.gef.Toolactivate, focusGained, focusLost, keyDown, keyTraversed, keyUp, mouseDoubleClick, mouseDown, mouseDrag, mouseHover, mouseMove, mouseUp, mouseWheelScrolled, nativeDragFinished, nativeDragStarted, setEditDomain, setProperties, setViewer, viewerEntered, viewerExited
- 
Field Details- 
MAX_FLAGprotected static final int MAX_FLAGMax flag- See Also:
 
 
- 
- 
Constructor Details- 
DragEditPartsTrackerConstructs a new DragEditPartsTracker with the given source edit part.- Parameters:
- sourceEditPart- the source edit part
 
 
- 
- 
Method Details- 
getDefaultCursorReturns the cursor used under normal conditions.- Overrides:
- getDefaultCursorin class- AbstractTool
- Returns:
- the default cursor
- See Also:
 
- 
getSourceBoundsReturns the bounds of thesource edit part'sfigure in absolute coordinates. In case the source figure implementsHandleBoundsthehandle boundsare returned in absolute coordinates, other wise thefigure bounds.- Returns:
- The bounds of the source figure in absolute coordinates.
- Since:
- 3.11
 
- 
getTargetRequestDescription copied from class:TargetingToolLazily creates and returns the request used when communicating with the target editpart.- Overrides:
- getTargetRequestin class- TargetingTool
- Returns:
- the target request
- Since:
- 3.21
 
- 
getOperationSetBoundsReturns the unioned bounds of theoperation set edit parts'figures in absolute coordinates. In case the figures implementHandleBoundstheirhandle boundswill be used, otherwise theirfigure bounds.- Returns:
- The unioned bounds of the operation set figures in absolute coordinates.
- Since:
- 3.11
 
- 
getSnapToHelperReturns theSnapToHelperused by thisDragEditPartsTracker.- Returns:
- The SnapToHelperused by thisDragEditPartsTracker.
- Since:
- 3.11
 
- 
commitDragpublic void commitDrag()Erases feedback and callsperformDrag(). Sets the state to terminal.- Specified by:
- commitDragin interface- DragTracker
- Overrides:
- commitDragin class- AbstractTool
- See Also:
 
- 
createOperationSetReturns a List of top-level edit parts excluding dependants (by callingToolUtilities.getSelectionWithoutDependants(EditPartViewer)that understand the current target request (by callingToolUtilities.filterEditPartsUnderstanding(List, Request).- Overrides:
- createOperationSetin class- AbstractTool
- Returns:
- a list of editparts being operated on
- See Also:
 
- 
createTargetRequestCreates aChangeBoundsRequest. By default, the type isRequestConstants.REQ_MOVE. Later on when the edit parts are asked to contribute to the overall command, the request type will be eitherRequestConstants.REQ_MOVEorRequestConstants.REQ_ORPHAN, depending on the result ofisMove().- Overrides:
- createTargetRequestin class- TargetingTool
- Returns:
- the new target request
- See Also:
 
- 
deactivatepublic void deactivate()Erases source feedback and sets the autoexpose helper tonull.- Specified by:
- deactivatein interface- Tool
- Overrides:
- deactivatein class- TargetingTool
- See Also:
 
- 
eraseSourceFeedbackprotected void eraseSourceFeedback()Asks the edit parts in theoperation setto erase their source feedback.
- 
getCommandAsks each edit part in theoperation setto contribute to aCompoundCommandafter first setting the request type to eitherRequestConstants.REQ_MOVEorRequestConstants.REQ_ORPHAN, depending on the result ofisMove().- Overrides:
- getCommandin class- TargetingTool
- Returns:
- a newly obtained command
- See Also:
 
- 
getCommandNameDescription copied from class:AbstractToolReturns the identifier of the command that is being sought. This name is also the named that will be logged in the debug view.- Overrides:
- getCommandNamein class- SelectEditPartTracker
- Returns:
- the identifier for the command
- See Also:
 
- 
getDebugNameDescription copied from class:AbstractToolReturns the debug name for this tool.- Overrides:
- getDebugNamein class- SelectEditPartTracker
- Returns:
- the debug name
- See Also:
 
- 
getExclusionSetReturns a list of all the edit parts in theoperation set, plus theConnectionLayer.- Overrides:
- getExclusionSetin class- TargetingTool
- Returns:
- the list of figures to be excluded as targets
- See Also:
 
- 
handleAutoexposeprotected void handleAutoexpose()Description copied from class:TargetingToolThis method is called whenever an autoexpose occurs. When an autoexpose occurs, it is possible that everything in the viewer has moved a little. Therefore, by default,handleMove()is called to simulate the mouse moving even though it didn't.- Overrides:
- handleAutoexposein class- TargetingTool
- See Also:
 
- 
handleButtonUpprotected boolean handleButtonUp(int button) Erases feedback and callsperformDrag().- Overrides:
- handleButtonUpin class- SelectEditPartTracker
- Parameters:
- button- the button being released
- Returns:
- trueif the button up was handled
- See Also:
 
- 
handleDragInProgressprotected boolean handleDragInProgress()Updates the target request and mouse target, asks to show feedback, and sets the current command.- Overrides:
- handleDragInProgressin class- AbstractTool
- Returns:
- trueif the drag was handled
- See Also:
 
- 
handleHoverprotected boolean handleHover()CallsTargetingTool.updateAutoexposeHelper()if a drag is in progress.- Overrides:
- handleHoverin class- AbstractTool
- Returns:
- trueif the hover was handled
- See Also:
 
- 
handleInvalidInputprotected boolean handleInvalidInput()Erases source feedback.- Overrides:
- handleInvalidInputin class- TargetingTool
- Returns:
- true
- See Also:
 
- 
handleKeyDownProcesses arrow keys used to move edit parts.- Overrides:
- handleKeyDownin class- AbstractTool
- Parameters:
- e- the key event
- Returns:
- trueif the key down was handled.
- See Also:
 
- 
handleKeyUpInterprets and processes clone deactivation, constrained move deactivation, and accessibility navigation reset.- Overrides:
- handleKeyUpin class- AbstractTool
- Parameters:
- e- the key event
- Returns:
- trueif the event was handled
- See Also:
 
- 
isCloneActiveprotected boolean isCloneActive()Returns true if the current drag is a clone operation.- Returns:
- true if cloning is enabled and is currently active.
 
- 
isMoveprotected boolean isMove()Returnstrueif the source edit part is being moved within its parent. If the source edit part is being moved to another parent, this returnsfalse.- Returns:
- trueif the source edit part is not being reparented
 
- 
performDragprotected void performDrag()
- 
repairStartLocationprotected void repairStartLocation()If auto scroll (also called auto expose) is being performed, the start location moves during the scroll. This method updates that location.
- 
setAutoexposeHelperDescription copied from class:TargetingToolSets the active autoexpose helper to the given helper, ornull. If the helper is notnull, a runnable is queued on the event thread that will trigger a subsequentTargetingTool.doAutoexpose(). The helper is typically updated only on a hover event.- Overrides:
- setAutoexposeHelperin class- TargetingTool
- Parameters:
- helper- the new autoexpose helper or- null
- See Also:
 
- 
setCloneActiveprotected void setCloneActive(boolean cloneActive) Enables cloning if the value is true.- Parameters:
- cloneActive-- trueif cloning should be active
 
- 
setTargetEditPartExtended to update the current snap-to strategy.- Overrides:
- setTargetEditPartin class- TargetingTool
- Parameters:
- editpart- the new target
- See Also:
 
- 
showSourceFeedbackprotected void showSourceFeedback()Asks the edit parts in theoperation setto show source feedback.
- 
setStateprotected void setState(int state) Extended to activate cloning and to update the captured source dimensions when applicable.- Overrides:
- setStatein class- AbstractTool
- Parameters:
- state- the new state
- See Also:
 
- 
updateTargetRequestprotected void updateTargetRequest()CallsrepairStartLocation()in case auto scroll is being performed. Updates the request with the currentoperation set, move delta, location and type.- Overrides:
- updateTargetRequestin class- TargetingTool
- See Also:
 
- 
snapPointThis method can be overridden by clients to customize the snapping behavior.- Parameters:
- request- the- ChangeBoundsRequestfrom which the move delta can be extracted and updated
- Since:
- 3.4
 
 
-