Class MacroUtils

java.lang.Object
com.j3d.engine.interact.macros.MacroUtils

public class MacroUtils extends Object
Da Macro Utils. Basically the single instance manager of all the macros in J3Engine, this class is responsible for:
  • Providing the entire set of macros from the user's macros folder and the keys map
  • Updating both ends when a new macro is added or a key is changed. Although thats specific to MacrosEditor
  • Removing all J3Key in the global KeyBindings when macros change and the same for the EngineFrame.getMacroJMenu() where the macros are clickable via the JMenu
  • Holding the single instances to the MacroRecorder and MacroRunner
It can be accessed via StaticRefs.getMacroUtils() at any time.
Author:
Lehlogonolo Poole
See Also:
  • Field Details

    • macroRecorder

      private final MacroRecorder macroRecorder
      Recorder instance
    • macroRunner

      private final MacroRunner macroRunner
      Runner instance
    • macros

      private final HashMap<String,Macro> macros
      The map of macros that exist or were discovered
    • macroKeys

      private HashMap<KeyStroke,String> macroKeys
      The key map of macros. A macro might be defined in macros but not in in macro keys. That implies the macro was freshly added and currently does not have a key association.
    • registeredKeys

      private final ArrayList<J3Key> registeredKeys
      The registered list of J3Key representing these macros such that tearDownAndUpdate() can purge all the keys when rebuilding.
    • commandsToIgnore

      public static final List<Class<? extends Command>> commandsToIgnore
      List of classes the MacroRecorder will ignore when listening for EventType.COMMAND_FIRED
  • Constructor Details

    • MacroUtils

      public MacroUtils()
      Default Constructor.

      This has the added job of instantiating MacroRecorder and MacroRunner and attaching them as listeners to the instances they wish to listen to

  • Method Details