GEF v2.0

org.eclipse.gef.editpolicies
Class GraphicalNodeEditPolicy

java.lang.Object
  |
  +--org.eclipse.gef.editpolicies.AbstractEditPolicy
        |
        +--org.eclipse.gef.editpolicies.GraphicalEditPolicy
              |
              +--org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy
All Implemented Interfaces:
EditPolicy, RequestConstants
Direct Known Subclasses:
ConnectionNodeEditPolicy

public abstract class GraphicalNodeEditPolicy
extends GraphicalEditPolicy


Field Summary
protected  Connection connectionFeedback
           
protected  FeedbackHelper feedbackHelper
           
 
Fields inherited from interface org.eclipse.gef.EditPolicy
COMPONENT_ROLE, CONNECTION_BENDPOINTS_ROLE, CONNECTION_ENDPOINTS_ROLE, CONNECTION_ROLE, CONTAINER_ROLE, DIRECT_EDIT_ROLE, GRAPHICAL_NODE_ROLE, LAYOUT_ROLE, NODE_ROLE, PRIMARY_DRAG_ROLE, SELECTION_FEEDBACK_ROLE, TREE_CONTAINER_ROLE
 
Fields inherited from interface org.eclipse.gef.RequestConstants
REQ_ADD, REQ_ALIGN, REQ_ALIGN_CHILD, REQ_ALIGN_CHILDREN, REQ_ANCESTOR_DELETED, REQ_CONNECTION_END, REQ_CONNECTION_START, REQ_CREATE, REQ_CREATE_BENDPOINT, REQ_DELETE, REQ_DELETE_BENDPOINT, REQ_DELETE_DEPENDANT, REQ_DIRECT_EDIT, REQ_MOVE, REQ_MOVE_BENDPOINT, REQ_MOVE_CHILD, REQ_MOVE_CHILDREN, REQ_ORPHAN, REQ_ORPHAN_CHILDREN, REQ_RECONNECT_END, REQ_RECONNECT_SOURCE, REQ_RECONNECT_START, REQ_RECONNECT_TARGET, REQ_RESIZE, REQ_RESIZE_CHILD, REQ_RESIZE_CHILDREN, REQ_SELECTION, REQ_SELECTION_HOVER, REQ_SOURCE_DELETED, REQ_TARGET_DELETED
 
Constructor Summary
GraphicalNodeEditPolicy()
           
 
Method Summary
protected  Connection createDummyConnection(Request req)
           
protected  void eraseCreationFeedback(CreateConnectionRequest request)
           
 void eraseSourceFeedback(Request request)
          Erase feedback indicating that the receiver object is being dragged.
protected  void eraseTargetConnectionFeedback(DropRequest request)
          Erase feedback indicating that the edit part is no longer the target of a drag.
 void eraseTargetFeedback(Request request)
          Erases target feedback based on the given request.
 Command getCommand(Request request)
          Get the command that performs an operation of the type indicated by @commandString on the receiver.
protected abstract  Command getConnectionCompleteCommand(CreateConnectionRequest request)
           
protected abstract  Command getConnectionCreateCommand(CreateConnectionRequest request)
           
protected  FeedbackHelper getFeedbackHelper(CreateConnectionRequest request)
           
protected abstract  Command getReconnectSourceCommand(ReconnectRequest request)
           
protected abstract  Command getReconnectTargetCommand(ReconnectRequest request)
           
protected  ConnectionAnchor getSourceConnectionAnchor(CreateConnectionRequest request)
           
protected  ConnectionAnchor getTargetConnectionAnchor(CreateConnectionRequest request)
           
 EditPart getTargetEditPart(Request request)
          Returns the host EditPart if the EditPolicy works with the given request type, otherwise return null.
protected  void showCreationFeedback(CreateConnectionRequest request)
           
 void showSourceFeedback(Request request)
          Shows or updates source feedback if the receiver works with the request type.
protected  void showTargetConnectionFeedback(DropRequest request)
           
 void showTargetFeedback(Request request)
          Shows or updates target feedback if the receiver works with the request type.
 
Methods inherited from class org.eclipse.gef.editpolicies.GraphicalEditPolicy
addFeedback, getHostFigure, getLayer, removeFeedback
 
Methods inherited from class org.eclipse.gef.editpolicies.AbstractEditPolicy
activate, deactivate, debugFeedback, getHost, initialize, setHost, toString, understandsRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

feedbackHelper

protected FeedbackHelper feedbackHelper

connectionFeedback

protected Connection connectionFeedback
Constructor Detail

GraphicalNodeEditPolicy

public GraphicalNodeEditPolicy()
Method Detail

createDummyConnection

protected Connection createDummyConnection(Request req)

eraseCreationFeedback

protected void eraseCreationFeedback(CreateConnectionRequest request)

eraseSourceFeedback

public void eraseSourceFeedback(Request request)
Erase feedback indicating that the receiver object is being dragged. This method is called when a drag is completed or cancelled on the receiver object.
Overrides:
eraseSourceFeedback in class AbstractEditPolicy
Parameters:
dragTracker - org.eclipse.gef.tools.DragTracker The drag tracker of the tool performing the drag.

eraseTargetConnectionFeedback

protected void eraseTargetConnectionFeedback(DropRequest request)
Erase feedback indicating that the edit part is no longer the target of a drag.

eraseTargetFeedback

public void eraseTargetFeedback(Request request)
Description copied from interface: EditPolicy
Erases target feedback based on the given request. Does nothing if the EditPolicy does not apply to the given request.
Overrides:
eraseTargetFeedback in class AbstractEditPolicy

getCommand

public Command getCommand(Request request)
Get the command that performs an operation of the type indicated by @commandString on the receiver. Data needed to create the command is contained in @tool Possible values for the commandString depend on the tool. Default tools send "create" and "move".
Overrides:
getCommand in class AbstractEditPolicy
Parameters:
commandString - java.lang.String The type of command to create
commandData - org.eclipse.gef.CommandData Data needed to create the command
Returns:
org.eclipse.gef.commands.Command The command that performs the operation

getConnectionCompleteCommand

protected abstract Command getConnectionCompleteCommand(CreateConnectionRequest request)

getConnectionCreateCommand

protected abstract Command getConnectionCreateCommand(CreateConnectionRequest request)

getFeedbackHelper

protected FeedbackHelper getFeedbackHelper(CreateConnectionRequest request)

getReconnectTargetCommand

protected abstract Command getReconnectTargetCommand(ReconnectRequest request)

getReconnectSourceCommand

protected abstract Command getReconnectSourceCommand(ReconnectRequest request)

getSourceConnectionAnchor

protected ConnectionAnchor getSourceConnectionAnchor(CreateConnectionRequest request)

getTargetConnectionAnchor

protected ConnectionAnchor getTargetConnectionAnchor(CreateConnectionRequest request)

getTargetEditPart

public EditPart getTargetEditPart(Request request)
Description copied from interface: EditPolicy
Returns the host EditPart if the EditPolicy works with the given request type, otherwise return null. For all practical uses, this method has "boolean" behavior. It is possible, although rarely useful, to return an EditPart other than the host.
Overrides:
getTargetEditPart in class AbstractEditPolicy

showCreationFeedback

protected void showCreationFeedback(CreateConnectionRequest request)

showSourceFeedback

public void showSourceFeedback(Request request)
Description copied from interface: EditPolicy
Shows or updates source feedback if the receiver works with the request type. This method may be called repeatedly for the purpose of updating feedback based on changes to the request object. Does nothing if the EditPolicy does not recognize the given request.
Overrides:
showSourceFeedback in class AbstractEditPolicy

showTargetConnectionFeedback

protected void showTargetConnectionFeedback(DropRequest request)

showTargetFeedback

public void showTargetFeedback(Request request)
Description copied from interface: EditPolicy
Shows or updates target feedback if the receiver works with the request type. This method may be called repeatedly for the purpose of updating feedback based on changes to the request object. Does nothing if the EditPolicy does not recognize the given request.
Overrides:
showTargetFeedback in class AbstractEditPolicy

GEF v2.0