edu.cmu.sphinx.tools.gui
Class GUIMediator

java.lang.Object
  extended by edu.cmu.sphinx.tools.gui.GUIMediator

public class GUIMediator
extends java.lang.Object

This is one of the important classes that coordinates between GUI and model Its main operations are : 1. to start and initialize the GUI and Sphinx model 2. drive the input - output operation, and 3. to retrieve the most updated data from GUI or to update GUI of the new loaded data

Author:
Ariani

Field Summary
static java.lang.String EXIT
           
static java.lang.String NEW
           
static java.lang.String OPEN
           
static java.lang.String REFRESH
           
static java.lang.String SAVE
           
static java.lang.String SHOW_CONFIG
           
 
Constructor Summary
GUIMediator()
          Creates a new instance of GUIMediator
 
Method Summary
 void action(java.lang.String command)
          action command that does not involve File operation
 void action(java.lang.String command, java.io.File fFile)
          all action will call this method, with its specific command
 void action(java.lang.String command, javax.swing.JTextArea outputJTextArea)
          action that needs String return, with its specific command
 void execute()
          Start the GUI - after load operations is completed successfully
 ModelBuilder getModelBuilder()
          A public function to obtain reference to the ModelBuilder, that holds the complete set of classes and groups in the model
 void registerPanel(GUIFileActionListener c)
          Used by GUI panel to register as one of the notified clients
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPEN

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

EXIT

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

NEW

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

SAVE

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

REFRESH

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

SHOW_CONFIG

public static final java.lang.String SHOW_CONFIG
See Also:
Constant Field Values
Constructor Detail

GUIMediator

public GUIMediator()
            throws ConfigurableUtilException
Creates a new instance of GUIMediator

Throws:
ConfigurableUtilException
Method Detail

getModelBuilder

public ModelBuilder getModelBuilder()
A public function to obtain reference to the ModelBuilder, that holds the complete set of classes and groups in the model

Returns:
ModelBuilder

registerPanel

public void registerPanel(GUIFileActionListener c)
Used by GUI panel to register as one of the notified clients

Parameters:
c - the registering class must implement GUIFileActionListener

execute

public void execute()
Start the GUI - after load operations is completed successfully


action

public void action(java.lang.String command,
                   java.io.File fFile)
            throws GUIReaderException,
                   GUIWriterException
all action will call this method, with its specific command

Parameters:
command - Action to be performed
fFile - File to open/save to
Throws:
GUIReaderException, - GUIWriterException
GUIReaderException
GUIWriterException

action

public void action(java.lang.String command,
                   javax.swing.JTextArea outputJTextArea)
            throws GUIWriterException,
                   GUIReaderException
action that needs String return, with its specific command

Parameters:
command - Action to be performed
outputJTextArea - text area to display the output
Throws:
GUIReaderException, - GUIWriterException
GUIWriterException
GUIReaderException

action

public void action(java.lang.String command)
            throws ConfigurableUtilException
action command that does not involve File operation

Throws:
ConfigurableUtilException - when there's error while reloading model