Generic Environment GUI Class Library

Class CreateEnvDialog

java.lang.Object
  |
  +--CreateEnvDialog

public class CreateEnvDialog
extends java.lang.Object

Environment-Based Applications:
An CreateEnvDialog is a dialog that allows the user to construct a new environment, choosing its type (bounded or unbounded) and, if appropriate, its dimensions.

Version:
1 December 2002

Constructor Summary
protected CreateEnvDialog(javax.swing.JFrame parent, boolean promptForEnvChoice)
          Creates a dialog that allows the user to choose the type of environment to create and/or its dimensions.
 
Method Summary
static CreateEnvDialog makeDimensionsDialog(javax.swing.JFrame parent)
          Creates a dialog that creates a BoundedEnv object after prompting the user for its dimensions.
static CreateEnvDialog makeEnvironmentChoiceDialog(javax.swing.JFrame parent)
          Creates a dialog that allows the user to choose the type of environment to create and, if appropriate, its dimensions.
 Environment showDialog()
          Shows the modal dialog that allows the user to create a new environment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CreateEnvDialog

protected CreateEnvDialog(javax.swing.JFrame parent,
                          boolean promptForEnvChoice)
Creates a dialog that allows the user to choose the type of environment to create and/or its dimensions. This constructor is called by the factory methods makeDimensionsDialog and makeEnvironmentChoiceDialog.
Parameters:
parent - parent frame for the dialog
promptForEnvChoice - true if dialog should prompt for choice of environment representation; false if it should always create a BoundedEnv environment
Method Detail

makeDimensionsDialog

public static CreateEnvDialog makeDimensionsDialog(javax.swing.JFrame parent)
Creates a dialog that creates a BoundedEnv object after prompting the user for its dimensions.
Parameters:
parent - parent frame for the dialog
Returns:
a dialog that will prompt for bounded environment dimensions and then create the environment

makeEnvironmentChoiceDialog

public static CreateEnvDialog makeEnvironmentChoiceDialog(javax.swing.JFrame parent)
Creates a dialog that allows the user to choose the type of environment to create and, if appropriate, its dimensions. The set of environment classes available to choose from depends on whether the application has registered environment classes with the MBSFactory. If any bounded environment classes have been registered with the MBSFactory, then the dialog will include them in the set of options. Otherwise, it will include BoundedEnv as its only bounded environment. Similarly, if any unbounded environment classes have been registered with the MBSFactory, then the dialog will include them in the set of options. Otherwise, it will include UnboundedEnv as its only unbounded environment. BoundedEnv and UnboundedEnv must explicitly be registered with the MBSFactory to appear along with other options from the factory.
Parameters:
parent - parent frame for the dialog
Returns:
a dialog that prompts for an Environment representation

showDialog

public Environment showDialog()
Shows the modal dialog that allows the user to create a new environment. If the dialog is dismissed by clicking the "OK" button, a new environment is created to the user's specification and returned. If "Cancel" is chosen or there is an error constructing the environment, null is returned.
Returns:
the newly created Environment or null

Generic Environment GUI Class Library

Copyright© 2003 Alyce Brady