Class SwingRunner

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

public class SwingRunner
extends Runner

Manages model runs in a Swing UI environment.

June 14, 2002
Miles Parker
See Also:
Serialized Form

Field Summary
Fields inherited from class org.ascape.runtime.Runner
Constructor Summary
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( 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


public SwingRunner()
Method Detail


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

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


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.

openImplementation in class Runner


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

Specified by:
saveChoose in class Runner


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


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


public void write( out)
write in class Runner

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