Class AgentGUI

java.lang.Object
  |
  +--java.awt.event.WindowAdapter
        |
        +--AgentGUI
All Implemented Interfaces:
java.util.EventListener, java.awt.event.ItemListener, java.awt.event.WindowFocusListener, java.awt.event.WindowListener, java.awt.event.WindowStateListener

public class AgentGUI
extends java.awt.event.WindowAdapter
implements java.awt.event.ItemListener

Project: DECAF
Class: AgentGUI
Description: This class is meant to make Agent GUI creation easier.


Constructor Summary
AgentGUI(java.lang.String agentName)
          Constructor that takes only the name of the agent, and sets up a blank desktop.
AgentGUI(java.lang.String agentName, java.lang.String windows)
          Constructor to set up a desktop with text windows.
 
Method Summary
 void addMenu(javax.swing.JMenu menu)
          Add a menu to the menu bar.
 void itemStateChanged(java.awt.event.ItemEvent e)
          Listens to the check boxes in the view menu.
 void message(java.lang.String name, java.lang.String message)
          Prints a message to the specified text message window.
 void newWindow(javax.swing.JInternalFrame newframe)
          Insert a customized window onto the desktop.
 void newWindow(java.lang.String name)
          Insert a text message window on the desktop.
 void removeMenu(java.lang.String name)
          Remove a menu from the menu bar.
 void removeWindow(java.lang.String name)
          Remove a window from the desktop.
 void windowClosing(java.awt.event.WindowEvent e)
          Sends a KQML shutdown message when the close button is pressed.
 
Methods inherited from class java.awt.event.WindowAdapter
windowActivated, windowClosed, windowDeactivated, windowDeiconified, windowGainedFocus, windowIconified, windowLostFocus, windowOpened, windowStateChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AgentGUI

public AgentGUI(java.lang.String agentName)
Constructor that takes only the name of the agent, and sets up a blank desktop.

Parameters:
agentName - The name of the agent appears in the window title.

AgentGUI

public AgentGUI(java.lang.String agentName,
                java.lang.String windows)
Constructor to set up a desktop with text windows.

Parameters:
agentName - The name of the agent appears in the window title.
windows - A '|' separated list of window names.
Method Detail

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
Sends a KQML shutdown message when the close button is pressed.

Specified by:
windowClosing in interface java.awt.event.WindowListener
Overrides:
windowClosing in class java.awt.event.WindowAdapter
Parameters:
e - A window event.

addMenu

public void addMenu(javax.swing.JMenu menu)
Add a menu to the menu bar.

Parameters:
menu - The menu to be added.

removeMenu

public void removeMenu(java.lang.String name)
Remove a menu from the menu bar.


removeWindow

public void removeWindow(java.lang.String name)
Remove a window from the desktop.

Parameters:
name - The name of the window to be removed.

newWindow

public void newWindow(javax.swing.JInternalFrame newframe)
Insert a customized window onto the desktop.

Parameters:
newframe - The frame to be added.

newWindow

public void newWindow(java.lang.String name)
Insert a text message window on the desktop.

Parameters:
name - The title of the window.

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
Listens to the check boxes in the view menu.

Specified by:
itemStateChanged in interface java.awt.event.ItemListener
Parameters:
e - An item event indicating a state change.

message

public void message(java.lang.String name,
                    java.lang.String message)
Prints a message to the specified text message window.

Parameters:
name - The name of the window.
message - The message to be displayed.