org.geworkbench.bison.util.colorcontext
Class DefaultColorContext

java.lang.Object
  extended by org.geworkbench.bison.util.colorcontext.DefaultColorContext
All Implemented Interfaces:
java.io.Serializable, ColorContext

public class DefaultColorContext
extends java.lang.Object
implements ColorContext

Default implementation of a color context. Assigns positive marker values in the red spectrum and negative values to the green spectrum.

See Also:
Serialized Form

Constructor Summary
DefaultColorContext()
           
 
Method Summary
 java.awt.Color getMarkerValueColor(DSMarkerValue mv, DSGeneMarker mInfo, float intensity)
           
 java.awt.Color getMaxColorValue(float intensity)
          Returns the color corresponding to the maxiumum value possible at this intensity.
 java.awt.Color getMiddleColorValue(float intensity)
          Returns the color that indicates a value between the minimum and maximum values.
 java.awt.Color getMinColorValue(float intensity)
          Returns the color corresponding to the minimum value possible at this intensity.
 void updateContext(DSMicroarraySetView<DSGeneMarker,DSMicroarray> view)
          Called whenever the view changes so that the ColorContext can (optionally) update itself.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultColorContext

public DefaultColorContext()
Method Detail

getMarkerValueColor

public java.awt.Color getMarkerValueColor(DSMarkerValue mv,
                                          DSGeneMarker mInfo,
                                          float intensity)
Specified by:
getMarkerValueColor in interface ColorContext
Parameters:
mv - The MarkerValue that needs to be drawn.
mInfo - The MarkerInfo corresponding to the MarkerValue
intensity - to be used
Returns:
The Color to use for drawing.

updateContext

public void updateContext(DSMicroarraySetView<DSGeneMarker,DSMicroarray> view)
Description copied from interface: ColorContext
Called whenever the view changes so that the ColorContext can (optionally) update itself.

Specified by:
updateContext in interface ColorContext

getMaxColorValue

public java.awt.Color getMaxColorValue(float intensity)
Description copied from interface: ColorContext
Returns the color corresponding to the maxiumum value possible at this intensity.

Specified by:
getMaxColorValue in interface ColorContext
Returns:

getMinColorValue

public java.awt.Color getMinColorValue(float intensity)
Description copied from interface: ColorContext
Returns the color corresponding to the minimum value possible at this intensity.

Specified by:
getMinColorValue in interface ColorContext
Returns:

getMiddleColorValue

public java.awt.Color getMiddleColorValue(float intensity)
Description copied from interface: ColorContext
Returns the color that indicates a value between the minimum and maximum values. Usually white or black.

Specified by:
getMiddleColorValue in interface ColorContext
Returns: