Skip to content

Commit 4636702

Browse files
committed
Remove animations from TestPointLocation test application
1 parent 8281072 commit 4636702

File tree

1 file changed

+0
-42
lines changed

1 file changed

+0
-42
lines changed

src/main/java/javafxlibrary/testapps/controllers/TestPointLocationController.java

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -17,71 +17,29 @@
1717

1818
package javafxlibrary.testapps.controllers;
1919

20-
import javafx.animation.*;
2120
import javafx.fxml.FXML;
2221
import javafx.fxml.Initializable;
2322
import javafx.scene.control.Label;
24-
import javafx.scene.effect.BoxBlur;
2523
import javafx.scene.input.MouseEvent;
26-
import javafx.util.Duration;
2724
import java.net.URL;
2825
import java.util.ResourceBundle;
2926

3027
public class TestPointLocationController implements Initializable {
3128

3229
private @FXML Label locationLabel;
33-
private SequentialTransition textTransition;
34-
private BoxBlur blur;
35-
private double blurAmount = 5.0;
3630

3731
@Override
3832
public void initialize(URL location, ResourceBundle resources) {
3933
locationLabel.setText("- | -");
40-
textTransition = new SequentialTransition();
41-
textTransition.getChildren().addAll(zoomIn(), zoomOut());
42-
blur = new BoxBlur(5.0, 5.0, 1);
4334
}
4435

4536
public void mouseListener(MouseEvent event) {
4637
int x = (int) event.getSceneX();
4738
int y = (int) event.getSceneY();
4839
locationLabel.setText(x + " | " + y);
49-
if(textTransition.getStatus() != Animation.Status.RUNNING)
50-
textTransition.play();
51-
locationLabel.setEffect(blur);
52-
blurAmount = 5.0;
53-
54-
AnimationTimer timer = new AnimationTimer() {
55-
@Override
56-
public void handle(long now) {
57-
blurAmount -= 0.01;
58-
locationLabel.setEffect(new BoxBlur(blurAmount, blurAmount, 1));
59-
if(blurAmount <= 0.0) {
60-
stop();
61-
}
62-
}
63-
};
64-
65-
timer.start();
6640
}
6741

6842
public void mouseExitedListener() {
6943
locationLabel.setText("- | -");
7044
}
71-
72-
public ScaleTransition zoomIn() {
73-
ScaleTransition scaleTransition = new ScaleTransition(Duration.millis(10), locationLabel);
74-
scaleTransition.setToX(1.75f);
75-
scaleTransition.setToY(1.75f);
76-
scaleTransition.setCycleCount(1);
77-
return scaleTransition;
78-
}
79-
80-
public ScaleTransition zoomOut() {
81-
ScaleTransition scaleTransition = new ScaleTransition(Duration.millis(10), locationLabel);
82-
scaleTransition.setToX(1f);
83-
scaleTransition.setToY(1f);
84-
scaleTransition.setCycleCount(1);
85-
return scaleTransition;
86-
}
8745
}

0 commit comments

Comments
 (0)