|
"WEBNMS_5 API Docs" | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.adventnet.nms.startclient.AbstractBaseNmsPanel
public abstract class AbstractBaseNmsPanel
This abstract class implements NmsPanel Interface. This class provides useful default implementation for most of the methods in the NmsPanel interface, which could be used by the implementing classes. It also provides other additional methods to enhance the customizablity mechanism of NmsPanels.
It is advisable to extend this abstract class rather than implementing the NmsPanel interface because of the useful
functionality's and default implementations that it provides to the users. The class by default extends the
javax.swing.JPanel class.
This is a client side class and hence can be used only in the JVM as that
of the client.
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 | |
---|---|
protected java.util.Hashtable |
tree_popup_menus
The variable is used to cache the tree popup menus that are accessed by this panel for faster access. |
protected java.lang.String |
treePopupMenuName
This variable holds the tree popup menu name associated with this panel instance. |
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 | |
---|---|
AbstractBaseNmsPanel()
The default constructor that is called on instantiation. |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
The default implementation of the ActionListener method. |
void |
addNmsPanelEventListener(NmsPanelEventListener arg0)
The method adds NmsPanelEvent Listeners to this panel instance. |
void |
destroy(java.lang.String action)
Stub Implementation of the corresponding method in NmsPanel interface. |
void |
fireNmsPanelEvent(NmsPanelEvent arg0)
This method provides the default implementation for firing NmsPanelEvent to all the Listeners registered with this panel instance. |
java.util.Hashtable |
getCurrentNodeProperties()
This method returns the currently selected tree node properties, to which this panel instance is associated. |
javax.swing.JMenu[] |
getObjectMenus()
The method returns the Object specific (specific to any UI object selected) menus, if any, associated with the panel at the time of this method invocation. |
java.util.Properties |
getPanelCommonProperties()
The method returns the common properties of the Panel, which is set by the init(Properties) method. |
javax.swing.JMenuBar |
getPanelMenuBar()
The method provides the default implementation for the getPanelMenuBar() method present in the NmsPanel interface. |
javax.swing.JMenu |
getTreePopupMenu()
This method provides the Menu that is to be displayed on the tree when any node is right-clicked. |
abstract void |
init(javax.swing.JApplet app)
Abstract declaration of the corresponding method defined in the NmsPanel interface. |
void |
init(java.util.Properties p)
This method is used to pass the common properties defined for the Panel in the Tree.xml or NmsPanels.conf configuration file to this instance. |
boolean |
isInitialized()
The method is used to determine whether the panel instance has completed its initialization job or not. |
java.lang.String |
key()
This method returns the unique identifier associated with this instance of the panel. |
void |
removeNmsPanelEventListener(NmsPanelEventListener arg0)
This method provides the default implementation for deregistering the NmsPanelEventListeners registered with this panel instance. |
boolean |
renameTreeNode(java.lang.String nodeID,
java.lang.String newTreeName)
The method determines whether the tree node associated with this panel instance is allowed to be renamed or not. |
void |
setCurrentNodeProperties(java.util.Hashtable p)
This method will be invoked to pass the attributes of the current tree node selected, to which this panel instance is associated. |
void |
setPanelMenuBar(javax.swing.JMenuBar mb)
This method provides the default implementation of the setPanelMenuBar() method present in the NmsPanel interface. |
abstract void |
setProperties(java.util.Properties prop)
Abstract declaration of the corresponding method defined in the NmsPanel interface. |
void |
start()
Stub Implementation of the corresponding method in NmsPanel interface. |
void |
stop()
Stub Implementation of the corresponding method in NmsPanel interface. |
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, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, 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, setToolTipText, 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 |
---|
protected java.util.Hashtable tree_popup_menus
protected java.lang.String treePopupMenuName
Constructor Detail |
---|
public AbstractBaseNmsPanel()
Method Detail |
---|
public void addNmsPanelEventListener(NmsPanelEventListener arg0)
addNmsPanelEventListener
in interface NmsPanel
arg0
- The NmsPanelEventListener instance that is to be registered with this panel instance.removeNmsPanelEventListener(com.adventnet.nms.util.NmsPanelEventListener)
public void fireNmsPanelEvent(NmsPanelEvent arg0)
fireNmsPanelEvent
in interface NmsPanel
arg0
- The NmsPanelEvent that is to be fired to all the listeners should be passed as parameter. The behaviour
of this method cannot be guranteed if the value is passed as null.NmsPanelEvent
public void removeNmsPanelEventListener(NmsPanelEventListener arg0)
removeNmsPanelEventListener
in interface NmsPanel
arg0
- The NmsPanelEventListener instance that is to be deregistered should be passed as argument.addNmsPanelEventListener(com.adventnet.nms.util.NmsPanelEventListener)
public boolean isInitialized()
This method will be of use for panels which needs to perform some critical intialization task on startup in a seperate Thread (preferably not in the same client intializaiton thread). The user should note that, any delay in initialization will directly affect the client initialization time. The users are advised to use this method with caution.
public javax.swing.JMenuBar getPanelMenuBar()
The method also takes care of resolving the OBJECT-SPECIFIC tag that may be specified in the panel specific menu file. In this case the method getObjectMenus() present in this class should return the corresponding object specific menus to be associated.
Implementation classes can override this method to provide their own implementation for returning the panel specific menus. The method will be invoked as described in the NmsPanel interface.
getPanelMenuBar
in interface NmsPanel
setPanelMenuBar(javax.swing.JMenuBar)
public void setPanelMenuBar(javax.swing.JMenuBar mb)
setPanelMenuBar
in interface NmsPanel
mb
- The Menubar that is constructed from the attribute setting MENU-FILE-NAME will be passed as parameter. The
menu bar will contain no menus if the MENU-FILE-NAME is not specified.getPanelMenuBar()
public void start()
start
in interface NmsPanel
NmsPanel.stop()
public void stop()
stop
in interface NmsPanel
NmsPanel.start()
public void destroy(java.lang.String action)
destroy
in interface NmsPanel
action
- The string argument that will hold the reason for destroying the panel as value.public abstract void setProperties(java.util.Properties prop)
setProperties
in interface NmsPanel
prop
- The Properties object that contains the associated properties of the panel to be passed when the panel
gains the focus.public abstract void init(javax.swing.JApplet app)
init
in interface NmsPanel
NmsMainApplet
public boolean renameTreeNode(java.lang.String nodeID, java.lang.String newTreeName)
The method will be passed the unique id, nodeID, of the tree node being renamed and the new tree name to given for this node. This method could be used to achieve any other functionality while renaming a tree node, like updating the database etc.,.
nodeID
- The unique id of the tree node which is renamed.newTreeName
- The new tree name with which the tree node is to be renamed.
public javax.swing.JMenu getTreePopupMenu()
This method will construct the tree popup menu to be shown from the menu file defined for the tree node attribute named TREE-POPUP-MENU specified in the configuration file Tree.xml. The menu file specified should be present in the [WebNMSHome]/users/[username] directory or the [WebNMSHome]/html/defaultsToAllUser directory (it will be searched in the given order).
If a tree popup menu should not be shown, then the implementing class should either not specify the attribute TREE-POPUP-MENU or override this method and return null.
public void setCurrentNodeProperties(java.util.Hashtable p)
This method can be of much use if the same panel instance is associated with more than one tree node (similar to custom views). In this scenario this method could be used to receive the currently selected tree node properties and use them for any behaviourial changes in the panel. For example, in the case of custom views the same panel instance is associated for each of the custom view created of the same type, namely Events, Alarms etc.,. In this case, the current node properties set by this method is used to modify the properties of the panel shown according the custom view selected currently.
Any implementation class can access the current node properties using the method getCurrentNodeProperties() present in this class. It should also be noted that this method will be invoked only for the panels that are associated with a client tree node.
p
- The attributes of the current tree node selected, to which this panel instance is associated, will be
passed in the Hashtable.getCurrentNodeProperties()
public java.util.Hashtable getCurrentNodeProperties()
If the common properties of a NmsPanel is defined in the configuration file NmsPanels.conf and if the same panel instance is associated to a client tree node defined in Tree.xml, then this method will return a combined Hashtable object which will contain the union of both the common properties and the tree node properties associated with this panel instance.
setCurrentNodeProperties(java.util.Hashtable)
public java.lang.String key()
Panels that need to just have one instance should override this method and return a unique identifier which will distinguish the instance among all the NmsPanel instances present in the client.
key
in interface NmsPanel
public void init(java.util.Properties p)
The common attributes will taken as the one defined in the NmsPanels.conf if the panel class has an entry in it. If there is entry only in Tree.xml then the attributes associated with the corresponding tree node will be taken as the common set. If the panel entry is defined in both the files, the setting present in NmsPanels.conf will taken as the common properties set.
This method will be invoked just after instantiation of this class after the invocation of the method init(Applet) defined in the NmsPanel interface. This method will be invoked only for the classes that extend AbstractBaseNmPanel.
p
- This argument will contain the common properties of the panel associated with either the Tree.xml or
NmsPanels.conf configuration files.getPanelCommonProperties()
public final java.util.Properties getPanelCommonProperties()
public javax.swing.JMenu[] getObjectMenus()
By default the object specific menus will be inserted in the menu bar, if the tag OBJECT-SPECIFIC is present in the panel specific menu file of this panel. Whenever this panel receives the focus, the getPanelMenuBar() method will be called to retreive the panel-specific and Object specific menus (if specified by OBJECT-SPECIFIC tag) and these menus will be inserted in the main Menu bar. To resolve the Object specific menus the getPanelMenuBar() method will in-turn call this method and construct the menubar to be returned. This is the default implementation provided by this class.
getPanelMenuBar()
public void actionPerformed(java.awt.event.ActionEvent e)
* 'Back' and 'Forward' navigation tool bar actions. * 'Close' and 'Close All' internal frame actions. * 'Detach' of internal frames. * 'Cascade' and 'Tile' actions of internal frames. * 'Show Tool bar' action.
actionPerformed
in interface java.awt.event.ActionListener
|
"WEBNMS_5 API Docs" | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |