infovis.visualization
Class ColorVisualization

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

public abstract class ColorVisualization
extends Object
implements ChangeListener

Interface for Color Visualizations.

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

Constructor Summary
ColorVisualization(Column column)
           
 
Method Summary
static Color colorComplement(Color c)
           
static int computeColor(double r, double g, double b, double a)
          Convert r,g,b,a float values into an int.
 Color getColor(int row)
          Returns a
abstract  int getColorValue(int row)
          Returns the color value omputed for the specified row.
 Column getColumn()
          Returns the managed Column.
 void setColumn(Column c)
          Sets the managed column
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.event.ChangeListener
stateChanged
 

Constructor Detail

ColorVisualization

public ColorVisualization(Column column)
Method Detail

getColumn

public Column getColumn()
Returns the managed Column.

Returns:
the managed Column.

setColumn

public void setColumn(Column c)
Sets the managed column

Parameters:
c - the new column to manage

getColorValue

public abstract int getColorValue(int row)
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);

Returns:
the color computed for the specified row.

getColor

public Color getColor(int row)
Returns a


computeColor

public static int computeColor(double r,
                               double g,
                               double b,
                               double a)
Convert r,g,b,a float values into an int.

Parameters:
r - DOCUMENT ME!
g - DOCUMENT ME!
b - DOCUMENT ME!
a - DOCUMENT ME!
Returns:
DOCUMENT ME!

colorComplement

public static Color colorComplement(Color c)


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