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.


Constructor Index

 o Thermometer()
Create a Thermometer with the initial value of 0 and a range from 0 to 100.
 o 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.
 o 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.

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 getBaseLevel()
Return the change over value, where the scale switches from positive to negative.
 o getMercury()
Return the color of the mercury.
 o getMinimumSize()
 o getNegative()
Return the color of the negative scale bar.
 o getPositive()
Return the color of the positive scale bar.
 o getPrefix()
Return the string prefix to the thermometer bulb.
 o getSuffix()
Return the string suffix to the thermometer bulb.
 o getTitle()
Return the string title to the thermometer.
 o getTube()
Return the color of the Thermometer tube.
 o getTubeWidth()
Return the width of the tube.
 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 isScaleEnabled()
Return if the scale is shown on the thermometer.
 o paintComponent(Graphics, Dimension, int, int, int)
Paint the gauge.
 o paintHighlight(Graphics, Dimension)
Override this method to paint on top of the gauge.
 o processComponentEvent(ComponentEvent)
 o processMouseEvent(MouseEvent)
 o processMouseMotionEvent(MouseEvent)
 o setBackground(Color)
Specify the background color.
 o setBaseLevel(int)
Specify the change over value, where the scale switches from positive to negative.
 o setForeground(Color)
Specify the foreground color.
 o setMercury(Color)
Specify the color of the mercury.
 o setNegative(Color)
Specify the color of the negative scale bar.
 o setPositive(Color)
Specify the color of the positive scale bar.
 o setPrefix(String)
Specify the string prefix to the thermometer bulb.
 o setScaleEnabled(boolean)
Specify that the scale should be shown on the thermometer.
 o setSuffix(String)
Specify the string suffix to the thermometer bulb.
 o setTitle(String)
Specify the string title to the thermometer bulb.
 o setTube(Color)
Specify the color of the Thermometer tube.
 o setTubeWidth(int)
Specify the width of the tube.

Constructors

 o 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.

 o 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.

 o 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.

Methods

 o copyright
 public static String copyright()
 o processComponentEvent
 public void processComponentEvent(ComponentEvent e)
Overrides:
processComponentEvent in class BaseGauge
 o isScaleEnabled
 public boolean isScaleEnabled()
Return if the scale is shown on the thermometer.

 o setScaleEnabled
 public void setScaleEnabled(boolean isScaleEnabled)
Specify that the scale should be shown on the thermometer.

 o getPrefix
 public String getPrefix()
Return the string prefix to the thermometer bulb.

 o setPrefix
 public void setPrefix(String prefix)
Specify the string prefix to the thermometer bulb. Use null to specify no string

 o getSuffix
 public String getSuffix()
Return the string suffix to the thermometer bulb.

 o setSuffix
 public void setSuffix(String suffix)
Specify the string suffix to the thermometer bulb. Use null to specify no string.

 o getTitle
 public String getTitle()
Return the string title to the thermometer.

 o setTitle
 public void setTitle(String title)
Specify the string title to the thermometer bulb. Use null to specify no string.

 o getPositive
 public Color getPositive()
Return the color of the positive scale bar.

 o setPositive
 public void setPositive(Color color)
Specify the color of the positive scale bar. Null is ignored.

 o getNegative
 public Color getNegative()
Return the color of the negative scale bar.

 o setNegative
 public void setNegative(Color color)
Specify the color of the negative scale bar. Null is ignored.

 o getTube
 public Color getTube()
Return the color of the Thermometer tube.

 o setTube
 public void setTube(Color color)
Specify the color of the Thermometer tube. Null is ignored.

 o getMercury
 public Color getMercury()
Return the color of the mercury.

 o setMercury
 public void setMercury(Color color)
Specify the color of the mercury. Null is ignored.

 o getTubeWidth
 public int getTubeWidth()
Return the width of the tube.

 o setTubeWidth
 public void setTubeWidth(int width)
Specify the width of the tube. Constrained to 2 or greater.

 o getBaseLevel
 public int getBaseLevel()
Return the change over value, where the scale switches from positive to negative.

 o setBaseLevel
 public void setBaseLevel(int changeOverValue)
Specify the change over value, where the scale switches from positive to negative.

 o setForeground
 public void setForeground(Color color)
Specify the foreground color. Null is ignored.

Overrides:
setForeground in class Component
 o setBackground
 public void setBackground(Color color)
Specify the background color. Null is ignored

Overrides:
setBackground in class Component
 o getMinimumSize
 public Dimension getMinimumSize()
Overrides:
getMinimumSize in class JComponent
 o paintHighlight
 protected void paintHighlight(Graphics g,
                               Dimension size)
Override this method to paint on top of the gauge.

 o paintComponent
 public synchronized void paintComponent(Graphics g,
                                         Dimension s,
                                         int displayvalue,
                                         int min,
                                         int max)
Paint the gauge.

Overrides:
paintComponent in class BaseGauge
 o 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
 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 processMouseEvent
 public void processMouseEvent(MouseEvent evt)
Overrides:
processMouseEvent in class Component
 o processMouseMotionEvent
 public void processMouseMotionEvent(MouseEvent evt)
Overrides:
processMouseMotionEvent in class JComponent

All Packages  Class Hierarchy  This Package  Previous  Next  Index