Module org.jfree.chart3d
Package org.jfree.chart3d.plot
Class StandardColorSource<K extends Comparable<K>>
java.lang.Object
org.jfree.chart3d.plot.StandardColorSource<K>
- All Implemented Interfaces:
Serializable
,ColorSource<K>
public final class StandardColorSource<K extends Comparable<K>>
extends Object
implements ColorSource<K>, Serializable
A standard implementation of the
NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.
ColorSource
interface.
NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance with default colors.StandardColorSource
(Color... colors) Creates a new instance with the supplied sequence of colors. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Tests this paint source for equality with an arbitrary object.Returns the color associated with the specified key.void
Sets the color for the specified key.void
Clears existing color settings and sets the default colors to the supplied value.
-
Constructor Details
-
StandardColorSource
public StandardColorSource()Creates a new instance with default colors. -
StandardColorSource
Creates a new instance with the supplied sequence of colors. The supplied array must have at least one entry, and all entries must be non-null
.- Parameters:
colors
- the colors (null
not permitted).
-
-
Method Details
-
getColor
Returns the color associated with the specified key.- Specified by:
getColor
in interfaceColorSource<K extends Comparable<K>>
- Parameters:
key
- the key (null
not permitted).- Returns:
- The color (never
null
).
-
setColor
Sets the color for the specified key.- Specified by:
setColor
in interfaceColorSource<K extends Comparable<K>>
- Parameters:
key
- the key (null
not permitted).color
- the color (null
permitted).
-
style
Clears existing color settings and sets the default colors to the supplied value. This method is used by the framework and is not normally called by client code.- Specified by:
style
in interfaceColorSource<K extends Comparable<K>>
- Parameters:
colors
- the colors (null
not permitted).- Since:
- 1.2
-
equals
Tests this paint source for equality with an arbitrary object.
-