Class Colors


  • public final class Colors
    extends AbstractNode
    Is a map to apply the color stop of the gradient in relation with the data of the chart.
    Author:
    Andrea "Stock" Stocchero
    • Method Detail

      • clear

        public void clear()
        Removes all keys.
      • setColor

        public void setColor​(String value,
                             IsColor color)
        Sets a color in the gradient, by a value of chart.
        Parameters:
        value - the value of the chart where the color stop has been applied
        color - the color assigned at passed chart value.
      • setColor

        public void setColor​(String value,
                             String color)
        Sets a color in the gradient, by a value of chart.
        Parameters:
        value - the value of the chart where the color stop has been applied
        color - the color assigned at passed chart value.
      • getColorAsString

        public String getColorAsString​(String value)
        Returns the stored color in the gradient, by a value of chart.
        Parameters:
        value - the value of the chart where the color stop has been applied
        Returns:
        the color assigned at passed chart value.
      • getColor

        public IsColor getColor​(String value)
        Returns the stored color in the gradient, by a value of chart.
        Parameters:
        value - the value of the chart where the color stop has been applied
        Returns:
        the color assigned at passed chart value.
      • remove

        public void remove​(String... values)
        Removes a color by keys.
        Parameters:
        values - the values of the chart where the color stop has been applied
      • setColor

        public void setColor​(double value,
                             IsColor color)
        Sets a color in the gradient, by a value of chart.
        Parameters:
        value - the value of the chart where the color stop has been applied
        color - the color assigned at passed chart value.
      • setColor

        public void setColor​(double value,
                             String color)
        Sets a color in the gradient, by a value of chart.
        Parameters:
        value - the value of the chart where the color stop has been applied
        color - the color assigned at passed chart value.
      • getColorAsString

        public String getColorAsString​(double value)
        Returns the stored color in the gradient, by a value of chart.
        Parameters:
        value - the value of the chart where the color stop has been applied
        Returns:
        the color assigned at passed chart value.
      • getColor

        public IsColor getColor​(double value)
        Returns the stored color in the gradient, by a value of chart.
        Parameters:
        value - the value of the chart where the color stop has been applied
        Returns:
        the color assigned at passed chart value.
      • remove

        public void remove​(double... values)
        Removes a color by keys.
        Parameters:
        values - the values of the chart where the color stop has been applied
      • setColor

        public void setColor​(Date value,
                             IsColor color)
        Sets a color in the gradient, by a value of chart.
        Parameters:
        value - the value of the chart where the color stop has been applied
        color - the color assigned at passed chart value.
      • setColor

        public void setColor​(Date value,
                             String color)
        Sets a color in the gradient, by a value of chart.
        Parameters:
        value - the value of the chart where the color stop has been applied
        color - the color assigned at passed chart value.
      • getColorAsString

        public String getColorAsString​(Date value)
        Returns the stored color in the gradient, by a value of chart.
        Parameters:
        value - the value of the chart where the color stop has been applied
        Returns:
        the color assigned at passed chart value.
      • getColor

        public IsColor getColor​(Date value)
        Returns the stored color in the gradient, by a value of chart.
        Parameters:
        value - the value of the chart where the color stop has been applied
        Returns:
        the color assigned at passed chart value.
      • remove

        public void remove​(Date... values)
        Removes a color by keys.
        Parameters:
        values - the values of the chart where the color stop has been applied
      • addMap

        public boolean addMap​(Map<Key,​String> toAdd)
        Adds a map of values and colors to the colors container.
        Parameters:
        toAdd - map to add to container
        Returns:
        true if the values and colors has been loaded, otherwise false
      • loadMap

        public boolean loadMap​(Map<Key,​String> toLoad)
        Loads a map of values and colors to the colors container, removing all existing values.
        Parameters:
        toLoad - map to load to container
        Returns:
        true if the values and colors has been loaded, otherwise false
      • toMap

        public Map<Key,​String> toMap()
        Exports the values and the colors in a map.
        Returns:
        the values and the colors in a map