OME
Class CreateElementMethod

java.lang.Object
  |
  +--OME.AbstractPluginMethod
        |
        +--OME.CreateElementMethod

public class CreateElementMethod
extends AbstractPluginMethod

This class is a PluginMethod that is used to create an element whose type is specified at construction time. This PluginMethod can be placed on a menu, toolbar or popupmenu.


Constructor Summary
CreateElementMethod(java.lang.Object type, java.lang.String typename, View view)
          Constructs a CreateElementMethod which can be used to create elements with the specified type, typename and view.
 
Method Summary
 void cancelled()
          Cancel this method.
 java.awt.Image getImage()
          Returns the image associated with the object this method will create.
 java.lang.String getName()
          Returns the type of the object, this method will create
 void invoke()
          Execute this method.
 PluginParameter nextParameter()
          Get the next parameter to be used when this method is invoked.
 void passParameter(java.util.Collection c)
          Passes the next parameter to be used when this method is invoked.
 
Methods inherited from class OME.AbstractPluginMethod
getSubmenu, getSubmenu, isEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CreateElementMethod

public CreateElementMethod(java.lang.Object type,
                           java.lang.String typename,
                           View view)
Constructs a CreateElementMethod which can be used to create elements with the specified type, typename and view.
Parameters:
type - the type of the object to be created
typename - the name to be associated with the created object
view - the view where this object will be created. Unfortunately in the present architecture, changes are made to the view which are then reflected in the model, instead of the reverse (where changes are made made to the model which are reflected in the view).
Method Detail

getImage

public java.awt.Image getImage()
Returns the image associated with the object this method will create.
Overrides:
getImage in class AbstractPluginMethod
See Also:
getImage()

getName

public java.lang.String getName()
Returns the type of the object, this method will create
Overrides:
getName in class AbstractPluginMethod
See Also:
getName()

nextParameter

public PluginParameter nextParameter()
Get the next parameter to be used when this method is invoked.
Overrides:
nextParameter in class AbstractPluginMethod
See Also:
nextParameter()

passParameter

public void passParameter(java.util.Collection c)
Passes the next parameter to be used when this method is invoked.
Overrides:
passParameter in class AbstractPluginMethod
See Also:
passParameter(Collection c)

invoke

public void invoke()
Execute this method. This is analogous to the actionPerformed method in ActionListener's.
Overrides:
invoke in class AbstractPluginMethod
See Also:
invoke()

cancelled

public void cancelled()
Cancel this method. Do neccessary clean-up and exit method gracefully.
Overrides:
cancelled in class AbstractPluginMethod
See Also:
cancelled()