|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jcontrol.ui.vole.Component | +--jcontrol.ui.vole.meter.AnalogMeter
This class AnalogMeter.class
implements a graphical analog meter for JControl.
Several parameters of the analog meter such as opening angle and orientation are user controllable.
Field Summary | |
protected int |
angleoffset
|
protected boolean |
border
|
protected int |
decimals
|
protected int |
dials
|
protected boolean |
firstLine
|
protected java.lang.String |
inscriptMax
|
protected java.lang.String |
inscriptMin
|
protected int |
maxDisplay
|
protected int |
maxValue
Internal coordinates and parameters |
protected int |
minDisplay
|
protected int |
minValue
Internal coordinates and parameters |
protected int |
openangle
The opening angle of the scale (0..180) |
protected int |
orientation
|
static int |
ORIENTATION_LEFT
Align the scale of the analog meter to the bottom-left corner of it's bounding box. |
static int |
ORIENTATION_MIDDLE
Align the scale of the analog meter to the middle. |
static int |
ORIENTATION_RIGHT
Align the scale of the analog meter to the bottom-right corner of it's bounding box. |
protected boolean |
painting
|
protected int |
radius
|
protected java.lang.String |
unit
|
protected int |
value
The current value of the analog meter |
protected boolean |
wasCovered
|
protected int |
xoff
|
protected int |
xpos
Internal coordinates and parameters |
protected int |
yoff
|
protected int |
ypos
Internal coordinates and parameters |
Fields inherited from class jcontrol.ui.vole.Component |
focusOwner, font, g, height, listener, parent, visible, width, x, y |
Constructor Summary | |
AnalogMeter(int x,
int y,
int width,
int height,
int minValue,
int maxValue,
int dials)
Creates a new AnalogMeter. |
Method Summary | |
int |
getOpenAngle()
Return the current opening angle of the analog meter. |
void |
paint()
Draws the AnalogMeter. |
void |
setBorder(boolean onoff)
Sets whether a rectangular border should be painted around the AnalogMeter. |
void |
setBounds(int x,
int y,
int width,
int height)
Sets a new position and size for the AnalogMeter. |
void |
setGraphics(jcontrol.io.Graphics g)
Set the graphics context of this AnalogMeter. |
void |
setInscription(java.lang.String inscriptMin,
java.lang.String inscriptMax)
Sets an inscription text which is displayed for the min and max value at the bottom of the analog meter. |
void |
setNumericDisplay(int minDisplay,
int maxDisplay,
int decimals,
java.lang.String unit)
Sets the parameters of a numeric value display. |
void |
setOpenAngle(int value)
Set the opening angle of the analog meter. |
void |
setOrientation(int orientation)
Set the scale orientation. |
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, setFont, setLocation, setParent, setVisible, validate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, notifyAll, wait |
Field Detail |
protected int angleoffset
protected boolean border
protected int decimals
protected int dials
protected boolean firstLine
protected java.lang.String inscriptMax
protected java.lang.String inscriptMin
protected int maxDisplay
protected int maxValue
protected int minDisplay
protected int minValue
protected int openangle
protected int orientation
public static final int ORIENTATION_LEFT
public static final int ORIENTATION_MIDDLE
public static final int ORIENTATION_RIGHT
protected boolean painting
protected int radius
protected java.lang.String unit
protected int value
protected boolean wasCovered
protected int xoff
protected int xpos
protected int yoff
protected int ypos
Constructor Detail |
public AnalogMeter(int x, int y, int width, int height, int minValue, int maxValue, int dials)
x
- The x coordinatey
- The y coordinatewidth
- The widthheight
- The heightminValue
- The minimum valuemaxValue
- The maximum valuedials
- Number of dial linesMethod Detail |
public int getOpenAngle()
public void paint()
paint
in class Component
public void setBorder(boolean onoff)
onoff
- Turn border on/off. The default is off.public void setBounds(int x, int y, int width, int height)
setBounds
in class Component
x
- the new x coordinatey
- the new y coordinatewidth
- the new widthheight
- the new heightpublic void setGraphics(jcontrol.io.Graphics g)
setGraphics
in class Component
g
- the Displaypublic void setInscription(java.lang.String inscriptMin, java.lang.String inscriptMax)
public void setNumericDisplay(int minDisplay, int maxDisplay, int decimals, java.lang.String unit)
minDisplay
- the minimum display valuemaxDisplay
- the maximum display valuedecimals
- The number of decimals behind the comma (may be "0").unit
- A String
representing the unit of the meter value.public void setOpenAngle(int value)
value
- angle between 0 and 180 degrees. Default value is 180 degrees.public void setOrientation(int orientation)
ORIENTATION_LEFT
, ORIENTATION_MIDDLE
and ORIENTATION_RIGHT
. The default is
ORIENTATION_MIDDLE
.
orientation
- The new scale orientation.public void setValue(int value)
value
- the value to set.public boolean transferFocus()
transferFocus
in class Component
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |