public static class ActionMapper.ApplyingAction extends ActionMapper.Action
Generic ActionMapper.Action impl that delegates to an object implementing an
apply(Object[]) method.
The apply(Object[]) method is passed the argument vector
{this, component, cs, actionSpec, cs.shiftDown, cs.ctrlDown,
cs.altDown, cs.button1Down, cs.button2Down, cs.button3Down, cs.width,
cs.height, cs.mousePressedX, cs.mousePressedY, cs.mouseX, cs.mouseY,
cs.mouseWheelClicks} where cs is the ActionMapper.ComponentState and component is the Component passed to
run(java.lang.String, java.awt.Component, vona.ui.ActionMapper.ComponentState). If it returns a Boolean or a boolean then the value has the
same semantics as ActionMapper.Action.run(java.lang.String, java.awt.Component, vona.ui.ActionMapper.ComponentState); other return types are treated as
true.
This is primarily for integration with higher-level scripting environments such as JScheme.
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.Object |
appliccable
the delegate
|
protected java.lang.reflect.Method |
applyMethod
the apply method on the delegate
|
COMPARATOR, consuming, description, dumpOnlyForSpec, enabled| Constructor and Description |
|---|
ActionMapper.ApplyingAction(java.lang.String description,
java.lang.Object appliccable)
uses default applyMethodName
|
ActionMapper.ApplyingAction(java.lang.String description,
java.lang.Object appliccable,
java.lang.String applyMethodName)
Make a new delegating action.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
run(java.lang.String actionSpec,
java.awt.Component component,
ActionMapper.ComponentState cs)
Delegates to
appliccable.apply(Object[]), see
class header doc. |
dump, dumpprotected final java.lang.Object appliccable
protected final java.lang.reflect.Method applyMethod
public ActionMapper.ApplyingAction(java.lang.String description,
java.lang.Object appliccable,
java.lang.String applyMethodName)
Make a new delegating action.
applyMethodName - the name of the apply(Object[]) method,
or null to use "apply"public ActionMapper.ApplyingAction(java.lang.String description,
java.lang.Object appliccable)
public boolean run(java.lang.String actionSpec,
java.awt.Component component,
ActionMapper.ComponentState cs)
Delegates to appliccable.apply(Object[]), see
class header doc.
run in class ActionMapper.ActionactionSpec - the action spec string that invoked the action, see
ActionMapper class header doccomponent - the AWT Component on which the event occurredcs - the ActionMapper.ComponentState of component, as
tracked by the containing ActionMapper