Apply animation effects to components and windows. Inspired by script.aculo.us effects.
The current version of griffon-effects-plugin is 0.4
To install just issue the following command
griffon install-plugin effects |
Effects can be applied in two ways:
griffon.effects.Effects (each method matches the effect's name in lower case, Move => Effects.move)Every effect takes the following parameters:
component - the component to be animatedparams - a map with effect options, may be empty or nullcallback - a closure to be called at the end of the effect, optional.All effects share the following options unless otherwise specified:
duration - ong, how long should the animation take. default: 500ldelay - long, wait time before the animation starts. default: 0lease - TimelineEase. default: Linearwait - boolean. Forces the current thread to wait until the effect has finished running default: false|
Make sure the calling thread is not the UI thread when setting |
Some effects accept an anchor option, whose value is defined by the griffon.effects.Anchor enum. Additional valid values are string literals in lower case, with underscores substituted by spaces; literals from SwingConstants are also valid. Examples
Animates the location property of the target component
Parameters:
x - int, in pixels. default: 0iy - int, in pixels. default: 0imode - String, if movement should be 'relative' or 'absolute'. default: 'relative'Animates the size property of the target component
Parameters:
w - int, in pixels. default: 0ih - int, in pixels. default: 0mode - String, if the update should be 'relative' or 'absolute'. default: 'relative'Animates the bounds property of a the target component
Parameters:
x - int, in pixels. default: 0iy - int, in pixels. default: 0iw - int, in pixels. default: 0ih - int, in pixels. default: 0mode - String, if the update should be 'relative' or 'absolute'. default: 'relative'Animates the bounds property of the target component by calculating a scale factor
Parameters:
scaleX - boolean, if the x coorinate should scale. default: truescaleY - boolean, if the y coorinate should scale. default: truefrom - float, starting value in percentage. default: 100.0fto - float, ending value in percentage. default: 0.0fanchor - Anchor, anchoring point. default: Anchor.CENTERAnimates a window's opacity property
Parameters:
from - float, starting value. default: 0.0fto - float, ending value. default: 1.0fAnimates a window's opacity from its current value or 1.0f to 0.0f
Animates a window's opacity from its current value or 0.0f to 1.0f
Moves a component from right to left a few times
Parameters:
distance - int, in pixels. default: 20iFades and blows up a window
Fades and moves a window out of the screen
Paremeters:
anchor - Anchor, anchoring point. default: Anchor.BOTTOMAppears and moves a window to the center of the screen
Paremeters:
anchor - Anchor, anchoring point. default: Anchor.TOPEffects can be chained in a sequential manner by using the chain(List<Effect>) method provided by griffon.effects.Effects utility class.
Version |
Date |
Notes |
|---|---|---|
0.4 |
06-27-10 |
Release sync with Griffon 0.9.3-beta-2 |
0.3 |
05-06-11 |
Upgraded dependencies |
0.2.1 |
02-22-11 |
Upgraded dependencies |
0.2 |
12-21-10 |
Release sync with Griffon 0.9.2 |
0.1 |
07-22-10 |
First release |