com.adventnet.snmp.ui
Class GraphWrapper

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--com.adventnet.snmp.ui.GraphWrapper
Direct Known Subclasses:
BarGraphBean

public class GraphWrapper
extends javax.swing.JPanel
implements java.io.Serializable

Class GraphWrapper acting as a wrapper for class Graph. By extending this class, User can implement different kinds of graphs like LineGraph, BarGraph, FilledGraph MultiBarGraph and MultiLineGraph.

See the superclass Graph, for details on parameters and more on methods for setting up the parameters.

See Also:
Graph, Serialized Form

Inner Class Summary
(package private)  class GraphWrapper.adlist
          Adjustment listener for the scroll bar.
 
Inner classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent, javax.swing.JComponent.IntVector, javax.swing.JComponent.KeyboardBinding, javax.swing.JComponent.KeyboardState
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AWTTreeLock
 
Field Summary
protected  java.awt.GridBagLayout gb
           
protected  java.awt.GridBagConstraints gbc
           
protected  javax.swing.JPanel jp
           
protected  javax.swing.JScrollBar jsb
           
protected  Graph sg
           
 
Fields inherited from class javax.swing.JComponent
_bounds, accessibleContext, listenerList, paintingChild, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Container
component, containerListener, layoutMgr, ncomponents
 
Fields inherited from class java.awt.Component
actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, componentListener, componentListenerK, componentOrientation, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, hasFocus, height, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowListenerK, x, y
 
Constructor Summary
GraphWrapper()
          Constructor for simple graph.
 
Method Summary
 void addMouseListener(java.awt.event.MouseListener l)
          Adds the specified mouse listener to receive the mouse events
 void barGraphSetUp()
          This calls barGraphSetUp of Graph.java .
 void filledGraphSetUp()
          This calls filledGraphSetUp of Graph.java .
 java.awt.Color getBarColor()
          To get bar color.
 java.awt.Color[] getBarColors()
          To get bar colors.
 java.awt.Color getBgcolor()
          To get background color .
 java.awt.Color getFgcolor()
          To get foreground color.
 java.awt.Color getLinecolor()
          To get line color.
 java.awt.Color[] getLineColors()
          To get line colors.
 long getMaxY()
          To get maximum value in y axis.
 long getMinY()
          To get minimum value in y axis.
 int getNoOfBars()
          To get number of bars.
 int getNoOfLines()
          To get number of lines.
 int getNoOfValues()
          To get no of polled values to be displayed in the graph.
 java.awt.Dimension getPreferredSize()
          To get the preferred size for simplegraphwrapper.
 java.awt.Font getScaleFont()
          To get scale font.
 java.lang.String getTitle()
          To get title of graph.
 java.awt.Font getTitleFont()
          To get font of the title.
 int getXGrids()
          To get number of vertical grids.
 java.lang.String getXLabel()
          To get label on the X axis.
 int getXRange()
          To get difference between x minimum and x maximum.
 int getXScalePoints()
          To get number of marks on x axis.
 int getYGrids()
          To get number of horizontal grids.
 java.lang.String getYLabel()
          To get label on the Y axis.
 int getYScalePoints()
          To get number of marks on y axis.
 boolean isAbsoluteTime()
          To know whether the graph is using absolute time or not.
 boolean isShowTitle()
          To know whether it can show the title or not.
 boolean isShowxLabel()
          To know whether it can show the x label or not.
 boolean isShowyLabel()
          To know whether it can show the y label or not.
 boolean isTimeAverage()
          To know whether time average the polled value or not.
 void lineGraphSetUp()
          This calls lineGraphSetUp of Graph.java .
 void removeMouseListener(java.awt.event.MouseListener l)
          Removes the specified mouse listener
 void setAbsoluteTime(boolean b)
          To set whether the graph can use absolute time or not.
 void setBarColor(java.awt.Color c)
          To set bar color.
 void setBarColors(java.awt.Color[] c)
          To set bar colors.
 void setBgcolor(java.awt.Color c)
          To set background color.
 void setFgcolor(java.awt.Color c)
          To set background color.
 void setLinecolor(java.awt.Color c)
          To set line color.
 void setLineColors(java.awt.Color[] c)
          To set line colors.
 void setMaxY(long l)
          To set maximum value in y axis.
 void setMinY(long l)
          To set minimum value in y axis.
 void setNoOfBars(int i)
          To set number of bars.
 void setNoOfLines(int i)
          To set number of lines.
 void setNoOfValues(int i)
          To set no of polled values to be displayed in the graph.
 void setResult(int i, long diff)
          Sets the result.
 void setResult(long diff)
          To set the result.
 void setScaleFont(java.awt.Font f)
          To set scale font.
 void setShowTitle(boolean b)
          To set whether it can show the title or not.
 void setShowxLabel(boolean b)
          To set whether it can show the x label or not.
 void setShowyLabel(boolean b)
          To set whether it can show the y label or not.
 void setTimeAverage(boolean b)
          To set whether time average the polled value or not.
 void setTitle(java.lang.String s)
          To set title of graph.
 void setTitleFont(java.awt.Font f)
          To set font of the title.
 void setXGrids(int i)
          To set number of vertical grids.
 void setXLabel(java.lang.String s)
          To set label on the X axis.
 void setXRange(int i)
          To set difference between x minimum and x maximum.
 void setXScalePoints(int i)
          To set number of marks on x axis.
 void setYGrids(int i)
          To set number of horizontal grids.
 void setYLabel(java.lang.String s)
          To set label on the Y axis.
 void setYScalePoints(int i)
          To set number of marks on y axis.
 
Methods inherited from class javax.swing.JPanel
, getAccessibleContext, getUIClassID, paramString, updateUI
 
Methods inherited from class javax.swing.JComponent
_paintImmediately, addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, alwaysOnTop, bindingForKeyStroke, checkIfChildObscuredBySibling, computeVisibleRect, computeVisibleRect, contains, createToolTip, enableSerialization, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInsets, getInsets, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyBindings, processKeyBindingsForAllComponents, processKeyEvent, processMouseMotionEvent, putClientProperty, rectangleIsObscured, rectangleIsObscuredBySibling, registerKeyboardAction, registerKeyboardAction, registerWithKeyboardManager, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPaintingChild, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVisible, shouldDebugGraphics, superProcessMouseMotionEvent, unregisterKeyboardAction, unregisterWithKeyboardManager, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyOrientation, countComponents, deliverEvent, dispatchEventImpl, dispatchEventToSelf, doLayout, eventEnabled, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getCursorTarget, getLayout, getMouseEventTarget, getWindow, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPrint, list, list, locate, minimumSize, nextFocus, paintComponents, postProcessKeyEvent, postsOldMouseEvents, preferredSize, preProcessKeyEvent, printComponents, printHeavyweightComponents, processContainerEvent, processEvent, proxyEnableEvents, proxyRequestFocus, remove, remove, removeAll, removeContainerListener, setCursor, setFocusOwner, setLayout, transferFocus, updateCursor, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseMotionListener, areInputMethodsEnabled, bounds, checkImage, checkImage, coalesceEvents, constructComponentName, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getIntrinsicCursor, getLocale, getLocation, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getToolkit, getToolkitImpl, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, isDisplayable, isEnabled, isEnabledImpl, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, 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, wait, wait, wait
 

Field Detail

sg

protected Graph sg

jsb

protected javax.swing.JScrollBar jsb

jp

protected javax.swing.JPanel jp

gb

protected java.awt.GridBagLayout gb

gbc

protected java.awt.GridBagConstraints gbc
Constructor Detail

GraphWrapper

public GraphWrapper()
Constructor for simple graph.
Method Detail

addMouseListener

public void addMouseListener(java.awt.event.MouseListener l)
Adds the specified mouse listener to receive the mouse events
Overrides:
addMouseListener in class java.awt.Component

removeMouseListener

public void removeMouseListener(java.awt.event.MouseListener l)
Removes the specified mouse listener
Overrides:
removeMouseListener in class java.awt.Component

lineGraphSetUp

public void lineGraphSetUp()
This calls lineGraphSetUp of Graph.java .

barGraphSetUp

public void barGraphSetUp()
This calls barGraphSetUp of Graph.java .

filledGraphSetUp

public void filledGraphSetUp()
This calls filledGraphSetUp of Graph.java .

getPreferredSize

public java.awt.Dimension getPreferredSize()
To get the preferred size for simplegraphwrapper.
Overrides:
getPreferredSize in class javax.swing.JComponent

setResult

public void setResult(long diff)
To set the result. This calls setResult of Graph.java.

setResult

public void setResult(int i,
                      long diff)
Sets the result.

This calls the setResult of Graph.java. The int argument(linenumber) should always start from 0. For example, Three SnmpPoller's are going to connected to this MultiLineGraph.

[1'st poller or hook-up file]

setNumericResult(long diff) { target.setResult(0,diff); [target is MultiLineGraph.] }

[2'nd poller or hook-up file]

setNumericResult(long diff) { target.setResult(1,diff); [target is MultiLineGraph.] }

[3'rd poller or hook-up file]

setNumericResult(long diff) { target.setResult(2,diff); [target is MultiLineGraph.] }


getTitle

public java.lang.String getTitle()
To get title of graph. This calls getTitle of Graph.java.

setTitle

public void setTitle(java.lang.String s)
To set title of graph. This calls setTitle of Graph.java.

isShowTitle

public boolean isShowTitle()
To know whether it can show the title or not. This calls isShowTitle of Graph.java.

setShowTitle

public void setShowTitle(boolean b)
To set whether it can show the title or not. This calls setShowTitle of Graph.java.

getTitleFont

public java.awt.Font getTitleFont()
To get font of the title. This calls getTitleFont of Graph.java.*

setTitleFont

public void setTitleFont(java.awt.Font f)
To set font of the title. This calls setTitleFont of Graph.java.

getBgcolor

public java.awt.Color getBgcolor()
To get background color . This calls getBgcolor of Graph.java.

setBgcolor

public void setBgcolor(java.awt.Color c)
To set background color. This calls setBgcolor of Graph.java.

getFgcolor

public java.awt.Color getFgcolor()
To get foreground color. This calls getFgcolor of Graph.java.

setFgcolor

public void setFgcolor(java.awt.Color c)
To set background color. This calls setFgcolor of Graph.java.

getLinecolor

public java.awt.Color getLinecolor()
To get line color. This calls getLinecolor of Graph.java.

setLinecolor

public void setLinecolor(java.awt.Color c)
To set line color. This calls setLinecolor of Graph.java.*

getBarColor

public java.awt.Color getBarColor()
To get bar color. This calls getBarColr of Graph.java.

setBarColor

public void setBarColor(java.awt.Color c)
To set bar color. This calls setBarColor of Graph.java.

getXLabel

public java.lang.String getXLabel()
To get label on the X axis. This calls getXLabel of Graph.java.

setXLabel

public void setXLabel(java.lang.String s)
To set label on the X axis. This calls setXLabel of Graph.java.*

isShowxLabel

public boolean isShowxLabel()
To know whether it can show the x label or not. This calls isShowxLabel of Graph.java.

setShowxLabel

public void setShowxLabel(boolean b)
To set whether it can show the x label or not. This calls setShowxLabel of Graph.java.

getYLabel

public java.lang.String getYLabel()
To get label on the Y axis. This calls getYLabel of Graph.java.

setYLabel

public void setYLabel(java.lang.String s)
To set label on the Y axis. This calls setYLabel of Graph.java.

isShowyLabel

public boolean isShowyLabel()
To know whether it can show the y label or not. This calls isShowyLabel of Graph.java.

setShowyLabel

public void setShowyLabel(boolean b)
To set whether it can show the y label or not. This calls setShowyLabel of Graph.java.

isTimeAverage

public boolean isTimeAverage()
To know whether time average the polled value or not. This calls isTimeAverage of Graph.java.

setTimeAverage

public void setTimeAverage(boolean b)
To set whether time average the polled value or not. This calls setTimeAverage of Graph.java.

getScaleFont

public java.awt.Font getScaleFont()
To get scale font. This calls getScaleFont of Graph.java.

setScaleFont

public void setScaleFont(java.awt.Font f)
To set scale font. This calls setScaleFont of Graph.java.

getXRange

public int getXRange()
To get difference between x minimum and x maximum. This calls getXRange of Graph.java.

setXRange

public void setXRange(int i)
To set difference between x minimum and x maximum. This calls setXRange of Graph.java.

getMinY

public long getMinY()
To get minimum value in y axis. This calls getMinY of Graph.java.

setMinY

public void setMinY(long l)
To set minimum value in y axis. This calls setMinY of Graph.java.

getMaxY

public long getMaxY()
To get maximum value in y axis. This calls getMaxY of Graph.java.

setMaxY

public void setMaxY(long l)
To set maximum value in y axis. This calls setMaxY of Graph.java.

getXGrids

public int getXGrids()
To get number of vertical grids. This calls getXGrids of Graph.java.

setXGrids

public void setXGrids(int i)
To set number of vertical grids. This calls setXGrids of Graph.java.

getYGrids

public int getYGrids()
To get number of horizontal grids. This calls getYGrids of Graph.java.

setYGrids

public void setYGrids(int i)
To set number of horizontal grids. This calls setYGrids of Graph.java.

getXScalePoints

public int getXScalePoints()
To get number of marks on x axis. This calls getXScalePoints of Graph.java.

setXScalePoints

public void setXScalePoints(int i)
To set number of marks on x axis. This calls setXScalePoints of Graph.java.

getYScalePoints

public int getYScalePoints()
To get number of marks on y axis. This calls getYScalePoints of Graph.java.

setYScalePoints

public void setYScalePoints(int i)
To set number of marks on y axis. This calls setYScalePoints of Graph.java.

getNoOfLines

public int getNoOfLines()
To get number of lines. This calls getNoOfLines of Graph.java.

setNoOfLines

public void setNoOfLines(int i)
To set number of lines. This calls setNoOfLines of Graph.java.

getNoOfBars

public int getNoOfBars()
To get number of bars. This calls getNoOfBars of Graph.java.

setNoOfBars

public void setNoOfBars(int i)
To set number of bars. This calls setNoOfBars of Graph.java.

getLineColors

public java.awt.Color[] getLineColors()
To get line colors. This calls getLineColors of Graph.java.

setLineColors

public void setLineColors(java.awt.Color[] c)
To set line colors. This calls setLineColors of Graph.java.

getBarColors

public java.awt.Color[] getBarColors()
To get bar colors. This calls getBarColors of Graph.java.

setBarColors

public void setBarColors(java.awt.Color[] c)
To set bar colors. This calls setBarColors of Graph.java.

getNoOfValues

public int getNoOfValues()
To get no of polled values to be displayed in the graph. This calls getnoOfValues of Graph.java.

setNoOfValues

public void setNoOfValues(int i)
To set no of polled values to be displayed in the graph. This calls setnoOfValues of Graph.java.

isAbsoluteTime

public boolean isAbsoluteTime()
To know whether the graph is using absolute time or not. This calls isAbsoluteTime of Graph.java.

setAbsoluteTime

public void setAbsoluteTime(boolean b)
To set whether the graph can use absolute time or not. This calls setAbsoluteTime of Graph.java.