Class InitWindow

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Frame
                          |
                          +--InitWindow

class InitWindow
extends java.awt.Frame
implements java.awt.event.ActionListener, java.awt.event.WindowListener

This is the class for the initization window for an agent. The user may enter the host and the port of ANS. These default to the local server and 6677, respectively. The user may enter the name of the agent, the port of the local server that the agent resides on, and the name of the agent's plan file. These default to MyAgent, 200, and agent.lsp, respectively. NOTE: the host of the agent will always be the local server, for obvious reasons. The Start Agent button must be pressed before the 'Read Plan' and 'Register Agent' buttons will appear That button will start the agent's processes. If successful, the other buttons will appear. The Read Plan button will read in the agent's plan file The Register Agent button tries to register the agent with the given ANS. If sucessful, the initilzation window will go away and the main window will appear The Exit button will exit the system if no agent has be registered or will close this window and go back to the main one if an agent has.

See Also:
Serialized Form

Inner Class Summary
(package private)  class InitWindow.SymWindow
           
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AWTTreeLock
 
Field Summary
private  java.awt.TextField agenthost
           
private  java.awt.Label agenthostlabel
           
private  java.awt.TextField agentname
           
private  java.awt.Label agentnamelabel
           
private  java.awt.TextField agentplan
           
private  java.awt.Label agentplanlabel
           
private  java.awt.TextField agentport
           
private  java.awt.Label agentportlabel
           
private  java.awt.TextField anshost
           
private  java.awt.Label anshostlabel
           
private  java.awt.TextField ansport
           
private  java.awt.Label ansportlabel
           
private  int count
           
(package private)  int counter
           
private  java.awt.Label debuglabel
           
private  java.awt.TextArea debugmessages
           
private  java.awt.Panel debugpanel
           
(package private)  java.util.Hashtable dSwitch
           
private  java.awt.Button exit
           
private  boolean foundport
           
private  NewGUI gui
           
private  int i
           
private  java.awt.Panel infopanel
           
private  boolean isregistered
           
private  java.net.ServerSocket listen_socket
           
private  MsgOutput messageoutput
           
private  java.awt.TextArea msgholder
           
private  Agent myagent
           
private  java.awt.TextArea outmsgs
           
private  int port
           
private  java.awt.Button readplan
           
private  java.awt.Button register
           
private  java.awt.Button startagent
           
 
Fields inherited from class java.awt.Frame
base, CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, frameSerializedDataVersion, HAND_CURSOR, icon, ICONIFIED, mbManagement, menuBar, MOVE_CURSOR, N_RESIZE_CURSOR, nameCounter, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, ownedWindows, resizable, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, serialVersionUID, state, SW_RESIZE_CURSOR, TEXT_CURSOR, title, W_RESIZE_CURSOR, WAIT_CURSOR, weakThis
 
Fields inherited from class java.awt.Window
active, base, focusMgr, inputContext, nameCounter, OPENED, ownedWindowList, serialVersionUID, state, warningString, weakThis, windowListener, windowSerializedDataVersion
 
Fields inherited from class java.awt.Container
component, containerListener, containerSerializedDataVersion, dispatcher, layoutMgr, maxSize, ncomponents, serialVersionUID
 
Fields inherited from class java.awt.Component
actionListenerK, adjustmentListenerK, appContext, assert, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, 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, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, RIGHT_ALIGNMENT, serialVersionUID, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowListenerK, x, y
 
Constructor Summary
InitWindow(java.lang.String title, Agent AGENT, java.util.Hashtable DB, java.awt.TextArea in, java.awt.TextArea out, NewGUI GUI)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void appendInitialMessage(java.lang.String Msg)
           
 java.lang.String getAgentHost()
           
 java.lang.String getAgentName()
          These functions return the private members of the class.
 java.lang.String getAgentPort()
           
 java.lang.String getANSHost()
           
 java.lang.String getANSPort()
           
 java.lang.String getDebugMessages()
           
 MsgOutput getmessageoutput()
           
 java.lang.String getMsgHolder()
           
(package private)  void InitWindow_WindowOpened(java.awt.event.WindowEvent event)
           
 void Reset(java.util.Hashtable dswitch)
          This function resets the information of the window to get ready for new agent info
 void windowActivated(java.awt.event.WindowEvent e)
           
 void windowClosed(java.awt.event.WindowEvent e)
           
 void windowClosing(java.awt.event.WindowEvent e)
           
 void windowDeactivated(java.awt.event.WindowEvent e)
           
 void windowDeiconified(java.awt.event.WindowEvent e)
           
 void windowIconified(java.awt.event.WindowEvent e)
           
 void windowOpened(java.awt.event.WindowEvent e)
           
 
Methods inherited from class java.awt.Frame
, addNotify, addToFrameList, constructComponentName, finalize, getCursorType, getFrames, getIconImage, getMenuBar, getState, getTitle, initIDs, isResizable, paramString, postProcessKeyEvent, readObject, remove, removeFromFrameList, removeNotify, setCursor, setIconImage, setMenuBar, setResizable, setState, setTitle, writeObject
 
Methods inherited from class java.awt.Window
addOwnedWindow, addWindowListener, applyResourceBundle, applyResourceBundle, connectOwnedWindow, dispatchEventImpl, dispose, eventEnabled, getFocusOwner, getInputContext, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, hide, isActive, isShowing, nextFocus, ownedInit, pack, postEvent, postWindowEvent, preProcessKeyEvent, processEvent, processWindowEvent, removeOwnedWindow, removeWindowListener, setCursor, setFocusOwner, setWarningString, show, toBack, toFront, transferFocus
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyOrientation, countComponents, deliverEvent, dispatchEventToSelf, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getCursorTarget, getInsets, getLayout, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPrint, list, list, locate, minimumSize, paint, paintComponents, postsOldMouseEvents, preferredSize, print, printComponents, printOneComponent, processContainerEvent, proxyEnableEvents, proxyRequestFocus, remove, remove, removeAll, removeContainerListener, setFont, setLayout, update, updateCursor, 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, getIntrinsicCursor, getLocation, getLocation, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, 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, processKeyEvent, processMouseEvent, processMouseMotionEvent, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, 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, registerNatives, wait, wait, wait
 

Field Detail

messageoutput

private MsgOutput messageoutput

infopanel

private java.awt.Panel infopanel

debugpanel

private java.awt.Panel debugpanel

agentnamelabel

private java.awt.Label agentnamelabel

agenthostlabel

private java.awt.Label agenthostlabel

agentportlabel

private java.awt.Label agentportlabel

agentplanlabel

private java.awt.Label agentplanlabel

anshostlabel

private java.awt.Label anshostlabel

ansportlabel

private java.awt.Label ansportlabel

debuglabel

private java.awt.Label debuglabel

agentname

private java.awt.TextField agentname

agenthost

private java.awt.TextField agenthost

agentport

private java.awt.TextField agentport

agentplan

private java.awt.TextField agentplan

anshost

private java.awt.TextField anshost

ansport

private java.awt.TextField ansport

startagent

private java.awt.Button startagent

readplan

private java.awt.Button readplan

register

private java.awt.Button register

exit

private java.awt.Button exit

isregistered

private boolean isregistered

debugmessages

private java.awt.TextArea debugmessages

msgholder

private java.awt.TextArea msgholder

outmsgs

private java.awt.TextArea outmsgs

port

private int port

i

private int i

count

private int count

myagent

private Agent myagent

gui

private NewGUI gui

listen_socket

private java.net.ServerSocket listen_socket

foundport

private boolean foundport

dSwitch

java.util.Hashtable dSwitch

counter

int counter
Constructor Detail

InitWindow

public InitWindow(java.lang.String title,
                  Agent AGENT,
                  java.util.Hashtable DB,
                  java.awt.TextArea in,
                  java.awt.TextArea out,
                  NewGUI GUI)
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

getAgentName

public java.lang.String getAgentName()
These functions return the private members of the class. They are used by the main window to get the info on the agent.

getAgentHost

public java.lang.String getAgentHost()

getAgentPort

public java.lang.String getAgentPort()

getANSHost

public java.lang.String getANSHost()

getANSPort

public java.lang.String getANSPort()

getDebugMessages

public java.lang.String getDebugMessages()

getMsgHolder

public java.lang.String getMsgHolder()

Reset

public void Reset(java.util.Hashtable dswitch)
This function resets the information of the window to get ready for new agent info

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
Specified by:
windowClosing in interface java.awt.event.WindowListener

windowOpened

public void windowOpened(java.awt.event.WindowEvent e)
Specified by:
windowOpened in interface java.awt.event.WindowListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent e)
Specified by:
windowClosed in interface java.awt.event.WindowListener

windowActivated

public void windowActivated(java.awt.event.WindowEvent e)
Specified by:
windowActivated in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent e)
Specified by:
windowDeactivated in interface java.awt.event.WindowListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent e)
Specified by:
windowIconified in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent e)
Specified by:
windowDeiconified in interface java.awt.event.WindowListener

appendInitialMessage

public void appendInitialMessage(java.lang.String Msg)

InitWindow_WindowOpened

void InitWindow_WindowOpened(java.awt.event.WindowEvent event)

getmessageoutput

public MsgOutput getmessageoutput()