Modelers

org.topcased.modeler.edit.policies
Class AbstractEdgeCreationEditPolicy

java.lang.Object
  extended by org.eclipse.gef.editpolicies.AbstractEditPolicy
      extended by org.eclipse.gef.editpolicies.GraphicalEditPolicy
          extended by org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy
              extended by org.topcased.modeler.edit.policies.NodeEditPolicy
                  extended by org.topcased.modeler.edit.policies.AbstractEdgeCreationEditPolicy
All Implemented Interfaces:
org.eclipse.gef.EditPolicy, org.eclipse.gef.RequestConstants

public abstract class AbstractEdgeCreationEditPolicy
extends NodeEditPolicy


creation : 15 juin 2005 Edge creation policy template


Field Summary
 
Fields inherited from class org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy
connectionFeedback, 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_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
AbstractEdgeCreationEditPolicy()
           
 
Method Summary
protected abstract  boolean checkCommand(org.eclipse.gef.commands.Command command)
          Check that the given command type is correct
protected abstract  boolean checkEdge(GraphEdge edge)
          Check that current edge is complient with the model object that is represented here
protected abstract  boolean checkSource(GraphElement source)
          Check that source object supports the current edge
protected abstract  boolean checkTargetForSource(GraphElement source, GraphElement target)
          Check that source and target are available for this type of edge
protected abstract  CreateTypedEdgeCommand createCommand(org.eclipse.gef.EditDomain domain, GraphEdge edge, GraphElement source)
          Get new edge creation command
protected  org.eclipse.gef.commands.Command getConnectionCompleteCommand(org.eclipse.gef.requests.CreateConnectionRequest request)
           
protected  org.eclipse.gef.commands.Command getConnectionCreateCommand(org.eclipse.gef.requests.CreateConnectionRequest request)
           
protected  org.eclipse.gef.commands.Command getReconnectSourceCommand(org.eclipse.gef.requests.ReconnectRequest request)
           
protected  org.eclipse.gef.commands.Command getReconnectTargetCommand(org.eclipse.gef.requests.ReconnectRequest request)
           
protected abstract  SourceTargetData getSourceTargetData(GraphElement source, GraphElement target)
          Build a SourceTargetData structure for a given source and a given target
protected  void showCreationFeedback(org.eclipse.gef.requests.CreateConnectionRequest request)
          Avoid duplicate feedbacks when several edge policies are available
 
Methods inherited from class org.topcased.modeler.edit.policies.NodeEditPolicy
getFeedbackLayer
 
Methods inherited from class org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy
createDummyConnection, deactivate, eraseCreationFeedback, eraseSourceFeedback, eraseTargetConnectionFeedback, eraseTargetFeedback, getCommand, getDummyConnectionRouter, getFeedbackHelper, getSourceConnectionAnchor, getTargetConnectionAnchor, getTargetEditPart, showSourceFeedback, showTargetConnectionFeedback, showTargetFeedback
 
Methods inherited from class org.eclipse.gef.editpolicies.GraphicalEditPolicy
addFeedback, getHostFigure, getLayer, removeFeedback
 
Methods inherited from class org.eclipse.gef.editpolicies.AbstractEditPolicy
activate, debugFeedback, getHost, setHost, toString, understandsRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractEdgeCreationEditPolicy

public AbstractEdgeCreationEditPolicy()
Method Detail

getConnectionCreateCommand

protected org.eclipse.gef.commands.Command getConnectionCreateCommand(org.eclipse.gef.requests.CreateConnectionRequest request)
Specified by:
getConnectionCreateCommand in class org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy
See Also:
GraphicalNodeEditPolicy.getConnectionCreateCommand(org.eclipse.gef.requests.CreateConnectionRequest)

getConnectionCompleteCommand

protected org.eclipse.gef.commands.Command getConnectionCompleteCommand(org.eclipse.gef.requests.CreateConnectionRequest request)
Specified by:
getConnectionCompleteCommand in class org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy
See Also:
GraphicalNodeEditPolicy.getConnectionCompleteCommand(org.eclipse.gef.requests.CreateConnectionRequest)

showCreationFeedback

protected void showCreationFeedback(org.eclipse.gef.requests.CreateConnectionRequest request)
Avoid duplicate feedbacks when several edge policies are available

Overrides:
showCreationFeedback in class org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy
See Also:
GraphicalNodeEditPolicy.showCreationFeedback(org.eclipse.gef.requests.CreateConnectionRequest)

getReconnectTargetCommand

protected org.eclipse.gef.commands.Command getReconnectTargetCommand(org.eclipse.gef.requests.ReconnectRequest request)
Specified by:
getReconnectTargetCommand in class org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy
See Also:
GraphicalNodeEditPolicy.getReconnectTargetCommand(org.eclipse.gef.requests.ReconnectRequest)

getReconnectSourceCommand

protected org.eclipse.gef.commands.Command getReconnectSourceCommand(org.eclipse.gef.requests.ReconnectRequest request)
Specified by:
getReconnectSourceCommand in class org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy
See Also:
GraphicalNodeEditPolicy.getReconnectSourceCommand(org.eclipse.gef.requests.ReconnectRequest)

createCommand

protected abstract CreateTypedEdgeCommand createCommand(org.eclipse.gef.EditDomain domain,
                                                        GraphEdge edge,
                                                        GraphElement source)
Get new edge creation command

Parameters:
domain - the current edit domain
edge - the current edge
source - the graphElement source
Returns:
a typed command for create an edge

checkEdge

protected abstract boolean checkEdge(GraphEdge edge)
Check that current edge is complient with the model object that is represented here

Parameters:
edge - the current edge
Returns:
true if the edge is complient

checkSource

protected abstract boolean checkSource(GraphElement source)
Check that source object supports the current edge

Parameters:
source - the graphnode source
Returns:
true if the source supports the current edge

checkTargetForSource

protected abstract boolean checkTargetForSource(GraphElement source,
                                                GraphElement target)
Check that source and target are available for this type of edge

Parameters:
source - the graphnode source
target - the graphnode target
Returns:
true if the "source target" couple is available for this edge

checkCommand

protected abstract boolean checkCommand(org.eclipse.gef.commands.Command command)
Check that the given command type is correct

Parameters:
command - the command
Returns:
true if command is ok

getSourceTargetData

protected abstract SourceTargetData getSourceTargetData(GraphElement source,
                                                        GraphElement target)
Build a SourceTargetData structure for a given source and a given target

Parameters:
source - the graphnode source
target - the graphnode target
Returns:
a new structure that stores data about the "source target" couple

Modelers

Copyright (c) 2005 TOPCASED Contributors 2005 - 2007. All rights reserved.