org.opennms.bb.eui.operator.panels
Class OperatorInterfacePanel

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--org.opennms.bb.eui.operator.panels.OperatorInterfacePanel
All Implemented Interfaces:
Accessible, ImageObserver, MenuContainer, Serializable

public class OperatorInterfacePanel
extends JPanel

 OperatorInterfacePanel is the realtime console panel

 It contains the standard menu/tool bar options and also adds
 - external menu options from the 'ExternalMenu' file specified 
   in the user profile file
 - external tool options from the 'ExternalTools' file specified 
   in the user profile file

 The operator standard options allows the operator to 
 - sort on name or severity
 - configure the folder tabs. i.e add/remove to/from the configured
   views from the list of views available to the user
 - bring up the event browser

 The operator can drill down to the various levels by double-click
 on a bar or jump to different levels by using the right-click
 popup menu on the bars

 The OperatorInterfacePanel automatically reads from the user profile
 file to restore user's last used configured views, tab placement, 
 look and feel, size etc. and stores these on exit

Author:
Sowmya
See Also:
Serialized Form

Inner classes inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Inner classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent, JComponent.ActionStandin, JComponent.IntVector, JComponent.KeyboardState
 
Inner classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.AWTTreeLock
 
Field Summary
protected  BBTBButton alertButton
           
protected  JMenuItem alertMenuItem
           
protected  Vector availableViewsVector
           
(package private)  boolean bLandFAtStartUp
           
(package private)  boolean bLookAndFeelChanged
           
(package private)  boolean bParseException
           
 String CATEGORY_LEVEL
           
protected  BBTBButton configureButton
           
protected  JMenuItem configureMenuItem
           
protected  Vector configViewsVector
           
protected  OperatorPanel curPanel
           
protected  StringBuffer curTab
           
(package private)  String EDESCR
           
(package private)  String ENAME
           
 String EVENTS_LEVEL
           
(package private)  String HEIGHT
           
(package private)  String LABEL
           
(package private)  String LOOKNFEEL
           
protected  BBTBButton nameSortButton
           
protected  JMenuItem nameSortMenuItem
           
protected  JLabel navigationLabel
           
protected  JFrame opFrame
           
protected  JTabbedPane opTabbedPane
           
(package private)  JRadioButton persRadio
           
protected  Hashtable prevPanel
           
protected  BBTBButton severityButton
           
protected  JMenuItem severityMenuItem
           
(package private)  int STATUS_CHANGE
           
(package private)  int STATUS_DOWN
           
(package private)  int STATUS_UP
           
(package private)  String TAB_PLACE
           
protected  BBTBButton topLevelButton
           
protected  JMenuItem topLevelMenuItem
           
protected  BBTBButton upButton
           
protected  JMenuItem upMenuItem
           
(package private)  String userID
           
(package private)  Hashtable userProfile
           
(package private)  String VIEWS
           
 String VIEWS_LEVEL
           
(package private)  String WIDTH
           
(package private)  String XPOS
           
(package private)  String YPOS
           
(package private)  JRadioButton zoomRadio
           
 
Fields inherited from class javax.swing.JPanel
defaultLayout, uiClassID
 
Fields inherited from class javax.swing.JComponent
_bounds, accessibleContext, actionMap, ACTIONMAP_CREATED, alignmentX, alignmentY, ANCESTOR_INPUTMAP_CREATED, ANCESTOR_USING_BUFFER, ancestorInputMap, ancestorNotifier, autoscroller, border, changeSupport, clientProperties, CREATED_DOUBLE_BUFFER, flags, FOCUS_INPUTMAP_CREATED, focusInputMap, HAS_FOCUS, htmlKey, htmlView, inputVerifier, IS_DOUBLE_BUFFERED, IS_OPAQUE, IS_PAINTING_TILE, IS_PRINTING, IS_PRINTING_ALL, KEY_EVENTS_ENABLED, KEYBOARD_BINDINGS_KEY, listenerList, maximumSize, minimumSize, NEXT_FOCUS, paintImmediatelyClip, paintingChild, preferredSize, readObjectCallbacks, REQUEST_FOCUS_DISABLED, tmpRect, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, verifyInputWhenFocusTarget, vetoableChangeSupport, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW, WHEN_IN_FOCUSED_WINDOW_BINDINGS, WIF_INPUTMAP_CREATED, windowInputMap
 
Fields inherited from class java.awt.Container
component, containerListener, containerSerializedDataVersion, dbg, dispatcher, layoutMgr, listeningBoundsChildren, listeningChildren, maxSize, ncomponents, needsPaint, printing, printingThreads, serialVersionUID
 
Fields inherited from class java.awt.Component
actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, graphicsConfig, hasFocus, height, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, privateKey, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowClosingException, windowListenerK, x, y
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, PROPERTIES, SOMEBITS
 
Constructor Summary
OperatorInterfacePanel(JFrame frame, String inpUserID)
           
 
Method Summary
 void configureTabbedPanes(Vector toConfigureList)
          Reconfigure the tabbed panes after user changes the views he want configured
protected  Vector createAvailableViews()
          Creates the available view vector from the xml file
protected  JPanel createStatusBarAndZoom()
          Creates the status bar and the zoom radio buttons
protected  JPanel createStatusPanel()
          Creates the statusbar
protected  JTabbedPane createTabbedPanes()
          Creates the tabbed pane
protected  JPanel createZoomPanel()
          Creates the zoom panel
protected  Vector getAvailableViews()
           
protected  Vector getConfiguredViews()
           
 String getCurTab()
           
 String getUser()
           
protected  Hashtable getUserProfile()
           
private  void handleExit()
           
protected  void handleMenuToolBarActions(String actionStr)
          Handles actions for all the menu items and the toolbar buttons
 void handleWindowClose()
          Store user preferences on exit
 void handleWindowOpen()
           
protected  void readUserProfile()
          Reads the user preferences from the user profile file
protected  void saveUserProfile()
          Handles the storing of user preferences to the user profile file.
protected  void setAllOptions(boolean b)
          Enable/Disable all options
 void setCurrentActiveComponent(OperatorPanel newPanel)
          Sets the currently selected tab to hold the new component - used by the bars to set the next component Also updates the stack of components for this tab
private  void setLookAndFeel(String str)
           
protected  void setSortOptions(boolean b)
          Enable/Disable the sort options
private  void setStatus(int statusHint)
          Sets status from the ID depending on the level
protected  void setUp(boolean b)
          Enable/Disable the 'move up' and 'Go top' options
protected  void setUpViewsToConfigure()
          Creates a list of views to configure from the list of configured views the user was using the last time he ran.
protected  void setUserPosDimPreferences()
          Sets the (x,y) and size preferences of the user
 Hashtable translateAvailableViewTitleToView(Object title)
           
 Hashtable translateConfigViewTitleToView(Object title)
           
protected  Hashtable translateViewTitleToView(Vector views, Object title)
           
 
Methods inherited from class javax.swing.JPanel
, getAccessibleContext, getUIClassID, paramString, updateUI, writeObject
 
Methods inherited from class javax.swing.JComponent
_paintImmediately, addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, adjustPaintFlags, alwaysOnTop, checkIfChildObscuredBySibling, clearFocusOwners, componentInputMapChanged, computeVisibleRect, computeVisibleRect, compWriteObjectNotify, contains, createToolTip, disable, enable, enableSerialization, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperties, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getCreatedDoubleBuffer, getDebugGraphicsOptions, getFlag, getGraphics, getHeight, getInputMap, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paintWithBuffer, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyBindings, processKeyBindingsForAllComponents, processKeyEvent, processMouseMotionEvent, putClientProperty, readObject, rectangleIsObscured, rectangleIsObscuredBySibling, registerKeyboardAction, registerKeyboardAction, registerWithKeyboardManager, registerWithKeyboardManager, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setCreatedDoubleBuffer, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFlag, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPaintingChild, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, shouldDebugGraphics, superProcessMouseMotionEvent, unregisterKeyboardAction, unregisterWithKeyboardManager, unregisterWithKeyboardManager, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, adjustListeningChildren, applyOrientation, checkGD, countComponents, createChildHierarchyEvents, createHierarchyEvents, deliverEvent, dispatchEventImpl, dispatchEventToSelf, doLayout, eventEnabled, findComponentAt, findComponentAt, findComponentAt, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getLayout, getMouseEventTarget, getWindow, initIDs, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPaint, lightweightPrint, list, list, locate, minimumSize, nextFocus, numListening, paintComponents, paintHeavyweightComponents, postProcessKeyEvent, postsOldMouseEvents, preferredSize, preProcessKeyEvent, printComponents, printHeavyweightComponents, processContainerEvent, processEvent, proxyEnableEvents, proxyRequestFocus, remove, remove, removeAll, removeContainerListener, setFocusOwner, setLayout, transferFocus, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, areInputMethodsEnabled, bounds, checkImage, checkImage, checkWindowClosingException, coalesceEvents, constructComponentName, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getAccessibleIndexInParent, getAccessibleStateSet, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getToolkit, getToolkitImpl, getTreeLock, getWindowForObject, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isEnabledImpl, isLightweight, isRecursivelyVisible, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resetGC, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

bParseException

boolean bParseException

opTabbedPane

protected JTabbedPane opTabbedPane

upMenuItem

protected JMenuItem upMenuItem

topLevelMenuItem

protected JMenuItem topLevelMenuItem

nameSortMenuItem

protected JMenuItem nameSortMenuItem

severityMenuItem

protected JMenuItem severityMenuItem

alertMenuItem

protected JMenuItem alertMenuItem

configureMenuItem

protected JMenuItem configureMenuItem

upButton

protected BBTBButton upButton

topLevelButton

protected BBTBButton topLevelButton

nameSortButton

protected BBTBButton nameSortButton

severityButton

protected BBTBButton severityButton

alertButton

protected BBTBButton alertButton

configureButton

protected BBTBButton configureButton

navigationLabel

protected JLabel navigationLabel

zoomRadio

JRadioButton zoomRadio

persRadio

JRadioButton persRadio

STATUS_DOWN

final int STATUS_DOWN

STATUS_UP

final int STATUS_UP

STATUS_CHANGE

final int STATUS_CHANGE

prevPanel

protected Hashtable prevPanel

curPanel

protected OperatorPanel curPanel

curTab

protected StringBuffer curTab

VIEWS_LEVEL

public final String VIEWS_LEVEL

CATEGORY_LEVEL

public final String CATEGORY_LEVEL

EVENTS_LEVEL

public final String EVENTS_LEVEL

availableViewsVector

protected Vector availableViewsVector

configViewsVector

protected Vector configViewsVector

userProfile

Hashtable userProfile

userID

String userID

XPOS

final String XPOS

YPOS

final String YPOS

WIDTH

final String WIDTH

HEIGHT

final String HEIGHT

TAB_PLACE

final String TAB_PLACE

LOOKNFEEL

final String LOOKNFEEL

VIEWS

final String VIEWS

LABEL

final String LABEL

ENAME

final String ENAME

EDESCR

final String EDESCR

bLandFAtStartUp

boolean bLandFAtStartUp

bLookAndFeelChanged

boolean bLookAndFeelChanged

opFrame

protected JFrame opFrame
Constructor Detail

OperatorInterfacePanel

public OperatorInterfacePanel(JFrame frame,
                              String inpUserID)
Method Detail

handleWindowOpen

public void handleWindowOpen()

handleWindowClose

public void handleWindowClose()
Store user preferences on exit

createStatusBarAndZoom

protected JPanel createStatusBarAndZoom()
Creates the status bar and the zoom radio buttons

createStatusPanel

protected JPanel createStatusPanel()
Creates the statusbar

createZoomPanel

protected JPanel createZoomPanel()
Creates the zoom panel

setStatus

private void setStatus(int statusHint)
Sets status from the ID depending on the level

handleMenuToolBarActions

protected void handleMenuToolBarActions(String actionStr)
Handles actions for all the menu items and the toolbar buttons

setLookAndFeel

private void setLookAndFeel(String str)

handleExit

private void handleExit()

saveUserProfile

protected void saveUserProfile()
Handles the storing of user preferences to the user profile 
 file. If the write into the profile file fails, the step is retried 
 thrice as a minimum mechanism to offset the possiblity of a different
 application currently writing into the profile

readUserProfile

protected void readUserProfile()
Reads the user preferences from the user profile file

setUserPosDimPreferences

protected void setUserPosDimPreferences()
Sets the (x,y) and size preferences of the user

createTabbedPanes

protected JTabbedPane createTabbedPanes()
Creates the tabbed pane

setUpViewsToConfigure

protected void setUpViewsToConfigure()
Creates a list of views to configure from the list of  
 configured views the user was using the last time he ran.
 The list is checked against the available views to check the view
 is still available to the user

 If the last used list is unavailable, all available views are 
 configured

createAvailableViews

protected Vector createAvailableViews()
Creates the available view vector from the xml file

getCurTab

public String getCurTab()

setCurrentActiveComponent

public void setCurrentActiveComponent(OperatorPanel newPanel)
Sets the currently selected tab to hold the new component - used by the bars to set the next component Also updates the stack of components for this tab

configureTabbedPanes

public void configureTabbedPanes(Vector toConfigureList)
Reconfigure the tabbed panes after user changes the views he want configured

setUp

protected void setUp(boolean b)
Enable/Disable the 'move up' and 'Go top' options

setSortOptions

protected void setSortOptions(boolean b)
Enable/Disable the sort options

setAllOptions

protected void setAllOptions(boolean b)
Enable/Disable all options

translateAvailableViewTitleToView

public Hashtable translateAvailableViewTitleToView(Object title)

translateConfigViewTitleToView

public Hashtable translateConfigViewTitleToView(Object title)

translateViewTitleToView

protected Hashtable translateViewTitleToView(Vector views,
                                             Object title)

getAvailableViews

protected Vector getAvailableViews()

getConfiguredViews

protected Vector getConfiguredViews()

getUserProfile

protected Hashtable getUserProfile()

getUser

public String getUser()