|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.7.2) E13403-10 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.ide.controls.Animator
public final class Animator
The Animator helps to implement animated transition in swing components. The class
Here is a typical example of an animated transition:
final PropertyChangeListener propertyChangeListener = new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { final Double newValue = (Double) evt.getNewValue(); final double r = newValue.doubleValue(); drawerElement.setBounds( (int) (sourceBounds.x + (destBounds.x - sourceBounds.x) * r), (int) (sourceBounds.y + (destBounds.y - sourceBounds.y) * r), (int) (sourceBounds.width + (destBounds.width - sourceBounds.width) * r), (int) (sourceBounds.height + (destBounds.height - sourceBounds.height) * r) ); final Graphics g = getGraphics(); paint(g); } }; Animator.animate(30, 600, 10, 0.6, 0.14, propertyChangeListener);
animate(int, long, java.beans.PropertyChangeListener)
Method Summary | |
---|---|
static void |
animate(int stepTime, long maxTime, int steps, double center, double sigma, java.beans.PropertyChangeListener listener) Calculates transitions values between 0.0 and 1.0 and invokes the listener with each transition value. The number of transitions is controlled by the steps parameter. The acceleration and deceleration are controlled by the center and sigma parameters.The animation rendering is usually too fast on an average computer and must be slowed down. |
static void |
animate(int stepTime, long maxTime, java.beans.PropertyChangeListener listener) |
static int |
getInt(double currentValue, int from, int to) |
static java.awt.Point |
getPoint(double currentValue, java.awt.Point ptFrom, java.awt.Point ptTo) |
static java.awt.Rectangle |
getRectangle(double currentValue, java.awt.Rectangle rcFrom, java.awt.Rectangle rcTo) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static int getInt(double currentValue, int from, int to)
public static java.awt.Point getPoint(double currentValue, java.awt.Point ptFrom, java.awt.Point ptTo)
public static java.awt.Rectangle getRectangle(double currentValue, java.awt.Rectangle rcFrom, java.awt.Rectangle rcTo)
public static void animate(int stepTime, long maxTime, java.beans.PropertyChangeListener listener)
stepTime
- The time in ms between each step.maxTime
- The maximum time (in ms) allowed for the animation. If the method predicts that the total time of the animation will be more than maxTime, it will skip enough steps to accomodate the remaining time.listener
- The listener to callback to render each step.animate(int, long, int, double, double, java.beans.PropertyChangeListener)
public static void animate(int stepTime, long maxTime, int steps, double center, double sigma, java.beans.PropertyChangeListener listener)
center
and sigma
parameters.stepTime
.maxTime
controls the maximum time taken to render the animation. Based on the time taken by each step, the method can predict if we are running late and it will skip steps to speed up the animation. The last step however is never skipped.stepTime
- The time (in ms) to wait between each step.maxTime
- The maximum time (in ms) allowed for the animation.steps
- The number of steps to be used to render the animation.center
- This value balances acceleration vs deceleration. The suggested value for a good effect is 0.6sigma
- Controls the length of the acceleration and deceleration.The suggested value for a good effect is 0.14listener
- The listener to callback to render each step.
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.7.2) E13403-10 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |