Class JsonFixture

All Implemented Interfaces:
LXComponent.Renamable, LXPath, LXSerializable, LXParameterListener, LXFixtureContainer

public class JsonFixture extends LXFixture
  • Field Details

  • Constructor Details

    • JsonFixture

      public JsonFixture(LX lx)
    • JsonFixture

      public JsonFixture(LX lx, String fixtureType)
  • Method Details

    • onParameterChanged

      public void onParameterChanged(LXParameter p)
      Description copied from class: LXComponent
      Subclasses are free to override this if desired. It will automatically fire for any listenable parameter that is registered with this component.
      Specified by:
      onParameterChanged in interface LXParameterListener
      Overrides:
      onParameterChanged in class LXFixture
      Parameters:
      p - Parameter that has a value change
    • getJsonParameters

      public Collection<JsonFixture.ParameterDefinition> getJsonParameters()
    • reload

      public void reload()
    • buildOutputs

      protected void buildOutputs()
      Description copied from class: LXFixture
      Subclasses must override this method to provide an implementation that produces the necessary set of outputs for this fixture to be sent. The subclass should call LXFixture.addOutputDefinition(OutputDefinition) or LXFixture.addOutputDirect(LXOutput) for each output.
      Specified by:
      buildOutputs in class LXFixture
    • size

      protected int size()
      Description copied from class: LXFixture
      Subclasses must implement to specify the number of points in the fixture. This does not include the number of points that are in children.
      Specified by:
      size in class LXFixture
      Returns:
      number of points immediately in the fixture
    • computePointGeometry

      protected void computePointGeometry(LXMatrix matrix, List<LXPoint> points)
      Description copied from class: LXFixture
      This method should be implemented by subclasses to generate the geometry of the fixture any time its geometry parameters have changed. The correct number of points will have already been computed, and merely need to have their positions set.
      Specified by:
      computePointGeometry in class LXFixture
      Parameters:
      matrix - A transform matrix representing the fixture's position
      points - The list of points that need to have their positions set
    • addModelMetaData

      protected void addModelMetaData(Map<String,String> metaData)
      Description copied from class: LXFixture
      Subclasses may override to add additiona metadata fields for inclusion in the model
      Overrides:
      addModelMetaData in class LXFixture
      Parameters:
      metaData - Map to add meta-data fields to
    • load

      public void load(LX lx, JsonObject obj)
      Description copied from class: LXComponent
      Loads the LX component. Restores the ID of the component, as well as its internal and user-facing parameters. Any explicitly registered children will be automatically loaded, so long as they are direct descendants. Dynamic arrays will not be automatically loaded, this is left to subclasses to implement.
      Specified by:
      load in interface LXSerializable
      Overrides:
      load in class LXFixture
      Parameters:
      lx - LX instance
      obj - Object to deserialize
    • save

      public void save(LX lx, JsonObject obj)
      Description copied from class: LXComponent
      Serializes the LX component. By default, all internal and user-facing parameters are serialized, as well as any explicitly registered child components. Note that child arrays are not serialized, or any other dynamic components. Subclasses may override to perform more saving, and are expected to call super.save(lx, obj) at the appropriate time.
      Specified by:
      save in interface LXSerializable
      Overrides:
      save in class LXComponent
      Parameters:
      lx - LX instance
      obj - Object to serialize into