Skip to content

Commit 60f0f45

Browse files
committed
Merge pull request #347 from Vennik/enhancement/center-graph
Center the graph after load.
2 parents d0e2bff + af6b94e commit 60f0f45

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

geex-core/src/main/java/nl/tudelft/context/controller/AbstractGraphController.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ public abstract class AbstractGraphController extends ViewController<AnchorPane>
5353
@FXML
5454
ScrollPane scroll;
5555

56+
/**
57+
* Center for the scrollbar.
58+
*/
59+
private static final double CENTER = .5;
60+
5661
/**
5762
* Sources that are displayed in the graph.
5863
*/
@@ -133,6 +138,7 @@ protected void showGraph(final DrawableGraph drawableGraph) {
133138
));
134139

135140
Platform.runLater(this::updatePosition);
141+
Platform.runLater(() -> scroll.setVvalue(CENTER));
136142

137143
}
138144

geex-core/src/main/java/nl/tudelft/context/controller/ViewController.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
import javafx.beans.property.BooleanProperty;
44
import javafx.beans.property.SimpleBooleanProperty;
5-
import javafx.fxml.FXML;
65
import javafx.scene.Parent;
7-
import javafx.scene.layout.VBox;
86

97
/**
108
* @param <T> fxml root type

0 commit comments

Comments
 (0)