jcontrol.ui.vole.meter
Class Thermometer

java.lang.Object
  extended by jcontrol.ui.vole.Component
      extended by jcontrol.ui.vole.meter.Thermometer

public class Thermometer
extends Component

The class Thermometer implements a classical thermometer as graphical Vole component. The final size of the thermometer depends on the width-to-height ratio given by the constructor or the setBounds-method. The thermometer is drawn that it completely fits into its bounding box. A thermometer without any caption has a width-to-height ratio of 2 to 7 plus text height. Any caption will be drawn on the right side of the fluid column, and with a caption, the width-to-height ratio will change. So, if the thermometer is too small or not visible at all, you should try to increase the width first.

(c) Copyright 2003-2007 DOMOLOGIC GmbH


Field Summary
 
Fields inherited from class jcontrol.ui.vole.Component
eventQueue, focusOwner, font, g, height, listener, parent, visible, width, x, y
 
Constructor Summary
Thermometer(int x, int y, int width, int height, int min, int max)
          Constructs a new thermometer.
 
Method Summary
 void paint()
          Paints this component.
 void setCaption(String captionMin, String captionMax)
          Sets a caption text which is displayed for the min and max value at the thermometer.
 void setNumericDisplay(int digits, int decimals, String unit)
          Sets the parameters of the numeric value display.
 void setValue(int value)
          Sets the thermometer value.
 boolean transferFocus()
          Thermometer never has the input focus
 
Methods inherited from class jcontrol.ui.vole.Component
getBounds, getParent, isVisible, onActionEvent, onKeyEvent, remove, removeFocus, requestFocus, setBounds, setFont, setGraphics, setParent, setVisible, validate
 
Methods inherited from class java.lang.Object
clone, equals, getClass, notifyAll, toString, wait
 

Constructor Detail

Thermometer

public Thermometer(int x,
                   int y,
                   int width,
                   int height,
                   int min,
                   int max)
Constructs a new thermometer.

Parameters:
x - The upper left x coordinate.
y - The upper left y coordinate.
width - The width
height - The height
min - The minimum value the BarMeter will be able to show
max - The maximum value the BarMeter will be able to show
Method Detail

setCaption

public void setCaption(String captionMin,
                       String captionMax)
Sets a caption text which is displayed for the min and max value at the thermometer.

Parameters:
captionMin - Text to display at the bottom
captionMax - Text to display at the top

setNumericDisplay

public void setNumericDisplay(int digits,
                              int decimals,
                              String unit)
Sets the parameters of the numeric value display.

Parameters:
decimals - The number of decimals behind the comma (may be "0").
unit - A String representing the unit of the thermometer, e.g. "°C"

setValue

public void setValue(int value)
Sets the thermometer value. If the value is out of the range minvalue .. maxvalue, the value will be cut.

Parameters:
value - the value

paint

public void paint()
Description copied from class: Component
Paints this component.

Overrides:
paint in class Component

transferFocus

public boolean transferFocus()
Thermometer never has the input focus

Overrides:
transferFocus in class Component
Returns:
true, if the focus was transferred successfully.