Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.mitre.cvw
Class CmdEntryPanel  view CmdEntryPanel download CmdEntryPanel.java

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended byorg.mitre.cvw.CmdEntryPanel
All Implemented Interfaces:
javax.accessibility.Accessible, java.util.EventListener, java.awt.image.ImageObserver, java.awt.event.KeyListener, java.awt.MenuContainer, java.io.Serializable

public class CmdEntryPanel
extends javax.swing.JPanel
implements java.awt.event.KeyListener

This is the gui which presents the user with the following components: the command pull down menu, the to field, the text area, the send and cancel buttons, the public/private label, and the beep checkbox.

Version:

Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
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  javax.swing.JCheckBox beepCheck
           
private  boolean beepCheckState
           
private  java.awt.Font bold
           
private  javax.swing.JButton clearButton
           
private  CmdChoice cmdChoice
           
private  CVWCmdMgr cmdMgr
           
private  javax.swing.JPanel cmdUserPanel
           
private  CmdEntryClient container
           
(package private)  int cvwCmd
           
private  java.lang.String emacsBuffer
           
private  java.util.Vector emacsCmds
           
private  boolean emacsUser
           
(package private)  java.awt.event.ActionListener hotKeyAL
           
private  CVWCoordinator jcvw
           
private  java.awt.Font large
           
(package private)  int lastCmd
           
(package private)  java.lang.String lastPerson
           
(package private)  java.lang.String lastText
           
private  javax.swing.JTextArea mudEntry
           
(package private)  boolean newBtn
           
private  javax.swing.JTextField personField
           
private  boolean personFieldEnabled
           
private  java.awt.Font plain
           
private  javax.swing.JLabel privateLabel
           
private  javax.swing.JLabel publicLabel
           
private  javax.swing.JPanel publicPanel
           
private  javax.swing.JPanel roomPanel
           
private  javax.swing.JButton sendButton
           
private  java.awt.Font small
           
(package private)  SentCVWCmds storedCmds
           
private  javax.swing.JPanel textPanel
           
private  javax.swing.JLabel toLabel
           
private  javax.swing.JPanel widgetPanel
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
(package private) CmdEntryPanel(CmdEntryClient insideOf)
          Constructor
(package private) CmdEntryPanel(CmdEntryClient insideOf, boolean clone)
           
 
Method Summary
 boolean beepCheckGetState()
          Returns whether the beep check box is checked.
 void clearCommand()
          User hit the clear button.
 void cmdChoiceChanged(int cmdKey)
          Processes a change in the command pull down choice menu, setting up the appropriate fields as visible, in focus, etc.
 void cmdChoiceSet(int cmdKey)
          Sets the command pull down menu given a int representing a CVWCommand.
protected  void createPopup(java.awt.Component source, java.awt.Point p)
           
 void enableEntry(boolean b)
          Enables/disables the entry area depending on the parameter sent in
 void eraseHotKeyEmacs()
          Erases emac hot keys for this window.
 java.util.Vector getEmacHotKeys()
           
 PastCVWCmd getLastCommand()
          Returns the last command with command used, to field values, and text in the text area.
 PastCVWCmd getLastCommand(boolean b)
          Returns the last command with command used, to field values, and text in the text area.
 java.lang.String getNonDupUsers()
          Return a string of user names entered in the person field with any duplications removed and surrounded by double quotes.
 java.lang.String getNonDupUsers(java.lang.String users)
          Given a space delimited list of user names, return a string with any duplications removed and surrounded by double quotes.
 void init()
          Initializes the gui.
 void initCmdChoiceMenu()
          Initializes the command menu pull down and sets up the hot keys.
 void initEntryPanel()
          Initializes the entry area.
 void keyPressed(java.awt.event.KeyEvent e)
          This method is called when a key is pressed.
 void keyReleased(java.awt.event.KeyEvent e)
          This method is called when a key is released.
 void keyTyped(java.awt.event.KeyEvent e)
          This method is called when a key is typed.
 void makePublicOnly()
          Hides the beep check box, making the entry area public
 java.lang.String mudEntryGetText()
          Returns the text in the text area.
 void mudEntryGrabFocus()
           
 boolean mudEntryHasFocus()
          Returns if the mud text field has focus
 void mudEntryRequestFocus()
          Requests focus in the text area.
 void mudEntrySelectAll()
          Selects all text in the text area.
 void mudEntrySetText(java.lang.String text)
          Sets the text in the text area.
 java.lang.String personFieldGetText()
          Returns the text of the person field.
 boolean personFieldHasFocus()
          Returns if the person field has focus
 void personFieldRequestFocus()
          Request focus to be on the person field.
 void personFieldSelectAll()
          Selects all the text in the person field.
 void personFieldSetEnabled(boolean b)
          Enables the person field depending on the parameter
 void personFieldSetText(java.lang.String text)
          Sets the text of the person field.
 void prevNextCommand(java.lang.String way)
           
 void processFirstKey(java.awt.event.KeyEvent e)
           
 void processHotKey(java.lang.String keyStroke)
          Processes the hotkey given a keystroke.
 void processHotKeyEmacs(java.lang.String keyStroke)
           
 void restoreCommand(PastCVWCmd cmd, boolean error)
          Restores the cmd entry area with command passed in, with command used, to field values, and text in the text area.
 void restoreLastCommand()
          Restores the last command with command used, to field values, and text in the text area.
 void saveLastCommand()
          Saves the last command for future in case of error.
 void sendCommand()
          User hit the send button.
 void setCmdGivenMenuStr(java.lang.String menuStr)
          Finds the CVW command given the selected string in the choice menu.
 void setPubPrvWidgets(boolean pub)
          Sets up the public/private widgets to be shown depending on the current command choses.
 void setupHotKey(CVWCommand cvwCmd)
          Sets up a hot key for this window given a CVWCommand.
 void setupHotKeyEmacs()
          Sets up emac hot keys for this window.
 void setupHotKeyPrevNext()
          Sets up the hot keys for prev and next CVWCommand history.
 void userClick(java.lang.String name)
          Adds the user name to the person field, if it is not already there.
 void userMenu(CVWObject user, java.lang.String function)
          Process a menu command on the user, if a new command then remove any existing user name and change the command, if the same command then append this user name to the person field.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, 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, 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, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

jcvw

private CVWCoordinator jcvw

container

private CmdEntryClient container

cmdChoice

private CmdChoice cmdChoice

personField

private javax.swing.JTextField personField

personFieldEnabled

private boolean personFieldEnabled

toLabel

private javax.swing.JLabel toLabel

publicLabel

private javax.swing.JLabel publicLabel

privateLabel

private javax.swing.JLabel privateLabel

publicPanel

private javax.swing.JPanel publicPanel

textPanel

private javax.swing.JPanel textPanel

cmdUserPanel

private javax.swing.JPanel cmdUserPanel

widgetPanel

private javax.swing.JPanel widgetPanel

roomPanel

private javax.swing.JPanel roomPanel

sendButton

private javax.swing.JButton sendButton

clearButton

private javax.swing.JButton clearButton

beepCheck

private javax.swing.JCheckBox beepCheck

beepCheckState

private boolean beepCheckState

mudEntry

private javax.swing.JTextArea mudEntry

large

private java.awt.Font large

small

private java.awt.Font small

bold

private java.awt.Font bold

plain

private java.awt.Font plain

cmdMgr

private CVWCmdMgr cmdMgr

cvwCmd

int cvwCmd

newBtn

boolean newBtn

emacsBuffer

private java.lang.String emacsBuffer

emacsUser

private boolean emacsUser

emacsCmds

private java.util.Vector emacsCmds

lastCmd

int lastCmd

lastPerson

java.lang.String lastPerson

lastText

java.lang.String lastText

storedCmds

SentCVWCmds storedCmds

hotKeyAL

java.awt.event.ActionListener hotKeyAL
Constructor Detail

CmdEntryPanel

CmdEntryPanel(CmdEntryClient insideOf)
Constructor


CmdEntryPanel

CmdEntryPanel(CmdEntryClient insideOf,
              boolean clone)
Method Detail

init

public void init()
Initializes the gui.


initCmdChoiceMenu

public void initCmdChoiceMenu()
Initializes the command menu pull down and sets up the hot keys.


setupHotKey

public void setupHotKey(CVWCommand cvwCmd)
Sets up a hot key for this window given a CVWCommand.


setupHotKeyPrevNext

public void setupHotKeyPrevNext()
Sets up the hot keys for prev and next CVWCommand history.


prevNextCommand

public void prevNextCommand(java.lang.String way)

setupHotKeyEmacs

public void setupHotKeyEmacs()
Sets up emac hot keys for this window.


getEmacHotKeys

public java.util.Vector getEmacHotKeys()

eraseHotKeyEmacs

public void eraseHotKeyEmacs()
Erases emac hot keys for this window.


initEntryPanel

public void initEntryPanel()
Initializes the entry area.


makePublicOnly

public void makePublicOnly()
Hides the beep check box, making the entry area public


createPopup

protected void createPopup(java.awt.Component source,
                           java.awt.Point p)

sendCommand

public void sendCommand()
User hit the send button.


clearCommand

public void clearCommand()
User hit the clear button.


enableEntry

public void enableEntry(boolean b)
Enables/disables the entry area depending on the parameter sent in


getLastCommand

public PastCVWCmd getLastCommand()
Returns the last command with command used, to field values, and text in the text area.


getLastCommand

public PastCVWCmd getLastCommand(boolean b)
Returns the last command with command used, to field values, and text in the text area.


restoreLastCommand

public void restoreLastCommand()
Restores the last command with command used, to field values, and text in the text area.


restoreCommand

public void restoreCommand(PastCVWCmd cmd,
                           boolean error)
Restores the cmd entry area with command passed in, with command used, to field values, and text in the text area.


saveLastCommand

public void saveLastCommand()
Saves the last command for future in case of error.


setCmdGivenMenuStr

public void setCmdGivenMenuStr(java.lang.String menuStr)
Finds the CVW command given the selected string in the choice menu.


cmdChoiceSet

public void cmdChoiceSet(int cmdKey)
Sets the command pull down menu given a int representing a CVWCommand.


cmdChoiceChanged

public void cmdChoiceChanged(int cmdKey)
Processes a change in the command pull down choice menu, setting up the appropriate fields as visible, in focus, etc.


setPubPrvWidgets

public void setPubPrvWidgets(boolean pub)
Sets up the public/private widgets to be shown depending on the current command choses.


personFieldHasFocus

public boolean personFieldHasFocus()
Returns if the person field has focus


mudEntryGrabFocus

public void mudEntryGrabFocus()

mudEntryHasFocus

public boolean mudEntryHasFocus()
Returns if the mud text field has focus


personFieldGetText

public java.lang.String personFieldGetText()
Returns the text of the person field.


personFieldSetText

public void personFieldSetText(java.lang.String text)
Sets the text of the person field.


personFieldSetEnabled

public void personFieldSetEnabled(boolean b)
Enables the person field depending on the parameter


personFieldRequestFocus

public void personFieldRequestFocus()
Request focus to be on the person field.


personFieldSelectAll

public void personFieldSelectAll()
Selects all the text in the person field.


mudEntryGetText

public java.lang.String mudEntryGetText()
Returns the text in the text area.


mudEntrySetText

public void mudEntrySetText(java.lang.String text)
Sets the text in the text area.


mudEntryRequestFocus

public void mudEntryRequestFocus()
Requests focus in the text area.


mudEntrySelectAll

public void mudEntrySelectAll()
Selects all text in the text area.


beepCheckGetState

public boolean beepCheckGetState()
Returns whether the beep check box is checked.


getNonDupUsers

public java.lang.String getNonDupUsers()
Return a string of user names entered in the person field with any duplications removed and surrounded by double quotes.


getNonDupUsers

public java.lang.String getNonDupUsers(java.lang.String users)
Given a space delimited list of user names, return a string with any duplications removed and surrounded by double quotes.


userClick

public void userClick(java.lang.String name)
Adds the user name to the person field, if it is not already there.


userMenu

public void userMenu(CVWObject user,
                     java.lang.String function)
Process a menu command on the user, if a new command then remove any existing user name and change the command, if the same command then append this user name to the person field.


processFirstKey

public void processFirstKey(java.awt.event.KeyEvent e)

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Description copied from interface: java.awt.event.KeyListener
This method is called when a key is typed. A key is considered typed when it and all modifiers have been pressed and released, mapping to a single virtual key.

Specified by:
keyTyped in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Description copied from interface: java.awt.event.KeyListener
This method is called when a key is released.

Specified by:
keyReleased in interface java.awt.event.KeyListener

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Description copied from interface: java.awt.event.KeyListener
This method is called when a key is pressed.

Specified by:
keyPressed in interface java.awt.event.KeyListener

processHotKey

public void processHotKey(java.lang.String keyStroke)
Processes the hotkey given a keystroke.


processHotKeyEmacs

public void processHotKeyEmacs(java.lang.String keyStroke)