Overview | Package | Class | Tree | Deprecated | Index | Help
| SNMP Stack 5_1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## uk.co.westhawk.visual
Class Graph

    java.lang.Object
      |
      +--java.awt.Component
            |
            +--java.awt.Container
                  |
                  +--javax.swing.JComponent
                        |
                        +--javax.swing.JPanel
                              |
                              +--uk.co.westhawk.visual.Graph

All Implemented Interfaces:
  javax.accessibility.Accessible, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.Serializable

public class Graph
extends javax.swing.JPanel
implements java.beans.PropertyChangeListener

The class Graph creates decoration labels around an actual (BareGraph) graph.

All the configurations of the BareGraph can be done from this class.

Version:
  $Revision: 1.7 $ $Date: 2006/01/17 17:43:54 $
Author:
  Birgit Arkesteijn
See Also:
  `BareGraph`, `GraphDataSet`, Serialized Form

Field Summary

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
`Graph()` The default constructor.
`Graph(GraphDataSet d)` The constructor with the data set.

Method Summary
`protected void` | `addToGridBag(java.awt.GridBagLayout grid, java.awt.Container cont, java.awt.Component comp, int x, int y, double wx, double wy)`
`protected void` | `addToGridBag(java.awt.GridBagLayout grid, java.awt.Container cont, java.awt.Component comp, int x, int y, double wx, double wy, int fill)`
`protected void` | `addToGridBag(java.awt.GridBagLayout grid, java.awt.Container cont, java.awt.Component comp, int x, int y, double wx, double wy, int fill, int anchor)`
`protected void` | `addToGridBag(java.awt.GridBagLayout grid, java.awt.Container cont, java.awt.Component comp, int x, int y, double wx, double wy, int gw, int gh, int fill, int anchor)`
`java.awt.Color` | `getAxisColour()` Returns the colour of the axes of the graph.
`float` | `getAxisPercent()` Returns the per cent size of the axes in respect to the graph.
`GraphDataSet` | `getDataSet()` Returns the data set that the graph displays.
`java.awt.Font` | `getFont()` Returns the font of the labels around the graph.
`java.awt.Color` | `getGraphColour()` Returns the colour of the line of the graph.
`int` | `getMax()` Returns the maximum value that is displayed in the graph.
`int` | `getMin()` Returns the minimum value that is displayed in the graph.
`boolean` | `isAxes()` Returns the axes mode of the graph.
`boolean` | `isLog()` Returns the log mode of the graph.
`void` | `propertyChange(java.beans.PropertyChangeEvent evt)` Implements the PropertyChangeListener.
`void` | `setAxes(boolean b)` Makes the graph draw the axes or not.
`void` | `setAxisColour(java.awt.Color c)` Sets the colour of the axes of the graph.
`void` | `setAxisPercent(float x)` Sets the per cent size of the axes in respect to the graph.
`void` | `setDataSet(GraphDataSet d)` Sets the data set that the graph displays.
`void` | `setFont(java.awt.Font f)` Sets the font of the labels around the graph.
`void` | `setGraphColour(java.awt.Color c)` Sets the colour of the line of the graph.
`void` | `setLog(boolean b)` Makes the graph draw the 10log() of the values or not.
`void` | `setMax(int m)` Sets the maximum value that is displayed in the graph.
`void` | `setMin(int m)` Sets the minimum value that is displayed in the graph.
`void` | `setName(java.lang.String n)` Sets the name (title) of the graph.
`void` | `setUnit(java.lang.String u)` Sets the units value of the graph.
`void` | `setXRange(java.lang.String x)` Sets the xrange value of the graph.

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, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, 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, setForeground, 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, 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, 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, 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`

Constructor Detail

### Graph

    public Graph()

  The default constructor. You will need to call setDataSet.

See Also:
  `setDataSet(uk.co.westhawk.visual.GraphDataSet)`

### Graph

    public Graph(GraphDataSet d)

  The constructor with the data set.

Parameters:
  `d` - the data set

Method Detail

### setLog

    public void setLog(boolean b)

  Makes the graph draw the 10log() of the values or not. The default is false.

  Parameters:
    `b` - set the 10log() version on or not
  See Also:
    `isLog()`

### isLog

    public boolean isLog()

  Returns the log mode of the graph.

  Returns:
    is the graph drawing the 10log() values or not
  See Also:
    `setLog(boolean)`

### setAxes

    public void setAxes(boolean b)

  Makes the graph draw the axes or not. The default is true.

  If the axes are off only the line, with above the name, value and units are displayed.

  If the axes are on the graph will have the axes, max, min and xrange displayed also.

  Parameters:
    `b` - set the axes or not
  See Also:
    `isAxes()`

### isAxes

    public boolean isAxes()

  Returns the axes mode of the graph.

  Returns:
    is the graph drawing the axes or not
  See Also:
    `setAxes(boolean)`

### getMin

    public int getMin()

  Returns the minimum value that is displayed in the graph.

  Returns:
    the minimum
  See Also:
    `setMin(int)`

### setMin

    public void setMin(int m)

  Sets the minimum value that is displayed in the graph. If the axes mode is on, this value will be displayed

  Parameters:
    `m` - the minimum value
  See Also:
    `getMin()`, `setAxes(boolean)`

### getMax

    public int getMax()

  Returns the maximum value that is displayed in the graph.

  Returns:
    the maximum value
  See Also:
    `setMax(int)`

### setMax

    public void setMax(int m)

  Sets the maximum value that is displayed in the graph. If the axes mode is on, this value will be displayed

  Parameters:
    `m` - the maximum
  See Also:
    `getMax()`, `setAxes(boolean)`

### setXRange

    public void setXRange(java.lang.String x)

  Sets the xrange value of the graph. If the axes mode is on, this string will be displayed under the x-axis. The default is Time.

  Parameters:
    `x` - the xrange string
  See Also:
    `setAxes(boolean)`

### setUnit

    public void setUnit(java.lang.String u)

  Sets the units value of the graph. This string will be displayed above the graph. The default is (b/s).

  Parameters:
    `u` - the units string

### setName

    public void setName(java.lang.String n)

  Sets the name (title) of the graph. This string will be displayed above the graph.

  Overrides:
    `setName` in class `java.awt.Component`
  Parameters:
    `n` - the name string

### setFont

    public void setFont(java.awt.Font f)

  Sets the font of the labels around the graph.

  Overrides:
    `setFont` in class `javax.swing.JComponent`
  Parameters:
    `f` - the font
  See Also:
    `getFont()`

### getFont

    public java.awt.Font getFont()

  Returns the font of the labels around the graph.

  Specified by:
    `getFont` in interface `java.awt.MenuContainer`
  Overrides:
    `getFont` in class `java.awt.Component`
  Returns:
    the font
  See Also:
    `setFont(java.awt.Font)`

### getAxisColour

    public java.awt.Color getAxisColour()

  Returns the colour of the axes of the graph.

  Returns:
    the axes' colour
  See Also:
    `setAxisColour(java.awt.Color)`

### setAxisColour

    public void setAxisColour(java.awt.Color c)

  Sets the colour of the axes of the graph. The default is Color.red.

  Parameters:
    `c` - the axes' colour
  See Also:
    `getAxisColour()`

### getGraphColour

    public java.awt.Color getGraphColour()

  Returns the colour of the line of the graph.

  Returns:
    the line's colour
  See Also:
    `setGraphColour(java.awt.Color)`

### setGraphColour

    public void setGraphColour(java.awt.Color c)

  Sets the colour of the line of the graph. The default is Color.blue.

  Parameters:
    `c` - the line's colour
  See Also:
    `getGraphColour()`

### getAxisPercent

    public float getAxisPercent()

  Returns the per cent size of the axes in respect to the graph.

  Returns:
    the size (%) of the axes
  See Also:
    `setAxisPercent(float)`

### setAxisPercent

    public void setAxisPercent(float x)

  Sets the per cent size of the axes in respect to the graph. The default is 5.0 %.

  See Also:
    `getAxisPercent()`

### setDataSet

    public void setDataSet(GraphDataSet d)

  Sets the data set that the graph displays. The last value will be displayed above the graph.

  Parameters:
    `d` - the data set.
  See Also:
    `getDataSet()`

### getDataSet

    public GraphDataSet getDataSet()

  Returns the data set that the graph displays.

  Returns:
    the data set.
  See Also:
    `setDataSet(uk.co.westhawk.visual.GraphDataSet)`

### propertyChange

    public void propertyChange(java.beans.PropertyChangeEvent evt)

  Implements the PropertyChangeListener. Gets the update of the data.

  Specified by:
    `propertyChange` in interface `java.beans.PropertyChangeListener`
  Parameters:
    `evt` - the property change event
  See Also:
    `PropertyChangeListener`

### addToGridBag

    protected void addToGridBag(java.awt.GridBagLayout grid,
                                java.awt.Container cont,
                                java.awt.Component comp,
                                int x,
                                int y,
                                double wx,
                                double wy)

### addToGridBag

    protected void addToGridBag(java.awt.GridBagLayout grid,
                                java.awt.Container cont,
                                java.awt.Component comp,
                                int x,
                                int y,
                                double wx,
                                double wy,
                                int fill)

### addToGridBag

    protected void addToGridBag(java.awt.GridBagLayout grid,
                                java.awt.Container cont,
                                java.awt.Component comp,
                                int x,
                                int y,
                                double wx,
                                double wy,
                                int fill,
                                int anchor)

### addToGridBag

    protected void addToGridBag(java.awt.GridBagLayout grid,
                                java.awt.Container cont,
                                java.awt.Component comp,
                                int x,
                                int y,
                                double wx,
                                double wy,
                                int gw,
                                int gh,
                                int fill,
                                int anchor)

Overview | Package | Class | Tree | Deprecated | Index | Help
| SNMP Stack 5_1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD