org.ascape.runtime.swing
Class SwingRunner

java.lang.Object
  extended by org.ascape.runtime.Runner
      extended by org.ascape.runtime.swing.SwingRunner
All Implemented Interfaces:
java.io.Serializable, java.lang.Runnable
Direct Known Subclasses:
ModelRoot

public class SwingRunner
extends Runner

Manages model runs in a Swing UI environment.

Since:
June 14, 2002
Version:
3.0
Author:
Miles Parker
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.ascape.runtime.Runner
environment
 
Constructor Summary
SwingRunner()
           
 
Method Summary
 void closeAndOpenSavedFinally(Scape oldScape)
          Requests the scape to open a saved run, closing the existing one.
static void main(java.lang.String[] args)
          Creates, initializes and runs the model specified in the argument.
 void notify(ScapeEvent event, ScapeListener listener)
           
 void openImplementation(java.lang.Object applet, java.lang.String[] args, boolean block)
          Method neccessary because of amibiguous null values in simpler signature methods.
 void saveChoose()
          Save the state of the scape to a file.
 void write(java.io.ObjectOutputStream out)
           
 
Methods inherited from class org.ascape.runtime.Runner
assignEnvironmentParameters, close, closeAndOpenNew, closeAndOpenNewFinally, closeAndOpenSaved, closeFinally, createEnvironment, exit, getData, getDescription, getEarliestPeriod, getEnvironment, getHome, getHTMLDescription, getIteration, getLatestPeriod, getModelThread, getPausePeriod, getPeriod, getPeriodName, getRestartingViews, getRootScape, getStartPeriod, getStopPeriod, initialize, instanceFromName, isAutoRestart, isBeginningDeserializedRun, isCloseAndOpenNewRequested, isCloseAndOpenSavedRequested, isCloseRequested, isDisplayGraphics, isInMainLoop, isMultiWinEnvironment, isOpenRequested, isPaused, isQuitRequested, isRestartRequested, isRunning, isSaveRequested, isServeGraphics, isStartOnOpen, isStep, isValidPeriod, launch, open, open, open, open, open, open, open, open, open, open, open, openChoose, openChoose, openInstance, openSavedChoose, openSavedRun, openSavedRun, openSavedRun, pause, quit, quitFinally, requestRestart, respondControl, restart, resume, run, run, runMainLoop, save, setAutoRestart, setBeginningDeserializedRun, setCloseAndOpenNewRequested, setCloseAndOpenSavedRequested, setCloseRequested, setDescription, setDisplayGraphics, setEarliestPeriod, setEnvironment, setHome, setHTMLDescription, setInMainLoop, setInternalRunning, setIteration, setLatestPeriod, setMultiWinEnvironment, setOpenRequested, setPaused, setPausePeriod, setPeriod, setPeriodName, setQuitRequested, setRestartingViews, setRestartRequested, setRootScape, setRunning, setSaveRequested, setServeGraphics, setStartOnOpen, setStartPeriod, setStep, setStopPeriod, start, stop, testRun, waitForViewsUpdate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwingRunner

public SwingRunner()
Method Detail

main

public static void main(java.lang.String[] args)
Creates, initializes and runs the model specified in the argument. To allow the running of a model directly from the command line, you should subclass this method as shown below:

public MyModel extends Model { public static void main(String[] args) { (open("mypath.MyModel")).start(); } }
Otherwise, assuming your classpath is set up correctly, to invoke a model from the command line type:

java org.ascape.model.Scape mypath.myModel

Parameters:
args - at index 0; the name of the subclass of this class to run

openImplementation

public void openImplementation(java.lang.Object applet,
                               java.lang.String[] args,
                               boolean block)
Description copied from class: Runner
Method neccessary because of amibiguous null values in simpler signature methods.

Overrides:
openImplementation in class Runner

saveChoose

public void saveChoose()
Save the state of the scape to a file.

Specified by:
saveChoose in class Runner

closeAndOpenSavedFinally

public void closeAndOpenSavedFinally(Scape oldScape)
Requests the scape to open a saved run, closing the existing one. Will not occur until the current iteration is complete; use static forms to open concurrently. Always called on root.

Specified by:
closeAndOpenSavedFinally in class Runner

notify

public void notify(ScapeEvent event,
                   ScapeListener listener)
Overrides:
notify in class Runner

write

public void write(java.io.ObjectOutputStream out)
           throws java.io.IOException
Overrides:
write in class Runner
Throws:
java.io.IOException


Copyright © 1998-2008 The Brookings Institution, NuTech Solutions, Metascape, LLC All Rights Reserved.