-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVisualizationController.java
More file actions
55 lines (44 loc) · 1.67 KB
/
Copy pathVisualizationController.java
File metadata and controls
55 lines (44 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package JavaFXpackage;
import javafx.animation.SequentialTransition;
import javafx.animation.TranslateTransition;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.control.Button;
import javafx.scene.control.ChoiceBox;
import javafx.scene.control.Slider;
import javafx.scene.layout.HBox;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.util.Duration;
import java.util.ArrayList;
import java.util.List;
public class VisualizationController { // Replace with your actual class name
private BooleanProperty animationRunning = new SimpleBooleanProperty(false);
private List<Button> buttonsToDisable;
private List<Slider> slidersToDisable;
private List<ChoiceBox<String>> choiceBoxesToDisable;
public void setUIElementsToToggle(List<Button> buttons, List<Slider> sliders, List<ChoiceBox<String>> choiceBoxes) {
this.buttonsToDisable = buttons;
this.slidersToDisable = sliders;
this.choiceBoxesToDisable = choiceBoxes;
}
private void toggleUI(boolean disable) {
if (buttonsToDisable != null) {
for (Button button : buttonsToDisable) {
button.setDisable(disable);
}
}
if (slidersToDisable != null) {
for (Slider slider : slidersToDisable) {
slider.setDisable(disable);
}
}
if (choiceBoxesToDisable != null) {
for (ChoiceBox<String> choiceBox : choiceBoxesToDisable) {
choiceBox.setDisable(disable);
}
}
}
}