< prev index next >
src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/AnimationController.java
Print this page
*** 81,91 ****
//this timer is used to cause repaint on animated components
//30 repaints per second should give smooth animation affect
private final javax.swing.Timer timer =
new javax.swing.Timer(1000/30, this);
! private static synchronized AnimationController getAnimationController() {
AppContext appContext = AppContext.getAppContext();
Object obj = appContext.get(ANIMATION_CONTROLLER_KEY);
if (obj == null) {
obj = new AnimationController();
appContext.put(ANIMATION_CONTROLLER_KEY, obj);
--- 81,91 ----
//this timer is used to cause repaint on animated components
//30 repaints per second should give smooth animation affect
private final javax.swing.Timer timer =
new javax.swing.Timer(1000/30, this);
! static synchronized AnimationController getAnimationController() {
AppContext appContext = AppContext.getAppContext();
Object obj = appContext.get(ANIMATION_CONTROLLER_KEY);
if (obj == null) {
obj = new AnimationController();
appContext.put(ANIMATION_CONTROLLER_KEY, obj);
*** 202,212 ****
State state) {
component.putClientProperty(PartUIClientPropertyKey.getKey(part),
state);
}
! private synchronized void startAnimation(JComponent component,
Part part,
State startState,
State endState,
long millis) {
boolean isForwardAndReverse = false;
--- 202,212 ----
State state) {
component.putClientProperty(PartUIClientPropertyKey.getKey(part),
state);
}
! synchronized void startAnimation(JComponent component,
Part part,
State startState,
State endState,
long millis) {
boolean isForwardAndReverse = false;
*** 389,398 ****
--- 389,402 ----
alpha = progress;
} else {
alpha = 1 - progress;
}
g.setComposite(AlphaComposite.SrcOver.derive(alpha));
+ if (state == null) { // used for animating buttons in a specific JToolBar
+ g.setColor(Color.WHITE);
+ g.fillRect(dx, dy, dw, dh);
+ }
skin.paintSkinRaw(g, dx, dy, dw, dh, state);
g.dispose();
} else {
skin.paintSkinRaw(_g, dx, dy, dw, dh, state);
}
< prev index next >