clarion.options
Class GuiTemplate

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Window
              extended byjava.awt.Frame
                  extended byjavax.swing.JFrame
                      extended byclarion.options.GuiTemplate
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants
Direct Known Subclasses:
GuiACS, GuiAcsExNets, GuiAcsNet, GuiAcsNets, GuiAmn, GuiClarion, GuiDims, GuiInterface, GuiNACS, GuiRT, GuiSupervisory, GuiTask

public class GuiTemplate
extends javax.swing.JFrame

See Also:
Serialized Form

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
protected  int activeButtonIdx
           
protected  javax.swing.JLabel capLabel
           
protected  java.lang.String capLabelText
          GUI components in the interface of configuration.
protected static boolean[][] configFlags
          inidicate whether an agent has been already configured by the options: CLARION and Task Specific.
protected static javax.swing.JButton confirmButton
           
protected  boolean confirmFlag
          flag for confirmation of the configuration.
protected  int curAgentIdx
          current index of agent requiring configuration.
protected static int currentSettingNum
          current number of configurations for a particular task.
protected static int currentTaskNum
          current number of tasks simulated so far.
protected static Global[] globals
          the associated global settings of each running agent.
protected  javax.swing.JButton loadSettingButton
           
protected  javax.swing.JTextField loadSettingField
           
protected  javax.swing.JMenuItem[] loadSettingItem
           
protected  javax.swing.JPopupMenu loadSettingMenu
           
protected  java.lang.String loadSettingName
          the name of the loaded task configuration.
protected  javax.swing.JMenuItem[] loadTaskItem
           
protected  javax.swing.JPopupMenu loadTaskMenu
           
protected static java.lang.String loadTaskName
          the name of the loaded task.
protected  javax.swing.JFrame mainFrame
           
protected  java.lang.String majorEntryText
          text indicates main interface of CLARION configuration.
protected static TransferManager manager
          the variable in charge of laoding and saving configuration.
protected  java.lang.String[] newSettingNames
          the names of all setting groups for a loaded task.
protected  java.lang.String[] newTaskNames
          the names of all currently simulated task.
protected  javax.swing.JButton nextButton
           
protected  java.lang.String note
           
protected  javax.swing.JPanel operatePanel
           
protected  int OPT_NUM
          number of components in the subsystem needing configuration.
protected  javax.swing.JButton[] optButtons
           
protected  java.lang.String[] optionButtonTexts
          GUI components in the interface of configuration.
protected  javax.swing.JPanel optionPanel
           
protected  javax.swing.JButton returnButton
           
protected static int runningAgentNum
          the number of agents running simultaneously.
protected  javax.swing.JButton saveButton
           
protected  javax.swing.JTextField saveField
           
protected  java.lang.String taskSpecEntryText
          text indicates main interface of Task-Specific configuration.
protected  javax.swing.JFrame thisFrame
           
 
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.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
GuiTemplate(int optNum, java.lang.String labelText)
          constructor.
GuiTemplate(int optNum, java.lang.String labelText, Global[] globals)
          constructor.
 
Method Summary
 void addActionListeners(javax.swing.JFrame mFrame)
          add action listeners.
 java.lang.String[] getButtonTexts()
          Returns the names of components in this subsystem.
 javax.swing.JFrame getFrame()
          Returns this GUI frame.
 java.lang.String getLabelText()
          Returns caption.
 void init(javax.swing.JFrame frame)
          the routine of initializing this configuration GUI.
 boolean isConfirmed(int configPart, int agentIdx)
          Returns if current configuration is confirmed or not.
protected  void processLoad()
           
 void resetConfigFlags()
          Returns if current configuration is confirmed or not.
 void returnFrom()
          the routine of processing the changes when returning from other GUIs.
 void setButtonTexts(java.lang.String[] strings)
          Sets the names of the components in this subsystem.
 void setConfirmStatus(boolean changeFlag)
          Sets the confirm status.
 void setCurAgentIdx(int agentIdx)
          Sets the index of current agent requiring configuration.
 void setGlobals(Global[] globals)
          Sets the global settings associated with the running agents.
 void setLabelText(java.lang.String str)
          Sets the caption.
 void setMainFrame(javax.swing.JFrame frame)
           
 void setRunningAgentNum(int num)
          Sets the index of current agent requiring configuration.
 void setTaskName(java.lang.String name)
          Sets the task name.
 void updateGui()
          Updates this GUI.
 
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

majorEntryText

protected final java.lang.String majorEntryText
text indicates main interface of CLARION configuration.

See Also:
Constant Field Values

taskSpecEntryText

protected final java.lang.String taskSpecEntryText
text indicates main interface of Task-Specific configuration.

See Also:
Constant Field Values

note

protected final java.lang.String note
See Also:
Constant Field Values

newTaskNames

protected java.lang.String[] newTaskNames
the names of all currently simulated task.


newSettingNames

protected java.lang.String[] newSettingNames
the names of all setting groups for a loaded task.


currentTaskNum

protected static int currentTaskNum
current number of tasks simulated so far.


currentSettingNum

protected static int currentSettingNum
current number of configurations for a particular task.


loadTaskName

protected static java.lang.String loadTaskName
the name of the loaded task.


runningAgentNum

protected static int runningAgentNum
the number of agents running simultaneously.


configFlags

protected static boolean[][] configFlags
inidicate whether an agent has been already configured by the options: CLARION and Task Specific.


globals

protected static Global[] globals
the associated global settings of each running agent.


confirmFlag

protected boolean confirmFlag
flag for confirmation of the configuration.


curAgentIdx

protected int curAgentIdx
current index of agent requiring configuration.


loadSettingName

protected java.lang.String loadSettingName
the name of the loaded task configuration.


OPT_NUM

protected int OPT_NUM
number of components in the subsystem needing configuration.


capLabelText

protected java.lang.String capLabelText
GUI components in the interface of configuration.


optionButtonTexts

protected java.lang.String[] optionButtonTexts
GUI components in the interface of configuration.


capLabel

protected javax.swing.JLabel capLabel

mainFrame

protected javax.swing.JFrame mainFrame

thisFrame

protected javax.swing.JFrame thisFrame

optionPanel

protected javax.swing.JPanel optionPanel

operatePanel

protected javax.swing.JPanel operatePanel

loadSettingButton

protected javax.swing.JButton loadSettingButton

saveButton

protected javax.swing.JButton saveButton

confirmButton

protected static javax.swing.JButton confirmButton

nextButton

protected javax.swing.JButton nextButton

returnButton

protected javax.swing.JButton returnButton

optButtons

protected javax.swing.JButton[] optButtons

loadSettingField

protected javax.swing.JTextField loadSettingField

saveField

protected javax.swing.JTextField saveField

loadTaskMenu

protected javax.swing.JPopupMenu loadTaskMenu

loadSettingMenu

protected javax.swing.JPopupMenu loadSettingMenu

loadTaskItem

protected javax.swing.JMenuItem[] loadTaskItem

loadSettingItem

protected javax.swing.JMenuItem[] loadSettingItem

activeButtonIdx

protected int activeButtonIdx

manager

protected static TransferManager manager
the variable in charge of laoding and saving configuration.

Constructor Detail

GuiTemplate

public GuiTemplate(int optNum,
                   java.lang.String labelText)
constructor.

Parameters:
optNum - number of components in the subsystem needing configuration.
labelText - the caption label.

GuiTemplate

public GuiTemplate(int optNum,
                   java.lang.String labelText,
                   Global[] globals)
constructor.

Parameters:
optNum - number of components in the subsystem needing configuration.
labelText - the caption label.
globals - the assoiciated global settings with the running agents.
Method Detail

resetConfigFlags

public void resetConfigFlags()
Returns if current configuration is confirmed or not.


isConfirmed

public boolean isConfirmed(int configPart,
                           int agentIdx)
Returns if current configuration is confirmed or not.


getFrame

public javax.swing.JFrame getFrame()
Returns this GUI frame.


getLabelText

public java.lang.String getLabelText()
Returns caption.


getButtonTexts

public java.lang.String[] getButtonTexts()
Returns the names of components in this subsystem.


setCurAgentIdx

public void setCurAgentIdx(int agentIdx)
Sets the index of current agent requiring configuration.

Parameters:
agentIdx - the index of agent to set.

setRunningAgentNum

public void setRunningAgentNum(int num)
Sets the index of current agent requiring configuration.

Parameters:
num - the number of agents to set.

setGlobals

public void setGlobals(Global[] globals)
Sets the global settings associated with the running agents.

Parameters:
globals - the array of global settings to set.

setLabelText

public void setLabelText(java.lang.String str)
Sets the caption.

Parameters:
str - the caption to set.

setConfirmStatus

public void setConfirmStatus(boolean changeFlag)
Sets the confirm status.

Parameters:
changeFlag - indicates if any option is change or not.

setButtonTexts

public void setButtonTexts(java.lang.String[] strings)
Sets the names of the components in this subsystem.

Parameters:
strings - the names to set.

setTaskName

public void setTaskName(java.lang.String name)
Sets the task name.

Parameters:
name - the task name to set.

setMainFrame

public void setMainFrame(javax.swing.JFrame frame)

init

public void init(javax.swing.JFrame frame)
the routine of initializing this configuration GUI.


addActionListeners

public void addActionListeners(javax.swing.JFrame mFrame)
add action listeners. this method needs overriding.


returnFrom

public void returnFrom()
the routine of processing the changes when returning from other GUIs.


updateGui

public void updateGui()
Updates this GUI.


processLoad

protected void processLoad()