Eclipse GEF
2.1

org.eclipse.gef.tools
Class TargetingTool

java.lang.Object
  |
  +--org.eclipse.gef.util.FlagSupport
        |
        +--org.eclipse.gef.tools.AbstractTool
              |
              +--org.eclipse.gef.tools.TargetingTool
All Implemented Interfaces:
RequestConstants, Tool
Direct Known Subclasses:
AbstractConnectionCreationTool, ConnectionEndpointTracker, CreationTool, SelectEditPartTracker, SelectionTool

public abstract class TargetingTool
extends AbstractTool


Nested Class Summary
 
Nested classes inherited from class org.eclipse.gef.tools.AbstractTool
AbstractTool.Input
 
Field Summary
protected static int 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_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
TargetingTool()
           
 
Method Summary
protected  Request createTargetRequest()
           
 void deactivate()
          Deactivates the tool.
protected  void doAutoexpose()
           
protected  void eraseTargetFeedback()
          Erase feedback indicating that the viewer object is no longer the target of a drag.
protected  Command getCommand()
          Re-queries the target viewer object for a command
protected  Collection getExclusionSet()
          Returns a List of EditParts that should be excluded from the possible Targets for this tools operations Example, when dragging an object, the object should be excluded to prevent you from dropping the object inside itself.
protected  EditPart getTargetEditPart()
           
protected  EditPartViewer.Conditional getTargetingConditional()
           
protected  Request getTargetRequest()
           
protected  void handleAutoexpose()
           
protected  boolean handleEnteredEditPart()
           
protected  boolean handleExitingEditPart()
           
protected  boolean handleHoverStop()
           
protected  boolean handleInvalidInput()
           
protected  void handleLeavingEditPart()
           
protected  boolean handleViewerExited()
          Called when the mouse exits an EditPartViewer.
protected  boolean isShowingTargetFeedback()
           
protected  boolean isTargetLocked()
           
protected  void lockTargetEditPart(EditPart editpart)
           
protected  void setAutoexposeHelper(AutoexposeHelper helper)
           
protected  void setTargetEditPart(EditPart editpart)
           
protected  void setTargetRequest(Request req)
           
protected  void showTargetFeedback()
           
protected  void unlockTargetEditPart()
           
protected  void updateAutoexposeHelper()
          Updates the active AutoexposeHelper.
protected  void updateTargetRequest()
          Subclasses should override to update the target request.
protected  boolean updateTargetUnderMouse()
          Returns true if the target has changed.
 
Methods inherited from class org.eclipse.gef.tools.AbstractTool
activate, addFeedback, calculateCursor, commitDrag, createOperationSet, debug, executeCurrentCommand, focusGained, focusLost, getCommandName, getCurrentCommand, getCurrentInput, getCurrentViewer, getDebugName, getDebugNameForState, getDefaultCursor, getDisabledCursor, getDomain, getDragMoveDelta, getLocation, getOperationSet, getStartLocation, getState, handleButtonDown, handleButtonUp, handleDoubleClick, handleDrag, handleDragInProgress, handleDragStarted, handleFinished, handleFocusGained, handleFocusLost, handleHover, handleKeyDown, handleKeyUp, handleMove, handleNativeDragFinished, handleNativeDragStarted, handleViewerEntered, isActive, isHoverActive, isInState, keyDown, keyUp, mouseDoubleClick, mouseDown, mouseDrag, mouseHover, mouseMove, mouseUp, movedPastThreshold, 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
 

Field Detail

MAX_FLAG

protected static final int MAX_FLAG
See Also:
Constant Field Values
Constructor Detail

TargetingTool

public TargetingTool()
Method Detail

createTargetRequest

protected Request createTargetRequest()

deactivate

public void deactivate()
Description copied from class: AbstractTool
Deactivates the tool. This method is called whenever the user switches to another tool. Use this method to do some clean-up when the tool is switched. The abstract tool allows cursors for viewers to be changed. When the tool is deactivated it must revert to normal the cursor of the last tool it changed.

Specified by:
deactivate in interface Tool
Overrides:
deactivate in class AbstractTool
See Also:
AbstractTool.activate()

doAutoexpose

protected void doAutoexpose()

eraseTargetFeedback

protected void eraseTargetFeedback()
Erase feedback indicating that the viewer object is no longer the target of a drag.


getCommand

protected Command getCommand()
Description copied from class: AbstractTool
Re-queries the target viewer object for a command

Overrides:
getCommand in class AbstractTool

getExclusionSet

protected Collection getExclusionSet()
Returns a List of EditParts that should be excluded from the possible Targets for this tools operations Example, when dragging an object, the object should be excluded to prevent you from dropping the object inside itself.


getTargetingConditional

protected EditPartViewer.Conditional getTargetingConditional()

getTargetEditPart

protected EditPart getTargetEditPart()

getTargetRequest

protected Request getTargetRequest()

handleAutoexpose

protected void handleAutoexpose()

handleEnteredEditPart

protected boolean handleEnteredEditPart()

handleExitingEditPart

protected boolean handleExitingEditPart()

handleHoverStop

protected boolean handleHoverStop()

handleInvalidInput

protected boolean handleInvalidInput()

handleLeavingEditPart

protected final void handleLeavingEditPart()
                                    throws Exception
Exception

handleViewerExited

protected boolean handleViewerExited()
Description copied from class: AbstractTool
Called when the mouse exits an EditPartViewer.

Overrides:
handleViewerExited in class AbstractTool

isShowingTargetFeedback

protected boolean isShowingTargetFeedback()

isTargetLocked

protected boolean isTargetLocked()

lockTargetEditPart

protected void lockTargetEditPart(EditPart editpart)

setAutoexposeHelper

protected void setAutoexposeHelper(AutoexposeHelper helper)

setTargetEditPart

protected void setTargetEditPart(EditPart editpart)

setTargetRequest

protected void setTargetRequest(Request req)

showTargetFeedback

protected void showTargetFeedback()

unlockTargetEditPart

protected void unlockTargetEditPart()

updateAutoexposeHelper

protected void updateAutoexposeHelper()
Updates the active AutoexposeHelper. Does nothing if there is still an active helper. Otherwise, obtains a new helper (possible null) at the current mouse location and calls setAutoexposeHelper(AutoexposeHelper).


updateTargetRequest

protected void updateTargetRequest()
Subclasses should override to update the target request.


updateTargetUnderMouse

protected boolean updateTargetUnderMouse()
Returns true if the target has changed.


Eclipse GEF
2.1

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.