Package heronarts.lx

Class LXRegistry

java.lang.Object
heronarts.lx.LXRegistry
All Implemented Interfaces:
LXSerializable
Direct Known Subclasses:
LXStudio.Registry

public class LXRegistry extends Object implements LXSerializable
Registry container for content classes used by the LX implementation
  • Field Details

  • Constructor Details

    • LXRegistry

      public LXRegistry(LX lx)
  • Method Details

    • addListener

      public LXRegistry addListener(LXRegistry.Listener listener)
    • removeListener

      public LXRegistry removeListener(LXRegistry.Listener listener)
    • getClassLoader

      public LXClassLoader getClassLoader()
    • getClass

      public Class<?> getClass(String className) throws ClassNotFoundException
      Throws:
      ClassNotFoundException
    • initialize

      protected void initialize()
    • checkRegistration

      public void checkRegistration()
    • runWatchService

      public void runWatchService()
    • reloadContent

      public void reloadContent()
    • reloadJsonFixtures

      public void reloadJsonFixtures()
    • installPackage

      public boolean installPackage(File file)
    • reinstallPackageMedia

      public void reinstallPackageMedia(LXClassLoader.Package pack)
    • installPackage

      public boolean installPackage(File file, boolean overwrite)
    • uninstallPackage

      public void uninstallPackage(LXClassLoader.Package pack)
    • uninstallPackage

      public void uninstallPackage(LXClassLoader.Package pack, boolean reload)
    • findPackage

      public LXClassLoader.Package findPackage(File file)
      Find a package that matches the package name in the given file
      Parameters:
      file - Package file
      Returns:
      Existing package which matches, or null if none exists
    • getInstantiableComponentType

      protected LXRegistry.ComponentType getInstantiableComponentType(Class<?> clz)
    • addClass

      protected void addClass(Class<?> clz, LXClassLoader.Package pack)
    • removeClass

      protected void removeClass(Class<?> clz)
    • addPattern

      public LXRegistry addPattern(Class<? extends LXPattern> pattern)
      Register a pattern class with the engine
      Parameters:
      pattern - Pattern class
      Returns:
      this
    • addPatterns

      public LXRegistry addPatterns(Class<? extends LXPattern>[] patterns)
      Register a pattern class with the engine
      Parameters:
      patterns - List of pattern classes
      Returns:
      this
    • removePattern

      public LXRegistry removePattern(Class<? extends LXPattern> pattern)
      Unregister pattern class with the engine
      Parameters:
      pattern - Pattern class
      Returns:
      this
    • removePatterns

      public LXRegistry removePatterns(List<Class<? extends LXPattern>> patterns)
      Unregister pattern classes with the engine
      Parameters:
      patterns - Pattern classes
      Returns:
      this
    • addEffect

      public LXRegistry addEffect(Class<? extends LXEffect> effect)
      Register an effect class with the engine
      Parameters:
      effect - Effect class
      Returns:
      this
    • addEffects

      public LXRegistry addEffects(Class<? extends LXEffect>[] effects)
      Register an effect class with the engine
      Parameters:
      effects - List of effect classes
      Returns:
      this
    • removeEffect

      public LXRegistry removeEffect(Class<? extends LXEffect> effect)
      Unregister effect class with the engine
      Parameters:
      effect - Effect class
      Returns:
      this
    • removeEffects

      public LXRegistry removeEffects(List<Class<? extends LXEffect>> effects)
      Unregister effect classes with the engine
      Parameters:
      effects - Effect classes
      Returns:
      this
    • addTag

      public LXRegistry addTag(Class<? extends LXComponent> component, String tag)
      Add a tag to the given component type
      Parameters:
      component - Component class
      tag - Tag
      Returns:
      this
    • removeTag

      public LXRegistry removeTag(Class<? extends LXComponent> component, String tag)
      Remove a tag from the given component type
      Parameters:
      component - Component type
      tag - Tag
      Returns:
      this
    • getTags

      public List<String> getTags(Class<? extends LXComponent> component)
      Get the set of tags for a given component class
      Parameters:
      component - Component type
      Returns:
      An unmodifiable list of tags, or null if no tags exist
    • isDefaultTag

      public boolean isDefaultTag(Class<? extends LXComponent> component, String tag)
      Whether a given tag is a default tag for the component type
      Parameters:
      component - Component type
      tag - Tag
      Returns:
      Whether this tag is a default annotation-tag for the component type
    • addModulator

      public LXRegistry addModulator(Class<? extends LXModulator> modulator)
      Register a modulator class with the engine
      Parameters:
      modulator - Modulator class
      Returns:
      this
    • addModulataors

      @Deprecated public LXRegistry addModulataors(Class<? extends LXModulator>[] modulators)
      Deprecated.
      Use addModulators without typo
      Register an array of modulator classes with the engine
      Parameters:
      modulators - List of modulator classes
      Returns:
      this
    • addModulators

      public LXRegistry addModulators(Class<? extends LXModulator>[] modulators)
      Register an array of modulator classes with the engine
      Parameters:
      modulators - List of modulator classes
      Returns:
      this
    • removeModulator

      public LXRegistry removeModulator(Class<? extends LXModulator> modulator)
      Unregister modulator class with the engine
      Parameters:
      modulator - Modulator class
      Returns:
      this
    • removeModulators

      public LXRegistry removeModulators(List<Class<? extends LXModulator>> modulators)
      Unregister modulators classes with the engine
      Parameters:
      modulators - Modulators classes
      Returns:
      this
    • addFixture

      public LXRegistry addFixture(Class<? extends LXFixture> fixture)
      Register a fixture class with the engine
      Parameters:
      fixture - Fixture class
      Returns:
      this
    • addFixtures

      public LXRegistry addFixtures(List<Class<? extends LXFixture>> fixtures)
      Register a set of fixture classes with the engine
      Parameters:
      fixtures - List of fixture classes
      Returns:
      this
    • removeFixture

      public LXRegistry removeFixture(Class<? extends LXFixture> fixture)
      Unregister fixture class with the engine
      Parameters:
      fixture - Fixture class
      Returns:
      this
    • removeFixtures

      public LXRegistry removeFixtures(List<Class<? extends LXFixture>> fixtures)
      Unregister fixture classes with the engine
      Parameters:
      fixtures - Fixture classes
      Returns:
      this
    • addBlend

      public LXRegistry addBlend(Class<? extends LXBlend> blend)
      Register a [channel and crossfader] blend class with the engine
      Parameters:
      blend - Blend class
      Returns:
      this
    • addBlends

      public LXRegistry addBlends(Class<LXBlend>[] blends)
      Register multiple [channel and crossfader] blend classes with the engine
      Parameters:
      blends - List of blend classes
      Returns:
      this
    • addChannelBlend

      public LXRegistry addChannelBlend(Class<? extends LXBlend> blend)
      Register a channel blend class with the engine
      Parameters:
      blend - Blend class
      Returns:
      this
    • addChannelBlends

      public LXRegistry addChannelBlends(Class<LXBlend>[] blends)
      Register multiple channel blend classes with the engine
      Parameters:
      blends - List of blend classes
      Returns:
      this
    • addTransitionBlend

      public LXRegistry addTransitionBlend(Class<? extends LXBlend> blend)
      Register a transition blend class with the engine
      Parameters:
      blend - Blend class
      Returns:
      this
    • addTransitionBlends

      public LXRegistry addTransitionBlends(Class<LXBlend>[] blends)
      Register multiple channel blend classes with the engine
      Parameters:
      blends - List of blend classes
      Returns:
      this
    • addCrossfaderBlend

      public LXRegistry addCrossfaderBlend(Class<? extends LXBlend> blend)
      Register a crossfader blend class with the engine
      Parameters:
      blend - Blend class
      Returns:
      this
    • addCrossfaderBlends

      public LXRegistry addCrossfaderBlends(Class<LXBlend>[] blends)
      Register multiple crossfader blend classes with the engine
      Parameters:
      blends - List of blend classes
      Returns:
      this
    • addPlugin

      protected void addPlugin(Class<? extends LXPlugin> plugin)
    • addPlugin

      protected void addPlugin(Class<? extends LXPlugin> plugin, boolean trusted)
    • initializePlugins

      protected void initializePlugins()
    • disposePlugins

      protected void disposePlugins()
    • isPluginClassEnabled

      public boolean isPluginClassEnabled(Class<? extends LXPlugin> pluginClass)
    • save

      public void save(LX lx, JsonObject object)
      Description copied from interface: LXSerializable
      Serializes this instance into the JSON object
      Specified by:
      save in interface LXSerializable
      Parameters:
      lx - LX instance
      object - Object to serialize into
    • load

      public void load(LX lx, JsonObject object)
      Description copied from interface: LXSerializable
      Restores this instance from a JSON object
      Specified by:
      load in interface LXSerializable
      Parameters:
      lx - LX instance
      object - Object to deserialize