|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ascape.runtime.Runner
public abstract class Runner
Manages model runs.
Field Summary | |
---|---|
protected RuntimeEnvironment |
environment
Manages user space UI, settings etc. |
Constructor Summary | |
---|---|
Runner()
|
|
Runner(RuntimeEnvironment environment)
|
Method Summary | |
---|---|
static boolean |
assignEnvironmentParameters(java.lang.String[] args)
Sets values for the models paramters based on supplied array of key value pairs. |
void |
close()
|
void |
closeAndOpenNew()
Requests the scape to open another model, closing the existing one. |
void |
closeAndOpenNewFinally(Scape oldScape)
Requests the scape to open another model, closing the existing one. |
void |
closeAndOpenSaved()
Requests the scape to open a saved run, closing the existing one. |
abstract void |
closeAndOpenSavedFinally(Scape oldScape)
|
void |
closeFinally()
Closes the application; allowing views to close themseleves gracefully. |
void |
createEnvironment()
|
static void |
exit()
Final kill. |
DataGroup |
getData()
|
java.lang.String |
getDescription()
Gets the description for the ModelRoot object. |
int |
getEarliestPeriod()
Gets the earliestPeriod for the ModelRoot object. |
RuntimeEnvironment |
getEnvironment()
|
java.lang.String |
getHome()
Returns the path in which all files should by default be stored to and retrieved from. |
java.lang.String |
getHTMLDescription()
Returns a brief descripiton (including credits) of the scape or of the model, if this is root scape. |
int |
getIteration()
|
int |
getLatestPeriod()
Gets the latestPeriod for the ModelRoot object. |
java.lang.Thread |
getModelThread()
|
int |
getPausePeriod()
Gets the pausePeriod for the ModelRoot object. |
int |
getPeriod()
|
java.lang.String |
getPeriodName()
Sets the period name for the delegate |
java.util.List |
getRestartingViews()
Gets the restartingViews for the ModelRoot object. |
Scape |
getRootScape()
|
int |
getStartPeriod()
Returns the period that this model started. |
int |
getStopPeriod()
Returns the period this scape stops running at. |
protected void |
initialize()
|
java.lang.Object |
instanceFromName(java.lang.String modelName)
|
boolean |
isAutoRestart()
Gets the AutoRestart for the ModelRoot object. |
boolean |
isBeginningDeserializedRun()
|
boolean |
isCloseAndOpenNewRequested()
|
boolean |
isCloseAndOpenSavedRequested()
|
boolean |
isCloseRequested()
|
static boolean |
isDisplayGraphics()
|
boolean |
isInMainLoop()
|
static boolean |
isMultiWinEnvironment()
|
boolean |
isOpenRequested()
|
boolean |
isPaused()
|
boolean |
isQuitRequested()
|
boolean |
isRestartRequested()
|
boolean |
isRunning()
|
boolean |
isSaveRequested()
|
static boolean |
isServeGraphics()
|
static boolean |
isStartOnOpen()
Gets the startOnOpen for the Runner object. |
boolean |
isStep()
|
boolean |
isValidPeriod(int period)
Is the supplied period a valid period for this scape? |
void |
launch(java.lang.String[] args)
|
void |
notify(ScapeEvent event,
ScapeListener listener)
|
void |
open()
Creates and runs (if start on open is true) this model scape. |
void |
open(boolean block)
Creates and runs (if start on open is true) this model scape. |
void |
open(java.lang.Object applet,
java.lang.String[] args)
Creates and runs (if start on open is true) this model scape. |
void |
open(java.lang.Object applet,
java.lang.String[] args,
boolean block)
Creates and runs (if start on open is true) this model scape. |
void |
open(java.lang.String[] args)
Creates and runs (if start on open is true) this model scape. |
void |
open(java.lang.String[] args,
boolean block)
Creates and runs (if start on open is true) this model scape. |
Scape |
open(java.lang.String modelName,
boolean block)
Constructs, creates and runs the supplied model. |
Scape |
open(java.lang.String modelName,
java.lang.Object applet)
Constructs, creates and runs the supplied model. |
Scape |
open(java.lang.String modelName,
java.lang.Object applet,
java.lang.String[] args,
boolean block)
Constructs, creates and runs (if start on open is true) the supplied model. |
Scape |
open(java.lang.String modelName,
java.lang.String[] args)
Constructs, creates and runs the supplied model. |
Scape |
open(java.lang.String modelName,
java.lang.String[] args,
boolean block)
Constructs, creates and runs the supplied model. |
Scape |
openChoose()
Requests the scape to open a model, providing UI for this purpose. |
Scape |
openChoose(java.lang.String[] args)
Requests the scape to open a model, providing UI for this purpose. |
void |
openImplementation(java.lang.Object applet,
java.lang.String[] args,
boolean block)
Method neccessary because of amibiguous null values in simpler signature methods. |
Scape |
openInstance(java.lang.String modelName)
Constructs, creates and runs the supplied model. |
void |
openSavedChoose()
Requests the scape to open a saved run. |
Scape |
openSavedRun(java.io.File savedRunFile)
|
static Scape |
openSavedRun(java.io.InputStream is)
|
Scape |
openSavedRun(java.lang.String fileName,
java.lang.String[] args)
|
void |
pause()
Requests the scape to pause. |
void |
quit()
Exits the application; calling stop if running and allowing views to close themseleves gracefully. |
void |
quitFinally()
Exits the application; allowing views to close themseleves gracefully. |
void |
requestRestart()
Requests the scape to restart. |
void |
respondControl(ControlEvent control)
Responds to any control events fired at this scape. |
void |
restart()
Stops the scape and requests the scape to restart. |
void |
resume()
Requests the scape to resume. |
void |
run()
The basic execution cycle of a running scape. |
void |
run(boolean singlethread)
The basic execution cycle of a running scape. |
protected void |
runMainLoop()
The main run loop of a running simulation. |
void |
save()
Requests the scape to save itself, providing UI for this purpose. |
abstract void |
saveChoose()
Save the state of the scape to a file. |
void |
setAutoRestart(boolean autoRestart)
Sets Restart for the ModelRoot object. |
void |
setBeginningDeserializedRun(boolean beginningDeserializedRun)
|
void |
setCloseAndOpenNewRequested(boolean closeAndOpenNewRequested)
|
void |
setCloseAndOpenSavedRequested(boolean closeAndOpenSavedRequested)
|
void |
setCloseRequested(boolean closeRequested)
|
void |
setDescription(java.lang.String description)
Sets description for the ModelRoot object. |
static void |
setDisplayGraphics(boolean displayGraphics)
|
void |
setEarliestPeriod(int earliestPeriod)
Sets the earliest period this scape is expected to be run at. |
void |
setEnvironment(RuntimeEnvironment environment)
|
void |
setHome(java.lang.String home)
Sets the path in which to store all scape related files. |
void |
setHTMLDescription(java.lang.String HTMLdescription)
Sets an html-formatted description to be used for the model as a whole. |
void |
setInMainLoop(boolean inMainLoop)
|
void |
setInternalRunning(boolean running)
|
void |
setIteration(int iteration)
|
void |
setLatestPeriod(int latestPeriod)
Sets the latest period this scape is expected to be run at. |
static void |
setMultiWinEnvironment(boolean muiltWinEnvironment)
|
void |
setOpenRequested(boolean openRequested)
|
void |
setPaused(boolean paused)
|
void |
setPausePeriod(int pausePeriod)
Sets pausePeriod for the ModelRoot object. |
void |
setPeriod(int period)
|
void |
setPeriodName(java.lang.String periodName)
Sets periodName for the ModelRoot object. |
void |
setQuitRequested(boolean quitRequested)
|
void |
setRestartingViews(java.util.List restartingViews)
Sets restartingViews for the ModelRoot object. |
void |
setRestartRequested(boolean restartRequested)
|
void |
setRootScape(Scape scape)
|
void |
setRunning(boolean running)
|
void |
setSaveRequested(boolean saveRequested)
|
static void |
setServeGraphics(boolean serveGraphics)
|
static void |
setStartOnOpen(boolean _startOnOpen)
Sets startOnOpen for the ModelRoot object. |
void |
setStartPeriod(int startPeriod)
Sets the start period for this scape. |
void |
setStep(boolean step)
|
void |
setStopPeriod(int stopPeriod)
Sets the stop period for this scape. |
void |
start()
Requests the scape to start. |
void |
stop()
Requests the scape to stop. |
void |
testRun()
Open (create) and run the model, just as in the normal open, but block execution. |
void |
waitForViewsUpdate()
Blocks until all views of this scape and this scape's members have been updated. |
void |
write(java.io.ObjectOutputStream out)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected transient RuntimeEnvironment environment
Constructor Detail |
---|
public Runner()
public Runner(RuntimeEnvironment environment)
Method Detail |
---|
protected void initialize()
protected void runMainLoop()
public void respondControl(ControlEvent control)
public void waitForViewsUpdate()
public void closeAndOpenNew()
public void closeAndOpenSaved()
public void closeAndOpenNewFinally(Scape oldScape)
public static Scape openSavedRun(java.io.InputStream is) throws java.io.IOException
java.io.IOException
public Scape openSavedRun(java.lang.String fileName, java.lang.String[] args) throws java.io.IOException
java.io.IOException
public Scape openSavedRun(java.io.File savedRunFile) throws java.io.IOException
java.io.IOException
public void testRun()
public void save()
public void run()
run
in interface java.lang.Runnable
public static boolean assignEnvironmentParameters(java.lang.String[] args)
args
- an array of strings with paramter-value paris in the form
"{paramter-name}={paramter-value}"reportNotFound
- if paramters not found should result in a console notification
and if errors in invocation should be reported, false
otherwisepublic void launch(java.lang.String[] args) throws java.io.IOException
java.io.IOException
public void run(boolean singlethread)
singlethread
- CURRENTLY IGNORED! should the run if restarted continue to use the same thread?public void start()
setRunning(boolean)
public void notify(ScapeEvent event, ScapeListener listener)
public void write(java.io.ObjectOutputStream out) throws java.io.IOException
java.io.IOException
public void stop()
setRunning(boolean)
public void pause()
setPaused(boolean)
public void resume()
setPaused(boolean)
public void requestRestart()
public void restart()
setRunning(boolean)
public void openImplementation(java.lang.Object applet, java.lang.String[] args, boolean block)
public void open(java.lang.Object applet, java.lang.String[] args, boolean block)
applet
- the applet if are we in an applet vm contextargs
- paramter arguments for the scapeblock
- should this call block or run in a new thread?public void open(java.lang.Object applet, java.lang.String[] args)
applet
- the applet if are we in an applet vm contextargs
- paramter arguments for the scapepublic void open(java.lang.String[] args, boolean block)
args
- paramter arguments for the scapeblock
- should this call block or run in a new thread?public void open(java.lang.String[] args)
args
- paramter arguments for the scapepublic void open()
public void open(boolean block)
block
- should this call block or run in a new thread?public void openSavedChoose()
public abstract void closeAndOpenSavedFinally(Scape oldScape)
public Scape open(java.lang.String modelName, java.lang.Object applet, java.lang.String[] args, boolean block)
modelName
- the fully qualified name of the Java class for the model's
root scapeapplet
- the applet if are we in an applet vm contextargs
- paramter arguments for the scapeblock
- should this call block or run in a new thread?public java.lang.Object instanceFromName(java.lang.String modelName)
public Scape open(java.lang.String modelName, java.lang.String[] args)
modelName
- the fully qualified name of the Java class for the model's
root scapeargs
- paramter arguments for the scapepublic Scape open(java.lang.String modelName, java.lang.String[] args, boolean block)
modelName
- the fully qualified name of the Java class for the model's
root scapeargs
- paramter arguments for the scapeblock
- should this call block or run in a new thread?public Scape open(java.lang.String modelName, java.lang.Object applet)
modelName
- the fully qualified name of the Java class for the model's
root scapeapplet
- the applet if are we in an applet vm contextpublic Scape open(java.lang.String modelName, boolean block)
modelName
- the fully qualified name of the Java class for the model's
root scapepublic Scape openInstance(java.lang.String modelName)
modelName
- the fully qualified name of the Java class for the model's
root scapepublic Scape openChoose()
public Scape openChoose(java.lang.String[] args)
public abstract void saveChoose()
public void close()
public void closeFinally()
close()
instead, allowing a running scape to stop
gracefully. Override this method if you want to provide any scape related
pre-quit finalization or clean-up.
quit()
public void quit()
quitFinally
if you
want to provide any pre-quit finalization or clean-up.
quitFinally()
public void quitFinally()
quit()
instead, allowing a running scape to stop
gracefully. Override this method if you want to provide any scape related
pre-quit finalization or clean-up.
quit()
public static void exit()
public void createEnvironment()
public static boolean isDisplayGraphics()
public static void setDisplayGraphics(boolean displayGraphics)
public static boolean isServeGraphics()
public static void setServeGraphics(boolean serveGraphics)
public static boolean isMultiWinEnvironment()
public static void setMultiWinEnvironment(boolean muiltWinEnvironment)
public java.lang.String getPeriodName()
public void setPeriodName(java.lang.String periodName)
periodName
- the periodNamepublic java.lang.String getDescription()
public void setDescription(java.lang.String description)
description
- the descriptionpublic java.lang.String getHTMLDescription()
public void setHTMLDescription(java.lang.String HTMLdescription)
HTMLdescription
- the descriptionpublic int getStartPeriod()
public static boolean isStartOnOpen()
public static void setStartOnOpen(boolean _startOnOpen)
startOnOpen
- the startOnOpenpublic void setStartPeriod(int startPeriod) throws SpatialTemporalException
startPeriod
- the period to begin runs at
SpatialTemporalException
- exceptionpublic int getStopPeriod()
public void setStopPeriod(int stopPeriod) throws SpatialTemporalException
stopPeriod
- the period the scape will stop at upon reaching
SpatialTemporalException
- exceptionsetAutoRestart(boolean)
public int getPausePeriod()
public void setPausePeriod(int pausePeriod)
pausePeriod
- the pausePeriodpublic int getEarliestPeriod()
public void setEarliestPeriod(int earliestPeriod)
earliestPeriod
- the lowest period value this scape can havepublic int getLatestPeriod()
public void setLatestPeriod(int latestPeriod)
latestPeriod
- the highest period value this scape can havepublic java.util.List getRestartingViews()
public void setRestartingViews(java.util.List restartingViews)
restartingViews
- the restartingViewspublic boolean isAutoRestart()
public void setAutoRestart(boolean autoRestart)
autoRestart
- should the model restart when it ends?public boolean isValidPeriod(int period)
period
- the period to test
public java.lang.String getHome()
public void setHome(java.lang.String home)
home
- the homepublic RuntimeEnvironment getEnvironment()
public boolean isBeginningDeserializedRun()
public void setBeginningDeserializedRun(boolean beginningDeserializedRun)
public boolean isCloseAndOpenNewRequested()
public void setCloseAndOpenNewRequested(boolean closeAndOpenNewRequested)
public boolean isCloseAndOpenSavedRequested()
public void setCloseAndOpenSavedRequested(boolean closeAndOpenSavedRequested)
public boolean isCloseRequested()
public void setCloseRequested(boolean closeRequested)
public boolean isInMainLoop()
public void setInMainLoop(boolean inMainLoop)
public int getIteration()
public void setIteration(int iteration)
public boolean isOpenRequested()
public void setOpenRequested(boolean openRequested)
public boolean isPaused()
public void setPaused(boolean paused)
public int getPeriod()
public void setPeriod(int period)
public boolean isQuitRequested()
public void setQuitRequested(boolean quitRequested)
public boolean isRestartRequested()
public void setRestartRequested(boolean restartRequested)
public boolean isRunning()
public void setRunning(boolean running)
public void setInternalRunning(boolean running)
public boolean isSaveRequested()
public void setSaveRequested(boolean saveRequested)
public boolean isStep()
public void setStep(boolean step)
public DataGroup getData()
public void setRootScape(Scape scape)
public Scape getRootScape()
public void setEnvironment(RuntimeEnvironment environment)
public java.lang.Thread getModelThread()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |