edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd Class Reference

List of all members.

Detailed Description

The front end that will allow the Wizard to communicate with the engine and tell it to perform tasks.

Author:
Will Haines


Public Member Functions

 WizardOfOzFrontEnd ()
 Constructs the front end instance.
List< NotificationgetNotificationList ()
 A getter for the list of notifications managed on the engine side.
List< TaskgetTaskList ()
 A getter for the list of tasks managed on the engine side.
void windowActivated (WindowEvent e)
 Does nothing when the window is activated.
void windowClosed (WindowEvent e)
 Does nothing when the window is closed.
void windowClosing (WindowEvent e)
 When the window is closing, perfoms socket cleanup and shuts off the engine.
void windowDeactivated (WindowEvent e)
 Does nothing when the window is deactivated.
void windowDeiconified (WindowEvent e)
 Does nothing when the window is deiconified.
void windowIconified (WindowEvent e)
 Does nothing when the window is iconified.
void windowOpened (WindowEvent e)
 Does nothing when the window is opened.
void actionPerformed (ActionEvent e)
 Called when the buttons are clicked.
Engine Test Methods
These methods allow public access to engine methods for use in testing.

Todo:
Remove us when testing is through.


void testAddTasklikeObject (TasklikeObject task)
 Allows an external caller add a tasklike object to the task manager.
List< NotificationtestGetNotificationList () throws IOException
 Allows an external caller to get the list of the notification manager's notifications.
List< TasktestGetTaskList () throws IOException
 Allows an external caller to get the list of the task manager's tasks.
void testSetNotificationPriority (Notification notification) throws IOException
 Allows an external caller to set a notification priority.
void testSetTaskPriority (Task task) throws IOException
 Allows an external caller to set a task prioirty.
void testStopEngine () throws IOException
 Allows an external caller to stop the engine.

Static Public Member Functions

static void main (String[] args)
 Runs a the Wizard of Oz frontend.

Package Attributes

Socket clientSocket = null
 The client socket.

Private Member Functions

void addTasklikeObject (TasklikeObject task)
 Adds a tasklike object to the task manager via the engine.
void createGUI ()
 Creates the GUI for the front end.
Map< String, Object > onInputReceived (Object o) throws IOException
 Takes input from off of the input stream and determines what to do with the messages received.
void readObject (java.io.ObjectInputStream in) throws IOException, ClassNotFoundException
 Reads in a serialized front end.
Map< String, Object > sendMessage (Message msg)
 Sends a message to the engine and awaits a response.
void setNotificationPriority (Notification notification)
 Determines and sets the priority of a notification.
void setTaskPriority (Task task)
 Determines and sets the priority of a task.
void stopEngine ()
 Stops the engine for cleanup.
void writeObject (java.io.ObjectOutputStream out) throws IOException
 Writes this front end to stream.

Private Attributes

ObjectOutputStream output
 The stream of serialized objects that this front end writes to to allow the engine to communicate to it.
ObjectInputStream input
 The stream of serialized object that this front end reads to allow the engine to communicate to it.
JFrame guiWindow
 The GUI window.
JScrollPane consoleScroller
 The scroller for the console.
JTextArea console
 Displays console output.
JButton refreshButton
 Refreshes the task list.
JButton addButton
 Adds a task to the task list.
JPanel taskListPanel
 A separator between the add and reset priority areas.
int taskIndex
 A label for tasks.
List< Tasktasks
 The the tasks that the front end currently tracks.

Static Private Attributes

static final long serialVersionUID = 461154975828537010L
 Prevent serialization collisions.
static final Dimension WINDOW_SIZE = new Dimension(640, 480)
 The initial size of the window.
static final String ADD_TASK = "AddTask"
 Add action identifier.
static final String REFRESH_TASKS = "RefreshTasks"
 Refresh action identifier.
static final String PRIORITY_BUTTON = "PriorityButton"
 Refresh action identifier.


Constructor & Destructor Documentation

edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.WizardOfOzFrontEnd (  ) 

Constructs the front end instance.


Member Function Documentation

static void edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.main ( String[]  args  )  [static]

Runs a the Wizard of Oz frontend.

This is a client; run it second.

Parameters:
args command-line args; don't bother passing any

void edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.addTasklikeObject ( TasklikeObject  task  )  [private]

Adds a tasklike object to the task manager via the engine.

Parameters:
task the task whose priority will be updated
Exceptions:
IOException 

void edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.createGUI (  )  [private]

Creates the GUI for the front end.

List<Notification> edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.getNotificationList (  ) 

A getter for the list of notifications managed on the engine side.

Returns:
the list of notifications

List<Task> edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.getTaskList (  ) 

A getter for the list of tasks managed on the engine side.

Returns:
the list of notifications

Map<String, Object> edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.onInputReceived ( Object  o  )  throws IOException [private]

Takes input from off of the input stream and determines what to do with the messages received.

It ignores things that it can't translate.

Todo:
Break this up better, an if list seems a bit crude.
Parameters:
o the object sent across the socket
Returns:
the user info dictionary
Exceptions:
IOException 

void edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.readObject ( java.io.ObjectInputStream  in  )  throws IOException, ClassNotFoundException [private]

Reads in a serialized front end.

Just checks against the serialVersionUID since this is not used except for error checking.

Parameters:
in the input stream to read from
Exceptions:
IOException 
ClassNotFoundException 

Map<String, Object> edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.sendMessage ( Message  msg  )  [private]

Sends a message to the engine and awaits a response.

Parameters:
msg the message to send to the engine
Returns:
the user info dictionary

void edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.setNotificationPriority ( Notification  notification  )  [private]

Determines and sets the priority of a notification.

Parameters:
notification the notification whose priority will be updated
Exceptions:
IOException 

void edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.setTaskPriority ( Task  task  )  [private]

Determines and sets the priority of a task.

Parameters:
task the task whose priority will be updated
Exceptions:
IOException 

void edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.stopEngine (  )  [private]

Stops the engine for cleanup.

void edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.testAddTasklikeObject ( TasklikeObject  task  ) 

Allows an external caller add a tasklike object to the task manager.

Parameters:
task the tasklike object to add
Exceptions:
IOException 

List<Notification> edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.testGetNotificationList (  )  throws IOException

Allows an external caller to get the list of the notification manager's notifications.

Returns:
a list of the notification manager's notifications.
Exceptions:
IOException 

List<Task> edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.testGetTaskList (  )  throws IOException

Allows an external caller to get the list of the task manager's tasks.

Returns:
a list of the task manager's notifications.
Exceptions:
IOException 

void edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.testSetNotificationPriority ( Notification  notification  )  throws IOException

Allows an external caller to set a notification priority.

Parameters:
notification the notification to reprioritize
Exceptions:
IOException 

void edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.testSetTaskPriority ( Task  task  )  throws IOException

Allows an external caller to set a task prioirty.

Parameters:
task the task to reprioritize
Exceptions:
IOException 

void edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.testStopEngine (  )  throws IOException

Allows an external caller to stop the engine.

Exceptions:
IOException 

void edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.windowActivated ( WindowEvent  e  ) 

Does nothing when the window is activated.

Parameters:
e the window activation event
See also:
java.util.eventlistener.windowActivated(java.awt.event.WindowEvent)

void edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.windowClosed ( WindowEvent  e  ) 

Does nothing when the window is closed.

Parameters:
e the window closed event
See also:
java.util.eventlistener.windowClosed(java.awt.event.WindowEvent)

void edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.windowClosing ( WindowEvent  e  ) 

When the window is closing, perfoms socket cleanup and shuts off the engine.

Parameters:
e the window closing event
See also:
java.util.eventlistener.windowClosing(java.awt.event.WindowEvent)

void edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.windowDeactivated ( WindowEvent  e  ) 

Does nothing when the window is deactivated.

Parameters:
e the window deactivation event
See also:
java.util.eventlistener.windowDeactivated(java.awt.event.WindowEvent)

void edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.windowDeiconified ( WindowEvent  e  ) 

Does nothing when the window is deiconified.

Parameters:
e the window deiconification event
See also:
java.util.eventlistener.windowDeiconified(java.awt.event.WindowEvent)

void edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.windowIconified ( WindowEvent  e  ) 

Does nothing when the window is iconified.

Parameters:
e the window iconification event
See also:
java.util.eventlistener.windowIconified(java.awt.event.WindowEvent)

void edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.windowOpened ( WindowEvent  e  ) 

Does nothing when the window is opened.

Parameters:
e the window open event
See also:
java.util.eventlistener.windowOpened(java.awt.event.WindowEvent)

void edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.writeObject ( java.io.ObjectOutputStream  out  )  throws IOException [private]

Writes this front end to stream.

Since I don't use this except for confirmation, I just write the ID for error checking.

Parameters:
out the output stream to write to
Exceptions:
IOException 

void edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.actionPerformed ( ActionEvent  e  ) 

Called when the buttons are clicked.

See also:
java.awt.event.ActionListener.actionPerformed(java.awt.event.ActionEvent)
Todo:
Serialization doesn't appear to work right for task priorities.


Member Data Documentation

final long edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.serialVersionUID = 461154975828537010L [static, private]

Prevent serialization collisions.

final Dimension edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.WINDOW_SIZE = new Dimension(640, 480) [static, private]

The initial size of the window.

final String edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.ADD_TASK = "AddTask" [static, private]

Add action identifier.

final String edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.REFRESH_TASKS = "RefreshTasks" [static, private]

Refresh action identifier.

final String edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.PRIORITY_BUTTON = "PriorityButton" [static, private]

Refresh action identifier.

ObjectOutputStream edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.output [private]

The stream of serialized objects that this front end writes to to allow the engine to communicate to it.

ObjectInputStream edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.input [private]

The stream of serialized object that this front end reads to allow the engine to communicate to it.

Socket edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.clientSocket = null [package]

The client socket.

JFrame edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.guiWindow [private]

The GUI window.

JScrollPane edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.consoleScroller [private]

The scroller for the console.

JTextArea edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.console [private]

Displays console output.

JButton edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.refreshButton [private]

Refreshes the task list.

JButton edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.addButton [private]

Adds a task to the task list.

JPanel edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.taskListPanel [private]

A separator between the add and reset priority areas.

int edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.taskIndex [private]

A label for tasks.

List<Task> edu.cmu.hcii.calo.engine.WizardOfOzFrontEnd.tasks [private]

The the tasks that the front end currently tracks.


The documentation for this class was generated from the following file:
Generated on Mon Jul 9 12:34:36 2007 for CALO by  doxygen 1.5.2