All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.eou.toolkit.gauge.Oscilloscope

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----com.sun.java.swing.JComponent
                           |
                           +----com.sun.java.swing.JPanel
                                   |
                                   +----com.ibm.eou.toolkit.gauge.BaseGauge
                                           |
                                           +----com.ibm.eou.toolkit.gauge.Oscilloscope

public class Oscilloscope
extends BaseGauge
implements Serializable
This gauge simulates the operation of an oscilloscope. A trace of recent values is created by a dot which traverses the gauge from left to right, with a vertical position representing the current gauge value. The oldest part of the trace is erased a short distance ahead of the dot.


Constructor Index

 o Oscilloscope()
Construct an Oscilloscope with 0 as the initial value and a range from 0 to 100.
 o Oscilloscope(int, int, int)
Minimal constructor for an Oscilloscope, it accepts the initial value, the minimum and maximum values.
 o Oscilloscope(int, int, int, int, long, int, Color)
Create an Oscilloscope specifying the distance the dot advances on each update, the maximum interval in milliseconds between updates, the number of horizontal scale lines required, and the color of those lines.

Method Index

 o copyright()
 o gaugeModelChanged(GaugeModelChangeEvent)
This method can be overriden by extending classes which need to react to a change to one or more of the models settings.
 o getAdvance()
Get the amount of pixels the gauge advances.
 o getInterval()
Return the millisecond interval between each advance of the oscilloscope.
 o getMinimumSize()
 o getNumberOfLines()
Return the number of scale lines on the Oscilloscope.
 o getScaleColor()
Return the scale lines color.
 o getTraceColor()
Return the trace color.
 o getUpdateBounds(Dimension, int, int, int, int, int, int)
Return an array of rectangles defining the regions within the gauge display area that will need to be repainted as a result of the supplied next and current display values.
 o paintComponent(Graphics, Dimension, int, int, int)
Paint the gauge.
 o processComponentEvent(ComponentEvent)
 o setAdvance(int)
Specify the number of pixels the gauge advances.
 o setBackground(Color)
 o setInterval(long)
Specify the millisecond interval between each advance of the oscilloscope.
 o setNumberOfLines(int)
Specify the number of scale lines on the Oscilloscope.
 o setScaleColor(Color)
Specify the scale lines color.
 o setTraceColor(Color)
Specify the trace color.

Constructors

 o Oscilloscope
 public Oscilloscope(int initialValue,
                     int minimum,
                     int maximum,
                     int advance,
                     long interval,
                     int numberOfLines,
                     Color scaleColor)
Create an Oscilloscope specifying the distance the dot advances on each update, the maximum interval in milliseconds between updates, the number of horizontal scale lines required, and the color of those lines. The delay can be specified as INDEFINITE_WAIT, in which case the gauge updates only when the value changes. The scale color can be given as null, in which case a suitable default will be used.

 o Oscilloscope
 public Oscilloscope(int initialValue,
                     int minimum,
                     int maximum)
Minimal constructor for an Oscilloscope, it accepts the initial value, the minimum and maximum values. The other properties default to a hundred millisecond interval, a ten pixel advance, and twenty scale bars that are shown in black.

 o Oscilloscope
 public Oscilloscope()
Construct an Oscilloscope with 0 as the initial value and a range from 0 to 100. The other properties default to a hundred millisecond interval, a two pixel advance, and seven scale bars that are shown in dark gray.

Methods

 o copyright
 public static String copyright()
 o getInterval
 public long getInterval()
Return the millisecond interval between each advance of the oscilloscope.

 o setInterval
 public void setInterval(long interval)
Specify the millisecond interval between each advance of the oscilloscope.

 o setAdvance
 public void setAdvance(int advance)
Specify the number of pixels the gauge advances.

 o getAdvance
 public int getAdvance()
Get the amount of pixels the gauge advances.

 o setNumberOfLines
 public void setNumberOfLines(int numberOfLines)
Specify the number of scale lines on the Oscilloscope.

 o getNumberOfLines
 public int getNumberOfLines()
Return the number of scale lines on the Oscilloscope.

 o getScaleColor
 public Color getScaleColor()
Return the scale lines color.

 o setScaleColor
 public void setScaleColor(Color color)
Specify the scale lines color. Null is ignored.

 o setTraceColor
 public void setTraceColor(Color color)
Specify the trace color. Null is ignored.

 o getTraceColor
 public Color getTraceColor()
Return the trace color.

 o setBackground
 public void setBackground(Color color)
Overrides:
setBackground in class Component
 o gaugeModelChanged
 protected void gaugeModelChanged(GaugeModelChangeEvent e)
This method can be overriden by extending classes which need to react to a change to one or more of the models settings.

Overrides:
gaugeModelChanged in class BaseGauge
 o getMinimumSize
 public Dimension getMinimumSize()
Overrides:
getMinimumSize in class JComponent
 o processComponentEvent
 public void processComponentEvent(ComponentEvent e)
Overrides:
processComponentEvent in class BaseGauge
 o paintComponent
 public synchronized void paintComponent(Graphics g,
                                         Dimension s,
                                         int value,
                                         int min,
                                         int max)
Paint the gauge.

Overrides:
paintComponent in class BaseGauge
 o getUpdateBounds
 protected Rectangle[] getUpdateBounds(Dimension size,
                                       int nextDisplayValue,
                                       int nextDisplayMinimum,
                                       int nextDisplayMaximum,
                                       int currentDisplayValue,
                                       int currentDisplayMinimum,
                                       int currentDisplayMaximum)
Return an array of rectangles defining the regions within the gauge display area that will need to be repainted as a result of the supplied next and current display values.

Overrides:
getUpdateBounds in class BaseGauge

All Packages  Class Hierarchy  This Package  Previous  Next  Index