Modelers

org.topcased.modeler.commands
Class ReconnectEdgeToNodeCommand

java.lang.Object
  extended by org.eclipse.gef.commands.Command
      extended by org.topcased.modeler.commands.ReconnectGraphEdgeCommand
          extended by org.topcased.modeler.commands.ReconnectEdgeToNodeCommand
Direct Known Subclasses:
ReconnectEdgeToSourceCommand, ReconnectEdgeToTargetCommand

public abstract class ReconnectEdgeToNodeCommand
extends ReconnectGraphEdgeCommand

This commands sets a reference of a node to the given edge


Constructor Summary
ReconnectEdgeToNodeCommand(org.eclipse.gef.ConnectionEditPart connection, java.lang.String featureName)
           
ReconnectEdgeToNodeCommand(org.eclipse.gef.EditDomain domain, org.eclipse.gef.ConnectionEditPart connection, java.lang.String featureName, boolean needModelUpdate)
           
 
Method Summary
protected  void doContainer(EObject owner, EObject toUpdate)
          Sets the object to update within the same container as the owner
protected abstract  EObject getObjectToUpdate()
          Returns the model object to be updated by changements
protected  void redoModel()
          Update the model after at the end of the redo() method.
 void setContainerRef(java.lang.String reference, int commandType)
          Keeps a trace of the container's feature
protected  void undoContainer(EObject updated)
          Sets back the old conatiner to the given object
protected  void undoModel()
          Update the model at the end of the undo() method.
 
Methods inherited from class org.topcased.modeler.commands.ReconnectGraphEdgeCommand
canExecute, execute, getEdge, getNewElement, getOldElement, getOldGraphElement, initializeConnectors, redo, setNewElement, undo, updateConnectors
 
Methods inherited from class org.eclipse.gef.commands.Command
canUndo, chain, dispose, getDebugLabel, getLabel, setDebugLabel, setLabel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReconnectEdgeToNodeCommand

public ReconnectEdgeToNodeCommand(org.eclipse.gef.ConnectionEditPart connection,
                                  java.lang.String featureName)
Parameters:
domain -
connection -

ReconnectEdgeToNodeCommand

public ReconnectEdgeToNodeCommand(org.eclipse.gef.EditDomain domain,
                                  org.eclipse.gef.ConnectionEditPart connection,
                                  java.lang.String featureName,
                                  boolean needModelUpdate)
Parameters:
domain -
connection -
needModelUpdate -
Method Detail

redoModel

protected void redoModel()
Description copied from class: ReconnectGraphEdgeCommand
Update the model after at the end of the redo() method. This method should be overriden by subclasses.

Specified by:
redoModel in class ReconnectGraphEdgeCommand
See Also:
ReconnectGraphEdgeCommand.redoModel()

undoModel

protected void undoModel()
Description copied from class: ReconnectGraphEdgeCommand
Update the model at the end of the undo() method. This method should be overriden by subclasses.

Specified by:
undoModel in class ReconnectGraphEdgeCommand
See Also:
ReconnectGraphEdgeCommand.undoModel()

setContainerRef

public void setContainerRef(java.lang.String reference,
                            int commandType)
Keeps a trace of the container's feature

Parameters:
reference - The containers feature name
commandType - the type of containment
See Also:
SourceTargetData.NONE, SourceTargetData.DIAGRAM, SourceTargetData.SOURCE, SourceTargetData.SOURCE_CONTAINER, SourceTargetData.TARGET, SourceTargetData.TARGET_CONTAINER

doContainer

protected void doContainer(EObject owner,
                           EObject toUpdate)
Sets the object to update within the same container as the owner

Parameters:
owner - The owner which has a reference to the object to update
toUpdate - The object sharing the same container as the owner

undoContainer

protected void undoContainer(EObject updated)
Sets back the old conatiner to the given object

Parameters:
updated - The object to be placed inside its ancient container

getObjectToUpdate

protected abstract EObject getObjectToUpdate()
Returns the model object to be updated by changements

Returns:
The object to be updated

Modelers

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