org.opennms.bb.eui.admin.snmp.panels
Class SnmpConfigPanel

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--org.opennms.bb.eui.admin.snmp.panels.SnmpConfigPanel
All Implemented Interfaces:
Accessible, ActionListener, EventListener, ImageObserver, ListSelectionListener, MenuContainer, Serializable, TableColumnModelListener, TableModelListener

public class SnmpConfigPanel
extends JPanel
implements ActionListener, ListSelectionListener, TableColumnModelListener, TableModelListener

SnmpConfigPanel is the core panel for the 'SnmpConfig'

This creates the tabbedpanes, the menu, toolbar to operate on the tables of these tabbed panes

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
(package private)  BBTabbedPaneTBButton addButton
           
(package private)  BBTabbedPaneMenuItem addMenuItem
           
(package private)  boolean bLandFAtStartUp
           
(package private)  boolean bParseException
           
private  Vector clipBoardVector
           
(package private)  BBTabbedPaneTBButton copyButton
           
(package private)  BBTabbedPaneMenuItem copyMenuItem
           
(package private)  int DEF_MANIP_PANEL
          The 'Default' tab
(package private)  BBTabbedPaneTBButton deleteButton
           
(package private)  BBTabbedPaneMenuItem deleteMenuItem
           
(package private)  DefaultManipPanel dPanel
           
(package private)  String HEIGHT
           
private  int iCopyPanel
           
private  int iCurrentActivePanel
           
private  int iLastActivePanel
           
(package private)  int IPR_MANIP_PANEL
          The 'Ranges' tab
private  TableColumnModel iprColM
           
(package private)  IPRangesManipPanel iprPanel
           
private  ListSelectionModel iprRowSM
           
(package private)  String LOOKNFEEL
           
(package private)  BBTabbedPaneTBButton pasteButton
           
(package private)  BBTabbedPaneMenuItem pasteMenuItem
           
(package private)  int SD_MANIP_PANEL
          The 'Specific Devices' tab
private  TableColumnModel sdColM
           
(package private)  SpecificDevicesManipPanel sdPanel
           
private  ListSelectionModel sdRowSM
           
(package private)  JFrame snmpFrame
           
(package private)  BBTabbedPane snmpTabbedPane
           
(package private)  JLabel statusLabel
           
(package private)  String tabPaneID
           
(package private)  int UC_MANIP_PANEL
          The 'URL' tab
private  TableColumnModel ucColM
           
(package private)  UrlConfigManipPanel ucPanel
           
private  ListSelectionModel ucRowSM
           
(package private)  String userID
           
(package private)  Hashtable userProfile
           
(package private)  String WIDTH
           
(package private)  String XPOS
           
(package private)  String YPOS
           
 
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
SnmpConfigPanel(JFrame frame, String userID)
           
 
Method Summary
 void actionPerformed(ActionEvent e)
          Handles actions for all the menu items and the toolbar buttons
 void columnAdded(TableColumnModelEvent e)
           
 void columnMarginChanged(ChangeEvent e)
           
 void columnMoved(TableColumnModelEvent e)
           
 void columnRemoved(TableColumnModelEvent e)
           
 void columnSelectionChanged(ListSelectionEvent e)
          Table(s) column selection listener to set status
protected  BBTabbedPane createBBTabbedPanes()
          Creates the tabbed pane by reading data from the xml file
protected  void createDefaultPanel(SnmpXmlParser parser)
          Creates the 'Default' panel
protected  JMenuBar createMenu()
          Creates the menubar
protected  void createRangesPanel(SnmpXmlParser parser)
          Creates the 'Ranges' panel
protected  void createSpecificDevicesPanel(SnmpXmlParser parser)
          Creates the 'Specific Devices' panel
protected  JLabel createStatusBar()
          Creates the statusbar
protected  JToolBar createToolBar()
          Creates the toolbar
protected  void createUrlConfigPanel(SnmpXmlParser parser)
          Creates the 'Url' panel
private  void disableCopyDelete()
           
private  void enableCopyDelete()
           
private  void handleAdd()
           
private  void handleCopy()
           
private  void handleDelete()
           
private  void handleExit()
           
(package private)  void handleMenuToolBarActions(String actionStr)
           
private  void handlePaste()
           
private  void handleSave()
           
 void handleWindowClose()
          Exits only if tabbedpane is clean
 void handleWindowOpen()
          Sets intial focus to first cell of the default panel
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.
private  void setLookAndFeel(String str)
           
private  void setStatus()
           
protected  void setTabTitles(String[] titles)
          Set the tab titles from the array
protected  void setUserPosDimPreferences()
          Sets the (x,y) and size preferences of the user
protected  void SnmpConfigInit(JFrame frame, String userID)
           
 void tableChanged(TableModelEvent e)
          Table(s) model listener to set status and enable/diable 'delete'
protected  boolean validateValuesInTables()
           
 void valueChanged(ListSelectionEvent e)
          Table(s) row selection model listener to enable/disable copy and delete
 
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

snmpFrame

JFrame snmpFrame

bParseException

boolean bParseException

snmpTabbedPane

BBTabbedPane snmpTabbedPane

dPanel

DefaultManipPanel dPanel

iprPanel

IPRangesManipPanel iprPanel

sdPanel

SpecificDevicesManipPanel sdPanel

ucPanel

UrlConfigManipPanel ucPanel

DEF_MANIP_PANEL

final int DEF_MANIP_PANEL
The 'Default' tab

IPR_MANIP_PANEL

final int IPR_MANIP_PANEL
The 'Ranges' tab

SD_MANIP_PANEL

final int SD_MANIP_PANEL
The 'Specific Devices' tab

UC_MANIP_PANEL

final int UC_MANIP_PANEL
The 'URL' tab

tabPaneID

final String tabPaneID

copyMenuItem

BBTabbedPaneMenuItem copyMenuItem

pasteMenuItem

BBTabbedPaneMenuItem pasteMenuItem

addMenuItem

BBTabbedPaneMenuItem addMenuItem

deleteMenuItem

BBTabbedPaneMenuItem deleteMenuItem

copyButton

BBTabbedPaneTBButton copyButton

pasteButton

BBTabbedPaneTBButton pasteButton

addButton

BBTabbedPaneTBButton addButton

deleteButton

BBTabbedPaneTBButton deleteButton

clipBoardVector

private Vector clipBoardVector

iCopyPanel

private int iCopyPanel

iCurrentActivePanel

private int iCurrentActivePanel

iLastActivePanel

private int iLastActivePanel

iprRowSM

private ListSelectionModel iprRowSM

sdRowSM

private ListSelectionModel sdRowSM

ucRowSM

private ListSelectionModel ucRowSM

iprColM

private TableColumnModel iprColM

sdColM

private TableColumnModel sdColM

ucColM

private TableColumnModel ucColM

statusLabel

JLabel statusLabel

userID

String userID

XPOS

final String XPOS

YPOS

final String YPOS

WIDTH

final String WIDTH

HEIGHT

final String HEIGHT

LOOKNFEEL

final String LOOKNFEEL

bLandFAtStartUp

boolean bLandFAtStartUp

userProfile

Hashtable userProfile
Constructor Detail

SnmpConfigPanel

public SnmpConfigPanel(JFrame frame,
                       String userID)
Method Detail

SnmpConfigInit

protected void SnmpConfigInit(JFrame frame,
                              String userID)

handleWindowOpen

public void handleWindowOpen()
Sets intial focus to first cell of the default panel

handleWindowClose

public void handleWindowClose()
Exits only if tabbedpane is clean

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

valueChanged

public void valueChanged(ListSelectionEvent e)
Table(s) row selection model listener to enable/disable copy and delete
Specified by:
valueChanged in interface ListSelectionListener

tableChanged

public void tableChanged(TableModelEvent e)
Table(s) model listener to set status and enable/diable 'delete'
Specified by:
tableChanged in interface TableModelListener

columnSelectionChanged

public void columnSelectionChanged(ListSelectionEvent e)
Table(s) column selection listener to set status
Specified by:
columnSelectionChanged in interface TableColumnModelListener

columnAdded

public void columnAdded(TableColumnModelEvent e)
Specified by:
columnAdded in interface TableColumnModelListener

columnMoved

public void columnMoved(TableColumnModelEvent e)
Specified by:
columnMoved in interface TableColumnModelListener

columnRemoved

public void columnRemoved(TableColumnModelEvent e)
Specified by:
columnRemoved in interface TableColumnModelListener

columnMarginChanged

public void columnMarginChanged(ChangeEvent e)
Specified by:
columnMarginChanged in interface TableColumnModelListener

setStatus

private void setStatus()

disableCopyDelete

private void disableCopyDelete()

enableCopyDelete

private void enableCopyDelete()

setTabTitles

protected void setTabTitles(String[] titles)
Set the tab titles from the array

createMenu

protected JMenuBar createMenu()
Creates the menubar

createToolBar

protected JToolBar createToolBar()
Creates the toolbar

createStatusBar

protected JLabel createStatusBar()
Creates the statusbar

actionPerformed

public void actionPerformed(ActionEvent e)
Handles actions for all the menu items and the toolbar buttons
Specified by:
actionPerformed in interface ActionListener

handleMenuToolBarActions

void handleMenuToolBarActions(String actionStr)

setLookAndFeel

private void setLookAndFeel(String str)

handleCopy

private void handleCopy()

handleDelete

private void handleDelete()

handlePaste

private void handlePaste()

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

handleAdd

private void handleAdd()

handleSave

private void handleSave()

validateValuesInTables

protected boolean validateValuesInTables()

createBBTabbedPanes

protected BBTabbedPane createBBTabbedPanes()
Creates the tabbed pane by reading data from the xml file

createDefaultPanel

protected void createDefaultPanel(SnmpXmlParser parser)
Creates the 'Default' panel

createRangesPanel

protected void createRangesPanel(SnmpXmlParser parser)
Creates the 'Ranges' panel

createSpecificDevicesPanel

protected void createSpecificDevicesPanel(SnmpXmlParser parser)
Creates the 'Specific Devices' panel

createUrlConfigPanel

protected void createUrlConfigPanel(SnmpXmlParser parser)
Creates the 'Url' panel