Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## baseCode.gui
Class ColorMap

    java.lang.Object
      baseCode.gui.ColorMap

public class ColorMap
extends java.lang.Object

Title: ColorMap

Description: contains predefined color maps for visualization and color palette methods

Copyright (c) 2004

Institution:: Columbia University

Version:
  $Id: ColorMap.java,v 1.7 2004/07/27 03:18:58 pavlidis Exp $
Author:
  Will Braynen

Field Summary
`static java.awt.Color[]` | `BLACKBODY_COLORMAP`
`static java.awt.Color` | `DARK_RED`
`static java.awt.Color[]` | `GREENRED_COLORMAP`
`protected java.awt.Color[]` | `m_colorPalette`
`protected java.awt.Color[]` | `m_currentColorMap`
`protected java.awt.Color[]` | `m_customColorMap`
`static int` | `m_defaultSuggestedNumberOfColors`
`protected java.awt.Color` | `m_maxColor` last color in the current color map
`protected java.awt.Color` | `m_minColor` first color in the current color map
`static java.awt.Color[]` | `REDGREEN_COLORMAP`

Constructor Summary
`ColorMap()`
`ColorMap(java.awt.Color[] colorMap)`
`ColorMap(int suggestedNumberOfColors)`
`ColorMap(int suggestedNumberOfColors, java.awt.Color[] colorMap)` Pre-condition: suggestedNumberOfColors > colorMap.length

Method Summary
`protected java.awt.Color[]` | `createColorPalette(int suggestedNumberOfColors, java.awt.Color[] colorMap)` Allocates colors across a range.
`java.awt.Color` | `getColor(int i)`
`java.awt.Color[]` | `getPalette()`
`int` | `getPaletteSize()`
`protected int` | `getStepSize(int minColor, int maxColor, int totalColors)` Calculate how fast we have to change color components.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### m_minColor

    protected java.awt.Color m_minColor

  first color in the current color map

### m_maxColor

    protected java.awt.Color m_maxColor

  last color in the current color map

### m_customColorMap

    protected java.awt.Color[] m_customColorMap

### m_defaultSuggestedNumberOfColors

    public static final int m_defaultSuggestedNumberOfColors

See Also:
  Constant Field Values

### DARK_RED

    public static final java.awt.Color DARK_RED

### GREENRED_COLORMAP

    public static final java.awt.Color[] GREENRED_COLORMAP

### REDGREEN_COLORMAP

    public static final java.awt.Color[] REDGREEN_COLORMAP

### BLACKBODY_COLORMAP

    public static final java.awt.Color[] BLACKBODY_COLORMAP

### m_currentColorMap

    protected java.awt.Color[] m_currentColorMap

### m_colorPalette

    protected java.awt.Color[] m_colorPalette

Constructor Detail

### ColorMap

    public ColorMap()

### ColorMap

    public ColorMap(int suggestedNumberOfColors)

### ColorMap

    public ColorMap(java.awt.Color[] colorMap)

### ColorMap

    public ColorMap(int suggestedNumberOfColors,
                    java.awt.Color[] colorMap)

  Pre-condition: suggestedNumberOfColors > colorMap.length

Parameters:
  `suggestedNumberOfColors` - int
  `colorMap` - Color[]

Method Detail

### getStepSize

    protected int getStepSize(int minColor,
                              int maxColor,
                              int totalColors)

  Calculate how fast we have to change color components. Assume min and max colors are different!

  Parameters:
    `minColor` - red, green, or blue component of the RGB color
    `maxColor` - red, green, or blue component of the RGB color
    `totalColors` - int
  Returns:
    positive or negative step size

### createColorPalette

    protected java.awt.Color[] createColorPalette(int suggestedNumberOfColors,
                                                  java.awt.Color[] colorMap)

  Allocates colors across a range.

  Parameters:
    `suggestedNumberOfColors` - palette resolution; if colorPalette.length does not evenly divide into this number, the actual number of colors in the palette will be rounded down.
    `colorMap` - the simplest color map is { minColor, maxColor }; you might, however, want to go through intermediate colors instead of following a straight-line route through the color space.
  Returns:
    Color[] the color palette

### getColor

    public java.awt.Color getColor(int i)

### getPalette

    public java.awt.Color[] getPalette()

### getPaletteSize

    public int getPaletteSize()

  Returns:
    the number of colors in the palette

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2005 Columbia University. All Rights Reserved.