Class LXCommand

java.lang.Object
heronarts.lx.command.LXCommand
Direct Known Subclasses:
LXCommand.Channel.AddEffect, LXCommand.Channel.AddPattern, LXCommand.Channel.GoPattern, LXCommand.Channel.MoveEffect, LXCommand.Channel.MovePattern, LXCommand.Channel.SetFader, LXCommand.Clip.Add, LXCommand.Clip.Record, LXCommand.Clip.Remove, LXCommand.Clip.Trigger, LXCommand.Device.ClearRemoteControls, LXCommand.Device.LoadPreset, LXCommand.Device.SetRemoteControls, LXCommand.Midi.AddMapping, LXCommand.Midi.RemoveMapping, LXCommand.Mixer.AddChannel, LXCommand.Mixer.DropChannel, LXCommand.Mixer.GroupSelectedChannels, LXCommand.Mixer.MoveChannel, LXCommand.Mixer.RemoveSelectedChannels, LXCommand.Mixer.Ungroup, LXCommand.Mixer.UngroupChannel, LXCommand.Modulation.AddModulation, LXCommand.Modulation.AddModulator, LXCommand.Modulation.AddTrigger, LXCommand.Modulation.MoveModulator, LXCommand.Modulation.Remove, LXCommand.Modulation.RemoveModulation, LXCommand.Modulation.RemoveModulations, LXCommand.Modulation.RemoveTrigger, LXCommand.Palette.AddColor, LXCommand.Palette.ImportSwatches, LXCommand.Palette.MoveSwatch, LXCommand.Palette.SaveSwatch, LXCommand.Palette.SetSwatch, LXCommand.Parameter.Decrement, LXCommand.Parameter.Increment, LXCommand.Parameter.Reset, LXCommand.Parameter.SetColor, LXCommand.Parameter.SetNormalized, LXCommand.Parameter.SetString, LXCommand.Parameter.SetValue, LXCommand.Parameter.Toggle, LXCommand.RemoveComponent, LXCommand.Snapshots.AddSnapshot, LXCommand.Snapshots.MoveSnapshot, LXCommand.Snapshots.Recall, LXCommand.Snapshots.Update, LXCommand.Structure.AddFixture, LXCommand.Structure.AddView, LXCommand.Structure.ImportViews, LXCommand.Structure.ModifyFixturePositions, LXCommand.Structure.MoveFixture, LXCommand.Structure.MoveView, LXCommand.Structure.NewModel, LXCommand.Structure.RemoveSelectedFixtures

public abstract class LXCommand extends Object
An LXCommand is an operation that may be performed by the engine, potentially in two directions, supporting and Undo operation. If you are working directly with the LX API, you are free to ignore this interface. However, if you are building a higher-level UI that you would like to integrate with the undo system, it is best to invoke operations via calls to lx.command.perform().
  • Constructor Details

    • LXCommand

      public LXCommand()
  • Method Details

    • getDescription

      public abstract String getDescription()
      Short description of a command, to explain it to the user
      Returns:
      short description of command
    • perform

      public abstract void perform(LX lx) throws LXCommand.InvalidCommandException
      Perform the given command
      Parameters:
      lx - LX instance
      Throws:
      LXCommand.InvalidCommandException - if the command is invalid
    • undo

      public abstract void undo(LX lx) throws LXCommand.InvalidCommandException
      Undo the command, after it has been performed
      Parameters:
      lx - LX instance
      Throws:
      LXCommand.InvalidCommandException - if the command is invalid
    • isIgnored

      public boolean isIgnored()
      May return true if a command should be ignore for the purposes of undo
      Returns:
      Whether to ignore command for purposes of undo