|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.nexttext.behaviour.AbstractAction net.nexttext.behaviour.control.Selector
public class Selector
This action maintains a collection of action (in form of a HashMap) in which any one of the contained actions can be set to act as the current action.
TextObjects are passed on to (and only to) the current action. This allows for the creation of behaviours with state, i.e. behaviours that display different dynamics at different times. For each action contained in the selector a collection of textObjects that the action has finished processing is maintained. This maintains the 'completed' semantics of contained actions but allows textObjects to continually be acted upon when the current action changes.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface net.nexttext.behaviour.Action |
---|
Action.ActionResult |
Constructor Summary | |
---|---|
Selector()
|
Method Summary | |
---|---|
void |
add(java.lang.String name,
Action action)
Add an action to the selector |
Action.ActionResult |
behave(TextObject to)
Applies the current action |
java.lang.Object[] |
getActionNames()
|
java.util.Map<java.lang.String,Property> |
getRequiredProperties()
The properties that this action requires on a TextObject. |
void |
select(java.lang.String name)
If [name] matches the name of a previously added action then that action will be made the current action |
Methods inherited from class net.nexttext.behaviour.AbstractAction |
---|
behave, behave, complete, getDisplayName, makeBehaviour, properties, setDisplayName |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Selector()
Method Detail |
---|
public void select(java.lang.String name)
name
- - the name of the action to be selected.public void add(java.lang.String name, Action action)
name
- action
- public Action.ActionResult behave(TextObject to)
behave
in interface Action
behave
in class AbstractAction
public java.lang.Object[] getActionNames()
public java.util.Map<java.lang.String,Property> getRequiredProperties()
AbstractAction
Right now this method always returns an empty map, since basic Actions should be restricted to use only the core set of TextObject properties.
If a subclass of Action requires a set of additional properties then it should override this method and return the appropriate Map containing the property objects.
This method is required by the Action
interface.
getRequiredProperties
in interface Action
getRequiredProperties
in class AbstractAction
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |