mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-03-13 11:36:15 +01:00
GuiUtils: use UI_ANIMATION_TIME
consistently, deprecate UI_ANIMATION_TIME_MSEC
This commit is contained in:
parent
b83c0b96e6
commit
af7c903df7
1 changed files with 8 additions and 6 deletions
|
@ -82,8 +82,10 @@ public class GuiUtils {
|
|||
Platform.runLater(r);
|
||||
}
|
||||
|
||||
/** @deprecated Use {@link #UI_ANIMATION_TIME} */
|
||||
@Deprecated
|
||||
public static final int UI_ANIMATION_TIME_MSEC = 600;
|
||||
public static final Duration UI_ANIMATION_TIME = Duration.millis(UI_ANIMATION_TIME_MSEC);
|
||||
public static final Duration UI_ANIMATION_TIME = Duration.millis(600);
|
||||
|
||||
public static Animation fadeIn(Node ui) {
|
||||
return fadeIn(ui, 0);
|
||||
|
@ -91,7 +93,7 @@ public class GuiUtils {
|
|||
|
||||
public static Animation fadeIn(Node ui, int delayMillis) {
|
||||
ui.setCache(true);
|
||||
FadeTransition ft = new FadeTransition(Duration.millis(UI_ANIMATION_TIME_MSEC), ui);
|
||||
FadeTransition ft = new FadeTransition(UI_ANIMATION_TIME, ui);
|
||||
ft.setFromValue(0.0);
|
||||
ft.setToValue(1.0);
|
||||
ft.setOnFinished(ev -> ui.setCache(false));
|
||||
|
@ -101,7 +103,7 @@ public class GuiUtils {
|
|||
}
|
||||
|
||||
public static Animation fadeOut(Node ui) {
|
||||
FadeTransition ft = new FadeTransition(Duration.millis(UI_ANIMATION_TIME_MSEC), ui);
|
||||
FadeTransition ft = new FadeTransition(UI_ANIMATION_TIME, ui);
|
||||
ft.setFromValue(ui.getOpacity());
|
||||
ft.setToValue(0.0);
|
||||
ft.play();
|
||||
|
@ -129,7 +131,7 @@ public class GuiUtils {
|
|||
node.setEffect(blur);
|
||||
Timeline timeline = new Timeline();
|
||||
KeyValue kv = new KeyValue(blur.radiusProperty(), 10.0);
|
||||
KeyFrame kf = new KeyFrame(Duration.millis(UI_ANIMATION_TIME_MSEC), kv);
|
||||
KeyFrame kf = new KeyFrame(UI_ANIMATION_TIME, kv);
|
||||
timeline.getKeyFrames().add(kf);
|
||||
timeline.play();
|
||||
}
|
||||
|
@ -138,7 +140,7 @@ public class GuiUtils {
|
|||
GaussianBlur blur = (GaussianBlur) node.getEffect();
|
||||
Timeline timeline = new Timeline();
|
||||
KeyValue kv = new KeyValue(blur.radiusProperty(), 0.0);
|
||||
KeyFrame kf = new KeyFrame(Duration.millis(UI_ANIMATION_TIME_MSEC), kv);
|
||||
KeyFrame kf = new KeyFrame(UI_ANIMATION_TIME, kv);
|
||||
timeline.getKeyFrames().add(kf);
|
||||
timeline.setOnFinished(actionEvent -> node.setEffect(null));
|
||||
timeline.play();
|
||||
|
@ -157,7 +159,7 @@ public class GuiUtils {
|
|||
}
|
||||
|
||||
private static ScaleTransition scaleFromTo(Node node, double from, double to, int delayMillis) {
|
||||
ScaleTransition scale = new ScaleTransition(Duration.millis(UI_ANIMATION_TIME_MSEC / 2), node);
|
||||
ScaleTransition scale = new ScaleTransition(UI_ANIMATION_TIME.divide(2), node);
|
||||
scale.setFromX(from);
|
||||
scale.setFromY(from);
|
||||
scale.setToX(to);
|
||||
|
|
Loading…
Add table
Reference in a new issue