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

Class ncsa.horizon.awt.color.StretchableColorModel

java.lang.Object
  |
  +--java.awt.image.ColorModel
        |
        +--ncsa.horizon.awt.color.HorizonColorModel
              |
              +--ncsa.horizon.awt.color.RemappableColorModel
                    |
                    +--ncsa.horizon.awt.color.StretchableColorModel

public class StretchableColorModel
extends RemappableColorModel
a HorizonColorModel that can be stretched, squeezed, and slid.

See Also:
Serialized Form

Field Summary
double m
          the slope of the mapping
int off
          the offset of the mapping
int pivot
          the pivot point for changing the slope
 
Fields inherited from class ncsa.horizon.awt.color.RemappableColorModel
cached, refcm, tbl
 
Fields inherited from class ncsa.horizon.awt.color.HorizonColorModel
mapsz, transi
 
Fields inherited from class java.awt.image.ColorModel
pixel_bits, transferType
 
Constructor Summary
StretchableColorModel(java.awt.image.IndexColorModel cm)
          instantiate a StretchableColorModel.
StretchableColorModel(HorizonColorModel cm)
          instantiate a StretchableColorModel.
 
Method Summary
int getMappedIndex(int index)
          return the current mapping of a given index to an index in the reference color table.
int getOffset()
          get the current shift or offset
int getPivot()
          get the current pivot index.
double getSlope()
          get the current scaling factor or slope
void incSlope(double inc)
           
void setOffset(int offset)
          set the current shift or offset
void setPivot(int p)
          get the current pivot index.
void setSlope(double s)
          set the current scaling factor or slope
void shiftOffset(int shift)
          add an amount to the offset
void stretch(int amount)
           
 
Methods inherited from class ncsa.horizon.awt.color.RemappableColorModel
cacheMapping, clone, createIndexColorModel, getAlpha, getAlpha, getBlue, getBlue, getGreen, getGreen, getMappedIndex, getRed, getRed, getRefAlpha, getRefBlue, getRefGreen, getRefModel, getRefRed, getRefRGB, hardReset, setOverflowColor, setUndefinedColor, setUnderflowColor, softReset
 
Methods inherited from class ncsa.horizon.awt.color.HorizonColorModel
addHorizonColorModelListener, clearChanged, clone, createIndexColorModel, delayNotify, delayNotify, getAlpha, getAlphas, getBlue, getBlues, getGreen, getGreens, getMapSize, getOverflowColor, getRed, getReds, getTransparentIndex, getUndefinedColor, getUnderflowColor, hasChanged, notifyListeners, removeAllListeners, removeListener, saveColorModel, saveColorModel, saveColorModel, setChanged, setChanged, setOverflowColor, setTransparentIndex, setUndefinedColor, setUnderflowColor
 
Methods inherited from class java.awt.image.ColorModel
coerceData, createCompatibleSampleModel, createCompatibleWritableRaster, equals, finalize, getAlpha, getAlpha, getAlphaRaster, getBlue, getBlue, getColorSpace, getComponents, getComponents, getComponentSize, getComponentSize, getDataElement, getDataElements, getGreen, getGreen, getNormalizedComponents, getNumColorComponents, getNumComponents, getPixelSize, getRed, getRed, getRGB, getRGB, getRGBdefault, getTransparency, getUnnormalizedComponents, hasAlpha, isAlphaPremultiplied, isCompatibleRaster, isCompatibleSampleModel, setDataElements, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait
 

Field Detail

m

protected double m
the slope of the mapping

off

protected int off
the offset of the mapping

pivot

protected int pivot
the pivot point for changing the slope
Constructor Detail

StretchableColorModel

public StretchableColorModel(java.awt.image.IndexColorModel cm)
instantiate a StretchableColorModel.
Parameters:
cm - the initial color model

StretchableColorModel

public StretchableColorModel(HorizonColorModel cm)
instantiate a StretchableColorModel.
Parameters:
cm - the initial color model
Method Detail

getMappedIndex

public int getMappedIndex(int index)
return the current mapping of a given index to an index in the reference color table.
Overrides:
getMappedIndex in class RemappableColorModel

getSlope

public double getSlope()
get the current scaling factor or slope

setSlope

public void setSlope(double s)
set the current scaling factor or slope
Throws:
java.lang.IllegalArgumentException - if s=0, infinity, or NaN;

getOffset

public int getOffset()
get the current shift or offset

setOffset

public void setOffset(int offset)
set the current shift or offset

getPivot

public int getPivot()
get the current pivot index.

setPivot

public void setPivot(int p)
get the current pivot index.

shiftOffset

public void shiftOffset(int shift)
add an amount to the offset

incSlope

public void incSlope(double inc)

stretch

public void stretch(int amount)

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