|
Modelers | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.gef.commands.Command
org.topcased.modeler.commands.CreateGraphNodeCommand
public class CreateGraphNodeCommand
Node creation
This command just add a graphNode into another. It also add the contained
element to the element of the parentNode graph node if needed.
creation : 30 nov. 2004
Constructor Summary | |
---|---|
CreateGraphNodeCommand(org.eclipse.gef.EditDomain domain,
GraphNode newObject,
GraphNode newParent,
EObject newContainerParent,
org.eclipse.draw2d.geometry.Point location,
org.eclipse.draw2d.geometry.Dimension dimension,
int attach,
java.util.List featuresList,
boolean needModelUpdate)
Constructor |
|
CreateGraphNodeCommand(org.eclipse.gef.EditDomain domain,
GraphNode newObject,
GraphNode newParent,
org.eclipse.draw2d.geometry.Point location,
org.eclipse.draw2d.geometry.Dimension dimension,
int attach)
Constructor - Add simply a graphNode to its container Node without updating the model |
|
CreateGraphNodeCommand(org.eclipse.gef.EditDomain domain,
GraphNode newObject,
GraphNode newParent,
org.eclipse.draw2d.geometry.Point location,
org.eclipse.draw2d.geometry.Dimension dimension,
java.util.List featuresList,
boolean needModelUpdate)
Constructor |
Method Summary | |
---|---|
boolean |
canExecute()
Check if the object that we try to add to the model is not already set (because the cardinality is 1) |
void |
execute()
|
protected EObject |
getChildEObject()
Return the childNode EObject to create |
protected GraphNode |
getChildNode()
Return the childNode to create |
protected org.eclipse.gef.EditDomain |
getEditDomain()
Return the EditDomain associated with the command |
protected EObject |
getParentEObject()
Return the parentNode EObject that will contain the childEObject |
protected GraphNode |
getParentNode()
Return the parentNode that will contain the childNode |
protected EStructuralFeature |
getSelectedFeature()
Return the EStructuralFeature where to add the childNode |
protected boolean |
isUpdateModel()
Return a boolean value used to update or not the model |
void |
redo()
|
protected void |
redoModel()
Update the model after at the end of the redo() method. |
void |
undo()
|
protected void |
undoModel()
Update the model at the end of the undo() method. |
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 |
---|
public CreateGraphNodeCommand(org.eclipse.gef.EditDomain domain, GraphNode newObject, GraphNode newParent, org.eclipse.draw2d.geometry.Point location, org.eclipse.draw2d.geometry.Dimension dimension, java.util.List featuresList, boolean needModelUpdate)
domain
- the EditDomain (used to init the name)newObject
- the node to createnewParent
- the parentNode nodelocation
- the location of the created nodedimension
- the size of the created nodefeaturesList
- the avalaible model element feature of the parentNode
node where the model element of the childNode node can be
addedneedModelUpdate
- true
if the model must be modified
during this command, false
if objects already
exist in the mode.public CreateGraphNodeCommand(org.eclipse.gef.EditDomain domain, GraphNode newObject, GraphNode newParent, EObject newContainerParent, org.eclipse.draw2d.geometry.Point location, org.eclipse.draw2d.geometry.Dimension dimension, int attach, java.util.List featuresList, boolean needModelUpdate)
domain
- the EditDomain (used to init the name)newObject
- the node to createnewParent
- the parentNode nodenewContainerParent
- the model object that should contain the new
childNode objectlocation
- the location of the created nodedimension
- the size of the created nodeattach
- the newAttachment of the created nodefeaturesList
- the avalaible model element feature of the parentNode
node where the model element of the childNode node can be
addedneedModelUpdate
- true
if the model must be modified
during this command, false
if objects already
exist in the mode.public CreateGraphNodeCommand(org.eclipse.gef.EditDomain domain, GraphNode newObject, GraphNode newParent, org.eclipse.draw2d.geometry.Point location, org.eclipse.draw2d.geometry.Dimension dimension, int attach)
domain
- the EditDomain (used to init the name)newObject
- the node to createnewParent
- the parentNode nodelocation
- the location of the created nodedimension
- the size of the created nodeattach
- the newAttachment of the created nodeMethod Detail |
---|
public boolean canExecute()
canExecute
in class org.eclipse.gef.commands.Command
Command.canExecute()
public void execute()
execute
in class org.eclipse.gef.commands.Command
Command.execute()
protected void redoModel()
public void redo()
redo
in class org.eclipse.gef.commands.Command
Command.redo()
protected void undoModel()
public void undo()
undo
in class org.eclipse.gef.commands.Command
Command.undo()
protected org.eclipse.gef.EditDomain getEditDomain()
protected EObject getChildEObject()
protected GraphNode getChildNode()
protected EObject getParentEObject()
protected GraphNode getParentNode()
protected EStructuralFeature getSelectedFeature()
protected boolean isUpdateModel()
|
Modelers | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) 2005 TOPCASED Contributors 2005 - 2007. All rights reserved.