|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
aa.gui.View
This class creates a window for MAA (Multi-Actor Architecture) Platform.
History:
Nested Class Summary |
Nested classes inherited from class javax.swing.JFrame |
javax.swing.JFrame.AccessibleJFrame |
Nested classes inherited from class java.awt.Frame |
java.awt.Frame.AccessibleAWTFrame |
Nested classes inherited from class java.awt.Window |
java.awt.Window.AccessibleAWTWindow |
Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
private ActorManager |
m_amActorManager
|
private boolean |
m_bMsqHistory
|
private javax.swing.tree.DefaultMutableTreeNode |
m_dmtnRoot
|
private java.lang.Integer |
m_intPort
|
private int |
m_iSizeOfMsgHistoryQueue
|
private javax.swing.JCheckBoxMenuItem |
m_jcbmiEnableMsgHistory
|
private javax.swing.JLabel |
m_jlStatusBar
|
private javax.swing.JMenuItem |
m_jmiAbout
|
private javax.swing.JMenuItem |
m_jmiChangePortNumber
|
private javax.swing.JMenuItem |
m_jmiChangeSizeOfHistory
|
private javax.swing.JMenuItem |
m_jmiClearMsgHistory
|
private javax.swing.JMenuItem |
m_jmiClose
|
private javax.swing.JMenuItem |
m_jmiCreate
|
private javax.swing.JMenuItem |
m_jmiExit
|
private javax.swing.JMenuItem |
m_jmiKill
|
private javax.swing.JMenuItem |
m_jmiResume
|
private javax.swing.JMenuItem |
m_jmiSaveMsgHistory
|
private javax.swing.JMenuItem |
m_jmiSend
|
private javax.swing.JMenuItem |
m_jmiShowMsgHistory
|
private javax.swing.JMenuItem |
m_jmiSuspend
|
private javax.swing.JMenuItem |
m_jmiSysInfo
|
private javax.swing.JScrollPane |
m_jspLeft
|
private javax.swing.JSplitPane |
m_jspMain
|
private javax.swing.JScrollPane |
m_jspRight
|
private javax.swing.JTree |
m_jtreeActor
|
private Platform |
m_pPlatform
|
private Queue |
m_qMsgQueue
|
private static java.lang.String |
m_strTitle
Title of this interface window. |
Fields inherited from class javax.swing.JFrame |
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Frame |
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
Fields inherited from class java.awt.Window |
|
Fields inherited from class java.awt.Container |
|
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.WindowConstants |
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
View(java.lang.Integer p_intPort)
Create the graphical user interface of this platform. |
Method Summary | |
private void |
actionAbout()
Displays a dialog box to show information about this program. |
private void |
actionChangePortNumber()
Shows a dialog box for changing server port number. |
private void |
actionChangeSizeOfMsgHistory()
Shows a dialog box for changing the size of log messages. |
private void |
actionClearMsgHistory()
Removes all log messages. |
private void |
actionClose()
Closes this window. |
private void |
actionCreate()
Creates a new actor. |
private void |
actionEnableMsgHistory()
Change otpion for enabling actor message logging |
private void |
actionExit()
Exits this program. |
private void |
actionKill()
Kills the selected actor. |
void |
actionPerformed(java.awt.event.ActionEvent p_ae)
Invoked when an action occurs. |
private void |
actionResume()
Resumes the selected actor. |
private void |
actionSaveMsgHistory()
Saves the message history. |
private void |
actionSend()
Sends a message to the selected actor. |
private void |
actionShowMsgHistory()
Shows a dialob box for actor messages delivered. |
private void |
actionSuspend()
Suspends the selected actor. |
private void |
actionViewSysInfo()
Shows a dialog box for the system information of this platform. |
void |
addNewActor(ActorName p_anActor)
Adds a node for the new actor on the actor list. |
void |
changeSizeOfMsgHistory(int p_iHistorySize)
Changes the size of actor message log queue. |
void |
checkPortNumber(java.lang.Object[] p_objaOptions)
Sets new option parameters. |
private void |
clearInfo()
Clears the information table. |
private void |
createMenu()
Create a menu bar with menu items. |
private void |
createPane()
Creates the main pane of this window. |
private void |
displayActorInfo(ActorName p_anActor)
Displays information about one actor. |
private void |
displayActorInfo(java.lang.String[][] p_straData)
Displays information about an actor on the information table. |
private void |
displayActorsInfo(java.lang.String[][] p_straData)
Displays information about actors on the information table. |
void |
displayErrorMessage(java.lang.String p_strMsg)
Displays an error message. |
private void |
displayInfo(java.lang.String[] p_straColName,
java.lang.String[][] p_straData)
Displays information on the jspRight pane. |
void |
exit()
Exits this program. |
private javax.swing.tree.DefaultMutableTreeNode |
findNodeInTree(java.lang.String p_strNodeName)
Finds a node matched with the given input string. |
void |
printOnStatusBar(java.lang.String p_strMsg)
Prints a message on the status bar. |
void |
refreshWindow()
Redraws the window. |
void |
removeActor(ActorName p_anActor)
Removes an actor from the jtreeRoot. |
void |
reportMessage(ActorMessage p_amMsg)
Reports a message. |
void |
setActorManager(ActorManager p_amActorManager)
Sets the reference to the Actor Manager of this actor platform. |
void |
setPlatform(Platform p_pPlatform)
Sets the pointer to this Platform. |
void |
valueChanged(javax.swing.event.TreeSelectionEvent p_tse)
Invoked whenever the value of the selection changes. |
Methods inherited from class javax.swing.JFrame |
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
Methods inherited from class java.awt.Frame |
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
Methods inherited from class java.awt.Window |
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, show, toBack, toFront |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, 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, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
getFont, postEvent |
Field Detail |
private static final java.lang.String m_strTitle
private javax.swing.JMenuItem m_jmiClose
private javax.swing.JMenuItem m_jmiExit
private javax.swing.JMenuItem m_jmiCreate
private javax.swing.JMenuItem m_jmiSend
private javax.swing.JMenuItem m_jmiSuspend
private javax.swing.JMenuItem m_jmiResume
private javax.swing.JMenuItem m_jmiKill
private javax.swing.JCheckBoxMenuItem m_jcbmiEnableMsgHistory
private javax.swing.JMenuItem m_jmiShowMsgHistory
private javax.swing.JMenuItem m_jmiClearMsgHistory
private javax.swing.JMenuItem m_jmiChangeSizeOfHistory
private javax.swing.JMenuItem m_jmiSaveMsgHistory
private javax.swing.JMenuItem m_jmiSysInfo
private javax.swing.JMenuItem m_jmiChangePortNumber
private javax.swing.JMenuItem m_jmiAbout
private javax.swing.tree.DefaultMutableTreeNode m_dmtnRoot
private javax.swing.JTree m_jtreeActor
private javax.swing.JScrollPane m_jspLeft
private javax.swing.JScrollPane m_jspRight
private javax.swing.JSplitPane m_jspMain
private javax.swing.JLabel m_jlStatusBar
private Platform m_pPlatform
private ActorManager m_amActorManager
private int m_iSizeOfMsgHistoryQueue
private boolean m_bMsqHistory
private Queue m_qMsgQueue
private java.lang.Integer m_intPort
Constructor Detail |
public View(java.lang.Integer p_intPort)
p_intPort
- the port number of a server socket for in-comming messages.Method Detail |
private void createMenu()
private void createPane()
public void actionPerformed(java.awt.event.ActionEvent p_ae)
actionPerformed
in interface java.awt.event.ActionListener
p_ae
- an action event to be invoked when an action occurs.private void actionClose()
private void actionExit()
private void actionCreate()
private void actionSend()
private void actionSuspend()
private void actionResume()
private void actionKill()
private void actionViewSysInfo()
private void actionChangePortNumber()
private void actionEnableMsgHistory()
private void actionChangeSizeOfMsgHistory()
private void actionClearMsgHistory()
private void actionSaveMsgHistory()
private void actionShowMsgHistory()
private void actionAbout()
public void checkPortNumber(java.lang.Object[] p_objaOptions)
p_objaOptions
- arguments for new options.public void printOnStatusBar(java.lang.String p_strMsg)
p_strMsg
- a message to be displayed on the status bar.public void setPlatform(Platform p_pPlatform)
p_pPlatform
- the reference to this platform.public void setActorManager(ActorManager p_amActorManager)
p_amActorManager
- the reference to the Actor Manager of this actor platform.private void clearInfo()
private void displayActorInfo(java.lang.String[][] p_straData)
p_straData
- contents of the information table.private void displayActorsInfo(java.lang.String[][] p_straData)
private void displayInfo(java.lang.String[] p_straColName, java.lang.String[][] p_straData)
p_straColName
- names for columns of the information table.p_straData
- contents of the information table.public void addNewActor(ActorName p_anActor)
p_anActor
- the name of an actor.private javax.swing.tree.DefaultMutableTreeNode findNodeInTree(java.lang.String p_strNodeName)
p_strNodeName
- the name of a tree node.
public void removeActor(ActorName p_anActor)
p_anActor
- the name of an actor.public void refreshWindow()
private void displayActorInfo(ActorName p_anActor)
p_anActor
- the name of an actor.public void valueChanged(javax.swing.event.TreeSelectionEvent p_tse)
valueChanged
in interface javax.swing.event.TreeSelectionListener
p_tse
- an event to be invoked when any node of the tree is selected.public void displayErrorMessage(java.lang.String p_strMsg)
p_strMsg
- an error message to be displayed.public void reportMessage(ActorMessage p_amMsg)
p_amMsg
- an actor communication message.public void changeSizeOfMsgHistory(int p_iHistorySize)
p_iHistorySize
- the new size of the actor message log queue.public void exit()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |