com.autodesk.actions
Class Action

java.lang.Object
  extended by com.autodesk.actions.Action

public abstract class Action
extends java.lang.Object

This class is used to represent actions.


Constructor Summary
Action(java.lang.String id, java.lang.Class[] inputClasses, java.lang.Class[] outputClasses)
          Create an Action.
 
Method Summary
 boolean accepts(java.lang.Class[] classes)
          Determine if this action accepts any of the given IOObject classes as input.
 java.lang.String getID()
           
protected  java.lang.String[] getLocale()
           
abstract  java.lang.String getName()
           
 java.lang.Class[] getOutputClasses()
          Get the set of output IOObjects that this class responds to.
abstract  javax.swing.JPanel getPanel()
           
abstract  java.lang.String getSectionID()
           
 java.lang.String[] getSectionNames()
           
 java.util.Map<java.lang.String,java.lang.Object> getValues(javax.swing.JPanel arg0)
           
 void initialize()
           
 IOObject run(java.util.Map<java.lang.String,java.lang.Object> vars, IOObject input)
          Run the Action.
protected abstract  IOObject runImpl(java.util.Map<java.lang.String,java.lang.Object> vars, IOObject input)
          The implementation of the run method.
 void setValues(javax.swing.JPanel arg0, java.util.Map<java.lang.String,java.lang.Object> arg1)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Action

public Action(java.lang.String id,
              java.lang.Class[] inputClasses,
              java.lang.Class[] outputClasses)
Create an Action.

Parameters:
id - a unique id for the action. This id is not localized and need not be in English, just must be unique.
inputClasses - a possibly null array of IOObject classes that this Action supports for input. The array is adopted by this method.
outputClasses - a possibly null array of IOObject classes that this Action supports for output. The array is adopted by this method.
Method Detail

accepts

public final boolean accepts(java.lang.Class[] classes)
Determine if this action accepts any of the given IOObject classes as input.

Parameters:
classes - an array of input classes.
Returns:
true if any of the input classes can be used by this Action.

getOutputClasses

public final java.lang.Class[] getOutputClasses()
Get the set of output IOObjects that this class responds to.

Returns:
the array of output classes. This returns the internal array of classes and should therefore the returned array should not be modified.

run

public final IOObject run(java.util.Map<java.lang.String,java.lang.Object> vars,
                          IOObject input)
Run the Action. This runs runImpl(java.util.Map, com.autodesk.objects.IOObject) making sure that the input IOObject is correct and that the output IOObject is also correct according to the XML description of the Action.

Parameters:
vars - a Map containing the names and values of variables that are available to the Action.
input - an IOObject that is used as input to the Action, generally the output from the previous Action.
Returns:
an IOObject generated by the Action. This must be one of the output classes used to initialize the super Action class.

runImpl

protected abstract IOObject runImpl(java.util.Map<java.lang.String,java.lang.Object> vars,
                                    IOObject input)
The implementation of the run method. Classes implementing an Action need to implement this method. The run(java.util.Map, com.autodesk.objects.IOObject) method calls this method when it has confirmed that the input is valid. run(java.util.Map, com.autodesk.objects.IOObject) will confirm that the IOObject returned by this method is one of the IOObjects the class declares as returning.

Parameters:
vars - a Map containing the names and values of variables that are available to the Action.
input - an IOObject that is used as input to the Action, generally the output from the previous Action.
Returns:
an IOObject generated by the Action. This must be one of the output classes used to initialize the super Action class.

initialize

public void initialize()

getName

public abstract java.lang.String getName()

getPanel

public abstract javax.swing.JPanel getPanel()

getID

public java.lang.String getID()

getSectionID

public abstract java.lang.String getSectionID()

getSectionNames

public java.lang.String[] getSectionNames()

getValues

public java.util.Map<java.lang.String,java.lang.Object> getValues(javax.swing.JPanel arg0)

setValues

public void setValues(javax.swing.JPanel arg0,
                      java.util.Map<java.lang.String,java.lang.Object> arg1)

getLocale

protected java.lang.String[] getLocale()