Class AppComponentInitializer

java.lang.Object
org.ngengine.components.jme3.AppComponentInitializer
All Implemented Interfaces:
ComponentInitializer

public class AppComponentInitializer extends Object implements ComponentInitializer
Initializes components by connecting them to JME3 application resources.
  • Constructor Details

    • AppComponentInitializer

      public AppComponentInitializer(Application app)
  • Method Details

    • initialize

      public int initialize(ComponentManager mng, Component fragment, Runnable markReady)
      Description copied from interface: ComponentInitializer
      Initialize the component in the given component manager. This method is called when the component is added to the component manager.
      Specified by:
      initialize in interface ComponentInitializer
      Parameters:
      mng - the component manager
      fragment - the component to initialize
      markReady - a runnable that should be called when the initialization is complete
      Returns:
      how many times the markReady callback is expected to be called to mark the complete initialization.
    • cleanup

      public void cleanup(ComponentManager mng, Component fragment)
      Description copied from interface: ComponentInitializer
      Cleanup the component in the given component manager. This method is called when the component is removed from the component manager.
      Specified by:
      cleanup in interface ComponentInitializer
      Parameters:
      mng - the component manager
      fragment - the component to cleanup
    • canInitialize

      public boolean canInitialize(ComponentManager mng, Component fragment)
      Description copied from interface: ComponentInitializer
      Check if the component can be initialized by this initializer. This is used to determine if the component is compatible with this initializer and can be initialized without issues. If the component is not compatible, it will not be initialized and the component manager will call the next available initializer in the chain.
      Specified by:
      canInitialize in interface ComponentInitializer
      Parameters:
      mng - the component manager
      fragment - the component to check
      Returns:
      true if the component can be initialized, false otherwise