Class DefaultDialModel

    • Constructor Detail

      • DefaultDialModel

        public DefaultDialModel()
    • Method Detail

      • newScale

        public DialModelScale newScale()
        Description copied from interface: DialModel
        new an instance of scale in this DialModel.
        Specified by:
        newScale in interface 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)
        Description copied from interface: DialModel
        new an instance of scale in this DialModel.
        Specified by:
        newScale in interface 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)
        Description copied from interface: DialModel
        Return the index of the specified model entry.
        Specified by:
        indexOf in interface DialModel
        Parameters:
        entry - the DialModelScale
        Returns:
        the index of the specified model entry.
      • getScale

        public DialModelScale getScale​(int index)
        Description copied from interface: DialModel
        Returns the DialModelScale of the specified index.
        Specified by:
        getScale in interface DialModel
        Parameters:
        index - the index of the entry.
        Returns:
        the DialModelScale.
      • removeScale

        public void removeScale​(DialModelScale scale)
        Description copied from interface: DialModel
        Remove the specified DialModelScale from this DialModel.
        Specified by:
        removeScale in interface DialModel
      • getValue

        public double getValue​(int index)
        Description copied from interface: DialModel
        Get value of the scale per the specified index.
        Specified by:
        getValue in interface DialModel
        Parameters:
        index - the scale index.
      • setValue

        public void setValue​(int index,
                             double value)
        Description copied from interface: DialModel
        add or update the value of a specified scale index.
        Specified by:
        setValue in interface DialModel
        Parameters:
        index - the index of the Scale
        value - the value
      • clear

        public void clear()
        Description copied from interface: DialModel
        clear the model.
        Specified by:
        clear in interface DialModel
      • setFrameBgAlpha

        public void setFrameBgAlpha​(int alpha)
        Description copied from interface: DialModel
        Set the background alpha of the dial frame (transparency, 0 ~ 255).
        Specified by:
        setFrameBgAlpha in interface DialModel
        Parameters:
        alpha - the transparency of background color (0 ~ 255, default to 255 opaque).
      • getFrameBgAlpha

        public int getFrameBgAlpha()
        Description copied from interface: DialModel
        Get the background alpha of the dial frame (transparency, 0 ~ 255, opacue).
        Specified by:
        getFrameBgAlpha in interface DialModel
      • setFrameBgColor

        public void setFrameBgColor​(String color)
        Description copied from interface: DialModel
        Set the background color of the dial frame.
        Specified by:
        setFrameBgColor in interface DialModel
        Parameters:
        color - in #RRGGBB format (hexadecimal).
      • getFrameBgColor

        public String getFrameBgColor()
        Description copied from interface: DialModel
        Get the background color of the dial frame (in string as #RRGGBB). null means default.
        Specified by:
        getFrameBgColor in interface DialModel
      • getFrameBgRGB

        public int[] getFrameBgRGB()
        Description copied from interface: DialModel
        Get the background color of the dial frame in int array (0: red, 1: green, 2:blue). null means default.
        Specified by:
        getFrameBgRGB in interface DialModel
      • setFrameFgColor

        public void setFrameFgColor​(String color)
        Description copied from interface: DialModel
        Set the foreground color of the dial frame.
        Specified by:
        setFrameFgColor in interface DialModel
        Parameters:
        color - in #RRGGBB format (hexadecimal).
      • getFrameFgColor

        public String getFrameFgColor()
        Description copied from interface: DialModel
        Get the foreground color of the dial frame (in string as #RRGGBB). null means default.
        Specified by:
        getFrameFgColor in interface DialModel
      • getFrameFgRGB

        public int[] getFrameFgRGB()
        Description copied from interface: DialModel
        Get the foreground color of the dial frame in int array (0: red, 1: green, 2:blue). null means default.
        Specified by:
        getFrameFgRGB in interface DialModel
      • setFrameBgColor1

        public void setFrameBgColor1​(String color)
        Description copied from interface: DialModel
        Set the 1st background color of the dial frame (for gradient starting color).
        Specified by:
        setFrameBgColor1 in interface DialModel
        Parameters:
        color - in #RRGGBB format (hexadecimal).
      • getFrameBgColor1

        public String getFrameBgColor1()
        Description copied from interface: DialModel
        Get the 1st background color of the dial frame (in string as #RRGGBB) for gradient starting color. null means use default.
        Specified by:
        getFrameBgColor1 in interface DialModel
      • getFrameBgRGB1

        public int[] getFrameBgRGB1()
        Description copied from interface: DialModel
        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.
        Specified by:
        getFrameBgRGB1 in interface DialModel
      • setFrameBgColor2

        public void setFrameBgColor2​(String color)
        Description copied from interface: DialModel
        Set the 2nd background color of the dial frame (for gradient ending color).
        Specified by:
        setFrameBgColor2 in interface DialModel
        Parameters:
        color - in #RRGGBB format (hexadecimal).
      • getFrameBgColor2

        public String getFrameBgColor2()
        Description copied from interface: DialModel
        Get the 2nd background color of the dial frame (in string as #RRGGBB) for gradient ending color. null means default.
        Specified by:
        getFrameBgColor2 in interface DialModel
      • getFrameBgRGB2

        public int[] getFrameBgRGB2()
        Description copied from interface: DialModel
        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.
        Specified by:
        getFrameBgRGB2 in interface DialModel
      • setGradientDirection

        public void setGradientDirection​(String direction)
        Description copied from interface: DialModel
        Set the Frame background gradient color direction (from bgColor1 to bgColor2); center_horizontal, center_vertical, horizontal, vertical.
        Specified by:
        setGradientDirection in interface DialModel
      • getGradientDirection

        public String getGradientDirection()
        Description copied from interface: DialModel
        Returns the Frame background gradient color direction (from bgColor1 to bgColor2); center_horizontal, center_vertical, horizontal, vertical.
        Specified by:
        getGradientDirection in interface DialModel
      • setCapRadius

        public void setCapRadius​(double radius)
        Description copied from interface: DialModel
        Sets the radius percentage(0 ~ 1) of the meter's cap; default to 0.07.
        Specified by:
        setCapRadius in interface DialModel
        Parameters:
        radius - the radius percentage(0 ~ 1) of the meter's cap.
      • getCapRadius

        public double getCapRadius()
        Description copied from interface: DialModel
        Return the radius percentage(0 ~ 1) of the meter's cap; default to 0.07.
        Specified by:
        getCapRadius in interface DialModel
        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 -