edu.washington.biostr.sig.volume.colors
Class AdvancedColorScheme

java.lang.Object
  extended by edu.washington.biostr.sig.volume.colors.ColorScheme
      extended by edu.washington.biostr.sig.volume.colors.AdvancedColorScheme

public class AdvancedColorScheme
extends ColorScheme

An AdvancedColorScheme allows the user to create a scheme that flows from one color to another (and maybe to another, etc) by doing a piecewise interpolation.
The most convenient way to use it is by calling the getWarm() or getCold() methods.

Version:
1.0
Author:
Eider Moore

Field Summary
 
Fields inherited from class edu.washington.biostr.sig.volume.colors.ColorScheme
alpha
 
Constructor Summary
AdvancedColorScheme()
          Create a simple grayscale color scheme.
AdvancedColorScheme(int numColors)
          Interpolate across the given number of colors (first from black to color 1, then from from color 1 to color 2, etc.)
 
Method Summary
 boolean equals(Object o)
           
static AdvancedColorScheme getCold(double alpha)
          Generate a color scheme that flows from black to blue to cyan to white (it has a cold feel and a large level of granularity).
static AdvancedColorScheme getColor(Color color, String name)
          Generate a color scheme for a single color.
 AlphaComposite getComposite()
           
 int[] getRGB(double value)
          Get an RGBA value as 4 ints {R, G, B, A}
static AdvancedColorScheme getWarm(double alpha)
          Generate a color scheme that flows from black to red to yellow to white (it has a warm feel and a large level of granularity).
 int hashCode()
           
 void setColor(int i, Color color, double start, double end)
          Add a color that will be blended with the existing color.
 void setComposite(int composite)
          Use one of AlphaComposite's values to mix this in with any existing colors on a palatte based on the rule and alpha level.
 String toString()
           
 
Methods inherited from class edu.washington.biostr.sig.volume.colors.ColorScheme
getAlpha, getAlphaComposite, getARGB, setAlpha, supportsAlpha
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AdvancedColorScheme

public AdvancedColorScheme()
Create a simple grayscale color scheme.


AdvancedColorScheme

public AdvancedColorScheme(int numColors)
Interpolate across the given number of colors (first from black to color 1, then from from color 1 to color 2, etc.)

Parameters:
numColors - The number of colors to interpolate across.
Method Detail

setComposite

public void setComposite(int composite)
Use one of AlphaComposite's values to mix this in with any existing colors on a palatte based on the rule and alpha level.

Parameters:
composite - The composite value from AlphaComposite

setColor

public void setColor(int i,
                     Color color,
                     double start,
                     double end)
Add a color that will be blended with the existing color.

Parameters:
i - The color index.
color - The color.
start - The starting value to blend this (between 0 and 1)
end - The ending value to blend this (between 0 and 1)

getRGB

public int[] getRGB(double value)
Description copied from class: ColorScheme
Get an RGBA value as 4 ints {R, G, B, A}

Overrides:
getRGB in class ColorScheme
Returns:
A 4 int RGBA value.

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

getComposite

public AlphaComposite getComposite()

getWarm

public static AdvancedColorScheme getWarm(double alpha)
Generate a color scheme that flows from black to red to yellow to white (it has a warm feel and a large level of granularity).

Parameters:
alpha - The level of opacity
Returns:
A scheme that generates warm colors.

getCold

public static AdvancedColorScheme getCold(double alpha)
Generate a color scheme that flows from black to blue to cyan to white (it has a cold feel and a large level of granularity).

Parameters:
alpha - The level of opacity
Returns:
A scheme that generates cold colors.

getColor

public static AdvancedColorScheme getColor(Color color,
                                           String name)
Generate a color scheme for a single color.

Parameters:
color - The desired color
name - The name of this scheme
Returns:
A color scheme for a single color.

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2006 University of Washington. All Rights Reserved.