|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdesktop.animation.transitions.Effect
public abstract class Effect
This is the base class for all effects that are used during
screen transitions.
Subclasses of this base class may override the init()
,
setup()
and paint()
methods to achieve the
desired effect.
Constructor Summary | |
---|---|
Effect()
|
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. |
protected javax.swing.JComponent |
getComponent()
|
java.awt.Image |
getComponentImage()
|
ComponentState |
getEnd()
|
boolean |
getRenderComponent()
|
ComponentState |
getStart()
|
void |
init(org.jdesktop.animation.timing.Animator animator,
Effect parentEffect)
|
void |
paint(java.awt.Graphics2D g2d)
This method is called during each frame of the transition animation, after the call to setup() . |
void |
setBounds(int x,
int y,
int width,
int height)
|
void |
setBounds(java.awt.Rectangle bounds)
|
protected void |
setComponentImage(java.awt.Image componentImage)
|
void |
setComponentStates(ComponentState start,
ComponentState end)
Sets both the start and end states of this Effect. |
void |
setEnd(ComponentState end)
Sets the end state of this Effect. |
void |
setHeight(int height)
|
void |
setLocation(java.awt.Point location)
|
void |
setRenderComponent(boolean renderComponent)
|
void |
setStart(ComponentState start)
Sets the start state of this Effect. |
void |
setup(java.awt.Graphics2D g2d)
This method is called during each frame of the transition animation, prior to the call to paint() . |
void |
setWidth(int width)
|
void |
setX(int x)
|
void |
setY(int y)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Effect()
Method Detail |
---|
public void setBounds(int x, int y, int width, int height)
public void setBounds(java.awt.Rectangle bounds)
public void setLocation(java.awt.Point location)
public void setX(int x)
public void setY(int y)
public void setWidth(int width)
public void setHeight(int height)
protected javax.swing.JComponent getComponent()
public void init(org.jdesktop.animation.timing.Animator animator, Effect parentEffect)
public void cleanup(org.jdesktop.animation.timing.Animator animator)
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.
public void setRenderComponent(boolean renderComponent)
public boolean getRenderComponent()
public void setComponentStates(ComponentState start, ComponentState end)
public void setStart(ComponentState start)
public ComponentState getStart()
public void setEnd(ComponentState end)
public ComponentState getEnd()
public java.awt.Image getComponentImage()
protected void setComponentImage(java.awt.Image componentImage)
public void setup(java.awt.Graphics2D g2d)
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.
g2d
- the Graphics2D destination for this renderingpublic void paint(java.awt.Graphics2D g2d)
setup()
.
Subclasses may implement this method to perform whatever rendering
is necessary to paint the transitioning component into the
Graphics2D
object with the desired effect.
Most subclasses may elect to not override this at all, as the Effect
version of the method already handles the basic painting operation.
Only subclasses that need facilities beyond the basic drawing of
the component or an image representation of the component should
consider overriding.
g2d
- The Graphics2D destination for this rendering. Note that
the state of this Graphics2D object is affected by the previous call
to setup
so there may be no more need to perturb the
graphics state further. Functionality in thihs method should focus,
instead, on the rendering details instead of the graphics state.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |