public class DialModelScale
extends java.lang.Object
implements java.io.Serializable
DialModel.newScale()
to start setting the scale.Modifier and Type | Method and Description |
---|---|
int |
getIndex() |
double |
getMajorTickInterval()
Returns the interval between major tick (in lower bound and upper bound).
|
int |
getMinorTickCount()
returns the number of minor ticks between major tick.
|
java.lang.String |
getNeedleColor()
Get the needle color of this scale(in string as #RRGGBB).
|
double |
getNeedleRadius()
Return the radius percentage(0 ~ 1) of the scale's needle; default to 0.9.
|
int[] |
getNeedleRGB()
Get the needle color of this scale in int array (0: red, 1: green, 2:blue).
|
java.lang.String |
getNeedleType()
Returns the needle type of this scale ("pointer" or "pin")
|
DialModelRange |
getRange(int index)
Returns the color range of the specified index.
|
double |
getScaleExtent()
Returns angles in degree extended from the starting angle (counter clockwise is positive).
|
double |
getScaleLowerBound()
Returns the scale's lower bound.
|
double |
getScaleStartAngle()
Returns starting angle in degree associated to the sclae's lower bound
(0 degree point to east, counter-clockwise is positive).
|
double |
getScaleUpperBound()
Returns the scale's upper bound.
|
java.lang.String |
getText()
Returns the text annotation of this scale.
|
java.awt.Font |
getTextFont()
Returns the text annotation font.
|
double |
getTextRadius()
Return the radius percentage(0 ~ 1) to place the text annotation.
|
java.lang.String |
getTickColor()
Get the tick color of this scale(in string as #RRGGBB).
|
java.awt.Font |
getTickFont()
Returns the tick label font.
|
double |
getTickLabelOffset()
Returns the radius offset in percentage(0 ~ 1) between the tick and tick label.
|
double |
getTickRadius()
Return the radius percentage(0 ~ 1) to place the tick label.
|
int[] |
getTickRGB()
Get the tick color of this scale in int array (0: red, 1: green, 2:blue).
|
double |
getValue()
Get the value
|
double |
getValueAngle()
Return the angle to place the value (counter clockwise is positive).
|
java.awt.Font |
getValueFont()
Returns the value font.
|
double |
getValueRadius()
Return the radius percentage(0 ~ 1) to place the value.
|
DialModelRange |
newRange(double lower,
double upper,
java.lang.String color,
double innerRadius,
double outerRadius)
Setup the DailModel range.
|
int |
rangeSize()
Returns the number of ranges associated with this scale.
|
void |
removeRange(DialModelRange range)
Removes the specified range from this scale.
|
void |
setNeedleColor(java.lang.String color)
Set the needle color.
|
void |
setNeedleRadius(double radius)
Sets the radius percentage(0 ~ 1) of the scale's needle; default to 0.9.
|
void |
setNeedleType(java.lang.String type)
Sets the needle type of this scale ("pointer" or "pin")
|
void |
setScale(double lowerBound,
double upperBound,
double startAngle,
double extent,
double majorTickInterval,
int minorTickCount)
Sets the scale information of this DialModelScale.
|
void |
setText(java.lang.String text)
Sets the text annotation of this scale; e.g.
|
void |
setTextFont(java.awt.Font font)
Sets the text annotation font.
|
void |
setTextRadius(double radius)
Sets the radius percentage(0 ~ 1) to place the text annotation.
|
void |
setTickColor(java.lang.String color)
Set the tick color.
|
void |
setTickFont(java.awt.Font font)
Sets the tick label font.
|
void |
setTickLabelOffset(double tickLabelOffset)
Sets the radius offset in percentage(0 ~ 1) between the tick and tick label.
|
void |
setTickRadius(double radius)
Sets the radius percentage(0 ~ 1) to place the tick label.
|
void |
setValue(double val) |
void |
setValueAngle(double angle)
Sets the angle in degree to place the value (counter clockwise is positive).
|
void |
setValueFont(java.awt.Font font)
Sets the value font.
|
void |
setValueRadius(double radius)
Sets the radius percentage(0 ~ 1) to place the value.
|
public int getIndex()
public double getValue()
public void setValue(double val)
public java.lang.String getText()
public void setText(java.lang.String text)
text
- text annotation(subtitle) of this scale.public java.awt.Font getTextFont()
public void setTextFont(java.awt.Font font)
font
- the text annotation font.public double getTextRadius()
public void setTextRadius(double radius)
radius
- radius percentage(0 ~ 1) to place the text annotation.public java.awt.Font getValueFont()
public void setValueFont(java.awt.Font font)
font
- the value font.public double getValueRadius()
public void setValueRadius(double radius)
radius
- radius percentage(0 ~ 1) to place the value.public double getValueAngle()
public void setValueAngle(double angle)
angle
- angle in degree to place the value (counter clockwise is positive).public void setScale(double lowerBound, double upperBound, double startAngle, double extent, double majorTickInterval, int minorTickCount)
lowerBound
- lower bound of this scale.upperBound
- upper bound of this scale.startAngle
- starting angle in degree associated to the sclae's lower bound(0 degree point to east, counter-clockwise is positive).extent
- angles in degree extended from the starting angle (counter clockwise is positive).majorTickInterval
- the interval between major tick (in lower bound and upper bound).minorTickCount
- the number of minor ticks between major tick.public double getScaleLowerBound()
public double getScaleUpperBound()
public double getScaleStartAngle()
public double getScaleExtent()
public double getMajorTickInterval()
public int getMinorTickCount()
public java.awt.Font getTickFont()
public void setTickFont(java.awt.Font font)
font
- the tick label font.public double getTickRadius()
public void setTickRadius(double radius)
radius
- radius percentage(0 ~ 1) to place the tick label.public double getTickLabelOffset()
public void setTickLabelOffset(double tickLabelOffset)
tickLabelOffset
- the radius offset in percentage(0 ~ 1) between the tick and tick label.public void setTickColor(java.lang.String color)
color
- in #RRGGBB format (hexadecimal).public java.lang.String getTickColor()
public int[] getTickRGB()
public DialModelRange newRange(double lower, double upper, java.lang.String color, double innerRadius, double outerRadius)
lower
- the lower bound in the scale.upper
- the upper bound in the scale.color
- the color in #RRGGBB format (hexadecimal); default to blue.innerRadius
- the inner radius percentage(0 ~ 1) of the range; default to 0.7.outerRadius
- the outer radius percentage(0 ~ 1) of the range; default to 0.8;public int rangeSize()
public DialModelRange getRange(int index)
index
- the specified index.public void removeRange(DialModelRange range)
range
- the range to be removed.public java.lang.String getNeedleType()
public void setNeedleType(java.lang.String type)
type
- the needle type of this scale ("pointer" or "pin")public void setNeedleColor(java.lang.String color)
color
- in #RRGGBB format (hexadecimal).public java.lang.String getNeedleColor()
public int[] getNeedleRGB()
public void setNeedleRadius(double radius)
radius
- the radius percentage(0 ~ 1) of the scale's needle; default to 0.9.public double getNeedleRadius()
Copyright © 2005-2011 Potix Corporation. All Rights Reserved.