jcontrol.ui.vole.meter
Class BarMeter

java.lang.Object
  |
  +--jcontrol.ui.vole.Component
        |
        +--jcontrol.ui.vole.meter.BarMeter

public class BarMeter
extends Component

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

(C) DOMOLOGIC Home Automation GmbH 2003

Version:
1.2
Author:
Marcus Timmermann, Wolfgang Klingauf

Field Summary
(package private)  boolean border
           
static int FILL_LINE
          Line style
static int FILL_SOLID
          Solid style
static boolean HORIZONTAL
          Horizontal bar graph
(package private)  int max
           
(package private)  int min
           
(package private)  boolean orientation
           
(package private)  int style
           
(package private)  int value
           
static boolean VERTICAL
          Vertical bar graph
 
Fields inherited from class jcontrol.ui.vole.Component
focusOwner, font, g, height, listener, parent, visible, width, x, y
 
Constructor Summary
BarMeter(int min, int max, int x, int y, int width, int height, boolean orientation, boolean border)
          Constructs a new bar graph.
 
Method Summary
 void paint()
          Repaints the BarMeter.
 void setBorder(boolean border)
          Toggle whether a border is painted around the bar meter.
 void setInscription(java.lang.String min, java.lang.String max)
          Sets an inscription text which is displayed for the min and max value.
 void setStyle(int style)
          Set the fill style of this BarMeter.
 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, setLocation, setParent, setVisible, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, notifyAll, wait
 

Field Detail

border

boolean border

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

HORIZONTAL

public static final boolean HORIZONTAL
Horizontal bar graph

See Also:
Constant Field Values

max

int max

min

int min

orientation

boolean orientation

style

int style

value

int value

VERTICAL

public static final boolean VERTICAL
Vertical bar graph

See Also:
Constant Field Values
Constructor Detail

BarMeter

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

Parameters:
x - The upper left x-coordinate.
y - The upper left y-coordinate.
width - The width.
height - The height.
orientation - VERTICAL or HORIZONZTAL.
min - The minimum value the BarMeter will be able to show.
max - The maximum value the BarMeter will be able to show.
border - When true, a border is painted around the BarMeter.
Method Detail

paint

public void paint()
Repaints the BarMeter.

Overrides:
paint in class Component

setBorder

public void setBorder(boolean border)
Toggle whether a border is painted around the bar meter.

Parameters:
border - When true, a border is painted around the BarMeter.

setInscription

public void setInscription(java.lang.String min,
                           java.lang.String max)
Sets an inscription text which is displayed for the min and max value.

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

setStyle

public void setStyle(int style)
Set the fill style of this BarMeter.

Parameters:
style - FILL_LINE or FILL_SOLID.

setValue

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

Parameters:
value - The new value

transferFocus

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

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