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 org.eclipse.gef.tools.SelectEditPartTracker
                  extended by org.eclipse.gef.tools.DragEditPartsTracker
                      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 org.eclipse.gef.tools.DragEditPartsTracker

Works with ITextPieceKeeper and IDOMIntervalSet that represents selection. Supports selecting by mouse. During selecting Caret is deactivated and selection is showed through IXMLGraphicalViewer. After selecting is finished, sets the selection to IXMLGraphicalViewer.

Author:
TV refactored by Martin Kollar on 22.5.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.DragEditPartsTracker
MAX_FLAG
 
Fields inherited from class org.eclipse.gef.tools.SelectEditPartTracker
FLAG_SELECTION_PERFORMED
 
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(org.eclipse.gef.EditPart owner, org.eclipse.draw2d.geometry.Point startLocation)
           
 
Method Summary
protected  Collection getExclusionSet()
           
 TextEditPart getTextEditPart()
           
protected  XMLAccess getXMLAccess()
           
protected  IXMLGraphicalViewer getXMLGraphicalViewer()
           
protected  boolean handleButtonDown(int button)
           
protected  boolean handleButtonUp(int button)
           
protected  boolean handleDoubleClick(int button)
          Activates text editing.
protected  boolean handleDrag()
           
protected  boolean handleDragStarted()
           
protected  sk.baka.ikslibs.ptr.DomPointer mouseLocationToDomPointer()
           
protected  void performDrag()
           
protected  void performInitSelection()
           
protected  void performSelection()
          select editparts depending on events from user
protected  void processLocalSelection(boolean commit)
          When selection ends, commit should be true
 
Methods inherited from class org.eclipse.gef.tools.DragEditPartsTracker
commitDrag, createOperationSet, createTargetRequest, deactivate, eraseSourceFeedback, getCommand, getCommandName, getDebugName, getDefaultCursor, handleAutoexpose, handleDragInProgress, handleHover, handleInvalidInput, handleKeyDown, handleKeyUp, isCloneActive, isMove, repairStartLocation, setAutoexposeHelper, setCloneActive, setState, setTargetEditPart, showSourceFeedback, updateTargetRequest
 
Methods inherited from class org.eclipse.gef.tools.SelectEditPartTracker
calculateCursor, getSourceEditPart, hasSelectionOccurred, performConditionalSelection, performDirectEdit, performOpen, resetFlags, setSourceEditPart
 
Methods inherited from class org.eclipse.gef.tools.TargetingTool
doAutoexpose, eraseTargetFeedback, getTargetEditPart, getTargetingConditional, getTargetRequest, handleEnteredEditPart, handleExitingEditPart, handleHoverStop, handleLeavingEditPart, handleViewerExited, isShowingTargetFeedback, isTargetLocked, lockTargetEditPart, setTargetRequest, showTargetFeedback, unlockTargetEditPart, updateAutoexposeHelper, updateTargetUnderMouse
 
Methods inherited from class org.eclipse.gef.tools.AbstractTool
activate, addFeedback, applyProperty, debug, executeCommand, executeCurrentCommand, focusGained, focusLost, getCurrentCommand, getCurrentInput, getCurrentViewer, getDebugNameForState, getDisabledCursor, getDomain, getDragMoveDelta, getLocation, getOperationSet, getStartLocation, getState, handleCommandStackChanged, handleFinished, handleFocusGained, handleFocusLost, 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, 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, keyTraversed, keyUp, mouseDoubleClick, mouseDown, mouseDrag, mouseHover, mouseMove, mouseUp, mouseWheelScrolled, nativeDragFinished, nativeDragStarted, setEditDomain, setProperties, setViewer, viewerEntered, viewerExited
 

Constructor Detail

TextDragTracker

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

handleDoubleClick

protected boolean handleDoubleClick(int button)
Activates text editing. Activates TextTool.

Overrides:
handleDoubleClick in class org.eclipse.gef.tools.SelectEditPartTracker
Parameters:
button - which button was double-clicked
See Also:
AbstractTool.handleDoubleClick(int)

handleButtonDown

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

handleDragStarted

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

getExclusionSet

protected Collection getExclusionSet()
Overrides:
getExclusionSet in class org.eclipse.gef.tools.DragEditPartsTracker
Returns:
the list of objects to be excluded as targets
See Also:
DragEditPartsTracker

handleDrag

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

performDrag

protected void performDrag()
Overrides:
performDrag in class org.eclipse.gef.tools.DragEditPartsTracker
See Also:
is called when the draging ends.

performSelection

protected void performSelection()
select editparts depending on events from user

Overrides:
performSelection in class org.eclipse.gef.tools.SelectEditPartTracker

handleButtonUp

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

processLocalSelection

protected void processLocalSelection(boolean commit)
When selection ends, commit should be true

Parameters:
commit - if true, then sets to GraphicalViewer processed selection othervise tell GraphicalViewer only to show processed selection

performInitSelection

protected void performInitSelection()

mouseLocationToDomPointer

protected sk.baka.ikslibs.ptr.DomPointer mouseLocationToDomPointer()

getXMLGraphicalViewer

protected IXMLGraphicalViewer getXMLGraphicalViewer()

getXMLAccess

protected XMLAccess getXMLAccess()

getTextEditPart

public TextEditPart getTextEditPart()
Returns:
sourceEditPart


Copyright © 2003-2006 null. All Rights Reserved.