Skip to content

Commit

Permalink
Update Layout
Browse files Browse the repository at this point in the history
* move tools buttons to menu bar
* move StartPage.fxml to resources package
* omit stylesheet (temporary)
  • Loading branch information
brp14005 committed Feb 7, 2016
1 parent 80aeeaa commit dcca875
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 66 deletions.
8 changes: 4 additions & 4 deletions src/main/java/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ public void handle(ActionEvent event) {
System.out.print("Bingo you did something!");
}
});*/

Parent root = FXMLLoader.load(getClass().getResource("StartPage.fxml"));
Parent root = FXMLLoader.load(getClass().getResource("/main/resources/StartPage.fxml"));
Rectangle2D screenBounds = Screen.getPrimary().getVisualBounds();
primaryStage.setTitle("Iron-gate!");
primaryStage.setScene(new Scene(root, screenBounds.getWidth(), screenBounds.getHeight())); // a scene is created here
// primaryStage.setScene(new Scene(root, screenBounds.getWidth(), screenBounds.getHeight())); // a scene is created here
primaryStage.setScene(new Scene(root, 990, 785));
Scene scene = primaryStage.getScene(); // we get the scene from above
scene.getStylesheets().clear(); // clear any styles
scene.getStylesheets().add("/main/resources/mainStyle.css"); // absolute path
// scene.getStylesheets().add("/main/resources/mainStyle.css"); // absolute path
primaryStage.show();
}
public static void main(String[] args) {
Expand Down
44 changes: 16 additions & 28 deletions src/main/java/StartPage.fxml → src/main/resources/StartPage.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,32 @@
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>


<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="480.0" prefWidth="640.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="785.0" prefWidth="990.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<top>
<MenuBar id="menubar-pane" BorderPane.alignment="CENTER">
<menus>
<Menu mnemonicParsing="false" text="File">
<items>
<MenuItem mnemonicParsing="false" text="Close" />
<MenuItem mnemonicParsing="false" text="Open..." />
<MenuItem mnemonicParsing="false" text="Open Recent" />
</items>
</Menu>
<Menu mnemonicParsing="false" text="Edit">
<items>
<MenuItem mnemonicParsing="false" text="Delete" />
<MenuItem mnemonicParsing="false" text="Preferences..." />
</items>
</Menu>
<Menu mnemonicParsing="false" text="Tools">
<items>
<MenuItem mnemonicParsing="false" text="Search" />
<MenuItem mnemonicParsing="false" text="Delete Files" />
<MenuItem mnemonicParsing="false" text="Auto Manager" />
<MenuItem mnemonicParsing="false" text="Templates" />
</items>
</Menu>
<Menu mnemonicParsing="false" text="Help">
<items>
<MenuItem mnemonicParsing="false" text="Check for Updates" />
<MenuItem mnemonicParsing="false" text="About" />
</items>
</Menu>
Expand All @@ -39,9 +48,9 @@
<left>
<BorderPane prefHeight="200.0" prefWidth="300.0" styleClass="pane-general-style" BorderPane.alignment="CENTER">
<center>
<StackPane id="tool-inspector-pane" prefHeight="150.0" prefWidth="200.0" BorderPane.alignment="CENTER">
<StackPane id="tool-inspector-pane" prefHeight="764.0" prefWidth="300.0" BorderPane.alignment="CENTER">
<children>
<BorderPane prefHeight="200.0" prefWidth="200.0">
<BorderPane prefHeight="731.0" prefWidth="300.0">
<top>
<Label alignment="CENTER" prefHeight="23.0" prefWidth="159.0" text="Search" BorderPane.alignment="CENTER">
<font>
Expand Down Expand Up @@ -77,35 +86,14 @@
</HBox>
</top>
<center>
<ListView maxWidth="-Infinity" prefHeight="200.0" prefWidth="250.0" BorderPane.alignment="CENTER" />
<ListView maxWidth="-Infinity" prefHeight="51.0" prefWidth="250.0" BorderPane.alignment="CENTER" />
</center>
</BorderPane>
</center>
</BorderPane>
</children>
</StackPane>
</center>
<top>
<BorderPane prefHeight="100.0" prefWidth="200.0" BorderPane.alignment="CENTER">
<center>
<FlowPane id="tool-selector-pane" alignment="CENTER" columnHalignment="CENTER" hgap="10.0" prefHeight="125.0" prefWidth="400.0" prefWrapLength="300.0" vgap="10.0" BorderPane.alignment="CENTER">
<children>
<Label text="Search" underline="true" />
<Label layoutX="215.0" layoutY="64.0" text="Delete Files" underline="true" />
<Label layoutX="242.0" layoutY="64.0" text="Auto Manager" underline="true" />
<Label layoutX="281.0" layoutY="64.0" text="Templates" underline="true" />
</children>
</FlowPane>
</center>
<top>
<Label alignment="CENTER" prefHeight="25.0" prefWidth="300.0" styleClass="pane-title" text="Tools" BorderPane.alignment="CENTER">
<font>
<Font name="System Bold" size="14.0" />
</font>
</Label>
</top>
</BorderPane>
</top>
</BorderPane>
</left>
<right>
Expand Down
34 changes: 0 additions & 34 deletions src/main/resources/mainStyle.css

This file was deleted.

0 comments on commit dcca875

Please sign in to comment.