infovis.visualization.color
Class OrderedColor

java.lang.Object
  extended by infovis.visualization.ColorVisualization
      extended by infovis.visualization.color.OrderedColor
All Implemented Interfaces:
EventListener, ChangeListener
Direct Known Subclasses:
EqualizedOrderedColor

public class OrderedColor
extends ColorVisualization

Color BasicVisualization for Ordered values.

Version:
$Revision: 1.20 $
Author:
Jean-Daniel Fekete

Constructor Summary
OrderedColor(NumberColumn column)
          Creates a new OrderedColor object.
OrderedColor(NumberColumn column, Color[] ramp)
           
OrderedColor(NumberColumn column, Color start, Color end)
          Constructor for OrderedColor.
 
Method Summary
 Color[] getCache()
           
 int getCacheSize()
           
 Color getColor(int row)
          Returns a
 int getColorAtParameter(double t)
           
 int getColorFor(double value)
           
 double getColorParameterFor(double value)
           
 int getColorValue(int row)
          Returns the color value omputed for the specified row.
 Column getColumn()
          Returns the managed Column.
static Color[] getDefaultRamp()
           
 Color getEnd()
          Returns the end Color.
 Color[] getRampReference()
           
 Color getStart()
          Returns the start Color.
 void setCacheSize(int cacheSize)
           
 void setColumn(Column c)
          Sets the managed column.
static void setDefaultRamp(Color[] ramp)
           
static void setDefaults(Color[] ramp)
           
 void setEnd(Color end)
          Sets the end color.
 void setRamp(Color[] ramp)
           
 void setRange(double min, double max)
           
 void setStart(Color start)
          Sets the start color.
 void stateChanged(ChangeEvent e)
           
 void update()
           
 
Methods inherited from class infovis.visualization.ColorVisualization
colorComplement, computeColor
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrderedColor

public OrderedColor(NumberColumn column,
                    Color[] ramp)

OrderedColor

public OrderedColor(NumberColumn column,
                    Color start,
                    Color end)
Constructor for OrderedColor.


OrderedColor

public OrderedColor(NumberColumn column)
Creates a new OrderedColor object.

Parameters:
column - the managed column.
Method Detail

setDefaults

public static void setDefaults(Color[] ramp)

setColumn

public void setColumn(Column c)
Sets the managed column.

Overrides:
setColumn in class ColorVisualization
Parameters:
c - the column.

stateChanged

public void stateChanged(ChangeEvent e)
See Also:
ChangeListener.stateChanged(ChangeEvent)

getCache

public Color[] getCache()

update

public void update()

getColumn

public Column getColumn()
Description copied from class: ColorVisualization
Returns the managed Column.

Overrides:
getColumn in class ColorVisualization
Returns:
the managed Column.
See Also:
ColorVisualization.getColumn()

getColorParameterFor

public double getColorParameterFor(double value)

getColorAtParameter

public int getColorAtParameter(double t)

getColorFor

public int getColorFor(double value)

getColorValue

public int getColorValue(int row)
Description copied from class: ColorVisualization
Returns the color value omputed for the specified row.

Color are coded as a 32bits integers. If the color is coded with red, green, blue and alpha floating point values between 0 and 1, the returned value is: ((((int)(a * 255)) & 0xFF) << 24) | ((((int)(r * 255)) & 0xFF) << 16) | ((((int)(g * 255)) & 0xFF) << 8) | ((((int)(b * 255)) & 0xFF) << 0);

Specified by:
getColorValue in class ColorVisualization
Returns:
the color computed for the specified row.
See Also:
ColorVisualization.getColor(int)

getColor

public Color getColor(int row)
Description copied from class: ColorVisualization
Returns a

Overrides:
getColor in class ColorVisualization

getRampReference

public Color[] getRampReference()

setRamp

public void setRamp(Color[] ramp)

getStart

public Color getStart()
Returns the start Color.

Returns:
the start Color.

setStart

public void setStart(Color start)
Sets the start color.

Parameters:
start - the start Color.

getEnd

public Color getEnd()
Returns the end Color.

Returns:
the end Color.

setEnd

public void setEnd(Color end)
Sets the end color.

Parameters:
end - the end Color.

getDefaultRamp

public static Color[] getDefaultRamp()

setDefaultRamp

public static void setDefaultRamp(Color[] ramp)

getCacheSize

public int getCacheSize()

setCacheSize

public void setCacheSize(int cacheSize)

setRange

public void setRange(double min,
                     double max)


Copyright © 2005 by Jean-Daniel Fekete and INRIA, France All rights reserved.