|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--OME.AbstractPluginMethod | +--OME.ObjectMethod
Many PluginMethods operate on ViewObjects. They look for a ViewObject from the context, and if they can't find one there, they will seek one from the user as a parameter. This class encapsulates that behaviour to save the plugin implementor from repeating the same code again and again.
Field Summary | |
protected java.lang.String |
instruction
|
protected java.lang.String[] |
instructions
|
protected java.lang.String |
name
|
protected View |
view
|
Constructor Summary | |
ObjectMethod(View view)
When no n is supplied, the default is 1. |
|
ObjectMethod(View view,
int n)
The input n determines how many objects are needed by this Method. |
Method Summary | |
void |
cancelled()
If the method is cancelled, we must return to the starting state. |
java.lang.String |
getName()
Set the name for this method in subclass' constructor. |
void |
invoke()
Invoke performs the operation on the method, and then resets the state of the method. |
boolean |
isEnabled(ViewContext con)
This method is only enabled if the view has an object associated with it. |
protected boolean |
isSuitable(ViewObject vo)
Override this method to perform a suitability test on the object. |
protected boolean |
isSuitable(ViewObject vo,
int n,
ViewObject[] collected)
Override this method to perform a suitability test on the nth object (COUNTING FROM ZERO). |
PluginParameter |
nextParameter()
We try to get the object from the context first, if possible, otherwise we ask for an object as a paramter. |
protected void |
operate(ViewObject vo)
For objects using 1 object... |
protected void |
operate(ViewObject[] viewobjects)
For objects using more than 1 object... |
void |
passParameter(java.util.Collection c)
Accept the parameter we just asked for. |
protected void |
resetMethod()
Override this method to perform any clean up that shoudl take place after an invocation of cancellation of the method. |
Methods inherited from class OME.AbstractPluginMethod |
getImage,
getSubmenu,
getSubmenu |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected View view
protected java.lang.String name
protected java.lang.String instruction
protected java.lang.String[] instructions
Constructor Detail |
public ObjectMethod(View view)
public ObjectMethod(View view, int n)
Method Detail |
public final PluginParameter nextParameter()
public final void passParameter(java.util.Collection c)
c
- a singleton Collection
containing the parameter
to be passed to this PluginMethod.public final void cancelled()
protected void resetMethod()
public final void invoke()
protected boolean isSuitable(ViewObject vo)
protected boolean isSuitable(ViewObject vo, int n, ViewObject[] collected)
protected void operate(ViewObject vo)
protected void operate(ViewObject[] viewobjects)
public final java.lang.String getName()
public final boolean isEnabled(ViewContext con)
con
- the ViewContext
for which this PluginMethod is
called.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |