Package org.eclipse.gef.tools
Class ConnectionEndpointTracker
java.lang.Object
org.eclipse.gef.util.FlagSupport
org.eclipse.gef.tools.AbstractTool
org.eclipse.gef.tools.TargetingTool
org.eclipse.gef.tools.ConnectionEndpointTracker
- All Implemented Interfaces:
- DragTracker,- RequestConstants,- Tool
A DragTracker that moves the endpoint of a connection to another location.
- 
Nested Class SummaryNested classes/interfaces inherited from class org.eclipse.gef.tools.AbstractToolAbstractTool.Input
- 
Field SummaryFieldsFields 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 SummaryConstructorsConstructorDescriptionConstructs a new ConnectionEndpointTracker for the given ConnectionEditPart.
- 
Method SummaryModifier and TypeMethodDescriptionprotected CursorReturns a custom "plug" cursor if this tool is in the initial, drag or accessible drag state.voidErases source and target feedback and executes the current command.protected RequestCreates the target request, aReconnectRequest.voidErases feedback and sets the viewer's focus tonull.protected voidErases the source feedback.protected StringReturns the identifier of the command that is being sought.protected ConnectionReturns the ConnectionEditPart's figure.protected ConnectionEditPartReturns the ConnectionEditPart.protected StringReturns the debug name for this tool.protected Collection<IFigure> Returns a List of figures that should be excluded as potential targets for the operation.protected ReconnectRequestLazily creates and returns the request used when communicating with the target editpart.protected booleanhandleButtonUp(int button) If currently in the drag-in-progress state, it goes into the terminal state erases feedback and executes the current command.protected booleanUpdates the request and the mouse target, asks to show feedback, and gets the current command.protected booleanCalled only one time during a drag when the drag threshold has been exceeded.protected booleanHandles high-level processing of a mouse hover event.protected booleanProcesses the arrow keys (to choose a different source or target edit part) and forwardslash and backslash keys (to try to connect to another connection).voidsetCommandName(String newCommandName) Sets the command name.voidSets the connection edit part that is being reconnected.protected voidAsks the ConnectionEditPart to show source feedback.protected voidUpdates the request location.Methods inherited from class org.eclipse.gef.tools.TargetingTooldoAutoexpose, eraseTargetFeedback, getAutoexposeHelper, getCommand, getDirection, getTargetEditPart, getTargetingConditional, handleAutoexpose, handleEnteredEditPart, handleExitingEditPart, handleHoverStop, handleInvalidInput, handleLeavingEditPart, handleViewerExited, 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, createOperationSet, debug, executeCommand, executeCurrentCommand, focusGained, focusLost, getCurrentCommand, getCurrentInput, getCurrentViewer, getDebugNameForState, getDefaultCursor, getDisabledCursor, getDomain, getDragMoveDelta, getLocation, getOperationSet, getStartLocation, getState, handleButtonDown, handleCommandStackChanged, handleDoubleClick, handleDrag, handleFinished, handleFocusGained, handleFocusLost, handleKeyTraversed, handleKeyUp, 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, setState, 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_FLAGThe max flag- See Also:
 
 
- 
- 
Constructor Details- 
ConnectionEndpointTrackerConstructs a new ConnectionEndpointTracker for the given ConnectionEditPart.- Parameters:
- cep- the ConnectionEditPart
 
 
- 
- 
Method Details- 
calculateCursorReturns a custom "plug" cursor if this tool is in the initial, drag or accessible drag state. Otherwise defers tosuper.- Overrides:
- calculateCursorin class- AbstractTool
- Returns:
- the cursor
- See Also:
 
- 
commitDragpublic void commitDrag()Erases source and target feedback and executes the current command.- Specified by:
- commitDragin interface- DragTracker
- Overrides:
- commitDragin class- AbstractTool
- See Also:
 
- 
createTargetRequestCreates the target request, aReconnectRequest.- Overrides:
- createTargetRequestin class- TargetingTool
- Returns:
- the target request
- See Also:
 
- 
deactivatepublic void deactivate()Erases feedback and sets the viewer's focus tonull. This will remove any focus rectangles that were painted to show the new target or source edit part.- Specified by:
- deactivatein interface- Tool
- Overrides:
- deactivatein class- TargetingTool
- See Also:
 
- 
eraseSourceFeedbackprotected void eraseSourceFeedback()Erases the source feedback.
- 
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.- Specified by:
- getCommandNamein class- AbstractTool
- Returns:
- the identifier for the command
- See Also:
 
- 
getConnectionReturns the ConnectionEditPart's figure.- Returns:
- the connection
 
- 
getConnectionEditPartReturns the ConnectionEditPart.- Returns:
- the ConnectionEditPart
 
- 
getDebugNameDescription copied from class:AbstractToolReturns the debug name for this tool.- Overrides:
- getDebugNamein class- AbstractTool
- Returns:
- the debug name
- See Also:
 
- 
getExclusionSetDescription copied from class:TargetingToolReturns a List of figures that should be excluded as potential targets for the operation.- Overrides:
- getExclusionSetin class- TargetingTool
- Returns:
- the list of figures to be excluded as targets
- See Also:
 
- 
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
 
- 
handleButtonUpprotected boolean handleButtonUp(int button) If currently in the drag-in-progress state, it goes into the terminal state erases feedback and executes the current command.- Overrides:
- handleButtonUpin class- AbstractTool
- Parameters:
- button- the button being released
- Returns:
- trueif the button up was handled
- See Also:
 
- 
handleDragInProgressprotected boolean handleDragInProgress()Updates the request and the mouse target, asks to show feedback, and gets the current command.- Overrides:
- handleDragInProgressin class- AbstractTool
- Returns:
- true
- See Also:
 
- 
handleDragStartedprotected boolean handleDragStarted()Description copied from class:AbstractToolCalled only one time during a drag when the drag threshold has been exceeded. By default, nothing happens andfalseis returned. Subclasses may override to interpret the drag starting. Returningtrueindicates that the event was handled.- Overrides:
- handleDragStartedin class- AbstractTool
- Returns:
- true if the drag starting was handled
- See Also:
 
- 
handleHoverprotected boolean handleHover()Description copied from class:AbstractToolHandles high-level processing of a mouse hover event. By default, nothing happens andfalseis returned. Subclasses may override this method to interpret the hover. Returntrueto indicate that the hover was handled.- Overrides:
- handleHoverin class- AbstractTool
- Returns:
- trueif the hover was handled
- See Also:
 
- 
handleKeyDownProcesses the arrow keys (to choose a different source or target edit part) and forwardslash and backslash keys (to try to connect to another connection).- Overrides:
- handleKeyDownin class- AbstractTool
- Parameters:
- e- the key event
- Returns:
- trueif the key down was handled.
- See Also:
 
- 
setCommandNameSets the command name.- Parameters:
- newCommandName- the new command name
 
- 
setConnectionEditPartSets the connection edit part that is being reconnected.- Parameters:
- cep- the connection edit part
 
- 
showSourceFeedbackprotected void showSourceFeedback()Asks the ConnectionEditPart to show source feedback.
- 
updateTargetRequestprotected void updateTargetRequest()Updates the request location.- Overrides:
- updateTargetRequestin class- TargetingTool
- See Also:
 
 
-