Modelers

org.topcased.modeler.edit.dragtrackers
Class SelectGraphEdgeEditPartTracker

java.lang.Object
  extended by org.eclipse.gef.util.FlagSupport
      extended by org.eclipse.gef.tools.AbstractTool
          extended by org.eclipse.gef.tools.TargetingTool
              extended by org.eclipse.gef.tools.SelectEditPartTracker
                  extended by org.topcased.modeler.edit.dragtrackers.SelectGraphEdgeEditPartTracker
All Implemented Interfaces:
org.eclipse.gef.DragTracker, org.eclipse.gef.RequestConstants, org.eclipse.gef.Tool

public class SelectGraphEdgeEditPartTracker
extends org.eclipse.gef.tools.SelectEditPartTracker

Specialized SelectEditPartTracker that allows for a request action to be taken on a Connection shapes anywhere along the extent of the line. Depending on whether the user clicks on a bendpoint along a line or on the line itself, this is interpreted as either a RequestConstants.REQ_MOVE_BENDPOINT request or a RequestConstants.REQ_CREATE_BENDPOINT request respectively.
It also allows for a request action to be taken on a Connection edge object figures. Depending on whether the user clicks on a edge object figure on a edge object offset figure, this is interpreted as either a ModelerRequestConstatns.REQ_CHANGE_EO_UV request or a ModelerRequestConstants.REQ_CHANGE_EO_OFFSET request respectively.
Creation : 28 oct. 2005


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.gef.tools.AbstractTool
org.eclipse.gef.tools.AbstractTool.Input
 
Field Summary
 
Fields inherited from class org.eclipse.gef.tools.SelectEditPartTracker
FLAG_SELECTION_PERFORMED, MAX_FLAG
 
Fields inherited from class org.eclipse.gef.tools.AbstractTool
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_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
SelectGraphEdgeEditPartTracker(GraphEdgeEditPart owner)
          Constructor.
 
Method Summary
protected  org.eclipse.swt.graphics.Cursor calculateCursor()
           
protected  org.eclipse.gef.Request createSourceRequest()
          Creates the source request that is activated when the drag operation occurs.
 void deactivate()
           
protected  org.eclipse.gef.commands.Command getCommand()
           
protected  java.lang.String getCommandName()
           
protected  java.lang.String getDebugName()
           
 EdgeObject getEdgeObject()
           
protected  int getIndex()
          Gets the current line segment index that the user clicked on to activate the drag tracker.
protected  java.lang.Object getType()
          Determines the type of request that will be created for the drag operation.
protected  boolean handleButtonDown(int button)
           
protected  boolean handleButtonUp(int button)
           
protected  boolean handleDragInProgress()
           
protected  boolean handleDragStarted()
           
 void setEdgeObject(EdgeObject edgeObject)
           
 void setIndex(int i)
          Method setIndex.
 void setType(java.lang.String type)
          Sets the type of request that will be created for the drag operation.
protected  boolean shouldAllowDrag()
          Determines if the the connector should be dragged or not.
protected  void updateSourceRequest()
          Updates the source request to reflect the current location.
 
Methods inherited from class org.eclipse.gef.tools.SelectEditPartTracker
getSourceEditPart, handleDoubleClick, hasSelectionOccurred, performConditionalSelection, performDirectEdit, performOpen, performSelection, resetFlags, setSourceEditPart
 
Methods inherited from class org.eclipse.gef.tools.TargetingTool
createTargetRequest, doAutoexpose, eraseTargetFeedback, getAutoexposeHelper, getExclusionSet, getTargetEditPart, getTargetingConditional, getTargetRequest, handleAutoexpose, handleEnteredEditPart, handleExitingEditPart, handleHoverStop, handleInvalidInput, handleLeavingEditPart, handleViewerExited, isShowingTargetFeedback, isTargetLocked, lockTargetEditPart, setAutoexposeHelper, setTargetEditPart, setTargetRequest, showTargetFeedback, unlockTargetEditPart, updateAutoexposeHelper, updateTargetRequest, updateTargetUnderMouse
 
Methods inherited from class org.eclipse.gef.tools.AbstractTool
activate, addFeedback, applyProperty, commitDrag, createOperationSet, debug, executeCommand, executeCurrentCommand, focusGained, focusLost, getCurrentCommand, getCurrentInput, getCurrentViewer, getDebugNameForState, getDefaultCursor, getDisabledCursor, getDomain, getDragMoveDelta, getLocation, getOperationSet, getStartLocation, getState, handleCommandStackChanged, handleDrag, handleFinished, handleFocusGained, handleFocusLost, handleHover, handleKeyDown, handleKeyTraversed, handleKeyUp, handleMove, handleNativeDragFinished, handleNativeDragStarted, handleViewerEntered, isActive, isHoverActive, isInState, isViewerImportant, keyDown, keyTraversed, keyUp, mouseDoubleClick, mouseDown, mouseDrag, mouseHover, mouseMove, mouseUp, mouseWheelScrolled, movedPastThreshold, nativeDragFinished, nativeDragStarted, performViewerMouseWheel, reactivate, refreshCursor, releaseToolCapture, removeFeedback, setCurrentCommand, setCursor, setDefaultCursor, setDisabledCursor, setEditDomain, setHoverActive, setProperties, setStartLocation, setState, setToolCapture, setUnloadWhenFinished, setViewer, stateTransition, unloadWhenFinished, viewerEntered, viewerExited
 
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
 
Methods inherited from interface org.eclipse.gef.DragTracker
commitDrag
 
Methods inherited from interface org.eclipse.gef.Tool
activate, focusGained, focusLost, keyDown, keyTraversed, keyUp, mouseDoubleClick, mouseDown, mouseDrag, mouseHover, mouseMove, mouseUp, mouseWheelScrolled, nativeDragFinished, nativeDragStarted, setEditDomain, setProperties, setViewer, viewerEntered, viewerExited
 

Constructor Detail

SelectGraphEdgeEditPartTracker

public SelectGraphEdgeEditPartTracker(GraphEdgeEditPart owner)
Constructor.

Parameters:
owner -
Method Detail

handleButtonDown

protected boolean handleButtonDown(int button)
Overrides:
handleButtonDown in class org.eclipse.gef.tools.SelectEditPartTracker

shouldAllowDrag

protected boolean shouldAllowDrag()
Determines if the the connector should be dragged or not.

Returns:
boolean true if dragging can occur, false otherwise.

handleButtonUp

protected boolean handleButtonUp(int button)
Overrides:
handleButtonUp in class org.eclipse.gef.tools.SelectEditPartTracker

handleDragInProgress

protected boolean handleDragInProgress()
Overrides:
handleDragInProgress in class org.eclipse.gef.tools.AbstractTool

handleDragStarted

protected boolean handleDragStarted()
Overrides:
handleDragStarted in class org.eclipse.gef.tools.SelectEditPartTracker

calculateCursor

protected org.eclipse.swt.graphics.Cursor calculateCursor()
Overrides:
calculateCursor in class org.eclipse.gef.tools.SelectEditPartTracker

deactivate

public void deactivate()
Specified by:
deactivate in interface org.eclipse.gef.Tool
Overrides:
deactivate in class org.eclipse.gef.tools.TargetingTool

getType

protected java.lang.Object getType()
Determines the type of request that will be created for the drag operation.

Returns:
Object

setType

public void setType(java.lang.String type)
Sets the type of request that will be created for the drag operation.

Parameters:
type - the String that represents the type of request.

createSourceRequest

protected org.eclipse.gef.Request createSourceRequest()
Creates the source request that is activated when the drag operation occurs.

Returns:
a Request that is the newly created source request

getCommand

protected org.eclipse.gef.commands.Command getCommand()
Overrides:
getCommand in class org.eclipse.gef.tools.TargetingTool

getCommandName

protected java.lang.String getCommandName()
Overrides:
getCommandName in class org.eclipse.gef.tools.SelectEditPartTracker

getDebugName

protected java.lang.String getDebugName()
Overrides:
getDebugName in class org.eclipse.gef.tools.SelectEditPartTracker

getIndex

protected int getIndex()
Gets the current line segment index that the user clicked on to activate the drag tracker.

Returns:
int

setIndex

public void setIndex(int i)
Method setIndex. Sets the current line segment index based on the location the user clicked on the connection.

Parameters:
i - int representing the line segment index in the connection.

updateSourceRequest

protected void updateSourceRequest()
Updates the source request to reflect the current location.


setEdgeObject

public void setEdgeObject(EdgeObject edgeObject)

getEdgeObject

public EdgeObject getEdgeObject()

Modelers

Copyright (c) 2005 TOPCASED Contributors 2005 - 2007. All rights reserved.