edu.ucla.loni.LOVE.colormap
Class BoundedColorMap

java.lang.Object
  extended by edu.ucla.loni.LOVE.BoundedModelImpl
      extended by edu.ucla.loni.LOVE.colormap.BoundedColorMap
All Implemented Interfaces:
BoundedModel

public class BoundedColorMap
extends BoundedModelImpl

This is a bounded colormap. Any changes to this colormap will fire a PropertyChangeEvent to the listeners that are registered. This class will create a actual colormap class based on the user's choice, and delegate all the request of colormap changes to this colormap instance and send a changevent as well. It will return the colormap generated by this colormap. The affected properties may include: upper limit, lower limit, under color, over color, alpha, colormap's style A special notice on colormap plugin could be found at: ???


Constructor Summary
BoundedColorMap(int size, int bits)
          /** Constructor.
BoundedColorMap(int size, int bits, int n)
          Constructor with default initial choice at index n.
 
Method Summary
 void copyColorMap(BoundedColorMap cMap)
          Copy the settings from another colormap.
 byte getAlpha()
          Get transparency.
 byte[] getAlphaMap()
          Get Alpha map
 int getBits()
          Get number of bits for this colormap.
 byte[] getBlueMap()
          Get Blue map
 java.lang.Object[] getColorMapNames()
          Get the available colormaps.
 ColorMap getColorMapRule()
           
 java.awt.image.ColorModel getColorModel()
          Get a colormodel of current colormap.
 java.lang.Object getCurrentColorMapName()
          Get colormap's name.
 byte[] getGreenMap()
          Get Green map
 boolean getInverted()
          Get inverted.
 int getLowerLimit()
          Get lower limit.
 java.awt.Color getOverColor()
          Get over color.
 byte[] getRedMap()
          Get Red map
 int getSize()
          Get size of this colormap.
 java.awt.Color getUnderColor()
          Get under color.
 int getUpperLimit()
          Get upper limit.
static void main(java.lang.String[] args)
          Test Program
 void setAlpha(byte alpha)
          set transparency.
 void setColorMapName(java.lang.Object colorMapName)
          Set which colormap to use.
 void setInverted(boolean flag)
          Set inverted.
 void setLowerLimit(int lowerLimit)
          set lower limit
 void setOverColor(java.awt.Color overColor)
          Set over color
 void setUnderColor(java.awt.Color underColor)
          Set under color
 void setUpperLimit(int upperLimit)
          set upper limit
 
Methods inherited from class edu.ucla.loni.LOVE.BoundedModelImpl
addPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BoundedColorMap

public BoundedColorMap(int size,
                       int bits)
/** Constructor.

Parameters:
size - Size of the colormap.
bits - Bits each pixel.

BoundedColorMap

public BoundedColorMap(int size,
                       int bits,
                       int n)
Constructor with default initial choice at index n.

Parameters:
size - Size of the colormap.
bits - Bits each pixel.
n - Index of the intial colormap.
Method Detail

getBits

public int getBits()
Get number of bits for this colormap. This information is not supposed to be changed after initialization. So, there is no set method.

Returns:
Number of bits for this colormap.

getSize

public int getSize()
Get size of this colormap. This information is not supposed to be changed after initialization. So, there is no set method.

Returns:
Size of the colormap.

copyColorMap

public void copyColorMap(BoundedColorMap cMap)
Copy the settings from another colormap. Here we need to do something smart, if the bits is not the same, we won't copy upper and lower limit.

Parameters:
cMap - The colormap to be copied into this.

getColorMapNames

public java.lang.Object[] getColorMapNames()
Get the available colormaps.

Returns:
name of all the available colormaps

getCurrentColorMapName

public java.lang.Object getCurrentColorMapName()
Get colormap's name.

Returns:
Name of colormap.

getColorMapRule

public ColorMap getColorMapRule()

setColorMapName

public void setColorMapName(java.lang.Object colorMapName)
Set which colormap to use.

Parameters:
colorMapName - Name of the colormap to be created.

setUnderColor

public void setUnderColor(java.awt.Color underColor)
Set under color


getUnderColor

public java.awt.Color getUnderColor()
Get under color.


setInverted

public void setInverted(boolean flag)
Set inverted.


getInverted

public boolean getInverted()
Get inverted.


setOverColor

public void setOverColor(java.awt.Color overColor)
Set over color


getOverColor

public java.awt.Color getOverColor()
Get over color.


setUpperLimit

public void setUpperLimit(int upperLimit)
set upper limit


getUpperLimit

public int getUpperLimit()
Get upper limit.


setLowerLimit

public void setLowerLimit(int lowerLimit)
set lower limit


getLowerLimit

public int getLowerLimit()
Get lower limit.


setAlpha

public void setAlpha(byte alpha)
set transparency.


getAlpha

public byte getAlpha()
Get transparency.


getColorModel

public java.awt.image.ColorModel getColorModel()
Get a colormodel of current colormap.


getRedMap

public byte[] getRedMap()
Get Red map


getGreenMap

public byte[] getGreenMap()
Get Green map


getBlueMap

public byte[] getBlueMap()
Get Blue map


getAlphaMap

public byte[] getAlphaMap()
Get Alpha map


main

public static void main(java.lang.String[] args)
Test Program