org.jdesktop.animation.transitions.effects
Class Fade

java.lang.Object
  extended by org.jdesktop.animation.transitions.Effect
      extended by org.jdesktop.animation.transitions.effects.Fade
Direct Known Subclasses:
FadeIn, FadeOut

public abstract class Fade
extends Effect

Effect that performs a Fade (in or out) on the component. This is done by using an image of the component and altering the translucency (or AlphaComposite) of the Graphics2D object according to how far along the transition animation is. This is an abstract class that relies on the FadeIn or FadeOut subclasses to set up the end (FadeIn) or start (FadeOut) states appropriately.


Constructor Summary
Fade()
           
 
Method Summary
 void setOpacity(float opacity)
           
 void setup(java.awt.Graphics2D g2d)
          This method is called prior to paint() during every frame of the transition animation.
 
Methods inherited from class org.jdesktop.animation.transitions.Effect
cleanup, getComponent, getComponentImage, getEnd, getRenderComponent, getStart, init, paint, setBounds, setBounds, setComponentImage, setComponentStates, setEnd, setHeight, setLocation, setRenderComponent, setStart, setWidth, setX, setY
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Fade

public Fade()
Method Detail

setOpacity

public void setOpacity(float opacity)

setup

public void setup(java.awt.Graphics2D g2d)
This method is called prior to paint() during every frame of the transition animation. It calculates the opacity based on the elapsed fraction of the animation and sets the AlphaComposite value on the Graphics2D object appropriately.

Overrides:
setup in class Effect
Parameters:
g2d - the Graphics2D destination for this rendering