Package org.zkoss.zul
Class DialModel
- java.lang.Object
-
- org.zkoss.zul.AbstractChartModel
-
- org.zkoss.zul.DialModel
-
- All Implemented Interfaces:
java.io.Serializable
,ChartModel
public class DialModel extends AbstractChartModel
A data model to be used with dial chart.- Author:
- henrichen
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.zkoss.zul.AbstractChartModel
_listeners
-
-
Constructor Summary
Constructors Constructor Description DialModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
clear the model.java.lang.Object
clone()
protected void
fireEvent(int type, java.lang.String propertyKey, java.lang.Object data)
Fire the chart data event with the given property key.double
getCapRadius()
Return the radius percentage(0 ~ 1) of the meter's cap; default to 0.07.int
getFrameBgAlpha()
Get the background alpha of the dial frame (transparency, 0 ~ 255, opacue).java.lang.String
getFrameBgColor()
Get the background color of the dial frame (in string as #RRGGBB).java.lang.String
getFrameBgColor1()
Get the 1st background color of the dial frame (in string as #RRGGBB) for gradient starting color.java.lang.String
getFrameBgColor2()
Get the 2nd background color of the dial frame (in string as #RRGGBB) for gradient ending color.int[]
getFrameBgRGB()
Get the background color of the dial frame in int array (0: red, 1: green, 2:blue).int[]
getFrameBgRGB1()
Get the 1st background color of the dial frame in int array (0: red, 1: green, 2:blue) for gradient starting color.int[]
getFrameBgRGB2()
Get the 2nd background color of the dial frame in int array (0: red, 1: green, 2:blue) for gradient ending color.java.lang.String
getFrameFgColor()
Get the foreground color of the dial frame (in string as #RRGGBB).int[]
getFrameFgRGB()
Get the foreground color of the dial frame in int array (0: red, 1: green, 2:blue).java.lang.String
getGradientDirection()
Returns the Frame background gradient color direction (from bgColor1 to bgColor2); center_horizontal, center_vertical, horizontal, vertical.DialModelScale
getScale(int index)
Returns theDialModelScale
of the specified index.double
getValue(int index)
Get value of the scale per the specified index.int
indexOf(DialModelScale entry)
Return the index of the specified model entry.DialModelScale
newScale()
new an instance of scale in this DialModel.DialModelScale
newScale(double lowerBound, double upperBound, double startAngle, double extent, double majorTickInterval, int minorTickCount)
new an instance of scale in this DialModel.void
removeScale(DialModelScale scale)
Remove the specified DialModelScale from this DialModel.void
setCapRadius(double radius)
Sets the radius percentage(0 ~ 1) of the meter's cap; default to 0.07.void
setFrameBgAlpha(int alpha)
Set the background alpha of the dial frame (transparency, 0 ~ 255).void
setFrameBgColor(java.lang.String color)
Set the background color of the dial frame.void
setFrameBgColor1(java.lang.String color)
Set the 1st background color of the dial frame (for gradient starting color).void
setFrameBgColor2(java.lang.String color)
Set the 2nd background color of the dial frame (for gradient ending color).void
setFrameFgColor(java.lang.String color)
Set the foreground color of the dial frame.void
setGradientDirection(java.lang.String direction)
Set the Frame background gradient color direction (from bgColor1 to bgColor2); center_horizontal, center_vertical, horizontal, vertical.void
setValue(int index, double value)
add or update the value of a specified scale index.int
size()
Returns the number ofDialModelScale
s.-
Methods inherited from class org.zkoss.zul.AbstractChartModel
addChartDataListener, fireEvent, removeChartDataListener
-
-
-
-
Method Detail
-
size
public int size()
Returns the number ofDialModelScale
s.
-
newScale
public DialModelScale newScale()
new an instance of scale in this DialModel.- Returns:
- an instance of scale in this DialModel.
-
newScale
public DialModelScale newScale(double lowerBound, double upperBound, double startAngle, double extent, double majorTickInterval, int minorTickCount)
new an instance of scale in this DialModel.- Parameters:
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.
-
indexOf
public int indexOf(DialModelScale entry)
Return the index of the specified model entry.- Parameters:
entry
- the DialModelScale- Returns:
- the index of the specified model entry.
-
getScale
public DialModelScale getScale(int index)
Returns theDialModelScale
of the specified index.- Parameters:
index
- the index of the entry.- Returns:
- the DialModelScale.
-
removeScale
public void removeScale(DialModelScale scale)
Remove the specified DialModelScale from this DialModel.- Parameters:
scale
-
-
getValue
public double getValue(int index)
Get value of the scale per the specified index.- Parameters:
index
- the scale index.
-
setValue
public void setValue(int index, double value)
add or update the value of a specified scale index.- Parameters:
index
- the index of the Scalevalue
- the value
-
clear
public void clear()
clear the model.
-
setFrameBgAlpha
public void setFrameBgAlpha(int alpha)
Set the background alpha of the dial frame (transparency, 0 ~ 255).- Parameters:
alpha
- the transparency of background color (0 ~ 255, default to 255 opaque).
-
getFrameBgAlpha
public int getFrameBgAlpha()
Get the background alpha of the dial frame (transparency, 0 ~ 255, opacue).
-
setFrameBgColor
public void setFrameBgColor(java.lang.String color)
Set the background color of the dial frame.- Parameters:
color
- in #RRGGBB format (hexadecimal).
-
getFrameBgColor
public java.lang.String getFrameBgColor()
Get the background color of the dial frame (in string as #RRGGBB). null means default.
-
getFrameBgRGB
public int[] getFrameBgRGB()
Get the background color of the dial frame in int array (0: red, 1: green, 2:blue). null means default.
-
setFrameFgColor
public void setFrameFgColor(java.lang.String color)
Set the foreground color of the dial frame.- Parameters:
color
- in #RRGGBB format (hexadecimal).
-
getFrameFgColor
public java.lang.String getFrameFgColor()
Get the foreground color of the dial frame (in string as #RRGGBB). null means default.
-
getFrameFgRGB
public int[] getFrameFgRGB()
Get the foreground color of the dial frame in int array (0: red, 1: green, 2:blue). null means default.
-
setFrameBgColor1
public void setFrameBgColor1(java.lang.String color)
Set the 1st background color of the dial frame (for gradient starting color).- Parameters:
color
- in #RRGGBB format (hexadecimal).
-
getFrameBgColor1
public java.lang.String getFrameBgColor1()
Get the 1st background color of the dial frame (in string as #RRGGBB) for gradient starting color. null means use default.
-
getFrameBgRGB1
public int[] getFrameBgRGB1()
Get the 1st background color of the dial frame in int array (0: red, 1: green, 2:blue) for gradient starting color. null means use default.
-
setFrameBgColor2
public void setFrameBgColor2(java.lang.String color)
Set the 2nd background color of the dial frame (for gradient ending color).- Parameters:
color
- in #RRGGBB format (hexadecimal).
-
getFrameBgColor2
public java.lang.String getFrameBgColor2()
Get the 2nd background color of the dial frame (in string as #RRGGBB) for gradient ending color. null means default.
-
getFrameBgRGB2
public int[] getFrameBgRGB2()
Get the 2nd background color of the dial frame in int array (0: red, 1: green, 2:blue) for gradient ending color. null means default.
-
setGradientDirection
public void setGradientDirection(java.lang.String direction)
Set the Frame background gradient color direction (from bgColor1 to bgColor2); center_horizontal, center_vertical, horizontal, vertical.
-
getGradientDirection
public java.lang.String getGradientDirection()
Returns the Frame background gradient color direction (from bgColor1 to bgColor2); center_horizontal, center_vertical, horizontal, vertical.
-
setCapRadius
public void setCapRadius(double radius)
Sets the radius percentage(0 ~ 1) of the meter's cap; default to 0.07.- Parameters:
radius
- the radius percentage(0 ~ 1) of the meter's cap.
-
getCapRadius
public double getCapRadius()
Return the radius percentage(0 ~ 1) of the meter's cap; default to 0.07.- Returns:
- the radius percentage(0 ~ 1) of the meter's cap.
-
fireEvent
protected void fireEvent(int type, java.lang.String propertyKey, java.lang.Object data)
Fire the chart data event with the given property key.- Parameters:
type
-propertyKey
-data
-- Since:
- 7.0.1
-
clone
public java.lang.Object clone()
- Overrides:
clone
in classAbstractChartModel
-
-