edu.williams.cs.ljil.finitizer.ui
Class FSPBuilderUI

java.lang.Object
  extended by edu.williams.cs.ljil.finitizer.ui.FSPBuilderUI
All Implemented Interfaces:
InteractiveFrontend

public class FSPBuilderUI
extends java.lang.Object
implements InteractiveFrontend

Main class for the FSP builder UI. A Singleton.


Field Summary
protected  FSPBuilder fspbLogic
          FSP Builder State
static FSPBuilderUI instance
           
protected  javax.swing.JProgressBar progressBar
           
protected  javax.swing.JFrame rootFrame
           
protected  javax.swing.JSplitPane splitPane
          UI elements we want to keep track of
protected  javax.swing.JLabel statusBar
           
protected  FSPBuilderToolbar toolbar
           
static java.lang.String VERSION
           
 
Method Summary
 java.lang.Object chooseFromList(java.lang.String prompt, java.lang.Object[] choices)
          Display a list of choices and allow the user to select one.
 void doBuildFSP()
          Invoke fsp generator
 void doOpen()
          Run an open dialog and open a file.
 void doSave()
           
static FSPBuilderUI getInstance()
          Get the instance of this singleton class.
 java.net.URL getResourceURL(java.lang.String filename)
          Return the URL for a resource within this program.
 boolean isLoaded()
          Test whether a file is currently loaded.
static void main(java.lang.String[] args)
          Initialize the UI.
protected  void openFile(java.io.File file)
          Open a file.
protected  void reportException(java.lang.String title, java.lang.String message, java.lang.Exception detail)
          Display a warning box to report an exception to the user.
protected  void showDefaultCursor()
          Displays the normal cursor that the user sees when the program is waiting for the user.
protected  void showWaitCursor()
          Displays a busy cursor.
 void statusMessage(java.lang.String s)
          Set a message in the status bar.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

splitPane

protected final javax.swing.JSplitPane splitPane
UI elements we want to keep track of


statusBar

protected final javax.swing.JLabel statusBar

rootFrame

protected final javax.swing.JFrame rootFrame

toolbar

protected final FSPBuilderToolbar toolbar

progressBar

protected final javax.swing.JProgressBar progressBar

fspbLogic

protected FSPBuilder fspbLogic
FSP Builder State


VERSION

public static final java.lang.String VERSION
See Also:
Constant Field Values

instance

public static FSPBuilderUI instance
Method Detail

getInstance

public static FSPBuilderUI getInstance()
Get the instance of this singleton class.


isLoaded

public boolean isLoaded()
Test whether a file is currently loaded.

Returns:
true if there is a file currently loaded.

statusMessage

public void statusMessage(java.lang.String s)
Set a message in the status bar.

Parameters:
s - the message to display. It should not be null.

reportException

protected void reportException(java.lang.String title,
                               java.lang.String message,
                               java.lang.Exception detail)
Display a warning box to report an exception to the user.

Parameters:
title - The title appearing in the warning box. It should not be null.
message - The message identifying the error. It should not be null.
detail - The exception that was thrown. The exception should have a toString method that prints a message that will be sensible to the user. It should not be null.

doBuildFSP

public void doBuildFSP()
Invoke fsp generator


doOpen

public void doOpen()
Run an open dialog and open a file.


openFile

protected void openFile(java.io.File file)
Open a file. If the file open succeeded, calls to isLoaded will return true, the new process will be displayed, and any issues that need to be resolved before create an FSP model will also be displayed.

Parameters:
file - The name of the file to open

showWaitCursor

protected void showWaitCursor()
Displays a busy cursor.


showDefaultCursor

protected void showDefaultCursor()
Displays the normal cursor that the user sees when the program is waiting for the user.


main

public static void main(java.lang.String[] args)
Initialize the UI.


chooseFromList

public java.lang.Object chooseFromList(java.lang.String prompt,
                                       java.lang.Object[] choices)
Display a list of choices and allow the user to select one.

Specified by:
chooseFromList in interface InteractiveFrontend
Parameters:
prompt - The message to display in the dialog box.
choices - The list of choices that the user can select from. If null, the user can enter any value. The first value in the array is treated as the default value.
Returns:
the value selected by the user or null. Returns null if the user cancels the dialog box.
See Also:
fspbuilder.InteractiveFrontend#chooseFromList(java.lang.String, java.util.Vector)

getResourceURL

public java.net.URL getResourceURL(java.lang.String filename)
Return the URL for a resource within this program.

Parameters:
filename - - the filename of the desired resource. This should not include a path.
Returns:
the URL for a resource in this project with the given name.

doSave

public void doSave()