Package org.ngengine.components.jme3
Class AppComponentInitializer
java.lang.Object
org.ngengine.components.jme3.AppComponentInitializer
- All Implemented Interfaces:
ComponentInitializer
Initializes components by connecting them to JME3 application resources.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
canInitialize
(ComponentManager mng, Component fragment) Check if the component can be initialized by this initializer.void
cleanup
(ComponentManager mng, Component fragment) Cleanup the component in the given component manager.int
initialize
(ComponentManager mng, Component fragment, Runnable markReady) Initialize the component in the given component manager.
-
Constructor Details
-
AppComponentInitializer
-
-
Method Details
-
initialize
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 interfaceComponentInitializer
- Parameters:
mng
- the component managerfragment
- the component to initializemarkReady
- 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
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 interfaceComponentInitializer
- Parameters:
mng
- the component managerfragment
- the component to cleanup
-
canInitialize
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 interfaceComponentInitializer
- Parameters:
mng
- the component managerfragment
- the component to check- Returns:
- true if the component can be initialized, false otherwise
-