Style Intelligence v12.0

inetsoft.graph.aesthetic
Class CategoricalColorFrame

java.lang.Object
  extended by inetsoft.graph.aesthetic.VisualFrame
      extended by inetsoft.graph.aesthetic.ColorFrame
          extended by inetsoft.graph.aesthetic.CategoricalColorFrame
All Implemented Interfaces:
CategoricalFrame, Serializable, Cloneable

public class CategoricalColorFrame
extends ColorFrame
implements CategoricalFrame

This class defines a color frame for categorical values. Each value is assigned a distinct color.

See Also:
Serialized Form

Field Summary
static Color[] COLOR_PALETTE
          The color palette.
 
Constructor Summary
CategoricalColorFrame()
          Create a color frame for categorical values.
CategoricalColorFrame(String field)
          Create a color frame.
 
Method Summary
 Object clone()
          Create a copy of this object.
 boolean equals(Object obj)
          Check if equals another object.
 Color getColor(DataSet data, String col, int row)
          Get the color for the chart object.
 Color getColor(int index)
          Get the color at the specified index.
 Color getColor(Object val)
          Get the color for the specified value.
 int getColorCount()
          Get the number of colors in the frame.
 void init(DataSet data)
          Initialize the categorical color frame with categorical values.
 void init(Object[] vals)
          Initialize the categorical color frame with categorical values.
 void init(Object[] vals, Color[] clrs)
          Initialize the categorical color frame with categorical values and colors.
 boolean isStatic(Object val)
          Check if the value is assigned a static aesthetic value.
 void setColor(int index, Color color)
          Set or append the color at the specified index.
 void setColor(Object val, Color color)
          Set the color for the specified value.
 
Methods inherited from class inetsoft.graph.aesthetic.ColorFrame
getBrightness, isGrayscale, process, setBrightness, setGrayscale
 
Methods inherited from class inetsoft.graph.aesthetic.VisualFrame
createComparator, getField, getLabels, getLegendFrame, getLegendSpec, getScale, getScaleOption, getTitle, getValues, hashCode, isValid, isVisible, setField, setLegendFrame, setLegendSpec, setScale, setScaleOption, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

COLOR_PALETTE

public static Color[] COLOR_PALETTE
The color palette.

Constructor Detail

CategoricalColorFrame

public CategoricalColorFrame()
Create a color frame for categorical values.


CategoricalColorFrame

public CategoricalColorFrame(String field)
Create a color frame.

Parameters:
field - field to get value to map to color.
Method Detail

init

public void init(Object[] vals)
Initialize the categorical color frame with categorical values.


init

public void init(Object[] vals,
                 Color[] clrs)
Initialize the categorical color frame with categorical values and colors. The value and color array must have identical length, and each value is assigned the color from the color array at the same position.


init

public void init(DataSet data)
Initialize the categorical color frame with categorical values. The values in the field column is used to obtain a distinct value list.

Overrides:
init in class VisualFrame

getColor

public Color getColor(DataSet data,
                      String col,
                      int row)
Get the color for the chart object.

Specified by:
getColor in class ColorFrame
Parameters:
data - the specified dataset.
col - the name of the specified column.
row - the specified row index.

getColor

public Color getColor(Object val)
Get the color for the specified value.

Specified by:
getColor in class ColorFrame

setColor

public void setColor(Object val,
                     Color color)
Set the color for the specified value.


isStatic

public boolean isStatic(Object val)
Check if the value is assigned a static aesthetic value.

Specified by:
isStatic in interface CategoricalFrame

getColor

public Color getColor(int index)
Get the color at the specified index.


setColor

public void setColor(int index,
                     Color color)
Set or append the color at the specified index.


getColorCount

public int getColorCount()
Get the number of colors in the frame.


equals

public boolean equals(Object obj)
Check if equals another object.

Overrides:
equals in class ColorFrame

clone

public Object clone()
Create a copy of this object.

Overrides:
clone in class VisualFrame

Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.