com.adventnet.snmp.ui
Class MibTree

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.adventnet.snmp.ui.MibTree
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.ItemListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class MibTree
extends javax.swing.JPanel
implements java.awt.event.ItemListener, java.awt.event.ActionListener

The MibTree class handles processing for viewing MIB trees in the JFC tree component.

To use the MibTree class, instantiate and supply the MibOperations instance. The MibTree component will map the loaded MIBs for display in the JFC tree.

This MibTree has an public variable tree which is an instance of JFC Tree . Then use this variable tree in MibTree instance just as you would any other JFC tree instance.

See the mibTreeDemo application example in the uiapplications directory.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
(package private)  java.applet.Applet applet
           
(package private)  javax.swing.JButton collapse
           
(package private)  java.lang.String currentMib
           
(package private)  NodeData data
           
(package private)  javax.swing.JButton expand
           
(package private)  java.awt.Font f
           
(package private)  boolean isGlobalView
           
(package private)  java.util.Vector mibNameVector
           
(package private)  MibOperations mibOps
           
 java.lang.String mibs
          Deprecated. . replaced by getMibModules() and addMibs(String) .
(package private)  MibNode mno
           
(package private)  NodeSystemTreeModel model
           
(package private)  MibModule module
           
(package private)  NodeIconRenderer nodeRend
           
(package private)  MibNode root
           
 javax.swing.JTree tree
          Deprecated. replaced by getTree() and setTree(JTree) .
(package private)  javax.swing.JCheckBox viewBox
           
 
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.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
MibTree()
          Creates a MibTree with the module view for the loaded MIB modules.
MibTree(java.applet.Applet applet)
          Use this constructor for applets.
MibTree(MibOperations mibOps)
          Creates a MibTree with the module view for the loaded MIB modules if any in the MibOperations instance passed.
MibTree(MibOperations mibOps, java.applet.Applet applet)
          Use this constructor for applets if URL based MIB loading is needed later.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent ae)
          Implementation for the ActionListener.
(package private)  void addAllChildren(MibModule mib, MibNode node, javax.swing.tree.DefaultMutableTreeNode nodeObj)
           
 void addCustomizedIcon(java.lang.String moduleName, javax.swing.ImageIcon customizedIcon)
          This method can be used when a customized icon needs to be specified for a particular MibModule.
(package private)  javax.swing.tree.DefaultMutableTreeNode addLeafNode(java.lang.Object o, javax.swing.tree.DefaultMutableTreeNode p)
          Add a child to the parent p
 void addMib(java.lang.String mib)
          Load the mib specified .
 void addMibs(java.lang.String mibs)
          Load the mibs specified by white-space separated list of mibs.
(package private)  void addSubTree(MibModule mib, MibNode node, javax.swing.tree.DefaultMutableTreeNode parent)
           
(package private)  javax.swing.tree.DefaultMutableTreeNode addTreeNode(java.lang.Object o, javax.swing.tree.DefaultMutableTreeNode p)
          Add a child to the parent p
 void addTreeSelectionListener(javax.swing.event.TreeSelectionListener tsl)
          Adds the specified listener tsl that will be notified for TreeSelection events.
 void deleteMib(java.lang.String mib)
          Delete the specified mib module from the MibTree and unload it.
(package private)  java.lang.Object getChildObject(java.lang.Object[] path, java.lang.Object o, int index)
          Need this method since using MIB nodes to build path fails
 java.lang.String getMibModule()
          Get the loaded MIB module.
 java.lang.String getMibModules()
          Returns all MIB modules loaded.
 boolean getOverwriteCMI()
          Gets the overwrite compiled mibs boolean.
 java.awt.Dimension getPreferredSize()
          This method returns the preferred display size of a MibTree.
 int getRowHeight()
          Returns the height of each row.
 MibModule getSelectedMibModule()
          Get the currently selected MIB module.
 MibModule[] getSelectedMibModules()
          Get the currently selected MIB modules.
 MibNode getSelectedMibNode()
          Get the currently selected MIB node
 java.lang.String getSerializedMibFileName()
          Returns the name of the Serialized Mib file.
 boolean getShowsRootHandles()
          Returns true if handles for the root nodes are displayed.
 java.lang.String getToolTipText()
          Overrides JComponent's getToolTipText method in order to allow renderer's tips to be used if it has text set.
 javax.swing.JTree getTree()
          Returns the instance of JTree in the MibTree.
(package private)  void initialization()
           
 void initJdbcParams(java.lang.String driverName, java.lang.String URL, java.lang.String userName, java.lang.String passWord)
          If you need to use database support for mibs, this method should be invoked to initialize the Jdbc Parameters.
 boolean isEditable()
          Returns true if the tree is editable.
 boolean isExpandCollapseEnabled()
          To check if the expand and collapse button is Enabled or Disabled.
 boolean isGlobalView()
          Returns false for module view and true for global view.
 boolean isLargeModel()
          Returns true if the tree is configured for a large model.
 boolean isLoadFromCompiledMibs()
          Gets the loadFromCompiledMibs boolean.
 boolean isLoadFromSerializedMibs()
          Returns the loadFromSerializedMibs boolean.
 boolean isLoadMibsFromDatabase()
          Gets the loadFromDataBase boolean
 boolean isOverwriteMibsInDatabase()
          Gets the overwrite mibs in DataBase boolean.
 boolean isReadDesc()
          Returns true if reading descriptions from compiled modules is enabled.
 boolean isRootVisible()
          Returns true if the root node of the tree is displayed.
 boolean isSerializeMibs()
          Gets the serializeMibs boolean.
 void itemStateChanged(java.awt.event.ItemEvent e)
          Implementation for the ItemListener added to the Global View checkbox.
 void refresh()
          This method can be used to refresh the MibTree after adding (or) removing customized icon for specified MibModule.
 void removeCustomizedIcon(java.lang.String moduleName)
          This method can be used to remove a customized icon specified for a particular MibModule.
 void removeTreeSelectionListener(javax.swing.event.TreeSelectionListener tsl)
          Removes the specified listener tsl that will be notified for the TreeSelection events.
 void setEditable(boolean editable)
          Determines whether the tree is editable.
 void setExpandCollapseEnabled(boolean flag)
          Enable or Disable the expand and collapse button.
 void setGlobalView(boolean view)
          Sets the view of MibTree.
 void setLargeModel(boolean newValue)
          Specifies whether the UI should use a large model.
 void setLoadFromCompiledMibs(boolean flag)
          Defines whether to load mib from compiled MIBs.
 void setLoadFromSerializedMibs(boolean flag)
          Method defines whether to load MIB from serialized file.
 void setLoadMibsFromDatabase(boolean flag)
          Defines whether to load mib from DataBase.
 void setMibModule(java.lang.String mibs)
          Deprecated. replaced by addMibs(String) .
 void setOverwriteCMI(boolean overWrite)
          Defines whether to overwrite the existing compiled MIB files.
 void setOverwriteMibsInDatabase(boolean overWrite)
          Defines whether to overwrite the MIB in the DataBase.
 void setReadDesc(boolean readFlag)
          Sets the flag to read descriptions from compiled mib modules.
 void setRootVisible(boolean rootVisible)
          Determines whether or not the root node is visible.
 void setRowHeight(int rowHeight)
          Sets the height of each cell.
 void setSelectedMibNode(MibNode node)
          used to hold the current node value for selected Node in Tree
 void setSerializedMibFileName(java.lang.String serFileName)
          Method defines the name of the Serialized MIB File.
 void setSerializeMibs(boolean flag)
          Defines whether to serialize the MibModule.
 void setShowsRootHandles(boolean newValue)
          Determines whether the node handles are to be displayed.
 void setToolTipText(java.lang.String tipText)
          Sets the ToolTip text.
 void setTree(javax.swing.JTree tree)
          Set the JTree instance in the MibTree.
(package private)  void update()
           
(package private)  void updateMibTree()
           
(package private)  void updateMibTree(MibModule mib)
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, 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, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, 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, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

tree

public javax.swing.JTree tree
Deprecated. replaced by getTree() and setTree(JTree) .
This variable is an instance of JTree. The loaded mibs will be displayed in this tree.

See Also:
getTree(), setTree(javax.swing.JTree)

mno

MibNode mno

expand

javax.swing.JButton expand

collapse

javax.swing.JButton collapse

currentMib

java.lang.String currentMib

isGlobalView

boolean isGlobalView

viewBox

javax.swing.JCheckBox viewBox

mibOps

MibOperations mibOps

applet

java.applet.Applet applet

mibs

public java.lang.String mibs
Deprecated. . replaced by getMibModules() and addMibs(String) .
Loaded list of Mibs seperated by a white space.

See Also:
getMibModules(), addMibs(java.lang.String)

module

MibModule module

model

NodeSystemTreeModel model

nodeRend

NodeIconRenderer nodeRend

data

NodeData data

root

MibNode root

f

java.awt.Font f

mibNameVector

java.util.Vector mibNameVector
Constructor Detail

MibTree

public MibTree()
Creates a MibTree with the module view for the loaded MIB modules. A CheckBox for global view is provided. By default, it is disabled.

See Also:
MibTree(MibOperations mibOps,Applet applet)

MibTree

public MibTree(java.applet.Applet applet)
Use this constructor for applets. Creates a MibTree with the module view for the loaded MIB modules.A CheckBox for global view is provided. By default, it is disabled.

Parameters:
applet - an Applet
See Also:
MibTree(MibOperations mibOps,Applet applet)

MibTree

public MibTree(MibOperations mibOps)
Creates a MibTree with the module view for the loaded MIB modules if any in the MibOperations instance passed. A CheckBox for global view is provided. By default, it is disabled.

Parameters:
mibOps - MibOperations
See Also:
MibTree(MibOperations mibOps,Applet applet)

MibTree

public MibTree(MibOperations mibOps,
               java.applet.Applet applet)
Use this constructor for applets if URL based MIB loading is needed later. Creates a MibTree with the module view for the loaded MIB modules.A CheckBox for global view is provided. By default, it is disabled.

Parameters:
mibOps - MibOperations
applet - an Applet
Method Detail

getTree

public javax.swing.JTree getTree()
Returns the instance of JTree in the MibTree. The loaded mibs will be displayed in this tree.

Returns:
Returns an instance of JTree.

setTree

public void setTree(javax.swing.JTree tree)
Set the JTree instance in the MibTree. The loaded mibs will be displayed in this tree.

Parameters:
tree - instance of JTree.

isGlobalView

public boolean isGlobalView()
Returns false for module view and true for global view.

Returns:
true if the GlobalView checkbox is selected and false if the Global View check box is unselected.

setGlobalView

public void setGlobalView(boolean view)
Sets the view of MibTree.

Parameters:
view - true if the GlobalView mode is selected

getPreferredSize

public java.awt.Dimension getPreferredSize()
This method returns the preferred display size of a MibTree.

Overrides:
getPreferredSize in class javax.swing.JComponent
Returns:
the preferred display size of a MibTree.

addMibs

public void addMibs(java.lang.String mibs)
             throws MibException,
                    java.io.IOException,
                    java.io.FileNotFoundException
Load the mibs specified by white-space separated list of mibs. If applet parameter was specified in constructor, then URLs will be used. Completely updates tree.

Parameters:
mibs - Mibs specified by white-space separated list of mibs.
Throws:
MibException - is thrown upon parse errors.
java.io.IOException - is thrown upon IO errors.
java.io.FileNotFoundException - is thrown if the file is not found.

addMib

public void addMib(java.lang.String mib)
            throws MibException,
                   java.io.IOException,
                   java.io.FileNotFoundException
Load the mib specified . If applet parameter was specified in constructor, then URLs will be used.

Parameters:
mib - MibName.
Throws:
MibException - is thrown upon parse errors.
java.io.IOException - is thrown upon IO errors.
java.io.FileNotFoundException - is thrown if the file is not found.

deleteMib

public void deleteMib(java.lang.String mib)
               throws MibException,
                      java.io.IOException,
                      java.io.FileNotFoundException
Delete the specified mib module from the MibTree and unload it. The string given should be the module name of the mib to be unloaded.

Parameters:
mib - Mib Module Name to be unloaded.
Throws:
MibException - is thrown upon errors.
java.io.IOException - is thrown upon IO errors.
java.io.FileNotFoundException - is thrown if the file is not found.

getSelectedMibModule

public MibModule getSelectedMibModule()
Get the currently selected MIB module.

Returns:
the instance of MibModule; If multiple modules are selected in the MibTree, it returns the first selected module.

getSelectedMibModules

public MibModule[] getSelectedMibModules()
Get the currently selected MIB modules.

Returns:
an instance of an array of MibModules if multiple MibModules are selected in the MibTree.

getSelectedMibNode

public MibNode getSelectedMibNode()
Get the currently selected MIB node

Returns:
the instance of MibNode

updateMibTree

void updateMibTree()

updateMibTree

void updateMibTree(MibModule mib)

addAllChildren

void addAllChildren(MibModule mib,
                    MibNode node,
                    javax.swing.tree.DefaultMutableTreeNode nodeObj)

addSubTree

void addSubTree(MibModule mib,
                MibNode node,
                javax.swing.tree.DefaultMutableTreeNode parent)

addTreeNode

javax.swing.tree.DefaultMutableTreeNode addTreeNode(java.lang.Object o,
                                                    javax.swing.tree.DefaultMutableTreeNode p)
Add a child to the parent p


addLeafNode

javax.swing.tree.DefaultMutableTreeNode addLeafNode(java.lang.Object o,
                                                    javax.swing.tree.DefaultMutableTreeNode p)
Add a child to the parent p


getMibModules

public java.lang.String getMibModules()
Returns all MIB modules loaded.

Returns:
the list of mibs added to the MibTree each seperated with a white space.

getMibModule

public java.lang.String getMibModule()
Get the loaded MIB module.

Returns:
the last mib added to the MibTree. If the mib added is deleted before calling this method, this method will return null.

setMibModule

public void setMibModule(java.lang.String mibs)
Deprecated. replaced by addMibs(String) .

Set the MIB modules to be added to the MibTree.

See Also:
addMibs(java.lang.String)

initialization

void initialization()

update

void update()

isRootVisible

public boolean isRootVisible()
Returns true if the root node of the tree is displayed.

Returns:
true if the root node of the tree is displayed

setRootVisible

public void setRootVisible(boolean rootVisible)
Determines whether or not the root node is visible.

Parameters:
rootVisible - true if the root node of the tree is to be displayed

getShowsRootHandles

public boolean getShowsRootHandles()
Returns true if handles for the root nodes are displayed.

Returns:
true if root handles are displayed

setShowsRootHandles

public void setShowsRootHandles(boolean newValue)
Determines whether the node handles are to be displayed.

Parameters:
newValue - true if root handles are to be displayed

isLargeModel

public boolean isLargeModel()
Returns true if the tree is configured for a large model.

Returns:
true if a large model is suggested

setLargeModel

public void setLargeModel(boolean newValue)
Specifies whether the UI should use a large model.

Parameters:
newValue - true to suggest a large model to the UI

getRowHeight

public int getRowHeight()
Returns the height of each row. If the returned value is less than or equal to 0 the height for each row is determined by the renderer.

Returns:
the heigth of the each row in pixels.

setRowHeight

public void setRowHeight(int rowHeight)
Sets the height of each cell. If the specified value is less than or equal to zero the current cell renderer is queried for each row's height.

Parameters:
rowHeight - the height of each cell, in pixels

getToolTipText

public java.lang.String getToolTipText()
Overrides JComponent's getToolTipText method in order to allow renderer's tips to be used if it has text set.

Overrides:
getToolTipText in class javax.swing.JComponent
Parameters:
event - the MouseEvent that initiated the ToolTip display

setToolTipText

public void setToolTipText(java.lang.String tipText)
Sets the ToolTip text.

Overrides:
setToolTipText in class javax.swing.JComponent
Parameters:
tipText - ToolTip text

isEditable

public boolean isEditable()
Returns true if the tree is editable.

Returns:
true if the tree is editable.

setEditable

public void setEditable(boolean editable)
Determines whether the tree is editable. Fires a property change event if the new setting is different from the existing setting.

Parameters:
editable - a boolean value, true if the tree is editable

setSelectedMibNode

public void setSelectedMibNode(MibNode node)
used to hold the current node value for selected Node in Tree

Parameters:
node - the MibNode to be selected in the MibTree.

getChildObject

java.lang.Object getChildObject(java.lang.Object[] path,
                                java.lang.Object o,
                                int index)
Need this method since using MIB nodes to build path fails


actionPerformed

public void actionPerformed(java.awt.event.ActionEvent ae)
Implementation for the ActionListener.

Specified by:
actionPerformed in interface java.awt.event.ActionListener

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
Implementation for the ItemListener added to the Global View checkbox. This method will be called when the state of the Global View checkbox was changed.

Specified by:
itemStateChanged in interface java.awt.event.ItemListener

setSerializeMibs

public void setSerializeMibs(boolean flag)
Defines whether to serialize the MibModule. This flag should be set before loading the MIBs. If this is set to true it will serialize the loaded MIBs. For ex: if RMON2-MIB is loaded, it will serialize this module along with the Imported Modules viz ., RFC1271-MIB,RFC1213-MIB,TOKEN-RING-RMON and saves it in a single file.The name of the serialized file can be set using the setSerializedMibFileName() method. In case,if serialized file name is not set,it will save the serialized file with the MIB file name along with ".ser" extention.Here, it will save it as RMON2-MIB.ser. Serialization is not supported in applets.

Parameters:
flag - boolean whether to serailize mibs or not.

isSerializeMibs

public boolean isSerializeMibs()
Gets the serializeMibs boolean.

Returns:
boolean value of the serialization of the Mibs.

setLoadFromSerializedMibs

public void setLoadFromSerializedMibs(boolean flag)
Method defines whether to load MIB from serialized file. This flag should be set before loading the MIBs. If both serializeMibs and loadFromSerializedMibs is set to true, it will just try to load the MIB as a serialized file.

Parameters:
flag - boolean whether to load and serialize the mibs.

setLoadFromCompiledMibs

public void setLoadFromCompiledMibs(boolean flag)
Defines whether to load mib from compiled MIBs. This flag should be set before loading the MIBs (By default it is set to false). If this flag is set to true, it will load from compiled file( i.e; .cmi and .cds files). For ex: RMON2-MIB is loaded, it will automatically load RMON2-MIB.cmi if it exists. otherwise it creates compiled files by parsing and then loads from it. If this flag is set to false, the mib is loaded without creating .cmi and .cds files. This is recommended in case of applets where you have security restrictions for file creation. This is slightly slower than loading from precompiled mibs. In Applets, precompiled mibs can be loaded but it cannot create/write compiled files.

If both loadFromSerializedMibs and loadFromCompiledMibs is set to true, it will just try to load the MIB as a serialized file.

Parameters:
flag - boolean whether to load from Compiled Mibs.

setOverwriteCMI

public void setOverwriteCMI(boolean overWrite)
Defines whether to overwrite the existing compiled MIB files. NOTE: This applies only when the setLoadFromCompiledMibs is set to true.

Parameters:
overWrite - boolean whether to overwrite the .cmi and .cds files.

getOverwriteCMI

public boolean getOverwriteCMI()
Gets the overwrite compiled mibs boolean. NOTE: This applies only when the setLoadFromCompiledMibs is set to true.

Returns:
overwrite compiled mibs boolean.

setReadDesc

public void setReadDesc(boolean readFlag)
Sets the flag to read descriptions from compiled mib modules. Default is true. Set it to false if you don't need the descriptions. NOTE: This applies only when the setLoadFromCompiledMibs is set to true.

Parameters:
readFlag - boolean whether to load .cds files.

isReadDesc

public boolean isReadDesc()
Returns true if reading descriptions from compiled modules is enabled. Default is true.

Returns:
read description boolean.

isLoadFromSerializedMibs

public boolean isLoadFromSerializedMibs()
Returns the loadFromSerializedMibs boolean. Default is true.

Returns:
serialize mibs boolean.

isLoadFromCompiledMibs

public boolean isLoadFromCompiledMibs()
Gets the loadFromCompiledMibs boolean. Default is false.

Returns:
load from compiled mibs boolean.

setSerializedMibFileName

public void setSerializedMibFileName(java.lang.String serFileName)
Method defines the name of the Serialized MIB File. The Serialized file will be saved with this filename in the directory from which the mib is loaded.

Parameters:
serFileName - name of the Serialized MIB File.

getSerializedMibFileName

public java.lang.String getSerializedMibFileName()
Returns the name of the Serialized Mib file.

Returns:
the name of the Serialized Mib file.

addTreeSelectionListener

public void addTreeSelectionListener(javax.swing.event.TreeSelectionListener tsl)
Adds the specified listener tsl that will be notified for TreeSelection events.

Parameters:
tsl - the TreeSelectionListener that will be notified when a node is selected or deselected (a "negative selection")

removeTreeSelectionListener

public void removeTreeSelectionListener(javax.swing.event.TreeSelectionListener tsl)
Removes the specified listener tsl that will be notified for the TreeSelection events.

Parameters:
tsl - the TreeSelectionListener to be removed.

initJdbcParams

public void initJdbcParams(java.lang.String driverName,
                           java.lang.String URL,
                           java.lang.String userName,
                           java.lang.String passWord)
                    throws MibException
If you need to use database support for mibs, this method should be invoked to initialize the Jdbc Parameters.

Parameters:
driverName - Name of the DataBase driver.
URL - URL pointing to the DataBase file name
userName - userName
passWord - password
Throws:
MibException

setLoadMibsFromDatabase

public void setLoadMibsFromDatabase(boolean flag)
Defines whether to load mib from DataBase. The Jdbc Parameters should be set using the initJDbcParams method. This flag should be set before loading the MIBs (By default it is set to false). If this flag is set to true, it will parse the mibs,and store it in the database. For ex: RMON2-MIB is loaded, it will parse the mib and store it in the database.

Parameters:
flag - boolean
See Also:
initJdbcParams(java.lang.String, java.lang.String, java.lang.String, java.lang.String)

setOverwriteMibsInDatabase

public void setOverwriteMibsInDatabase(boolean overWrite)
Defines whether to overwrite the MIB in the DataBase. NOTE: This applies only when the setLoadFromDataBase is set to true.


isOverwriteMibsInDatabase

public boolean isOverwriteMibsInDatabase()
Gets the overwrite mibs in DataBase boolean. NOTE: This applies only when the setLoadFromDataBase is set to true.


isLoadMibsFromDatabase

public boolean isLoadMibsFromDatabase()
Gets the loadFromDataBase boolean


setExpandCollapseEnabled

public void setExpandCollapseEnabled(boolean flag)
Enable or Disable the expand and collapse button.


isExpandCollapseEnabled

public boolean isExpandCollapseEnabled()
To check if the expand and collapse button is Enabled or Disabled.


addCustomizedIcon

public void addCustomizedIcon(java.lang.String moduleName,
                              javax.swing.ImageIcon customizedIcon)
This method can be used when a customized icon needs to be specified for a particular MibModule.

Parameters:
moduleName - The MibModuleName for which the icon needs to be customized.
customizedIcon - The customized icon which needs to be displayed in the UI corresponding to the MibModuleName. Note : After invoking this method, refresh() method of this class should be called to update the MibTree.

removeCustomizedIcon

public void removeCustomizedIcon(java.lang.String moduleName)
This method can be used to remove a customized icon specified for a particular MibModule.

Parameters:
moduleName - The MibModuleName for which the customized icon needs to be removed. Note : After invoking this method, refresh() method of this class should be called to update the MibTree.

refresh

public void refresh()
This method can be used to refresh the MibTree after adding (or) removing customized icon for specified MibModule.