Package net.sourceforge.chart2d
Class MultiColorsProperties
java.lang.Object
net.sourceforge.chart2d.MultiColorsProperties
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final intCHART2D colors are a set of 12 colors selected by a graphic designer.static final Color[]The default is new Color[0].static final booleanThe default is false.static final intThe default is CHART2D.static final intNATURAL colors are more pure than PASTEL colors.static final intPASTEL colors have other colors besides their primary ones added to them. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a MultiColorsProperties object with the documented default values.MultiColorsProperties(MultiColorsProperties multiColorsProps) Creates a MultiColorsProperties object with property values copied from another object. -
Method Summary
Modifier and TypeMethodDescriptionfinal Color[]getColorsArray(int length) Gets an array of Colors of the length requested.final Color[]Gets the custom color array.final booleanGets whether the colors are to be manual (custom) or to be automatically selected.final intGets the type of colors.final voidsetColorsCustom(Color[] colors) Sets the custom color array.final voidsetColorsCustomize(boolean cust) Sets whether the colors are to be manual (custom) or to be automatically selected.final voidsetColorsType(int type) Sets the type of colors.final voidsetMultiColorsProperties(MultiColorsProperties multiColorsProps) Sets all properties to be the values of another MultiColorsProperties object.final voidSets all properties to their default values.
-
Field Details
-
NATURAL
public static final int NATURALNATURAL colors are more pure than PASTEL colors.- See Also:
-
PASTEL
public static final int PASTELPASTEL colors have other colors besides their primary ones added to them.- See Also:
-
CHART2D
public static final int CHART2DCHART2D colors are a set of 12 colors selected by a graphic designer.- See Also:
-
COLORS_CUSTOMIZE_DEFAULT
public static final boolean COLORS_CUSTOMIZE_DEFAULTThe default is false.- See Also:
-
COLORS_CUSTOM_DEFAULT
The default is new Color[0]. -
COLORS_TYPE_DEFAULT
public static final int COLORS_TYPE_DEFAULTThe default is CHART2D.- See Also:
-
-
Constructor Details
-
MultiColorsProperties
public MultiColorsProperties()Creates a MultiColorsProperties object with the documented default values. -
MultiColorsProperties
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
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
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
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
Gets an array of Colors of the length requested.- Parameters:
length- The number of colors requested.- Returns:
- The color array.
-