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.
-
Oscilloscope()
- Construct an Oscilloscope with 0 as the initial value and a range from 0 to 100.
-
Oscilloscope(int, int, int)
- Minimal constructor for an Oscilloscope, it accepts the initial value, the minimum
and maximum values.
-
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.
-
copyright()
-
-
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.
-
getAdvance()
- Get the amount of pixels the gauge advances.
-
getInterval()
- Return the millisecond interval between each advance of the oscilloscope.
-
getMinimumSize()
-
-
getNumberOfLines()
- Return the number of scale lines on the Oscilloscope.
-
getScaleColor()
- Return the scale lines color.
-
getTraceColor()
- Return the trace color.
-
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.
-
paintComponent(Graphics, Dimension, int, int, int)
- Paint the gauge.
-
processComponentEvent(ComponentEvent)
-
-
setAdvance(int)
- Specify the number of pixels the gauge advances.
-
setBackground(Color)
-
-
setInterval(long)
- Specify the millisecond interval between each advance of the oscilloscope.
-
setNumberOfLines(int)
- Specify the number of scale lines on the Oscilloscope.
-
setScaleColor(Color)
- Specify the scale lines color.
-
setTraceColor(Color)
- Specify the trace color.
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.
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.
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.
copyright
public static String copyright()
getInterval
public long getInterval()
- Return the millisecond interval between each advance of the oscilloscope.
setInterval
public void setInterval(long interval)
- Specify the millisecond interval between each advance of the oscilloscope.
setAdvance
public void setAdvance(int advance)
- Specify the number of pixels the gauge advances.
getAdvance
public int getAdvance()
- Get the amount of pixels the gauge advances.
setNumberOfLines
public void setNumberOfLines(int numberOfLines)
- Specify the number of scale lines on the Oscilloscope.
getNumberOfLines
public int getNumberOfLines()
- Return the number of scale lines on the Oscilloscope.
getScaleColor
public Color getScaleColor()
- Return the scale lines color.
setScaleColor
public void setScaleColor(Color color)
- Specify the scale lines color. Null is ignored.
setTraceColor
public void setTraceColor(Color color)
- Specify the trace color. Null is ignored.
getTraceColor
public Color getTraceColor()
- Return the trace color.
setBackground
public void setBackground(Color color)
- Overrides:
- setBackground in class Component
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
getMinimumSize
public Dimension getMinimumSize()
- Overrides:
- getMinimumSize in class JComponent
processComponentEvent
public void processComponentEvent(ComponentEvent e)
- Overrides:
- processComponentEvent in class BaseGauge
paintComponent
public synchronized void paintComponent(Graphics g,
Dimension s,
int value,
int min,
int max)
- Paint the gauge.
- Overrides:
- paintComponent in class BaseGauge
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