public class JunctionController extends AbstractPlantController implements IJunctionListener, IPlantControllerManagerListener
Junction
model with the JunctionView
. Any updates to the view should be
coordinated through this class.component
Constructor and Description |
---|
JunctionController(Junction model,
JunctionView view,
IRenderQueue renderQueue,
PlantControllerManager manager)
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addedController(PlantComponent component,
AbstractPlantController controller)
A controller was created for a PlantComponent.
|
void |
addedPipes(IJunction junction,
java.util.List<PlantComponent> addedPipes)
PlantComponents have been added to the Junction.
|
void |
removedController(PlantComponent component)
A controller was just deleted for a PlantComponent.
|
void |
removedPipes(IJunction junction,
java.util.List<PlantComponent> removedPipes)
PlantComponents have been removed from the Junction.
|
void |
update(IUpdateable component)
|
setBaseColor, setWireFrame
dispose, getModel, setParentNode
public JunctionController(Junction model, JunctionView view, IRenderQueue renderQueue, PlantControllerManager manager)
model
- The model (a Junction
) for which this controller
provides a view.view
- The view (a JunctionView
) associated with this
controller.renderQueue
- The queue responsible for tasks that need to be performed on
the jME rendering thread.manager
- A PlantControllerManager
used for looking up
PipeController
s for the current Pipe
s
connected to the Junction.public void update(IUpdateable component)
view
depending on the changes in the model
.
It also updates the view based on changes to pipes connected to this
junction.update
in interface IUpdateableListener
update
in class AbstractController
component
- The component that was updated in some way.public void addedPipes(IJunction junction, java.util.List<PlantComponent> addedPipes)
IJunctionListener
addedPipes
in interface IJunctionListener
junction
- The Junction that was updated.addedPipes
- A List of PlantComponents that were added to the Junction.public void removedPipes(IJunction junction, java.util.List<PlantComponent> removedPipes)
IJunctionListener
removedPipes
in interface IJunctionListener
junction
- The Junction that was updated.removedPipes
- A List of PlantComponents that were removed from the Junction.public void addedController(PlantComponent component, AbstractPlantController controller)
IPlantControllerManagerListener
addedController
in interface IPlantControllerManagerListener
component
- The PlantComponent that now has a controller.controller
- The AbstractPlantController for the component.public void removedController(PlantComponent component)
IPlantControllerManagerListener
removedController
in interface IPlantControllerManagerListener
component
- The PlantComponent that no longer has a controller.