Package com.j3d.engine.interact.macros
Class MacroRecorder
java.lang.Object
com.j3d.engine.interact.macros.MacroRecorder
- All Implemented Interfaces:
EventListener
A single-instantiated class with the purpose of recording engine events to become a single
Macro.
How it works is, it listens for the following events:
EventType.CAMERA_MOVEDto track camera changesEventType.COMMAND_FIREDto track command invocations (only the base invocation since it'll have the subcommand as arguments)EventType.X_SELECTEDto track selection
MacroRunner
- Author:
- Lehlogonolo Poole
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean<K> voidonEvent(EventType event, EventPayload<K> properties) Listens for the 3 events listed in theMacroRecorderdoc and applies human readable formatting if the recorded class instance does not provide a specialized macro-line method.voidBegins recording engine events to save as macro instructions.stop()Stops recording the macro, clears all state such that a new macro can be recorded and returns a macro of the recorded instructions.
-
Field Details
-
instructions
The ordered list of instructions. -
name
The name of the macro provided byRecordCmd -
running
private boolean runningBoolean indicating whether the macro is running or not
-
-
Constructor Details
-
MacroRecorder
MacroRecorder()Package-private default constructor (OnlyMacroUtilscan instantiate it)
-
-
Method Details
-
record
Begins recording engine events to save as macro instructions. This serves as the start of recording a macro.- Parameters:
name- The name of the new macro
-
stop
Stops recording the macro, clears all state such that a new macro can be recorded and returns a macro of the recorded instructions.- Returns:
- The recorded macro, unless the class was never running then null.
-
onEvent
Listens for the 3 events listed in theMacroRecorderdoc and applies human readable formatting if the recorded class instance does not provide a specialized macro-line method.- Specified by:
onEventin interfaceEventListener- Type Parameters:
K- K.- Parameters:
event- The type of eventproperties- The given event payload- See Also:
-
isRecording
public boolean isRecording()
-