org.eclipse.gef.internal.ui.rulers
Class RulerDragTracker

java.lang.Object
  extended byorg.eclipse.gef.util.FlagSupport
      extended byorg.eclipse.gef.tools.AbstractTool
          extended byorg.eclipse.gef.tools.SimpleDragTracker
              extended byorg.eclipse.gef.internal.ui.rulers.RulerDragTracker
All Implemented Interfaces:
DragTracker, RequestConstants, Tool

public class RulerDragTracker
extends SimpleDragTracker


Nested Class Summary
 
Nested classes inherited from class org.eclipse.gef.tools.AbstractTool
AbstractTool.Input
 
Field Summary
protected  RulerEditPart source
           
 
Fields inherited from class org.eclipse.gef.tools.SimpleDragTracker
MAX_FLAG
 
Fields inherited from class org.eclipse.gef.tools.AbstractTool
MAX_STATE, MOUSE_BUTTON_ANY, MOUSE_BUTTON1, MOUSE_BUTTON2, MOUSE_BUTTON3, 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
RulerDragTracker(RulerEditPart source)
           
 
Method Summary
protected  void eraseSourceFeedback()
          Show the source drag feedback for the drag occurring within the viewer.
protected  Command getCommand()
          Returns a new, updated command based on the tool's current properties.
protected  java.lang.String getCommandName()
          Returns the identifier of the command that is being sought.
protected  int getCurrentPosition()
           
protected  int getCurrentPositionZoomed()
           
protected  java.lang.String getDebugName()
          Returns the debug name for this tool.
protected  org.eclipse.swt.graphics.Cursor getDefaultCursor()
          Returns the cursor used under normal conditions.
protected  boolean handleButtonDown(int button)
          Looks for button 1, and goes into the drag state.
protected  boolean handleButtonUp(int button)
          If dragging is in progress, cleans up feedback and calls performDrag().
protected  boolean isCreationValid()
           
protected  boolean isDelete()
           
protected  boolean movedPastThreshold()
          Returns true if the threshold has been exceeded during a mouse drag.
protected  void showSourceFeedback()
          Show the source drag feedback for the drag occurring within the viewer.
 
Methods inherited from class org.eclipse.gef.tools.SimpleDragTracker
calculateCursor, commitDrag, createSourceRequest, deactivate, getSourceRequest, handleDragInProgress, handleDragStarted, handleInvalidInput, handleKeyDown, handleKeyUp, isShowingFeedback, performDrag, updateSourceRequest
 
Methods inherited from class org.eclipse.gef.tools.AbstractTool
activate, addFeedback, createOperationSet, debug, executeCurrentCommand, focusGained, focusLost, getCurrentCommand, getCurrentInput, getCurrentViewer, getDebugNameForState, getDisabledCursor, getDomain, getDragMoveDelta, getLocation, getOperationSet, getStartLocation, getState, handleCommandStackChanged, handleDoubleClick, handleDrag, handleFinished, handleFocusGained, handleFocusLost, handleHover, handleMove, handleNativeDragFinished, handleNativeDragStarted, handleViewerEntered, handleViewerExited, isActive, isHoverActive, isInState, keyDown, keyUp, mouseDoubleClick, mouseDown, mouseDrag, mouseHover, mouseMove, mouseUp, nativeDragFinished, nativeDragStarted, reactivate, refreshCursor, releaseToolCapture, removeFeedback, resetFlags, setCurrentCommand, setCursor, setDefaultCursor, setDisabledCursor, setEditDomain, setHoverActive, 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.Tool
activate, focusGained, focusLost, keyDown, keyUp, mouseDoubleClick, mouseDown, mouseDrag, mouseHover, mouseMove, mouseUp, nativeDragFinished, nativeDragStarted, setEditDomain, setViewer, viewerEntered, viewerExited
 

Field Detail

source

protected RulerEditPart source
Constructor Detail

RulerDragTracker

public RulerDragTracker(RulerEditPart source)
Method Detail

eraseSourceFeedback

protected void eraseSourceFeedback()
Description copied from class: SimpleDragTracker
Show the source drag feedback for the drag occurring within the viewer.

Overrides:
eraseSourceFeedback in class SimpleDragTracker

getCommand

protected Command getCommand()
Description copied from class: AbstractTool
Returns a new, updated command based on the tool's current properties. The default implementation returns an unexecutable command. Some tools do not work commands and the model, but simply change the viewer's state in some way.

Overrides:
getCommand in class AbstractTool
Returns:
a newly obtained command

getCommandName

protected java.lang.String getCommandName()
Description copied from class: AbstractTool
Returns 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:
getCommandName in class AbstractTool
Returns:
the identifier for the command

getCurrentPositionZoomed

protected int getCurrentPositionZoomed()

getCurrentPosition

protected int getCurrentPosition()

getDebugName

protected java.lang.String getDebugName()
Description copied from class: AbstractTool
Returns the debug name for this tool.

Specified by:
getDebugName in class AbstractTool
Returns:
the debug name

getDefaultCursor

protected org.eclipse.swt.graphics.Cursor getDefaultCursor()
Description copied from class: AbstractTool
Returns the cursor used under normal conditions.

Overrides:
getDefaultCursor in class AbstractTool
Returns:
the default cursor
See Also:
AbstractTool.setDefaultCursor(Cursor)

handleButtonDown

protected boolean handleButtonDown(int button)
Description copied from class: SimpleDragTracker
Looks for button 1, and goes into the drag state. Any other button is invalid input.

Overrides:
handleButtonDown in class SimpleDragTracker
See Also:
AbstractTool.handleButtonDown(int)

handleButtonUp

protected boolean handleButtonUp(int button)
Description copied from class: SimpleDragTracker
If dragging is in progress, cleans up feedback and calls performDrag().

Overrides:
handleButtonUp in class SimpleDragTracker
See Also:
AbstractTool.handleButtonUp(int)

isCreationValid

protected boolean isCreationValid()

isDelete

protected boolean isDelete()

movedPastThreshold

protected boolean movedPastThreshold()
Description copied from class: AbstractTool
Returns true if the threshold has been exceeded during a mouse drag.

Overrides:
movedPastThreshold in class AbstractTool
Returns:
true if the threshold has been exceeded

showSourceFeedback

protected void showSourceFeedback()
Description copied from class: SimpleDragTracker
Show the source drag feedback for the drag occurring within the viewer.

Overrides:
showSourceFeedback in class SimpleDragTracker