jcontrol.ui.vole.meter
Class BarMeter

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

public class BarMeter
extends Component

This class implements a bar graph, used for analog output in equalizers etc.

(c) Copyright 2003-2007 DOMOLOGIC GmbH


Field Summary
static int FILL_LINE
          Line style
static int FILL_SOLID
          Solid style
static boolean ORIENTATION_HORIZONTAL
          Horizontal bar graph
static boolean ORIENTATION_VERTICAL
          Vertical bar graph
 
Fields inherited from class jcontrol.ui.vole.Component
eventQueue, focusOwner, font, g, height, listener, parent, visible, width, x, y
 
Constructor Summary
BarMeter(int x, int y, int width, int height, int min, int max, boolean orientation, int style)
          Constructs a new bar graph.
 
Method Summary
 void paint()
          Repaints the BarMeter.
 void setCaption(String captionMin, String captionMax)
          Sets a caption text which is displayed for the min and max value.
 void setNumericDisplay(int digits, int decimals, String unit)
          Sets the parameters of the numeric value display.
 void setValue(int value)
          Sets the bar graph value.
 boolean transferFocus()
          We never gain 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
 

Field Detail

ORIENTATION_VERTICAL

public static final boolean ORIENTATION_VERTICAL
Vertical bar graph

See Also:
Constant Field Values

ORIENTATION_HORIZONTAL

public static final boolean ORIENTATION_HORIZONTAL
Horizontal bar graph

See Also:
Constant Field Values

FILL_LINE

public static final int FILL_LINE
Line style

See Also:
Constant Field Values

FILL_SOLID

public static final int FILL_SOLID
Solid style

See Also:
Constant Field Values
Constructor Detail

BarMeter

public BarMeter(int x,
                int y,
                int width,
                int height,
                int min,
                int max,
                boolean orientation,
                int style)
Constructs a new bar graph.

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.
orientation - ORIENTATION_VERTICAL or ORIENTATION_HORIZONZTAL.
style - FILL_LINE or FILL_SOLID.
Method Detail

setCaption

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

Parameters:
captionMin - Text to display at the right bottom (vertical bar meter) or at the left bottom (horizontal bar meter).
captionMax - Text to display at the right top (vertical bar meter) or at the right bottom (horizontal bar meter).

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 bar graph value. If the value is out of the range minValue .. value, the value will be cut.

Parameters:
value - The new value

paint

public void paint()
Repaints the BarMeter.

Overrides:
paint in class Component

transferFocus

public boolean transferFocus()
We never gain the input focus.

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