Package fr.ifremer.isisfish.simulator
Class SimulationControl
java.lang.Object
fr.ifremer.isisfish.simulator.SimulationControl
- All Implemented Interfaces:
PropertyChangeListener
,EventListener
Permit to communicate with user interface from simulation thread.
Created: Fri Oct 6 2000
- Version:
- $Revision$ Mise a jour: $Date$ par : $Author$
- Author:
- POUSSIN Benjamin <poussin@codelutin.com>
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
Control save mecanism each time a property is changed (default to false).protected String
protected boolean
protected PropertyChangeSupport
protected long
protected long
protected boolean
protected SimulationStorage
protected boolean
protected TimeStep
protected boolean
protected String
protected double
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addPropertyChangeListener
(String propName, PropertyChangeListener l) getId()
Method getId donne id de la simulation.long
Get current progress.long
Met dans un Properties tous les champsRetourne la simulation associe a ce controlgetStep()
Method getDate donne la date utiliser par la simulation.getText()
double
Get mean time for one step in secondboolean
Get current auto save state.boolean
Method running.boolean
boolean
Is stop request been asked.void
void
void
removePropertyChangeListener
(String propName, PropertyChangeListener l) void
reset()
Reset control values for job restart.void
setAutoSaveState
(boolean autoSaveState) Change auto save state on property change.void
setProgress
(long progress) Set current progress.void
setProgressMax
(long progressMax) Set max progress.void
setStarted
(boolean started) Appelee juste avant de reellement demarrer le thread de simulation indique que cette simulation est en cours et qu'il ne faut plus la lancervoid
Modifie la date de la simulation.void
setStopSimulationRequest
(boolean val) Demande l'arret de la simulation.void
void
setTimeStepMeanTime
(double timeStepMeanTime) Set mean time for one step in secondvoid
Appele lors du debut de la simulation.void
Appele lors de la fin reelle de la simulation.void
updateFromProperties
(Properties props) update current object from Properties representation
-
Field Details
-
listeners
-
inUpdateFromProperties
protected boolean inUpdateFromProperties -
simulation
-
id
-
started
protected boolean started -
running
protected boolean running -
stop
protected boolean stop -
step
-
progressMax
protected long progressMax -
progress
protected long progress -
text
-
timeStepMeanTime
protected double timeStepMeanTime -
autoSaveState
protected transient boolean autoSaveStateControl save mecanism each time a property is changed (default to false).
-
-
Constructor Details
-
SimulationControl
Init simulation control with simulation id.- Parameters:
id
- simulation id
-
-
Method Details
-
setAutoSaveState
public void setAutoSaveState(boolean autoSaveState) Change auto save state on property change. Usefull to disable autosave in simulation monitoring.- Parameters:
autoSaveState
- new state
-
isAutoSaveState
public boolean isAutoSaveState()Get current auto save state.- Returns:
- auto save state
-
reset
public void reset()Reset control values for job restart. -
getSimulation
Retourne la simulation associe a ce control- Returns:
- retourne null si la simulation n'existe pas encore
-
addPropertyChangeListener
-
addPropertyChangeListener
-
removePropertyChangeListener
-
removePropertyChangeListener
-
isStarted
public boolean isStarted() -
setStarted
public void setStarted(boolean started) Appelee juste avant de reellement demarrer le thread de simulation indique que cette simulation est en cours et qu'il ne faut plus la lancer- Parameters:
started
- The running to set.
-
isRunning
public boolean isRunning()Method running.- Returns:
- faux une fois que stopSimulation a ete appele.
-
startSimulation
public void startSimulation()Appele lors du debut de la simulation. -
stopSimulation
public void stopSimulation()Appele lors de la fin reelle de la simulation. -
getText
- Returns:
- Returns the text.
-
setText
- Parameters:
text
- The text to set.
-
getProgressMax
public long getProgressMax()- Returns:
- Returns the progressMax.
-
setProgressMax
public void setProgressMax(long progressMax) Set max progress.- Parameters:
progressMax
- progressMax to set.
-
getProgress
public long getProgress()Get current progress.- Returns:
- the progress.
-
setProgress
public void setProgress(long progress) Set current progress.- Parameters:
progress
- progress to set.
-
setStopSimulationRequest
public void setStopSimulationRequest(boolean val) Demande l'arret de la simulation.- Parameters:
val
-true
to stop
-
isStopSimulationRequest
public boolean isStopSimulationRequest()Is stop request been asked.- Returns:
- retourne vrai si l'arret de la simulation a ete demandee
-
getId
Method getId donne id de la simulation.- Returns:
- l'id de la simulation
-
getStep
Method getDate donne la date utiliser par la simulation.- Returns:
- donne la date utiliser par la simulation
-
setStep
Modifie la date de la simulation.- Parameters:
t
- la nouvelle etape
-
setTimeStepMeanTime
public void setTimeStepMeanTime(double timeStepMeanTime) Set mean time for one step in second- Parameters:
timeStepMeanTime
-
-
getTimeStepMeanTime
public double getTimeStepMeanTime()Get mean time for one step in second- Returns:
-
getProperties
Met dans un Properties tous les champs- Returns:
- un Properties avec tous les champs
-
updateFromProperties
update current object from Properties representation- Parameters:
props
- new properties to update from
-
propertyChange
- Specified by:
propertyChange
in interfacePropertyChangeListener
-