Class AppComponentLoader

java.lang.Object
org.ngengine.components.jme3.AppComponentLoader
All Implemented Interfaces:
ComponentLoader

public class AppComponentLoader extends Object implements ComponentLoader
load components by connecting them to JME3 application resources.
  • Constructor Details

    • AppComponentLoader

      public AppComponentLoader(Application app)
  • Method Details

    • load

      public int load(ComponentManager mng, Component fragment, Runnable markReady)
      Description copied from interface: ComponentLoader
      Load the component in the given component manager. This method is called after the component is initialized
      Specified by:
      load in interface ComponentLoader
      Parameters:
      mng - the component manager
      fragment - the component to load
      markReady - a runnable that should be called when the loading is complete
      Returns:
      how many times the markReady callback is expected to be called to mark the complete loading.
    • canLoad

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

      public void unload(ComponentManager mng, Component fragment)
      Description copied from interface: ComponentLoader
      Frees up resources and configurations for the component in the given component manager.
      Specified by:
      unload in interface ComponentLoader
      Parameters:
      mng - the component manager
      fragment - the component to cleanup