Skip to content

Commit a24310b

Browse files
Added solutionClusterScrollPane
solutionClusterScrollPane is now shown/hidden instead of solutionClusterView.
1 parent 39f7656 commit a24310b

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/main/java/ee/ut/similaritydetector/ui/controllers/CodeViewController.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ public class CodeViewController {
4242
@FXML
4343
private MenuBarController menuBarController;
4444
@FXML
45+
private ScrollPane solutionClusterScrollPane;
46+
@FXML
4547
private VBox solutionClusterView;
4648
@FXML
4749
private SplitPane codeSplitPane;
@@ -114,14 +116,14 @@ private void initialize() {
114116
*/
115117
private void hideClusterPane(){
116118
Duration duration = Duration.millis(300);
117-
solutionClusterView.setPrefWidth(solutionClusterView.getWidth());
118-
solutionClusterView.setMinWidth(solutionClusterView.getWidth());
119+
solutionClusterScrollPane.setPrefWidth(solutionClusterScrollPane.getWidth());
120+
solutionClusterScrollPane.setMinWidth(solutionClusterScrollPane.getWidth());
119121
Timeline timeline = new Timeline(
120122
new KeyFrame(duration,
121-
new KeyValue(solutionClusterView.maxWidthProperty(), 0, Interpolator.EASE_OUT),
122-
new KeyValue(solutionClusterView.minWidthProperty(), 0, Interpolator.EASE_OUT)));
123+
new KeyValue(solutionClusterScrollPane.maxWidthProperty(), 0, Interpolator.EASE_OUT),
124+
new KeyValue(solutionClusterScrollPane.minWidthProperty(), 0, Interpolator.EASE_OUT)));
123125
timeline.setOnFinished(event -> {
124-
solutionClusterView.setVisible(false);
126+
solutionClusterScrollPane.setVisible(false);
125127
hideSideBarButton.setOnAction(e -> Platform.runLater(this::openClusterPane));
126128
});
127129
hideSideBarButton.setOnAction(e -> {});
@@ -137,9 +139,9 @@ public void openClusterPane(){
137139
Duration duration = Duration.millis(300);
138140
Timeline timeline = new Timeline(
139141
new KeyFrame(duration,
140-
new KeyValue(solutionClusterView.maxWidthProperty(), solutionClusterView.getPrefWidth(), Interpolator.EASE_OUT),
141-
new KeyValue(solutionClusterView.minWidthProperty(), solutionClusterView.getPrefWidth(), Interpolator.EASE_OUT)));
142-
solutionClusterView.setVisible(true);
142+
new KeyValue(solutionClusterScrollPane.maxWidthProperty(), solutionClusterScrollPane.getPrefWidth(), Interpolator.EASE_OUT),
143+
new KeyValue(solutionClusterScrollPane.minWidthProperty(), solutionClusterScrollPane.getPrefWidth(), Interpolator.EASE_OUT)));
144+
solutionClusterScrollPane.setVisible(true);
143145
timeline.setOnFinished(event -> hideSideBarButton.setOnAction(e -> Platform.runLater(this::hideClusterPane)));
144146
hideSideBarButton.setOnAction(e -> {});
145147
timeline.play();

0 commit comments

Comments
 (0)