org.zilonis.tool.ext.aerith.effects
Class Fade

java.lang.Object
  extended by org.zilonis.tool.ext.aerith.effects.ComponentEffect
      extended by org.zilonis.tool.ext.aerith.effects.Fade
Direct Known Subclasses:
FadeIn, FadeOut

public abstract class Fade
extends ComponentEffect

ComponentEffect 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.


Field Summary
 
Fields inherited from class org.zilonis.tool.ext.aerith.effects.ComponentEffect
componentImage, end, height, renderComponent, start, width, x, y
 
Constructor Summary
Fade()
           
 
Method Summary
 void setup(java.awt.Graphics2D g2d, float fraction)
          This method is called prior to paint() during every frame of the transition animation.
 
Methods inherited from class org.zilonis.tool.ext.aerith.effects.ComponentEffect
getComponent, getComponentImage, getEnd, getStart, paint, setComponentImage, setComponentStates, setEnd, setStart
 
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

setup

public void setup(java.awt.Graphics2D g2d,
                  float fraction)
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 ComponentEffect
Parameters:
g2d - the Graphics2D destination for this rendering
fraction - The fraction of elapsed time in this animation