pamanager
Class PAManagerFrame

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Frame
                          |
                          +--javax.swing.JFrame
                                |
                                +--pamanager.PAManagerFrame

public class PAManagerFrame
extends javax.swing.JFrame
implements CIAgentEventListener, java.beans.PropertyChangeListener, AgentPlatform

The PAManagerFrame class implements the GUI and the logic for the PAManager application.

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AWTTreeLock
 
Field Summary
(package private)  javax.swing.JMenuItem AboutMenuItem
           
(package private)  java.util.Hashtable agentClasses
           
(package private)  java.util.Vector agents
           
(package private)  javax.swing.JTable agentTable
           
(package private)  java.awt.BorderLayout borderLayout1
           
(package private)  java.awt.BorderLayout borderLayout2
           
(package private)  java.awt.BorderLayout borderLayout3
           
(package private)  javax.swing.JMenuItem clearMenuItem
           
(package private) static int COL_NAMEID
           
(package private) static int COL_STATEID
           
(package private) static int COL_TASKID
           
(package private) static int COL_TYPEID
           
protected  java.lang.String[] columnNameList
           
(package private)  javax.swing.JMenu createMenu
           
(package private)  javax.swing.JMenuItem cutMenuItem
           
protected  java.lang.Object[][] data
           
(package private)  javax.swing.JMenu editMenu
           
(package private)  javax.swing.JMenuItem exitMenuItem
           
(package private)  javax.swing.JMenu fileMenu
           
(package private)  javax.swing.JMenu helpMenu
           
(package private)  javax.swing.JLabel jLabel1
           
(package private)  javax.swing.JLabel jLabel2
           
(package private)  javax.swing.JPanel jPanel1
           
(package private)  javax.swing.JPanel jPanel2
           
(package private)  javax.swing.JScrollPane jScrollPane1
           
(package private)  javax.swing.JScrollPane jScrollPane2
           
(package private)  javax.swing.JMenuBar menuBar1
           
(package private) static int NUM_COLS
           
(package private)  javax.swing.JMenuItem propertiesMenuItem
           
(package private)  javax.swing.JMenuItem resumeProcessingMenuItem
           
(package private)  javax.swing.JMenuItem startProcessingMenuItem
           
(package private)  javax.swing.JMenuItem suspendProcessingMenuItem
           
(package private)  javax.swing.JTextArea traceTextArea
           
 
Fields inherited from class javax.swing.JFrame
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, icon, ICONIFIED, mbManagement, menuBar, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, ownedWindows, resizable, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, title, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Window
inputContext, OPENED, ownedWindowList, state, warningString, windowListener
 
Fields inherited from class java.awt.Container
component, containerListener, layoutMgr, ncomponents
 
Fields inherited from class java.awt.Component
actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, componentListener, componentListenerK, componentOrientation, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, hasFocus, height, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowListenerK, x, y
 
Constructor Summary
PAManagerFrame()
          Creates a PAManagerFrame object.
 
Method Summary
(package private)  void AboutMenuItem_actionPerformed(java.awt.event.ActionEvent e)
          Displays the About dialog.
 void addAgent(CIAgent agent)
          Adds an agent bean to this platform.
(package private)  void clearMenuItem_actionPerformed(java.awt.event.ActionEvent e)
          Clears the PAManager by stopping and removing all agents.
(package private)  void CreateMenuItem_actionPerformed(java.awt.event.ActionEvent theEvent)
          Creates a new agent and adds it to the table.
(package private)  void Cut_actionPerformed(java.awt.event.ActionEvent e)
          Stops the selected agent and removes it from the PAManager list.
(package private)  void exitMenuItem_actionPerformed(java.awt.event.ActionEvent e)
          Closes the main window on exit.
 CIAgent getAgent(java.lang.String agentName)
          Retrieves the agent that has specified name.
 java.util.Vector getAgents()
          Retrieves a list of the registered agents running on this platform.
 void postCIAgentEvent(CIAgentEvent event)
          Processes an event (does not actually post it to the event queue).
 void processCIAgentEvent(CIAgentEvent event)
          Processes the CIAgentEvent received by this application by displaying information in the trace text area.
protected  void processWindowEvent(java.awt.event.WindowEvent e)
          Processes a window event to add exiting on close.
(package private)  void propertiesMenuItem_actionPerformed(java.awt.event.ActionEvent e)
          Opens the bean customizer on the selected agent.
 void propertyChange(java.beans.PropertyChangeEvent event)
          Refreshes the table when an agent waschanged.
(package private)  void resumeProcessingMenuItem_actionPerformed(java.awt.event.ActionEvent e)
          Resumes agent processing.
 void setUpTheTable()
          Sets up the agent table.
(package private)  void startProcessingMenuItem_actionPerformed(java.awt.event.ActionEvent e)
          Starts an agent.
(package private)  void suspendProcessingMenuItem_actionPerformed(java.awt.event.ActionEvent e)
          Suspends agent processing.
 void trace(java.lang.String msg)
          Adds a message to the trace text area.
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, setContentPane, setDefaultCloseOperation, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
, addNotify, addToFrameList, constructComponentName, finalize, getCursorType, getFrames, getIconImage, getMenuBar, getState, getTitle, isResizable, postProcessKeyEvent, remove, removeFromFrameList, removeNotify, setCursor, setIconImage, setMenuBar, setResizable, setState, setTitle
 
Methods inherited from class java.awt.Window
addOwnedWindow, addWindowListener, applyResourceBundle, applyResourceBundle, connectOwnedWindow, dispatchEventImpl, dispose, eventEnabled, getFocusOwner, getInputContext, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, isActive, isShowing, nextFocus, pack, postEvent, postWindowEvent, preProcessKeyEvent, processEvent, removeOwnedWindow, removeWindowListener, setFocusOwner, show, toBack, toFront, transferFocus
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyOrientation, countComponents, deliverEvent, dispatchEventToSelf, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPrint, list, list, locate, minimumSize, paint, paintComponents, postsOldMouseEvents, preferredSize, print, printComponents, processContainerEvent, proxyEnableEvents, proxyRequestFocus, remove, remove, removeAll, removeContainerListener, setFont, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkitImpl, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processInputMethodEvent, processMouseEvent, processMouseMotionEvent, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

menuBar1

javax.swing.JMenuBar menuBar1

fileMenu

javax.swing.JMenu fileMenu

editMenu

javax.swing.JMenu editMenu

cutMenuItem

javax.swing.JMenuItem cutMenuItem

borderLayout1

java.awt.BorderLayout borderLayout1

jPanel1

javax.swing.JPanel jPanel1

jPanel2

javax.swing.JPanel jPanel2

borderLayout2

java.awt.BorderLayout borderLayout2

jLabel1

javax.swing.JLabel jLabel1

jScrollPane1

javax.swing.JScrollPane jScrollPane1

traceTextArea

javax.swing.JTextArea traceTextArea

borderLayout3

java.awt.BorderLayout borderLayout3

jLabel2

javax.swing.JLabel jLabel2

jScrollPane2

javax.swing.JScrollPane jScrollPane2

clearMenuItem

javax.swing.JMenuItem clearMenuItem

exitMenuItem

javax.swing.JMenuItem exitMenuItem

createMenu

javax.swing.JMenu createMenu

helpMenu

javax.swing.JMenu helpMenu

AboutMenuItem

javax.swing.JMenuItem AboutMenuItem

agents

java.util.Vector agents

agentTable

javax.swing.JTable agentTable

agentClasses

java.util.Hashtable agentClasses

columnNameList

protected java.lang.String[] columnNameList

data

protected java.lang.Object[][] data

NUM_COLS

static final int NUM_COLS

COL_NAMEID

static final int COL_NAMEID

COL_TYPEID

static final int COL_TYPEID

COL_STATEID

static final int COL_STATEID

COL_TASKID

static final int COL_TASKID

propertiesMenuItem

javax.swing.JMenuItem propertiesMenuItem

startProcessingMenuItem

javax.swing.JMenuItem startProcessingMenuItem

suspendProcessingMenuItem

javax.swing.JMenuItem suspendProcessingMenuItem

resumeProcessingMenuItem

javax.swing.JMenuItem resumeProcessingMenuItem
Constructor Detail

PAManagerFrame

public PAManagerFrame()
Creates a PAManagerFrame object.
Method Detail

processWindowEvent

protected void processWindowEvent(java.awt.event.WindowEvent e)
Processes a window event to add exiting on close.
Parameters:
e - the WindowEvent object that was generated for this frame
Overrides:
processWindowEvent in class javax.swing.JFrame

Cut_actionPerformed

void Cut_actionPerformed(java.awt.event.ActionEvent e)
Stops the selected agent and removes it from the PAManager list.
Parameters:
e - the ActionEvent object that was generated when cut was selected

trace

public void trace(java.lang.String msg)
Adds a message to the trace text area.
Parameters:
msg - the String object that contains the message to be appended

processCIAgentEvent

public void processCIAgentEvent(CIAgentEvent event)
Processes the CIAgentEvent received by this application by displaying information in the trace text area.
Specified by:
processCIAgentEvent in interface CIAgentEventListener
Parameters:
event - the CIAgentEvent object

postCIAgentEvent

public void postCIAgentEvent(CIAgentEvent event)
Processes an event (does not actually post it to the event queue).
Specified by:
postCIAgentEvent in interface CIAgentEventListener
Parameters:
event - the CIAgentEvent object to be processed

setUpTheTable

public void setUpTheTable()
Sets up the agent table.

CreateMenuItem_actionPerformed

void CreateMenuItem_actionPerformed(java.awt.event.ActionEvent theEvent)
Creates a new agent and adds it to the table.
Parameters:
theEvent - the ActionEvent object

propertiesMenuItem_actionPerformed

void propertiesMenuItem_actionPerformed(java.awt.event.ActionEvent e)
Opens the bean customizer on the selected agent.
Parameters:
e - the ActionEvent object generated when the agent was selected

exitMenuItem_actionPerformed

void exitMenuItem_actionPerformed(java.awt.event.ActionEvent e)
Closes the main window on exit.
Parameters:
e - the ActionEvent object generated when exit was selected

clearMenuItem_actionPerformed

void clearMenuItem_actionPerformed(java.awt.event.ActionEvent e)
Clears the PAManager by stopping and removing all agents.
Parameters:
e - the ActionEvent object generated when clear was selected

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent event)
Refreshes the table when an agent waschanged.
Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Parameters:
event - the PropertyChangeEvent object generated when the agent was changed

startProcessingMenuItem_actionPerformed

void startProcessingMenuItem_actionPerformed(java.awt.event.ActionEvent e)
Starts an agent.
Parameters:
e - the ActionEvent object generated when start was selected

suspendProcessingMenuItem_actionPerformed

void suspendProcessingMenuItem_actionPerformed(java.awt.event.ActionEvent e)
Suspends agent processing.
Parameters:
e - the ActionEvent object generated when suspend was selected

resumeProcessingMenuItem_actionPerformed

void resumeProcessingMenuItem_actionPerformed(java.awt.event.ActionEvent e)
Resumes agent processing.
Parameters:
e - the ActionEvent object generated when resume was selected

AboutMenuItem_actionPerformed

void AboutMenuItem_actionPerformed(java.awt.event.ActionEvent e)
Displays the About dialog.
Parameters:
e - the ActionEvent object generated when About was selected

addAgent

public void addAgent(CIAgent agent)
Adds an agent bean to this platform.
Parameters:
agent - the CIAgent object to be added to this container, giving it a unique name

getAgents

public java.util.Vector getAgents()
Retrieves a list of the registered agents running on this platform.
Specified by:
getAgents in interface AgentPlatform
Returns:
the Vector object that contains the agents

getAgent

public CIAgent getAgent(java.lang.String agentName)
Retrieves the agent that has specified name.
Specified by:
getAgent in interface AgentPlatform
Parameters:
agentName - the String object that contains the name of the agent to be retrieved
Returns:
the CIAgent object or null if not found