All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.eou.toolkit.gauge.Thermometer
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.Thermometer
- public class Thermometer
- extends BaseGauge
- implements Serializable
This gauge represents a thermometer with an optional scale. The gauge value is represented
by a column of mercury inside a tube. The mercury will slide smoothly towards new values.
The scale shows the minimum and maximum of the gauge range together with a changeover point.
These values are highlighted by two colored bars drawn down the sides of the tube, one from
the minimum value to the changeover point, and the other from the changeover point to the
maximum value. The current value is displayed in the bulb as text with an optional prefix
and suffix.
-
Thermometer()
- Create a Thermometer with the initial value of 0 and a range from 0 to 100.
-
Thermometer(int, int, int)
- Create a Thermometer specifying the initial value, the maximum and the minimum value
the other properties default to the mercury in blue, the tube in white, the positive
color in green, the
negative color in red.
-
Thermometer(int, int, int, int, String, Color, Color, boolean, Color, Color, int, String, String)
- Create a Thermometer specifying the width, the title, the colors for the tube
and mercury, whether the scale is required, the colors for the scale bars,
the scale changeover point, and the prefix and suffix strings.
-
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.
-
getBaseLevel()
- Return the change over value, where the scale switches from positive to negative.
-
getMercury()
- Return the color of the mercury.
-
getMinimumSize()
-
-
getNegative()
- Return the color of the negative scale bar.
-
getPositive()
- Return the color of the positive scale bar.
-
getPrefix()
- Return the string prefix to the thermometer bulb.
-
getSuffix()
- Return the string suffix to the thermometer bulb.
-
getTitle()
- Return the string title to the thermometer.
-
getTube()
- Return the color of the Thermometer tube.
-
getTubeWidth()
- Return the width of the tube.
-
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.
-
isScaleEnabled()
- Return if the scale is shown on the thermometer.
-
paintComponent(Graphics, Dimension, int, int, int)
- Paint the gauge.
-
paintHighlight(Graphics, Dimension)
- Override this method to paint on top of the gauge.
-
processComponentEvent(ComponentEvent)
-
-
processMouseEvent(MouseEvent)
-
-
processMouseMotionEvent(MouseEvent)
-
-
setBackground(Color)
- Specify the background color.
-
setBaseLevel(int)
- Specify the change over value, where the scale switches from positive to negative.
-
setForeground(Color)
- Specify the foreground color.
-
setMercury(Color)
- Specify the color of the mercury.
-
setNegative(Color)
- Specify the color of the negative scale bar.
-
setPositive(Color)
- Specify the color of the positive scale bar.
-
setPrefix(String)
- Specify the string prefix to the thermometer bulb.
-
setScaleEnabled(boolean)
- Specify that the scale should be shown on the thermometer.
-
setSuffix(String)
- Specify the string suffix to the thermometer bulb.
-
setTitle(String)
- Specify the string title to the thermometer bulb.
-
setTube(Color)
- Specify the color of the Thermometer tube.
-
setTubeWidth(int)
- Specify the width of the tube.
Thermometer
public Thermometer(int initialValue,
int minimum,
int maximum,
int tubeWidth,
String title,
Color tube,
Color mercury,
boolean scaleEnabled,
Color positive,
Color negative,
int changeOver,
String prefix,
String suffix)
- Create a Thermometer specifying the width, the title, the colors for the tube
and mercury, whether the scale is required, the colors for the scale bars,
the scale changeover point, and the prefix and suffix strings.
If any of the colors are null, a suitable default is be used.
The prefix, suffix and title strings may be null to suppress their display.
Thermometer
public Thermometer(int initialValue,
int minimum,
int maximum)
- Create a Thermometer specifying the initial value, the maximum and the minimum value
the other properties default to the mercury in blue, the tube in white, the positive
color in green, the
negative color in red. There are no titles, prefixes or suffixes, the change from negative to
positive is 0, and the tube is 30 pixels wide.
Thermometer
public Thermometer()
- Create a Thermometer with the initial value of 0 and a range from 0 to 100.
The other properties default to the mercury in blue, the tube in white, the positive
color in green, the
negative color in red. There are no titles, prefixes or suffixes, the change from negative to
positive is 0, and the tube is 30 pixels wide.
copyright
public static String copyright()
processComponentEvent
public void processComponentEvent(ComponentEvent e)
- Overrides:
- processComponentEvent in class BaseGauge
isScaleEnabled
public boolean isScaleEnabled()
- Return if the scale is shown on the thermometer.
setScaleEnabled
public void setScaleEnabled(boolean isScaleEnabled)
- Specify that the scale should be shown on the thermometer.
getPrefix
public String getPrefix()
- Return the string prefix to the thermometer bulb.
setPrefix
public void setPrefix(String prefix)
- Specify the string prefix to the thermometer bulb. Use null to specify no string
getSuffix
public String getSuffix()
- Return the string suffix to the thermometer bulb.
setSuffix
public void setSuffix(String suffix)
- Specify the string suffix to the thermometer bulb. Use null to specify no string.
getTitle
public String getTitle()
- Return the string title to the thermometer.
setTitle
public void setTitle(String title)
- Specify the string title to the thermometer bulb. Use null to specify no string.
getPositive
public Color getPositive()
- Return the color of the positive scale bar.
setPositive
public void setPositive(Color color)
- Specify the color of the positive scale bar. Null is ignored.
getNegative
public Color getNegative()
- Return the color of the negative scale bar.
setNegative
public void setNegative(Color color)
- Specify the color of the negative scale bar. Null is ignored.
getTube
public Color getTube()
- Return the color of the Thermometer tube.
setTube
public void setTube(Color color)
- Specify the color of the Thermometer tube. Null is ignored.
getMercury
public Color getMercury()
- Return the color of the mercury.
setMercury
public void setMercury(Color color)
- Specify the color of the mercury. Null is ignored.
getTubeWidth
public int getTubeWidth()
- Return the width of the tube.
setTubeWidth
public void setTubeWidth(int width)
- Specify the width of the tube. Constrained to 2 or greater.
getBaseLevel
public int getBaseLevel()
- Return the change over value, where the scale switches from positive to negative.
setBaseLevel
public void setBaseLevel(int changeOverValue)
- Specify the change over value, where the scale switches from positive to negative.
setForeground
public void setForeground(Color color)
- Specify the foreground color. Null is ignored.
- Overrides:
- setForeground in class Component
setBackground
public void setBackground(Color color)
- Specify the background color. Null is ignored
- Overrides:
- setBackground in class Component
getMinimumSize
public Dimension getMinimumSize()
- Overrides:
- getMinimumSize in class JComponent
paintHighlight
protected void paintHighlight(Graphics g,
Dimension size)
- Override this method to paint on top of the gauge.
paintComponent
public synchronized void paintComponent(Graphics g,
Dimension s,
int displayvalue,
int min,
int max)
- Paint the gauge.
- Overrides:
- paintComponent in class BaseGauge
getUpdateBounds
protected Rectangle[] getUpdateBounds(Dimension s,
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
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
processMouseEvent
public void processMouseEvent(MouseEvent evt)
- Overrides:
- processMouseEvent in class Component
processMouseMotionEvent
public void processMouseMotionEvent(MouseEvent evt)
- Overrides:
- processMouseMotionEvent in class JComponent
All Packages Class Hierarchy This Package Previous Next Index