org.jdesktop.animation.transitions.effects
Class CompositeEffect

java.lang.Object
  extended by org.jdesktop.animation.transitions.Effect
      extended by org.jdesktop.animation.transitions.effects.CompositeEffect

public class CompositeEffect
extends Effect

This Effect combines one or more sub-effects to create a more complex and interesting effect. For example, you could create an effect that both moves and scales by creating a CompositeEffect with the Move and Scale effects. Composite effects are created by simply adding effects in the order that you want them combined.


Constructor Summary
CompositeEffect()
          Creates a CompositeEffect with no sub-effects.
CompositeEffect(Effect effect)
          Creates a CompositeEffect with the given effect as the first sub-effect.
 
Method Summary
 void addEffect(Effect effect)
          Adds an additional effect to this CompositeEffect.
 void cleanup(org.jdesktop.animation.timing.Animator animator)
          Effect subclasses that create temporary objects for the transition (such as in the init() method) should override this method and clean up those resources.
 void init(org.jdesktop.animation.timing.Animator animator, Effect parentEffect)
           
 void setEnd(ComponentState end)
          This method is called during the initialization process of a transition and allows the effects to set up the end state for each effect.
 void setStart(ComponentState start)
          This method is called during the initialization process of a transition and allows the effects to set up the start state for each effect.
 void setup(java.awt.Graphics2D g2d)
          This method is called during each frame of the transition animation and allows the effect to set up the Graphics state according to the various sub-effects in this CompositeEffect.
 
Methods inherited from class org.jdesktop.animation.transitions.Effect
getComponent, getComponentImage, getEnd, getRenderComponent, getStart, paint, setBounds, setBounds, setComponentImage, setComponentStates, setHeight, setLocation, setRenderComponent, setWidth, setX, setY
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeEffect

public CompositeEffect()
Creates a CompositeEffect with no sub-effects. Additional sub-effects should be added via the addEffect method.


CompositeEffect

public CompositeEffect(Effect effect)
Creates a CompositeEffect with the given effect as the first sub-effect. Additional sub-effects should be added via the addEffect method.

Method Detail

addEffect

public void addEffect(Effect effect)
Adds an additional effect to this CompositeEffect. This effect is added to the end of the existing list of effects, and will be processed after the other effects have been processed.


setStart

public void setStart(ComponentState start)
This method is called during the initialization process of a transition and allows the effects to set up the start state for each effect.

Overrides:
setStart in class Effect

init

public void init(org.jdesktop.animation.timing.Animator animator,
                 Effect parentEffect)
Overrides:
init in class Effect

cleanup

public void cleanup(org.jdesktop.animation.timing.Animator animator)
Description copied from class: Effect
Effect subclasses that create temporary objects for the transition (such as in the init() method) should override this method and clean up those resources. For example, TimingTarget e.g., PropertySetter) objects added to Animator should be removed after the transition to avoid leaking resources that may otherwise be retained by those objects.

Overrides:
cleanup in class Effect

setEnd

public void setEnd(ComponentState end)
This method is called during the initialization process of a transition and allows the effects to set up the end state for each effect.

Overrides:
setEnd in class Effect

setup

public void setup(java.awt.Graphics2D g2d)
This method is called during each frame of the transition animation and allows the effect to set up the Graphics state according to the various sub-effects in this CompositeEffect.

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