Class MultiColorsProperties

java.lang.Object
net.sourceforge.chart2d.MultiColorsProperties

public final class MultiColorsProperties extends Object
A data structure for holding the properties common to all sets of colors. Charting requires sets of colors (one color for each set for example). Color generation can be done manually or automatically. Even if manually, some automation adds convenience. A MultiColorsProperties takes care of the generation of color sets either way. Pass this to any number of color requiring objects.
  • Field Details

    • NATURAL

      public static final int NATURAL
      NATURAL colors are more pure than PASTEL colors.
      See Also:
    • PASTEL

      public static final int PASTEL
      PASTEL colors have other colors besides their primary ones added to them.
      See Also:
    • CHART2D

      public static final int CHART2D
      CHART2D colors are a set of 12 colors selected by a graphic designer.
      See Also:
    • COLORS_CUSTOMIZE_DEFAULT

      public static final boolean COLORS_CUSTOMIZE_DEFAULT
      The default is false.
      See Also:
    • COLORS_CUSTOM_DEFAULT

      public static final Color[] COLORS_CUSTOM_DEFAULT
      The default is new Color[0].
    • COLORS_TYPE_DEFAULT

      public static final int COLORS_TYPE_DEFAULT
      The default is CHART2D.
      See Also:
  • Constructor Details

    • MultiColorsProperties

      public MultiColorsProperties()
      Creates a MultiColorsProperties object with the documented default values.
    • MultiColorsProperties

      public MultiColorsProperties(MultiColorsProperties multiColorsProps)
      Creates a MultiColorsProperties object with property values copied from another object. The copying is a deep copy.
      Parameters:
      multiColorsProps - The properties to copy.
  • Method Details

    • setMultiColorsPropertiesToDefaults

      public final void setMultiColorsPropertiesToDefaults()
      Sets all properties to their default values.
    • setMultiColorsProperties

      public final void setMultiColorsProperties(MultiColorsProperties multiColorsProps)
      Sets all properties to be the values of another MultiColorsProperties object. The copying is a deep copy.
      Parameters:
      multiColorsProps - The properties to copy.
    • setColorsCustomize

      public final void setColorsCustomize(boolean cust)
      Sets whether the colors are to be manual (custom) or to be automatically selected. If true, then use the setColorsCustom method to pass in an array of Color objects.
      Parameters:
      cust - If true, then manual colors are used.
    • setColorsCustom

      public final void setColorsCustom(Color[] colors)
      Sets the custom color array. To be used, the setColorsCustomize method must be set to true.
      Parameters:
      colors - The custom color array.
    • setColorsType

      public final void setColorsType(int type)
      Sets the type of colors. Possible values are NATURAL and PASTEL.
      Parameters:
      type - The type of colors in the array.
    • getColorsCustomize

      public final boolean getColorsCustomize()
      Gets whether the colors are to be manual (custom) or to be automatically selected. If true, then use the setColorsCustom method to pass in an array of Color objects.
      Returns:
      If true, then manual colors are used.
    • getColorsCustom

      public final Color[] getColorsCustom()
      Gets the custom color array. To be used, the setColorsCustomize method must be set to true.
      Returns:
      The custom color array.
    • getColorsType

      public final int getColorsType()
      Gets the type of colors. Possible values are NATURAL and PASTEL.
      Returns:
      The type of colors in the array.
    • getColorsArray

      public final Color[] getColorsArray(int length)
      Gets an array of Colors of the length requested.
      Parameters:
      length - The number of colors requested.
      Returns:
      The color array.