org.ascape.runtime.swing
Class SwingEnvironment

java.lang.Object
  extended by org.ascape.model.event.DefaultScapeListener
      extended by org.ascape.runtime.RuntimeEnvironment
          extended by org.ascape.runtime.AbstractUIEnvironment
              extended by org.ascape.runtime.swing.SwingEnvironment
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.EventListener, ScapeListener, HasName
Direct Known Subclasses:
DesktopEnvironment

public abstract class SwingEnvironment
extends AbstractUIEnvironment

User: milesparker Date: May 26, 2006 Time: 7:29:23 PM To change this template use File | Settings | File Templates.

See Also:
Serialized Form

Field Summary
protected  ControlBarView controlBarView
          The control bar view.
protected static javax.swing.JTextField modelNameField
          The model name field.
 
Fields inherited from class org.ascape.runtime.AbstractUIEnvironment
DEBUG_RUNTIME_MODE, RELEASE_RUNTIME_MODE, runtimeMode
 
Fields inherited from class org.ascape.model.event.DefaultScapeListener
listeningToScape, name, scape
 
Constructor Summary
protected SwingEnvironment()
          Instantiates a new UI environment.
 
Method Summary
 void addView(ScapeListener view, boolean createFrame)
          Adds the view.
 void addViews(ScapeListener[] views, boolean createFrame)
          Adds the views.
 void createFrame(ComponentView view)
          Creates the frame.
abstract  void createFrame(ComponentView[] views)
          Creates the frame.
 java.util.Vector getAllFrames()
          Returns the actual frame implementation.
 ControlBarView getControlBarView()
          Gets the controlBarView for the ModelRoot object.
 java.awt.Container getRootPane()
          Gets the root pane.
 java.lang.String openDialog()
          Gets the users models name from a dialog and validates that it is a legitimate class name.
 void removeView(ScapeListener view)
          Removes the view.
 void setControlBarView(ControlBarView controlBarView)
          Sets controlBarView for the ModelRoot object.
 void setRootPane(java.awt.Container rootPane)
          Sets the root pane.
 void showErrorDialog(Scape scape, java.lang.RuntimeException e)
          Displays a standard splash screen message asserting copyright and other information.
static void showSplashScreenNotice()
          Displays a standard splash screen message asserting copyright and other information.
 
Methods inherited from class org.ascape.runtime.AbstractUIEnvironment
getCustomizer, getRuntimeMode, isInApplet, isRedirectConsole, isShowNavigator, setApplet, setCustomizer, setRedirectConsole, setRuntimeMode, setShowNavigator
 
Methods inherited from class org.ascape.runtime.RuntimeEnvironment
addView, addViews, environmentQuiting, exit, getConsole, getEnvironmentViews, quit, removeViews, scapeAdded, setConsole
 
Methods inherited from class org.ascape.model.event.DefaultScapeListener
clone, getName, getScape, isGraphic, isLifeOfScape, isNotifyScapeAutomatically, notifyScapeUpdated, scapeClosing, scapeDeserialized, scapeInitialized, scapeIterated, scapeNotification, scapeRemoved, scapeSetup, scapeStarted, scapeStopped, setName, setNotifyScapeAutomatically, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

controlBarView

protected transient ControlBarView controlBarView
The control bar view.


modelNameField

protected static javax.swing.JTextField modelNameField
The model name field.

Constructor Detail

SwingEnvironment

protected SwingEnvironment()
Instantiates a new UI environment.

Method Detail

getControlBarView

public ControlBarView getControlBarView()
Gets the controlBarView for the ModelRoot object.

Returns:
the controlBarView

setControlBarView

public void setControlBarView(ControlBarView controlBarView)
Sets controlBarView for the ModelRoot object.

Parameters:
controlBarView - the controlBarView

getRootPane

public java.awt.Container getRootPane()
Gets the root pane.

Returns:
the root pane

setRootPane

public void setRootPane(java.awt.Container rootPane)
Sets the root pane.

Parameters:
rootPane - the new root pane

showSplashScreenNotice

public static final void showSplashScreenNotice()
Displays a standard splash screen message asserting copyright and other information. Warning: This splash screen notice must be displayed anytime the Ascape uiEnvironment is initialized within a graphics uiEnvironment; that is, anytime a user might see it. It is displayed anytime a model opens by default, but will not be displayed if Scape.setDisplayGraphics() is set to false. This should normally only be done when the uiEnvironment is being run in a headless mode, for example in a batch mode on a distributed system. In rare circumstances, such as when opening multiple models or repeatedly instantiating new models, it might be desirable to disable the splash screen at each model open. In this case, it is the model developer's responsiblity to call this method when first instantiating the uiEnvironment. It is of course also a violation of copyright to attempt to circumvent the methods that we have put in place to properly assert copyright. For example, this code should not be modified.


showErrorDialog

public void showErrorDialog(Scape scape,
                            java.lang.RuntimeException e)
Displays a standard splash screen message asserting copyright and other information. See warnings above.

Specified by:
showErrorDialog in class AbstractUIEnvironment
Parameters:
scape - the scape
e - the e

openDialog

public java.lang.String openDialog()
Gets the users models name from a dialog and validates that it is a legitimate class name. Returns the validated model name, or null if the user cancelled. This feature only works with Swing..will generate exception if called in other contexts.

Specified by:
openDialog in class AbstractUIEnvironment
Returns:
the string

addViews

public void addViews(ScapeListener[] views,
                     boolean createFrame)
Description copied from class: RuntimeEnvironment
Adds the views.

Overrides:
addViews in class RuntimeEnvironment
Parameters:
views - the views
createFrame - the create frame

addView

public void addView(ScapeListener view,
                    boolean createFrame)
Description copied from class: RuntimeEnvironment
Adds the view.

Overrides:
addView in class RuntimeEnvironment
Parameters:
view - the view
createFrame - the create frame

removeView

public void removeView(ScapeListener view)
Description copied from class: RuntimeEnvironment
Removes the view.

Overrides:
removeView in class RuntimeEnvironment
Parameters:
view - the view

createFrame

public void createFrame(ComponentView view)
Creates the frame.

Parameters:
view - the view

createFrame

public abstract void createFrame(ComponentView[] views)
Creates the frame.

Parameters:
views - the views

getAllFrames

public java.util.Vector getAllFrames()
Returns the actual frame implementation. Use sparingly, and only if you know the view context you will be using!

Returns:
the all frames


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