public class UIAgent extends JPanel implements Observer
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Modifier and Type | Method and Description |
---|---|
void |
addMessage(String sBody,
String sFrom)
add message to table display
|
boolean |
appOpenApp(String sApp)
loop through list of ConfigApp objects and try to fire-up the requested application
|
boolean |
appOpenFile(String sFile)
loop through list of ConfigApp objects and try to open the file with the
associated application based on the file type
|
void |
enableButtons(boolean flag)
enableButtons - enable/disable Guess/Clear buttons
|
AgentConfig |
getAgentConfig()
used by Hotkey to trigger an event
|
String |
getIMDirIn()
get the directory to store incoming binary data
(e.g. encoded data in Jabber XHTML message)
|
String |
getIMDirOut()
get the directory to store outgoing binary data
(e.g. encoded data in Jabber XHTML message)
|
String |
getIMDomain()
get the Jabber logon domain
|
String |
getIMJID()
get the Jabber ID to listen to upon connection
|
String |
getIMNickName()
get the Jabber user nickname
|
int |
getIMPort()
get Jabber port no.
|
String |
getIMResource()
get the Jabber user resource
|
String |
getIMUserName()
get the Jabber user name
|
String |
getIMUserPassword()
get the Jabber user password
|
void |
highlightText(int start,
int len,
String sColor,
boolean[] arr)
highlight text in memobox
|
void |
init()
init - initialise the user interface
|
protected Component |
makeTextPanel(String text)
dummy text label for tabbed pages
|
void |
processb64_2() |
void |
processb64()
test base-64 encode/decode
|
void |
processClear()
processClear - invoke clearTextFields to clean-up contents of
JTextFields.
|
void |
processEncodeTest()
test encode/decode performance
|
void |
processHTTPGet()
HTTP get file
|
void |
processHTTPPost()
HTTP post file
|
void |
processIMJoin(String sRoom)
processReset - group chat
A group chat connects to a chat room on a server and allows you to send
and receive messages from a group of people.
|
void |
processIMSend()
package and send out Jabber message
|
void |
processObserverNotify()
testing of Observer notifications
|
void |
processP2P()
processParse - parser the paragraph
|
void |
processWebStartStop()
processWebStartStop - start/stop web server
To serve to web page, type-in "http://
|
void |
processXHTML(String sXML)
process XHTML string and spawn respective application to display it.
|
void |
setConfigAppList(List lst)
set list of ConfigApp objects that have been read from configuration file
|
void |
setCriteriaBody(String sJID)
set list of Message Body keywords
|
void |
setCriteriaSubject(String sJID)
set list of Message Subject keywords
|
void |
setIMDirIn(String sDir)
set the directory to store incoming binary data
(e.g. encoded data in Jabber XHTML message)
|
void |
setIMDirOut(String sDir)
set the directory to store outgoing binary data
(e.g. encoded data in Jabber XHTML message)
|
void |
setIMDomain(String sDomain)
set the Jabber logon domain
|
void |
setIMJID(String sJID)
set the Jabber ID to listen to upon connection
|
void |
setIMNickName(String sNick)
set the Jabber user nickname
|
void |
setIMPort(int iPort)
set Jabber port no.
|
void |
setIMResource(String sResource)
set the Jabber user resource
|
void |
setIMUserName(String sName)
set the Jabber user name
|
void |
setIMUserPassword(String sPwd)
set the Jabber user password
|
JPanel |
uiButton()
panel of buttons
|
JPanel |
uiCriteria()
create scrollable text area
|
JPanel |
uiIMConnect()
user interface to set/get Jabber user, password, domain, nickname
|
JPanel |
uiIMRecv()
create a table to display list of incoming Jabber messages
|
JPanel |
uiIMSend()
create a table to display list of incoming Jabber messages
|
JScrollPane |
uiTextArea()
create scrollable text area
|
JPanel |
uiWeb()
user interface to start/stop webserver
|
void |
update(Observable ob,
Object obj)
method is called whenever the observed object is changed.
|
void |
writeErr(String aStr)
write a error messgae to console
|
void |
writeLn()
write a line to console
|
static void |
writeLn(boolean bStr)
write boolean value to console
|
static void |
writeLn(int iStr)
write numeric value to console
|
void |
writeLn(String aStr)
write a line to console
|
void |
writeText(String aStr)
write string to memobox
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public UIAgent(String xmlConfig)
xmlConfig
- configuration file
param mView for plotting of coordinates on Mission Plannerpublic void addMessage(String sBody, String sFrom)
sBody
- message bodysFrom
- from whopublic boolean appOpenApp(String sApp)
sApp
- application to be openedpublic boolean appOpenFile(String sFile)
sFile
- file to be openedpublic void setConfigAppList(List lst)
lst
- list of ConfigApp objectspublic void enableButtons(boolean flag)
flag
- is true for enabled, false for disabledpublic void highlightText(int start, int len, String sColor, boolean[] arr)
start
- start position of string to be highlightedlen
- length of string to be highlightedsColor
- color namearr
- boolean arraypublic AgentConfig getAgentConfig()
public String getIMDirIn()
public void setIMDirIn(String sDir)
sDir
- String valuepublic String getIMDirOut()
public void setIMDirOut(String sDir)
sDir
- String valuepublic String getIMDomain()
public void setIMDomain(String sDomain)
sDomain
- String valuepublic String getIMJID()
public void setIMJID(String sJID)
sJID
- String valuepublic String getIMUserName()
public void setIMUserName(String sName)
sName
- String valuepublic String getIMNickName()
public void setIMNickName(String sNick)
sNick
- String valuepublic String getIMUserPassword()
public void setIMUserPassword(String sPwd)
sPwd
- String valuepublic int getIMPort()
public void setIMPort(int iPort)
iPort
- numeric valuepublic String getIMResource()
public void setIMResource(String sResource)
sResource
- String valueprotected Component makeTextPanel(String text)
text
- string in JLabelpublic void setCriteriaBody(String sJID)
sJID
- Jabber user IDpublic void setCriteriaSubject(String sJID)
sJID
- Jabber user IDpublic JPanel uiButton()
public JPanel uiCriteria()
public JPanel uiIMConnect()
public JPanel uiIMRecv()
public JPanel uiIMSend()
public JScrollPane uiTextArea()
public JPanel uiWeb()
public void update(Observable ob, Object obj)
public void processEncodeTest()
public void processHTTPGet()
public void processHTTPPost()
public void processIMSend()
public void processObserverNotify()
public void processb64()
public void processb64_2()
public void processClear()
public void processP2P()
public void processWebStartStop()
public void processXHTML(String sXML)
sXML
- XHTML stringpublic void processIMJoin(String sRoom)
sRoom
- chatroom e.g. "savage@conference.xchat.movesinstitute.org"public void writeText(String aStr)
aStr
- status string to be writtenpublic void writeErr(String aStr)
aStr
- line to be written to consolepublic void writeLn(String aStr)
aStr
- line to be written to consolepublic static void writeLn(boolean bStr)
bStr
- boolean value to be written to consolepublic static void writeLn(int iStr)
iStr
- numeric value to be written to consolepublic void writeLn()