Package com.j3d.engine.interact.cmd.base
Interface StatefulCommand<T>
- Type Parameters:
T- The type of object that the command operates on.
- All Superinterfaces:
SemiStatefulCommand
- All Known Subinterfaces:
KeyedStatefulCommand
- All Known Implementing Classes:
AbstractTransform,ExtrudeCmd,OrbitCmd,PrismCmd,QuickTranslateCmd,RotateSelection,ScaleSelection,TranslateSelection
A command that can be in one of two states: running or not running.
When a stateful command is running, it takes over the input stream and waits for a specific event to occur.
This event can be either the 'Enter' key being pressed, which confirms the command and executes its 'onEnter' method,
or the 'Escape' key being pressed, which cancels the command and executes its 'onEsc' method.
- Author:
- Lehlogonolo Poole
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidonEnter(T object, SafeJLabel label) Called when the 'Enter' key is pressed.default voidonEsc(T object, SafeJLabel label) Called when the 'Escape' key is pressed.voidonStart(T object, SafeJLabel label) Called when the command is first started.default voidrun(StatefulCommand<?> t, String name, T object, SafeJLabel label) default voidrun(StatefulCommand<?> t, String name, T object, SafeJLabel label, String s) Runs the stateful command.Methods inherited from interface com.j3d.engine.interact.cmd.base.SemiStatefulCommand
fire
-
Method Details
-
onStart
Called when the command is first started.- Parameters:
object- The object that the command operates on.label- The SafeJLabel instance.
-
onEnter
Called when the 'Enter' key is pressed.- Parameters:
object- The object that the command operates on.label- The SafeJLabel instance.
-
onEsc
Called when the 'Escape' key is pressed.- Parameters:
object- The object that the command operates on.label- The SafeJLabel instance.
-
run
-
run
Runs the stateful command.- Parameters:
t- The stateful command that is running.name- The name of the command.object- The object that the command should operates on.
-