public abstract class AbstractOrientation extends java.lang.Object implements Orientation
Orientation
instances.Modifier | Constructor and Description |
---|---|
protected |
AbstractOrientation()
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected static int |
calculate(int val,
int max,
int size)
Returns the fraction
val/max rounded to [0..size ]. |
int |
getCur()
Returns the current value.
|
int |
getH()
Returns the height of the highlighted part of the image.
|
int |
getHeight()
Returns the total height of the image.
|
int |
getMax()
Returns the maximum value.
|
int |
getMin()
Returns the minimum value.
|
int |
getW()
Returns the width of the highlighted part of the image.
|
int |
getWidth()
Returns the total width of the image.
|
int |
getX()
Returns the x-coordinate of the highlighted part of the image.
|
int |
getY()
Returns the y-coordinate of the highlighted part of the image.
|
boolean |
isLowImage()
Returns whether the low image should be shown.
|
boolean |
isNegativeImage()
Returns whether the negative image should be shown.
|
boolean |
isValid()
Returns whether the gauge's values are valid.
|
protected abstract void |
reCalculate()
Recalculate the extents of the highlighted image part.
|
boolean |
setExtends(int width,
int height)
Sets the extends of the image.
|
protected void |
setExtent(int x,
int y,
int w,
int h)
Sets the extent of the highlighted part of the image.
|
void |
setHasNegativeImage(boolean hasNegativeImage)
Sets whether the gauge can display negative images.
|
boolean |
setValues(int cur,
int min,
int max)
Sets the gauge's values.
|
public void setHasNegativeImage(boolean hasNegativeImage)
Orientation
setHasNegativeImage
in interface Orientation
hasNegativeImage
- whether the gauge can display negative imagespublic boolean setValues(int cur, int min, int max)
Orientation
setValues
in interface Orientation
cur
- the current valuemin
- the minimum valuemax
- the maximum valuepublic boolean setExtends(int width, int height)
Orientation
setExtends
in interface Orientation
width
- the widthheight
- the heightpublic int getX()
Orientation
getX
in interface Orientation
public int getY()
Orientation
getY
in interface Orientation
public int getW()
Orientation
getW
in interface Orientation
public int getH()
Orientation
getH
in interface Orientation
public boolean isNegativeImage()
Orientation
isNegativeImage
in interface Orientation
public boolean isLowImage()
Orientation
isLowImage
in interface Orientation
public boolean isValid()
Orientation
isValid
in interface Orientation
protected abstract void reCalculate()
protected static int calculate(int val, int max, int size)
val/max
rounded to [0..size
].val
- the valuemax
- the range sizesize
- the size of the resultpublic int getWidth()
public int getHeight()
public int getCur()
public int getMin()
public int getMax()
protected void setExtent(int x, int y, int w, int h)
x
- the x-coordinatey
- the y-coordinatew
- the widthh
- the height