|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPanel | +--com.adventnet.snmp.ui.MibTree
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.
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 | |
java.lang.String |
mibs
Deprecated. . replaced by getMibModules()
and addMibs(String) . |
javax.swing.JTree |
tree
Deprecated. replaced by getTree()
and setTree(JTree) . |
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. |
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. |
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. |
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. |
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. |
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. |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, 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, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, 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, removePropertyChangeListener, removePropertyChangeListener, 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, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, 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, 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, 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 |
public javax.swing.JTree tree
getTree()
and setTree(JTree)
.
getTree()
,
setTree(javax.swing.JTree)
public java.lang.String mibs
getMibModules()
and addMibs(String)
.
getMibModules()
,
addMibs(java.lang.String)
Constructor Detail |
public MibTree()
MibTree(MibOperations mibOps,Applet applet)
public MibTree(java.applet.Applet applet)
applet
- an AppletMibTree(MibOperations mibOps,Applet applet)
public MibTree(MibOperations mibOps)
mibOps
- MibOperationsMibTree(MibOperations mibOps,Applet applet)
public MibTree(MibOperations mibOps, java.applet.Applet applet)
mibOps
- MibOperationsapplet
- an AppletMethod Detail |
public javax.swing.JTree getTree()
public void setTree(javax.swing.JTree tree)
tree
- instance of JTree.public boolean isGlobalView()
public void setGlobalView(boolean view)
view
- true if the GlobalView mode is selectedpublic java.awt.Dimension getPreferredSize()
getPreferredSize
in class javax.swing.JComponent
public void addMibs(java.lang.String mibs) throws MibException, java.io.IOException, java.io.FileNotFoundException
mibs
- Mibs specified by white-space separated list of mibs.
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.public void addMib(java.lang.String mib) throws MibException, java.io.IOException, java.io.FileNotFoundException
mib
- MibName.
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.public void deleteMib(java.lang.String mib) throws MibException, java.io.IOException, java.io.FileNotFoundException
mib
- Mib Module Name to be unloaded.
MibException
- is thrown upon errors.
java.io.IOException
- is thrown upon IO errors.
java.io.FileNotFoundException
- is thrown if the file is not found.public MibModule getSelectedMibModule()
public MibModule[] getSelectedMibModules()
public MibNode getSelectedMibNode()
public java.lang.String getMibModules()
public java.lang.String getMibModule()
public void setMibModule(java.lang.String mibs)
addMibs(String)
.
addMibs(java.lang.String)
public boolean isRootVisible()
public void setRootVisible(boolean rootVisible)
rootVisible
- true if the root node of the tree is to be displayedpublic boolean getShowsRootHandles()
public void setShowsRootHandles(boolean newValue)
newValue
- true if root handles are to be displayedpublic boolean isLargeModel()
public void setLargeModel(boolean newValue)
newValue
- true to suggest a large model to the UIpublic int getRowHeight()
public void setRowHeight(int rowHeight)
rowHeight
- the height of each cell, in pixelspublic java.lang.String getToolTipText()
getToolTipText
in class javax.swing.JComponent
public void setToolTipText(java.lang.String tipText)
setToolTipText
in class javax.swing.JComponent
tipText
- ToolTip textpublic boolean isEditable()
public void setEditable(boolean editable)
editable
- a boolean value, true if the tree is editablepublic void setSelectedMibNode(MibNode node)
node
- the MibNode to be selected in the MibTree.public void actionPerformed(java.awt.event.ActionEvent ae)
actionPerformed
in interface java.awt.event.ActionListener
public void itemStateChanged(java.awt.event.ItemEvent e)
itemStateChanged
in interface java.awt.event.ItemListener
public void setSerializeMibs(boolean flag)
flag
- boolean whether to serailize mibs or not.public boolean isSerializeMibs()
public void setLoadFromSerializedMibs(boolean flag)
flag
- boolean whether to load and serialize the mibs.public void setLoadFromCompiledMibs(boolean flag)
If both loadFromSerializedMibs and loadFromCompiledMibs is set to true, it will just try to load the MIB as a serialized file.
flag
- boolean whether to load from Compiled Mibs.public void setOverwriteCMI(boolean overWrite)
overWrite
- boolean whether to overwrite the .cmi and .cds files.public boolean getOverwriteCMI()
public void setReadDesc(boolean readFlag)
readFlag
- boolean whether to load .cds files.public boolean isReadDesc()
public boolean isLoadFromSerializedMibs()
public boolean isLoadFromCompiledMibs()
public void setSerializedMibFileName(java.lang.String serFileName)
serFileName
- name of the Serialized MIB File.public java.lang.String getSerializedMibFileName()
public void addTreeSelectionListener(javax.swing.event.TreeSelectionListener tsl)
tsl
- the TreeSelectionListener that will be notified when
a node is selected or deselected (a "negative
selection")public void removeTreeSelectionListener(javax.swing.event.TreeSelectionListener tsl)
tsl
- the TreeSelectionListener to be removed.public void initJdbcParams(java.lang.String driverName, java.lang.String URL, java.lang.String userName, java.lang.String passWord) throws MibException
driverName
- Name of the DataBase driver.URL
- URL pointing to the DataBase file nameuserName
- userNamepassWord
- password
MibException
public void setLoadMibsFromDatabase(boolean flag)
flag
- booleaninitJdbcParams(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
public void setOverwriteMibsInDatabase(boolean overWrite)
public boolean isOverwriteMibsInDatabase()
public boolean isLoadMibsFromDatabase()
public void setExpandCollapseEnabled(boolean flag)
public boolean isExpandCollapseEnabled()
public void addCustomizedIcon(java.lang.String moduleName, javax.swing.ImageIcon customizedIcon)
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.public void removeCustomizedIcon(java.lang.String moduleName)
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.public void refresh()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |