Class KQMLWindow

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

class KQMLWindow
extends java.awt.Frame
implements java.awt.event.ActionListener, java.awt.event.ItemListener, java.awt.event.WindowListener

This is the class for the KQML sessage sender window for an agent. The user may enter the host and the port of ANS. These default to the local server and 6677, respectively. Currently, the user may: pick from a list of performatives enter the name of the receiver agent enter a string to reply with or just use a randomly-generated string enter the subject that the message is in reply to pick from a list of ontologies pick from a list of languages the content of the message There are 2 buttons: The 'clear content' button clears the textarea that hold the main message The 'Send Message' button sends the KQML message The 'Exit' button exits out to the main window If the message is successfully sent, the input text fields are cleared

See Also:
Serialized Form

Inner Class Summary
(package private)  class KQMLWindow.MessageWindow
           
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AWTTreeLock
 
Field Summary
private  java.awt.TextField anshost
           
private  java.awt.Label anshostlabel
           
private  java.awt.TextField ansport
           
private  java.awt.Label ansportlabel
           
private  java.awt.Button clear
           
private  java.awt.TextArea content
           
private  java.awt.Label contentlabel
           
private  java.awt.TextArea debugArea
           
private  java.awt.Button exit
           
private  NewGUI gui
           
private  int i
           
private  java.awt.TextField language
           
private  java.awt.Choice languagechoice
           
private  java.awt.Label languagelabel
           
private  java.lang.String[] languages
           
private  int maxX
           
private  int maxY
           
private  java.lang.String message
           
private  Agent myAgent
           
private  java.lang.String name
           
private  java.lang.String[] ontologies
           
private  java.awt.TextField ontology
           
private  java.awt.Choice ontologychoice
           
private  java.awt.Label ontologylabel
           
private  java.awt.TextField performative
           
private  java.awt.Choice performativechoice
           
private  java.awt.Label performativelabel
           
private  java.lang.String[] performs
           
private  java.awt.TextField receiver
           
private  java.awt.Label receiverlabel
           
private  java.awt.TextField replyto
           
private  java.awt.Label replytolabel
           
private  java.awt.TextField replywith
           
private  java.awt.Choice replywithchoice
           
private  java.awt.Label replywithlabel
           
private  java.awt.Button send
           
 
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
KQMLWindow(java.lang.String title, Agent AGENT, java.lang.String agentname, NewGUI GUI)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 java.lang.String getDebugMessages()
          Returns the content of the debug area.
 java.lang.String getMessage()
          Returns the content of the KQML message.
 void itemStateChanged(java.awt.event.ItemEvent e)
           
 void Reset()
          This function resets the information of the window to get ready for a new message
 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

anshostlabel

private java.awt.Label anshostlabel

ansportlabel

private java.awt.Label ansportlabel

performativelabel

private java.awt.Label performativelabel

receiverlabel

private java.awt.Label receiverlabel

replytolabel

private java.awt.Label replytolabel

replywithlabel

private java.awt.Label replywithlabel

contentlabel

private java.awt.Label contentlabel

languagelabel

private java.awt.Label languagelabel

ontologylabel

private java.awt.Label ontologylabel

anshost

private java.awt.TextField anshost

ansport

private java.awt.TextField ansport

performative

private java.awt.TextField performative

receiver

private java.awt.TextField receiver

replyto

private java.awt.TextField replyto

replywith

private java.awt.TextField replywith

language

private java.awt.TextField language

ontology

private java.awt.TextField ontology

content

private java.awt.TextArea content

debugArea

private java.awt.TextArea debugArea

clear

private java.awt.Button clear

send

private java.awt.Button send

exit

private java.awt.Button exit

performativechoice

private java.awt.Choice performativechoice

replywithchoice

private java.awt.Choice replywithchoice

ontologychoice

private java.awt.Choice ontologychoice

languagechoice

private java.awt.Choice languagechoice

message

private java.lang.String message

name

private java.lang.String name

performs

private java.lang.String[] performs

ontologies

private java.lang.String[] ontologies

languages

private java.lang.String[] languages

myAgent

private Agent myAgent

i

private int i

maxX

private int maxX

maxY

private int maxY

gui

private NewGUI gui
Constructor Detail

KQMLWindow

public KQMLWindow(java.lang.String title,
                  Agent AGENT,
                  java.lang.String agentname,
                  NewGUI GUI)
Method Detail

actionPerformed

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

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
Specified by:
itemStateChanged in interface java.awt.event.ItemListener

getMessage

public java.lang.String getMessage()
Returns the content of the KQML message. The main window calls this and places the info in the outgoing message area

getDebugMessages

public java.lang.String getDebugMessages()
Returns the content of the debug area. The main window calls this and places the info in the debugging message area

Reset

public void Reset()
This function resets the information of the window to get ready for a new message

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