sk.uniba.euromath.editor.textEditor.tools
Class TextDragTracker

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 sk.uniba.euromath.editor.xmlEditor.tools.XMLStructureDragTracker
                  extended by sk.uniba.euromath.editor.textEditor.tools.TextDragTracker
All Implemented Interfaces:
org.eclipse.gef.DragTracker, org.eclipse.gef.RequestConstants, org.eclipse.gef.Tool

public class TextDragTracker
extends XMLStructureDragTracker

Works like super, but pointer translation is performed to always point into node's text. This is achieved by accepting as target and source editpart only ITextPieceKeeper.

Author:
Tomas Studva on 5.8.2006

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.TargetingTool
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
TextDragTracker(TextEditPart source, org.eclipse.draw2d.geometry.Point startLocation, CaretManager cManager)
           
 
Method Summary
protected  DOMIntervalSet computeLocalSelection()
          Computes local selection corresponding to drag.
protected  boolean evaluate(org.eclipse.gef.EditPart editpart)
          Test editpart, if is acceptable as end point of selection under mouse.
protected  void finishDrag()
          Is called at termination of drag to perfom and finish selection and drag related tasks.
protected  boolean handleButtonDown(int button)
           
protected  boolean handleDragInProgress()
           
protected  boolean handleDragStarted()
           
protected  boolean handleEnteredEditPart()
          Not needed - all done in handleDragInProgress.
protected  boolean handleExitingEditPart()
          Not needed - all done in handleDragInProgress.
protected  DomPointer locationToDomPointer(org.eclipse.draw2d.geometry.Point p, ITextPieceKeeper keeper)
          Translates point in editpart to DOMPointer.
protected  void updateCaret()
          Updates caret position to location of mouse cursor if possible.
 
Methods inherited from class sk.uniba.euromath.editor.xmlEditor.tools.XMLStructureDragTracker
computeGlobalSelection, getCommandName, getSourceEditPart, getXMLAccess, getXMLGraphicalViewer, handleButtonUp, handleDrag, handleKeyDown, handleKeyUp, setViewer, updateTargetUnderMouse
 
Methods inherited from class org.eclipse.gef.tools.TargetingTool
createTargetRequest, deactivate, doAutoexpose, eraseTargetFeedback, getCommand, getExclusionSet, getTargetEditPart, getTargetingConditional, getTargetRequest, handleAutoexpose, handleHoverStop, handleInvalidInput, handleLeavingEditPart, handleViewerExited, isShowingTargetFeedback, isTargetLocked, lockTargetEditPart, resetFlags, setAutoexposeHelper, setTargetEditPart, setTargetRequest, showTargetFeedback, unlockTargetEditPart, updateAutoexposeHelper, updateTargetRequest
 
Methods inherited from class org.eclipse.gef.tools.AbstractTool
activate, addFeedback, applyProperty, calculateCursor, commitDrag, createOperationSet, debug, executeCommand, executeCurrentCommand, focusGained, focusLost, getCurrentCommand, getCurrentInput, getCurrentViewer, getDebugName, getDebugNameForState, getDefaultCursor, getDisabledCursor, getDomain, getDragMoveDelta, getLocation, getOperationSet, getStartLocation, getState, handleCommandStackChanged, handleDoubleClick, handleFinished, handleFocusGained, handleFocusLost, handleHover, handleKeyTraversed, 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, 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, deactivate, focusGained, focusLost, keyDown, keyTraversed, keyUp, mouseDoubleClick, mouseDown, mouseDrag, mouseHover, mouseMove, mouseUp, mouseWheelScrolled, nativeDragFinished, nativeDragStarted, setEditDomain, setProperties, viewerEntered, viewerExited
 

Constructor Detail

TextDragTracker

public TextDragTracker(TextEditPart source,
                       org.eclipse.draw2d.geometry.Point startLocation,
                       CaretManager cManager)
Parameters:
owner -
startLocation - location where this DragTracker starts it work
Method Detail

handleEnteredEditPart

protected boolean handleEnteredEditPart()
Not needed - all done in handleDragInProgress.

Overrides:
handleEnteredEditPart in class XMLStructureDragTracker

handleExitingEditPart

protected boolean handleExitingEditPart()
Not needed - all done in handleDragInProgress.

Overrides:
handleExitingEditPart in class XMLStructureDragTracker

handleButtonDown

protected boolean handleButtonDown(int button)
Overrides:
handleButtonDown in class XMLStructureDragTracker

handleDragStarted

protected boolean handleDragStarted()
Overrides:
handleDragStarted in class XMLStructureDragTracker

handleDragInProgress

protected boolean handleDragInProgress()
Overrides:
handleDragInProgress in class XMLStructureDragTracker

updateCaret

protected void updateCaret()
Updates caret position to location of mouse cursor if possible.


computeLocalSelection

protected DOMIntervalSet computeLocalSelection()
Description copied from class: XMLStructureDragTracker
Computes local selection corresponding to drag.

Overrides:
computeLocalSelection in class XMLStructureDragTracker
Returns:
selection made by this drag

locationToDomPointer

protected DomPointer locationToDomPointer(org.eclipse.draw2d.geometry.Point p,
                                          ITextPieceKeeper keeper)
Translates point in editpart to DOMPointer.

Parameters:
p - point in editpart
part - editpart where point is
Returns:
DOM pointer

evaluate

protected boolean evaluate(org.eclipse.gef.EditPart editpart)
Description copied from class: XMLStructureDragTracker
Test editpart, if is acceptable as end point of selection under mouse.

Overrides:
evaluate in class XMLStructureDragTracker
Parameters:
editpart - to test for potential target - end point of selection
Returns:
true if is suitable for end point of selection

finishDrag

protected void finishDrag()
Description copied from class: XMLStructureDragTracker
Is called at termination of drag to perfom and finish selection and drag related tasks.

Overrides:
finishDrag in class XMLStructureDragTracker


Copyright © 2003-2006 null. All Rights Reserved.