com.planeth.common.gfx.color
Class FlickeringPhColor

java.lang.Object
  extended byjava.awt.Color
      extended bycom.planeth.common.gfx.color.PhColor
          extended bycom.planeth.common.gfx.color.AbstractChangingPhColor
              extended bycom.planeth.common.gfx.color.FlickeringPhColor
All Implemented Interfaces:
ITimeControllable, java.awt.Paint, java.io.Serializable, java.awt.Transparency

public class FlickeringPhColor
extends AbstractChangingPhColor
implements ITimeControllable

Self changing color with flicker effect.

Author:
Andreas Grässer, gal@planet-h.com.
created May 5, 2005
See Also:
Serialized Form

Field Summary
static int NO_RESTART_TIME
           
 
Fields inherited from class java.awt.Color
black, BLACK, blue, BLUE, cyan, CYAN, DARK_GRAY, darkGray, gray, GRAY, green, GREEN, LIGHT_GRAY, lightGray, magenta, MAGENTA, orange, ORANGE, pink, PINK, red, RED, white, WHITE, yellow, YELLOW
 
Fields inherited from interface java.awt.Transparency
BITMASK, OPAQUE, TRANSLUCENT
 
Constructor Summary
FlickeringPhColor(java.awt.Color color1, java.awt.Color color2)
          Constructor for FlickeringPhColor.
FlickeringPhColor(java.awt.Color color1, java.awt.Color color2, int flickerTime)
          Constructor for FlickeringPhColor.
FlickeringPhColor(java.awt.Color color1, java.awt.Color color2, int flickerTime, int flickerRestartTime)
          Constructor for FlickeringPhColor.
 
Method Summary
 void change()
          Does the color change.
 java.awt.Color getColor1()
           
 java.awt.Color getColor2()
           
 void pause(boolean pauseState)
          Pauses the ITimeControllable
 void setColor1(java.awt.Color color1)
           
 void setColor2(java.awt.Color color2)
           
 void setFlickerTime(int flickerTime)
          Sets the main flicker interval
 void setFlickerTime(int flickerTime, int flickerRestartTime)
          sets the main flicker interval and the pause and restart time.
 
Methods inherited from class com.planeth.common.gfx.color.AbstractChangingPhColor
brighter, createContext, darker, equals, getAlpha, getBlue, getCol, getColorComponents, getColorComponents, getColorSpace, getComponents, getComponents, getGreen, getRealTimeControl, getRed, getRGB, getRGBColorComponents, getRGBComponents, getTransparency, setCol
 
Methods inherited from class java.awt.Color
decode, getColor, getColor, getColor, getHSBColor, hashCode, HSBtoRGB, RGBtoHSB, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_RESTART_TIME

public static final int NO_RESTART_TIME
See Also:
Constant Field Values
Constructor Detail

FlickeringPhColor

public FlickeringPhColor(java.awt.Color color1,
                         java.awt.Color color2)
Constructor for FlickeringPhColor.

Parameters:
color1 - the first color of the flicker effect
color2 - the second color of the flicker effect

FlickeringPhColor

public FlickeringPhColor(java.awt.Color color1,
                         java.awt.Color color2,
                         int flickerTime)
Constructor for FlickeringPhColor.

Parameters:
color1 - the first color of the flicker effect
color2 - the second color of the flicker effect
flickerTime - the baseTime for the flicker interval

FlickeringPhColor

public FlickeringPhColor(java.awt.Color color1,
                         java.awt.Color color2,
                         int flickerTime,
                         int flickerRestartTime)
Constructor for FlickeringPhColor.

Parameters:
color1 - the first color of the flicker effect
color2 - the second color of the flicker effect
flickerTime - the time for the main flicker interval
flickerRestartTime - the time for the "pause and restart flickering" interval
Method Detail

pause

public void pause(boolean pauseState)
Description copied from interface: ITimeControllable
Pauses the ITimeControllable

Specified by:
pause in interface ITimeControllable
Parameters:
pauseState -
See Also:
ITimeControllable.pause(boolean)

change

public void change()
Description copied from class: AbstractChangingPhColor
Does the color change.

Specified by:
change in class AbstractChangingPhColor
See Also:
AbstractChangingPhColor.change()

setFlickerTime

public void setFlickerTime(int flickerTime)
Sets the main flicker interval

Parameters:
flickerTime -

setFlickerTime

public void setFlickerTime(int flickerTime,
                           int flickerRestartTime)
sets the main flicker interval and the pause and restart time.

Parameters:
flickerTime -
flickerRestartTime -

getColor1

public java.awt.Color getColor1()
Returns:
Returns the color1.

setColor1

public void setColor1(java.awt.Color color1)
Parameters:
color1 - The color1 to set.

getColor2

public java.awt.Color getColor2()
Returns:
Returns the color2.

setColor2

public void setColor2(java.awt.Color color2)
Parameters:
color2 - The color2 to set.