public class ConnectionEndpointTracker extends TargetingTool implements DragTracker
AbstractTool.Input| Modifier and Type | Field and Description |
|---|---|
protected static int |
MAX_FLAG
The max flag
|
MAX_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_TERMINALREQ_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 and Description |
|---|
ConnectionEndpointTracker(ConnectionEditPart cep)
Constructs a new ConnectionEndpointTracker for the given
ConnectionEditPart.
|
| Modifier and Type | Method and Description |
|---|---|
protected Cursor |
calculateCursor()
Returns a custom "plug" cursor if this tool is in the initial, drag or
accessible drag state.
|
void |
commitDrag()
Erases source and target feedback and executes the current command.
|
protected Request |
createTargetRequest()
Creates the target request, a
ReconnectRequest. |
void |
deactivate()
Erases feedback and sets the viewer's focus to
null. |
protected void |
eraseSourceFeedback()
Erases the source feedback.
|
protected java.lang.String |
getCommandName()
Returns the identifier of the command that is being sought.
|
protected Connection |
getConnection()
Returns the ConnectionEditPart's figure.
|
protected ConnectionEditPart |
getConnectionEditPart()
Returns the ConnectionEditPart.
|
protected java.lang.String |
getDebugName()
Returns the debug name for this tool.
|
protected java.util.Collection |
getExclusionSet()
Returns a List of objects that should be excluded as potential targets
for the operation.
|
protected 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.
|
protected boolean |
handleDragInProgress()
Updates the request and the mouse target, asks to show feedback, and gets
the current command.
|
protected boolean |
handleDragStarted()
Called only one time during a drag when the drag threshold has been
exceeded.
|
protected boolean |
handleHover()
Handles high-level processing of a mouse hover event.
|
protected boolean |
handleKeyDown(KeyEvent e)
Processes the arrow keys (to choose a different source or target edit
part) and forwardslash and backslash keys (to try to connect to another
connection).
|
void |
setCommandName(java.lang.String newCommandName)
Sets the command name.
|
void |
setConnectionEditPart(ConnectionEditPart cep)
Sets the connection edit part that is being reconnected.
|
protected void |
showSourceFeedback()
Asks the ConnectionEditPart to show source feedback.
|
protected void |
updateTargetRequest()
Updates the request location.
|
doAutoexpose, eraseTargetFeedback, getAutoexposeHelper, getCommand, getTargetEditPart, getTargetingConditional, getTargetRequest, handleAutoexpose, handleEnteredEditPart, handleExitingEditPart, handleHoverStop, handleInvalidInput, handleLeavingEditPart, handleViewerExited, isShowingTargetFeedback, isTargetLocked, lockTargetEditPart, resetFlags, resetHover, setAutoexposeHelper, setTargetEditPart, setTargetRequest, showTargetFeedback, unlockTargetEditPart, updateAutoexposeHelper, updateTargetUnderMouseacceptArrowKey, 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, viewerExitedgetFlag, setFlagclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitactivate, focusGained, focusLost, keyDown, keyTraversed, keyUp, mouseDoubleClick, mouseDown, mouseDrag, mouseHover, mouseMove, mouseUp, mouseWheelScrolled, nativeDragFinished, nativeDragStarted, setEditDomain, setProperties, setViewer, viewerEntered, viewerExitedprotected static final int MAX_FLAG
public ConnectionEndpointTracker(ConnectionEditPart cep)
cep - the ConnectionEditPartprotected Cursor calculateCursor()
super.calculateCursor in class AbstractToolAbstractTool.getDefaultCursor(),
AbstractTool.getDisabledCursor(),
AbstractTool.getCurrentCommand()public void commitDrag()
commitDrag in interface DragTrackercommitDrag in class AbstractToolDragTracker.commitDrag()protected Request createTargetRequest()
ReconnectRequest.createTargetRequest in class TargetingToolTargetingTool.getTargetRequest()public void deactivate()
null. This
will remove any focus rectangles that were painted to show the new target
or source edit part.deactivate in interface Tooldeactivate in class TargetingToolTool.deactivate()protected void eraseSourceFeedback()
protected java.lang.String getCommandName()
AbstractToolgetCommandName in class AbstractToolAbstractTool.getCommandName()protected Connection getConnection()
protected ConnectionEditPart getConnectionEditPart()
protected java.lang.String getDebugName()
AbstractToolgetDebugName in class AbstractToolAbstractTool.getDebugName()protected java.util.Collection getExclusionSet()
TargetingToolgetExclusionSet in class TargetingToolTargetingTool.getExclusionSet()protected boolean handleButtonUp(int button)
handleButtonUp in class AbstractToolbutton - the button being releasedtrue if the button up was handledAbstractTool.handleButtonUp(int)protected boolean handleDragInProgress()
handleDragInProgress in class AbstractTooltrueAbstractTool.movedPastThreshold(),
AbstractTool.mouseDrag(MouseEvent, EditPartViewer)protected boolean handleDragStarted()
AbstractToolfalse is returned.
Subclasses may override to interpret the drag starting. Returning
true indicates that the event was handled.handleDragStarted in class AbstractToolAbstractTool.handleDragStarted()protected boolean handleHover()
AbstractToolfalse is returned. Subclasses may override this
method to interpret the hover. Return true to indicate that
the hover was handled.handleHover in class AbstractTooltrue if the hover was handledAbstractTool.handleHover()protected boolean handleKeyDown(KeyEvent e)
handleKeyDown in class AbstractToole - the key eventtrue if the key down was handled.AbstractTool.handleKeyDown(org.eclipse.swt.events.KeyEvent)public void setCommandName(java.lang.String newCommandName)
newCommandName - the new command namepublic void setConnectionEditPart(ConnectionEditPart cep)
cep - the connection edit partprotected void showSourceFeedback()
protected void updateTargetRequest()
updateTargetRequest in class TargetingToolTargetingTool.updateTargetRequest()Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.