public abstract class AbstractController extends java.lang.Object implements IUpdateableListener
IUpdateable
model and an AbstractView
associated with that
model. It ensures that changes to the model or features provided by the
controller itself are synchronized with the view through the parent
SimpleApplication's simpleUpdate() thread.component
Constructor and Description |
---|
AbstractController(IUpdateable model,
AbstractView view,
IRenderQueue renderQueue)
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Disposes of the AbstractController and its associated
AbstractView . |
IUpdateable |
getModel() |
void |
setParentNode(com.jme3.scene.Node node)
Sets the Node to which the associated
AbstractView is attached. |
abstract void |
update(IUpdateable component)
Updates the controller and/or view if the
model has changed. |
public AbstractController(IUpdateable model, AbstractView view, IRenderQueue renderQueue)
IllegalArgumentException
is thrown.model
- The model for which this controller provides a view.view
- The view associated with this controller. This needs to be
instantiated by the sub-class.renderQueue
- The queue responsible for tasks that need to be performed on
the jME rendering thread.public IUpdateable getModel()
public void setParentNode(com.jme3.scene.Node node)
AbstractView
is attached.node
- The new parent node for the associated AbstractView
.public void dispose()
AbstractView
.public abstract void update(IUpdateable component)
model
has changed.update
in interface IUpdateableListener
component
- The component that was updated in some way.