be.ac.vub.cocompose.eclipse.commands
Class CreateCommand

java.lang.Object
  extended byorg.eclipse.gef.commands.Command
      extended bybe.ac.vub.cocompose.eclipse.commands.CreateCommand

public class CreateCommand
extends Command

Create command for CoCompose elements.

Since:
0.2.0
Version:
0.2.0, 09/01/2004
Author:
Dennis Wagelaar

Constructor Summary
CreateCommand()
          Creates a CreateCommand.
 
Method Summary
protected  String adaptName(String name)
          Adapts the given name to be unique within the new namespace.
 void execute()
           
 ModelElement getElement()
          Gets the created element.
 Namespace getOwner()
          Gets the owner element.
 Rectangle getPosition()
          Gets the position for insertion.
protected  void primExecute()
          Execute implementation.
 void redo()
           
 void setElement(ModelElement element)
          Sets the created element.
 void setOwner(Namespace owner)
          Sets the owner element.
 void setPosition(Rectangle position)
          Sets the position for insertion.
 void undo()
           
 
Methods inherited from class org.eclipse.gef.commands.Command
canExecute, 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

CreateCommand

public CreateCommand()
Creates a CreateCommand.

Method Detail

execute

public void execute()
See Also:
Command.execute()

getOwner

public Namespace getOwner()
Gets the owner element.

Returns:
the owner element.

setOwner

public void setOwner(Namespace owner)
Sets the owner element.

Parameters:
owner - - the owner element.

getElement

public ModelElement getElement()
Gets the created element.

Returns:
the created element.

setElement

public void setElement(ModelElement element)
Sets the created element.

Parameters:
element - - the created element.

getPosition

public Rectangle getPosition()
Gets the position for insertion.

Returns:
the position data.

setPosition

public void setPosition(Rectangle position)
Sets the position for insertion.

Parameters:
position - - the position data.

redo

public void redo()
See Also:
Command.redo()

undo

public void undo()
See Also:
Command.undo()

primExecute

protected void primExecute()
Execute implementation.

See Also:
Command.execute()

adaptName

protected String adaptName(String name)
Adapts the given name to be unique within the new namespace.

Parameters:
name - the name to adapt
Returns:
the adapted name