jcontrol.ui.vole.meter
Class AnalogMeter

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

public class AnalogMeter
extends Component

This class AnalogMeter.class implements a graphical analog meter for JControl. Several parameters of the analog meter such as opening angle and m_orientation are user controllable.

(c) Copyright 2003-2007 DOMOLOGIC GmbH


Field Summary
static int ORIENTATION_CENTER
          Align the scale of the analog meter to the middle.
static int ORIENTATION_LEFT
          Align the scale of the analog meter to the bottom-left corner of it's bounding box.
static int ORIENTATION_RIGHT
          Align the scale of the analog meter to the bottom-right corner of it's bounding box.
 
Fields inherited from class jcontrol.ui.vole.Component
eventQueue, focusOwner, font, g, height, listener, parent, visible, width, x, y
 
Constructor Summary
AnalogMeter(int x, int y, int width, int height, int min, int max, int openAngle, int orientation, int dials)
          Creates a new AnalogMeter.
 
Method Summary
 void paint()
          Draws the AnalogMeter.
 void setCaption(String captionMin, String captionMax)
          Sets a caption text which is displayed for the min and max values at the bottom of the analog meter.
 void setNumericDisplay(int digits, int decimals, String unit)
          Sets the parameters of the numeric value display.
 void setValue(int value)
          Sets the current analog meter value.
 boolean transferFocus()
          AnalogMeter never gains 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
 

Field Detail

ORIENTATION_LEFT

public static final int ORIENTATION_LEFT
Align the scale of the analog meter to the bottom-left corner of it's bounding box.

See Also:
Constant Field Values

ORIENTATION_CENTER

public static final int ORIENTATION_CENTER
Align the scale of the analog meter to the middle.

See Also:
Constant Field Values

ORIENTATION_RIGHT

public static final int ORIENTATION_RIGHT
Align the scale of the analog meter to the bottom-right corner of it's bounding box.

See Also:
Constant Field Values
Constructor Detail

AnalogMeter

public AnalogMeter(int x,
                   int y,
                   int width,
                   int height,
                   int min,
                   int max,
                   int openAngle,
                   int orientation,
                   int dials)
Creates a new AnalogMeter.

Parameters:
x - The x coordinate
y - The y coordinate
width - The width
height - The height
min - The minimum m_value
max - The maximum m_value
openAngle - An angle between 0 and 180 degrees. Default value is 180 degrees.
orientation - Set the scale orientation. Possible values are ORIENTATION_LEFT, ORIENTATION_CENTER and ORIENTATION_RIGHT. The default is ORIENTATION_CENTER.
dials - Number of dial lines
Method Detail

setCaption

public void setCaption(String captionMin,
                       String captionMax)
Sets a caption text which is displayed for the min and max values at the bottom of the analog meter.

Parameters:
captionMin - Text to display at the left bottom border
captionMax - Text to display at the right bottom border

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 ("-1" turns the display off).
unit - A String representing the unit of the meter value.

setValue

public void setValue(int value)
Sets the current analog meter value. If the value is out of the range min .. max, value will be cut.

Parameters:
value - The value to set.

paint

public void paint()
Draws the AnalogMeter.

Overrides:
paint in class Component

transferFocus

public boolean transferFocus()
AnalogMeter never gains focus.

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