< prev index next >
src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/AnimationController.java
Print this page
@@ -81,11 +81,11 @@
//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() {
+ 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,11 +202,11 @@
State state) {
component.putClientProperty(PartUIClientPropertyKey.getKey(part),
state);
}
- private synchronized void startAnimation(JComponent component,
+ synchronized void startAnimation(JComponent component,
Part part,
State startState,
State endState,
long millis) {
boolean isForwardAndReverse = false;
@@ -389,10 +389,14 @@
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 >