Skip to content

Commit 2c48c0b

Browse files
committed
Divider between document pane and editor pane
1 parent 6891c2e commit 2c48c0b

File tree

3 files changed

+32
-32
lines changed

3 files changed

+32
-32
lines changed
Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,30 @@
11
package org.team2363.helixnavigator;
22

3-
import javax.measure.Quantity;
4-
import javax.measure.quantity.Force;
3+
import javafx.application.Application;
4+
import javafx.scene.Scene;
5+
import javafx.scene.control.Button;
6+
import javafx.scene.control.SplitPane;
7+
import javafx.scene.layout.StackPane;
8+
import javafx.stage.Stage;
59

6-
import org.team2363.lib.unit.CustomUnits;
10+
public class Test extends Application {
711

8-
import tech.units.indriya.quantity.Quantities;
9-
import tech.units.indriya.unit.Units;
10-
11-
public class Test {
1212
public static void main(String[] args) {
13-
// Unit<Mass> lb = USCustomary.POUND;
14-
// Unit<Mass> g = Units.GRAM;
15-
// var tenLbs = Quantities.getQuantity(10.0, lb);
16-
// var asG = tenLbs.to(g);
17-
// System.out.println("Ten pounds: " + tenLbs);
18-
// System.out.println("As Grams: " + asG);
13+
launch(args);
14+
}
1915

20-
// Unit<Length> inch = USCustomary.INCH;
21-
// Unit<Length> centimeter = MetricPrefix.CENTI(USCustomary.METER);
22-
// var oneInch = Quantities.getQuantity(10.0, inch);
23-
// var asCm = oneInch.to(centimeter);
24-
// System.out.println("One inch: " + oneInch.getValue() + " " + oneInch.getUnit().getSymbol());
25-
// System.out.println("As centimeter: " + asCm);
26-
// System.out.println(CustomUnits.KILOGRAM_SQUARE_METRE);
27-
// System.out.println(CustomUnits.NEWTON_METRE);
28-
// Quantity<Acceleration> x = Quantities.getQuantity(10.0, CustomUnits.FOOT_PER_SQUARE_SECOND);
29-
// System.out.println(x);
30-
Quantity<Force> onePoundForce = Quantities.getQuantity(1.0, CustomUnits.POUND_FORCE);
31-
System.out.println(CustomUnits.POUND_FOOT);
16+
@Override
17+
public void start(Stage primaryStage) {
18+
SplitPane sp = new SplitPane();
19+
final StackPane sp1 = new StackPane();
20+
sp1.getChildren().add(new Button("Button One"));
21+
final StackPane sp2 = new StackPane();
22+
sp2.getChildren().add(new Button("Button Two"));
23+
final StackPane sp3 = new StackPane();
24+
sp3.getChildren().add(new Button("Button Three"));
25+
sp.getItems().addAll(sp1, sp2, sp3);
26+
sp.setDividerPositions(0.3f, 0.6f, 0.9f);
27+
primaryStage.setScene(new Scene(sp));
28+
primaryStage.show();
3229
}
33-
}
30+
}

app/src/main/java/org/team2363/helixnavigator/ui/MainPane.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,28 @@
55
import org.team2363.helixnavigator.ui.editor.EditorPane;
66
import org.team2363.helixnavigator.ui.menu.MainMenuBar;
77

8-
import javafx.scene.layout.BorderPane;
8+
import javafx.scene.control.SplitPane;
9+
import javafx.scene.layout.VBox;
910

10-
public class MainPane extends BorderPane {
11+
public class MainPane extends VBox {
1112

1213
private final DocumentManager documentManager;
1314

1415
private final MainMenuBar mainMenuBar;
16+
1517
private final DocumentPane documentPane;
1618
private final EditorPane editorPane;
19+
private final SplitPane middleRow;
1720

1821
public MainPane(DocumentManager documentManager) {
1922
this.documentManager = documentManager;
2023

2124
mainMenuBar = new MainMenuBar(this.documentManager);
25+
2226
documentPane = new DocumentPane(this.documentManager);
2327
editorPane = new EditorPane(this.documentManager);
28+
middleRow = new SplitPane(documentPane, editorPane);
2429

25-
setTop(mainMenuBar);
26-
setLeft(documentPane);
27-
setCenter(editorPane);
30+
getChildren().addAll(mainMenuBar, middleRow);
2831
}
2932
}

app/src/main/java/org/team2363/helixnavigator/ui/document/PathChooserBox.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public PathChooserBox(DocumentManager documentManager) {
4545
pathChooser.setCellFactory(PathListCell.PATH_CELL_FACTORY);
4646
// seems weird to me that this doesn't happen automatically:
4747
pathChooser.setButtonCell(new PathListCell());
48-
pathChooser.setMaxWidth(200);
48+
pathChooser.setMaxWidth(Double.POSITIVE_INFINITY);
4949
HBox.setHgrow(pathChooser, Priority.ALWAYS);
5050
plusButton.setOnAction(this::plusButtonPressed);
5151
minusButton.setOnAction(this::minusButtonPressed);

0 commit comments

Comments
 (0)