org.jdesktop.animation.transitions.effects
Class Rotate

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

public class Rotate
extends Effect

This Effect rotates an image through a given number of degrees during the animated transition. It subclasses ComponentImageEffect to use an image for redrawing the component instead of re-rendering the component each time.


Constructor Summary
Rotate(ComponentState start, ComponentState end, int degrees, int xCenter, int yCenter)
          Construct a Rotate effect for a given component with the number of degrees you wish to rotate through during the transition and the center of rotation to use.
Rotate(int degrees, int xCenter, int yCenter)
          Construct a Rotate effect for a given component with the number of degrees you wish to rotate through during the transition.
Rotate(int degrees, javax.swing.JComponent component)
          Construct a Rotate effect for a given component with the number of degrees you wish to rotate through during the transition.
 
Method Summary
 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 setRadians(double radians)
           
 void setup(java.awt.Graphics2D g2d)
          This method is called during each frame of the transition animation, prior to the call to paint().
 
Methods inherited from class org.jdesktop.animation.transitions.Effect
getComponent, getComponentImage, getEnd, getRenderComponent, getStart, 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

Rotate

public Rotate(int degrees,
              javax.swing.JComponent component)
Construct a Rotate effect for a given component with the number of degrees you wish to rotate through during the transition. This constructor will result in an effect that rotates around the center of the component


Rotate

public Rotate(int degrees,
              int xCenter,
              int yCenter)
Construct a Rotate effect for a given component with the number of degrees you wish to rotate through during the transition. This constructor will result in an effect that rotates around the point (xCenter, yCenter)


Rotate

public Rotate(ComponentState start,
              ComponentState end,
              int degrees,
              int xCenter,
              int yCenter)
Construct a Rotate effect for a given component with the number of degrees you wish to rotate through during the transition and the center of rotation to use.

Method Detail

setRadians

public void setRadians(double radians)

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

setup

public void setup(java.awt.Graphics2D g2d)
Description copied from class: Effect
This method is called during each frame of the transition animation, prior to the call to paint(). Subclasses will implement this method to set up the Graphic state, or other related state, that will be used in the following call to the paint() method. Note that changes to the Graphics2D object here will still be present in the Graphics2D object that is passed into the paint() method, so this is a good time to set up things such as transform state.

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