Skip to content
Snippets Groups Projects
Commit dd32f791 authored by Robert Goldmann's avatar Robert Goldmann
Browse files

Fixed #10

parent c494e264
Branches
Tags
No related merge requests found
No preview for this file type
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ScrollPane?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.FlowPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<AnchorPane prefHeight="600.0" prefWidth="300.0" xmlns="http://javafx.com/javafx/8.0.60" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.deadlocker8.roadgame.ui.PossibleTilesController">
<AnchorPane prefHeight="500.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.60" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.deadlocker8.roadgame.ui.PossibleTilesController">
<children>
<ScrollPane layoutX="14.0" layoutY="14.0" AnchorPane.bottomAnchor="56.0" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="14.0">
<VBox alignment="TOP_CENTER" layoutX="14.0" layoutY="14.0" AnchorPane.bottomAnchor="14.0" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="14.0">
<children>
<ScrollPane fx:id="scrollPane" VBox.vgrow="ALWAYS">
<content>
<VBox fx:id="vbox" prefHeight="530.0" prefWidth="272.0" />
<FlowPane fx:id="flowPane" prefHeight="418.0" prefWidth="565.0" />
</content>
</ScrollPane>
<Button fx:id="buttonBack" layoutX="119.0" layoutY="556.0" mnemonicParsing="false" onAction="#back" prefHeight="30.0" prefWidth="63.0" text="Back" AnchorPane.bottomAnchor="14.0" AnchorPane.leftAnchor="119.0" AnchorPane.rightAnchor="118.0">
<Button fx:id="buttonBack" mnemonicParsing="false" onAction="#back" prefHeight="30.0" prefWidth="70.0" text="Back">
<font>
<Font name="System Bold" size="14.0" />
</font>
<VBox.margin>
<Insets top="14.0" />
</VBox.margin>
</Button>
</children>
</VBox>
</children>
</AnchorPane>
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -8,14 +8,16 @@ import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.ScrollPane;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class PossibleTilesController
{
@FXML private VBox vbox;
@FXML private ScrollPane scrollPane;
@FXML private FlowPane flowPane;
@FXML private Button buttonBack;
private Stage stage;
......@@ -24,8 +26,11 @@ public class PossibleTilesController
{
this.stage = stage;
vbox.setSpacing(10.0);
vbox.setAlignment(Pos.TOP_CENTER);
flowPane.setVgap(25);
flowPane.setHgap(25);
flowPane.prefWidthProperty().bind(scrollPane.widthProperty());
flowPane.prefHeightProperty().bind(scrollPane.heightProperty());
for(TileType key : tilePack.getTiles().keySet())
{
......@@ -42,7 +47,7 @@ public class PossibleTilesController
hbox.getChildren().add(currentStack);
hbox.getChildren().add(labelTimes);
HBox.setMargin(labelTimes, new Insets(0, 0, 0, 25));
vbox.getChildren().add(hbox);
flowPane.getChildren().add(hbox);
}
}
......
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ScrollPane?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.FlowPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<AnchorPane prefHeight="600.0" prefWidth="300.0" xmlns="http://javafx.com/javafx/8.0.60" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.deadlocker8.roadgame.ui.PossibleTilesController">
<AnchorPane prefHeight="500.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.60" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.deadlocker8.roadgame.ui.PossibleTilesController">
<children>
<ScrollPane layoutX="14.0" layoutY="14.0" AnchorPane.bottomAnchor="56.0" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="14.0">
<VBox alignment="TOP_CENTER" layoutX="14.0" layoutY="14.0" AnchorPane.bottomAnchor="14.0" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="14.0">
<children>
<ScrollPane fx:id="scrollPane" VBox.vgrow="ALWAYS">
<content>
<VBox fx:id="vbox" prefHeight="530.0" prefWidth="272.0" />
<FlowPane fx:id="flowPane" prefHeight="418.0" prefWidth="565.0" />
</content>
</ScrollPane>
<Button fx:id="buttonBack" layoutX="119.0" layoutY="556.0" mnemonicParsing="false" onAction="#back" prefHeight="30.0" prefWidth="63.0" text="Back" AnchorPane.bottomAnchor="14.0" AnchorPane.leftAnchor="119.0" AnchorPane.rightAnchor="118.0">
<Button fx:id="buttonBack" mnemonicParsing="false" onAction="#back" prefHeight="30.0" prefWidth="70.0" text="Back">
<font>
<Font name="System Bold" size="14.0" />
</font>
<VBox.margin>
<Insets top="14.0" />
</VBox.margin>
</Button>
</children>
</VBox>
</children>
</AnchorPane>
......@@ -78,8 +78,10 @@ public class SelectTilePackController
newStage.initModality(Modality.APPLICATION_MODAL);
newStage.setTitle("Possible Tiles");
newStage.setScene(new Scene(root));
newStage.setMinWidth(400);
newStage.setMinHeight(400);
newStage.getIcons().add(icon);
newStage.setResizable(false);
newStage.setResizable(true);
PossibleTilesController newController = fxmlLoader.getController();
newController.init(newStage, controller, currentPack);
newStage.show();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment