|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
fr.lifl.jedi.controllersCore.AbstractGUIController<GUIView>
public abstract class AbstractGUIController<GUIView extends ISimulationGUI>
Controller associated with all GUI that display simulations data.
Such controllers have to be registered to the simulation core. Whenever the state of the simulations core changes, one of these methods are called :
updateViewWhileInitializing()
method, which is called
when the simulation core is initializing the simulation.
updateViewAfterInitialization()
method, which is called
whenever the simulation core finished the environment's initialization.
The simulation can be started (i.e. the first simulation step can be performed) only
when all controllers registered to the simulation core finished their call to the
updateViewAfterInitialization()
method.
updateViewDuringTimeStep()
method, which is called
whenever a simulation step starts.
updateViewAfterTimeStep()
method, which is called
whenever a simulation step ends.
The simulation will resume (i.e. the next simulation step will be performed) only
when all controllers registered to the simulation core finished their call to the
updateViewAfterTimeStep()
method.
updateViewWhenPaused()
method, which is called
whenever the simulation is paused.
updateViewAtSimulationsEnd()
method, which is called when the simulation
ended normaly -- i.e. if the simulation met its ending criterion (see
SimulationCore.hasToStop()
).
The simulation can be initialized again only when all controllers registered to the simulation
core finished their call to the updateViewAtSimulationsEnd()
method.
updateViewAtSimulationsAbortion()
method, which is called when the simulation
ended because of an abortion (because of a ToSimulationCoreControlEvents.TO_CORE_ABORT_SIMULATION
event
sent by the controller of a simulation control GUI).
The simulation can be initialized again only when all controllers registered to the simulation
core finished their call to the updateViewAtSimulationsAbortion()
method.
reactToCloseRequest()
method, which is called when the program is about
to exit.
The program exits only when all controllers registered to the simulation
core finished their call to the reactToCloseRequest()
method.
handleViewMessage(ISimulationEvent)
abstract method.
JEDI V 2.3 |
Created the 2nd april 2009 |
Modified the 5th june 2009 |
Yoann Kubera |
SMAC Team (Systèmes Multi-Agents et Comportement) |
LIFL (Laboratoire d'Informatique Fondamentale de Lille) |
University of Lille, France |
Field Summary | |
---|---|
protected SimulationCore |
core
The simulation core to which the controller is registered. |
protected GUIView |
view
The view associated with this controller. |
Constructor Summary | |
---|---|
AbstractGUIController(GUIView view)
Constructor of the controller associated with the control gui that manages the initialization, pause, run or abortion of the simulation. |
Method Summary | |
---|---|
GUIView |
getView()
Gets the view associated with this controller. |
protected abstract void |
handleViewMessage(ISimulationEvent event)
Defines how the controller reacts when it receives an event coming from the view. |
protected abstract void |
reactToCloseRequest()
This method is called when the program is about to exit. |
void |
setSimulationCore(SimulationCore core)
This method is automatically called whenever a controller is added to the simulation core. |
void |
update(java.util.Observable o,
java.lang.Object arg)
|
protected abstract void |
updateViewAfterInitialization()
This method is called whenever the simulation core finished the environment's initialization. |
protected abstract void |
updateViewAfterTimeStep()
This method is called whenever a simulation step ends. |
protected abstract void |
updateViewAtSimulationsAbortion()
This method is called when the simulation ended because of an abortion (because of a ToSimulationCoreControlEvents.TO_CORE_ABORT_SIMULATION event
sent by the controller of a simulation control GUI). |
protected abstract void |
updateViewAtSimulationsEnd()
This method is called when the simulation ended normaly -- i.e. |
protected abstract void |
updateViewDuringTimeStep()
This method is called whenever a simulation step starts. |
protected abstract void |
updateViewWhenPaused()
This method is called whenever the simulation is paused. |
protected abstract void |
updateViewWhileInitializing()
This method is called when the simulation core begins to (and has not finished to) initialize the simulation. |
Methods inherited from class java.util.Observable |
---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected GUIView extends ISimulationGUI view
protected SimulationCore core
Constructor Detail |
---|
public AbstractGUIController(GUIView view)
view
- The view associated with this controller.Method Detail |
---|
public void setSimulationCore(SimulationCore core)
core
- The simulation core to which the controller registers.public GUIView getView()
public void update(java.util.Observable o, java.lang.Object arg)
update
in interface java.util.Observer
Observer.update(java.util.Observable, java.lang.Object)
protected abstract void handleViewMessage(ISimulationEvent event)
event
- The event that came from the view.protected abstract void updateViewWhileInitializing()
protected abstract void updateViewAfterInitialization()
updateViewAfterInitialization()
method.
protected abstract void updateViewDuringTimeStep()
protected abstract void updateViewAfterTimeStep()
updateViewAfterTimeStep()
method.
protected abstract void updateViewWhenPaused()
updateViewWhenPaused()
method.
protected abstract void updateViewAtSimulationsEnd()
SimulationCore.hasToStop()
).
The simulation can be initialized again only when all controllers registered to the simulation
core finished their call to the updateViewAtSimulationsEnd()
method.
protected abstract void updateViewAtSimulationsAbortion()
ToSimulationCoreControlEvents.TO_CORE_ABORT_SIMULATION
event
sent by the controller of a simulation control GUI).
The simulation can be initialized again only when all controllers registered to the simulation
core finished their call to the updateViewAtSimulationsAbortion()
method.
protected abstract void reactToCloseRequest()
reactToCloseRequest()
method.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |