net.infonode.gui.colorprovider
Class ColorBlender

java.lang.Object
  extended by net.infonode.gui.colorprovider.AbstractColorProvider
      extended by net.infonode.gui.colorprovider.ColorBlender
All Implemented Interfaces:
java.io.Serializable, ColorProvider

public class ColorBlender
extends AbstractColorProvider
implements java.io.Serializable

Blends two colors according to the given blend amount.

Version:
$Revision: 1.5 $
Author:
$Author: jesper $
See Also:
Serialized Form

Field Summary
private  float blendAmount
           
private  ColorProvider color1
           
private  ColorProvider color2
           
private static long serialVersionUID
           
 
Constructor Summary
ColorBlender(ColorProvider color1, ColorProvider color2, float blendAmount)
          Constructor.
 
Method Summary
 java.awt.Color getColor()
          Returns the default color when no component is available.
 java.awt.Color getColor(java.awt.Component component)
          Returns the color obtained from the given component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

color1

private ColorProvider color1

color2

private ColorProvider color2

blendAmount

private float blendAmount
Constructor Detail

ColorBlender

public ColorBlender(ColorProvider color1,
                    ColorProvider color2,
                    float blendAmount)
Constructor.

Parameters:
color1 - provides the first color
color2 - provides the second color
blendAmount - the blend amount, range 0 - 1 where 0 means only the first color and 1 means only the second color
Method Detail

getColor

public java.awt.Color getColor(java.awt.Component component)
Description copied from interface: ColorProvider
Returns the color obtained from the given component.

Specified by:
getColor in interface ColorProvider
Overrides:
getColor in class AbstractColorProvider
Parameters:
component - the component
Returns:
the color obtained from the given component

getColor

public java.awt.Color getColor()
Description copied from interface: ColorProvider
Returns the default color when no component is available.

Specified by:
getColor in interface ColorProvider
Overrides:
getColor in class AbstractColorProvider
Returns:
the default color when no component is available