Package org.zkoss.zul

Class DialModel

All Implemented Interfaces:
Serializable, ChartModel

public class DialModel extends AbstractChartModel
A data model to be used with dial chart.
Author:
henrichen
See Also:
  • Constructor Details

    • DialModel

      public DialModel()
  • Method Details

    • size

      public int size()
      Returns the number of DialModelScales.
    • 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 the DialModelScale 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 Scale
      value - 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(String color)
      Set the background color of the dial frame.
      Parameters:
      color - in #RRGGBB format (hexadecimal).
    • getFrameBgColor

      public 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(String color)
      Set the foreground color of the dial frame.
      Parameters:
      color - in #RRGGBB format (hexadecimal).
    • getFrameFgColor

      public 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(String color)
      Set the 1st background color of the dial frame (for gradient starting color).
      Parameters:
      color - in #RRGGBB format (hexadecimal).
    • getFrameBgColor1

      public 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(String color)
      Set the 2nd background color of the dial frame (for gradient ending color).
      Parameters:
      color - in #RRGGBB format (hexadecimal).
    • getFrameBgColor2

      public 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(String direction)
      Set the Frame background gradient color direction (from bgColor1 to bgColor2); center_horizontal, center_vertical, horizontal, vertical.
    • getGradientDirection

      public 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, String propertyKey, Object data)
      Fire the chart data event with the given property key.
      Parameters:
      type -
      propertyKey -
      data -
      Since:
      7.0.1
    • clone

      public Object clone()
      Overrides:
      clone in class AbstractChartModel