com.spelunkcomputing.color
Class ColorPalette

java.lang.Object
  extended by com.spelunkcomputing.color.ColorPalette
All Implemented Interfaces:
java.io.Serializable

public class ColorPalette
extends java.lang.Object
implements java.io.Serializable

Represents a collection of related colors. The colors may be related in the specific sense of conforming to a perscribed ColorRelation or they may "related" in the looser sense that the user has choosen them as a set of colors. Instances of this class are immutable with respect to the colors and color relation but not with respect to the name.

See Also:
Serialized Form

Constructor Summary
ColorPalette(java.awt.Color[] colors, java.lang.String name)
           
ColorPalette(ColorPalette original, java.lang.String name)
           
ColorPalette(ColorRelation relation, int index, java.awt.Color color, java.lang.String name)
           
 
Method Summary
 boolean equals(java.lang.Object other)
           
 java.awt.Color getColor(int index)
           
 int getColorCount()
           
 ColorRelation getColorRelation()
           
 java.awt.Color[] getColors()
           
 java.lang.String getName()
           
 ColorRelation.Type getRelationType()
           
 java.lang.String getTip()
           
 int hashCode()
           
 void setName(java.lang.String name)
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColorPalette

public ColorPalette(ColorRelation relation,
                    int index,
                    java.awt.Color color,
                    java.lang.String name)

ColorPalette

public ColorPalette(java.awt.Color[] colors,
                    java.lang.String name)

ColorPalette

public ColorPalette(ColorPalette original,
                    java.lang.String name)
Method Detail

getColorRelation

public ColorRelation getColorRelation()

getRelationType

public ColorRelation.Type getRelationType()

getColorCount

public int getColorCount()

getColor

public java.awt.Color getColor(int index)

getColors

public java.awt.Color[] getColors()

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getTip

public java.lang.String getTip()