Skip to content

Commit

Permalink
fix レイアウト修正👋
Browse files Browse the repository at this point in the history
  • Loading branch information
Khromium committed Dec 13, 2017
1 parent 145a6db commit 13d3f3b
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 54 deletions.
2 changes: 2 additions & 0 deletions field/src/main/java/kosen/janken/Controller.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ public void buttonsHandler(ActionEvent event) {
case "reset":
playerRPS1 = null;
playerRPS2 = null;
team1name.setText("Team1");
team2name.setText("Team2");
player11.setImage(rock);
player12.setImage(rock);
player21.setImage(rock);
Expand Down
131 changes: 77 additions & 54 deletions field/src/main/resources/layout.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -10,116 +10,139 @@
<?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.layout.VBox?>

<HBox fx:id="main" alignment="TOP_CENTER" prefHeight="600.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/8.0.111"
xmlns:fx="http://javafx.com/fxml/1" fx:controller="kosen.janken.Controller">
<HBox fx:id="main" alignment="TOP_CENTER" prefHeight="600.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1" fx:controller="kosen.janken.Controller">
<children>
<VBox alignment="CENTER" minHeight="-Infinity" minWidth="-Infinity">
<children>
<HBox>
<children>
<Button fx:id="select_one" mnemonicParsing="false" onAction="#buttonsHandler"
onDragDropped="#handleOneDropped" onDragOver="#handleDragOver" prefHeight="27.0"
prefWidth="90.0" text="選択1...">
<Button fx:id="select_one" mnemonicParsing="false" onAction="#buttonsHandler" onDragDropped="#handleOneDropped" onDragOver="#handleDragOver" prefHeight="27.0" prefWidth="90.0" text="選択1...">
<HBox.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0"/>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</HBox.margin>
</Button>
<Button fx:id="select_two" mnemonicParsing="false" onAction="#buttonsHandler"
onDragDropped="#handleTwoDropped" onDragOver="#handleDragOver" prefHeight="27.0"
prefWidth="94.0" text="選択2...">
<Button fx:id="select_two" mnemonicParsing="false" onAction="#buttonsHandler" onDragDropped="#handleTwoDropped" onDragOver="#handleDragOver" prefHeight="27.0" prefWidth="94.0" text="選択2...">
<HBox.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0"/>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</HBox.margin>
</Button>
</children>
</HBox>
<GridPane prefHeight="164.0" prefWidth="600.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints/>
<RowConstraints maxHeight="80.0" minHeight="10.0" prefHeight="80.0" vgrow="SOMETIMES"/>
<RowConstraints maxHeight="80.0" minHeight="10.0" prefHeight="80.0" vgrow="SOMETIMES"/>
<RowConstraints maxHeight="35.0" minHeight="6.0" prefHeight="24.0" vgrow="SOMETIMES"/>
<RowConstraints maxHeight="35.0" minHeight="6.0" prefHeight="24.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="80.0" minHeight="10.0" prefHeight="80.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="80.0" minHeight="10.0" prefHeight="80.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="35.0" minHeight="6.0" prefHeight="24.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<HBox alignment="CENTER" prefHeight="600.0" prefWidth="124.0" GridPane.columnIndex="1"
GridPane.rowIndex="2">
<HBox alignment="CENTER_LEFT" prefHeight="600.0" prefWidth="124.0" GridPane.columnIndex="1" GridPane.rowIndex="2">
<children>
<ImageView fx:id="player22" fitHeight="57.0" fitWidth="65.0" pickOnBounds="true"
preserveRatio="true"/>
<Label fx:id="set_four" prefHeight="17.0" prefWidth="120" text="Team2Player2"/>
<ImageView fx:id="player22" fitHeight="57.0" fitWidth="65.0" pickOnBounds="true" preserveRatio="true">
<HBox.margin>
<Insets left="40.0" right="20.0" />
</HBox.margin>
</ImageView>
<Label fx:id="set_four" prefHeight="17.0" prefWidth="120" text="Agent2" />
</children>
</HBox>
<HBox alignment="CENTER" prefHeight="600.0" prefWidth="124.0" GridPane.rowIndex="1">
<HBox alignment="CENTER_RIGHT" prefHeight="600.0" prefWidth="124.0" GridPane.rowIndex="1">
<children>
<Label fx:id="set_one" prefHeight="17.0" prefWidth="120" text="Team1Player1"/>
<ImageView fx:id="player11" fitHeight="57.0" fitWidth="65.0" pickOnBounds="true"
preserveRatio="true"/>
<Label fx:id="set_one" alignment="CENTER_RIGHT" prefHeight="17.0" prefWidth="120" text="Agent1" />
<ImageView fx:id="player11" fitHeight="57.0" fitWidth="65.0" pickOnBounds="true" preserveRatio="true">
<HBox.margin>
<Insets left="20.0" right="40.0" />
</HBox.margin>
</ImageView>
</children>
</HBox>
<HBox alignment="CENTER" prefHeight="600.0" prefWidth="124.0" GridPane.columnIndex="1"
GridPane.rowIndex="1">
<HBox alignment="CENTER_LEFT" prefHeight="600.0" prefWidth="124.0" GridPane.columnIndex="1" GridPane.rowIndex="1">
<children>
<ImageView fx:id="player21" fitHeight="57.0" fitWidth="65.0" pickOnBounds="true"
preserveRatio="true"/>
<Label fx:id="set_two" prefHeight="17.0" prefWidth="120" text="Team2Player1"/>
<ImageView fx:id="player21" fitHeight="57.0" fitWidth="65.0" pickOnBounds="true" preserveRatio="true">
<HBox.margin>
<Insets left="40.0" right="20.0" />
</HBox.margin>
</ImageView>
<Label fx:id="set_two" prefHeight="17.0" prefWidth="120" text="Agent1" />
</children>
</HBox>
<HBox alignment="CENTER" prefHeight="600.0" prefWidth="124.0" GridPane.rowIndex="2">
<HBox alignment="CENTER_RIGHT" prefHeight="600.0" prefWidth="124.0" GridPane.rowIndex="2">
<children>
<Label fx:id="set_three" prefHeight="17.0" prefWidth="120" text="Team1Player2"/>
<ImageView fx:id="player12" fitHeight="57.0" fitWidth="65.0" pickOnBounds="true"
preserveRatio="true"/>
<Label fx:id="set_three" alignment="CENTER_RIGHT" prefHeight="17.0" prefWidth="120" text="Agent2" />
<ImageView fx:id="player12" fitHeight="57.0" fitWidth="65.0" pickOnBounds="true" preserveRatio="true">
<HBox.margin>
<Insets left="20.0" right="40.0" />
</HBox.margin>
</ImageView>
</children>
</HBox>
<HBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="200.0" GridPane.rowIndex="3">
<children>
<Label fx:id="condition1" text="Not set."/>
<Label fx:id="condition1" text="Not set." />
</children>
<opaqueInsets>
<Insets/>
<Insets />
</opaqueInsets>
<GridPane.margin>
<Insets left="20.0"/>
<Insets left="20.0" />
</GridPane.margin>
</HBox>
<HBox alignment="CENTER_RIGHT" prefHeight="42.0" prefWidth="297.0" GridPane.columnIndex="1"
GridPane.rowIndex="3">
<HBox alignment="CENTER_RIGHT" prefHeight="42.0" prefWidth="297.0" GridPane.columnIndex="1" GridPane.rowIndex="3">
<children>
<Label fx:id="condition2" text="Not set."/>
<Label fx:id="condition2" alignment="CENTER_RIGHT" text="Not set." />
</children>
<padding>
<Insets right="20.0"/>
</padding>
<GridPane.margin>
<Insets right="20.0" />
</GridPane.margin>
</HBox>
<Label fx:id="team1name" text="Team1">
<HBox alignment="CENTER_RIGHT" prefHeight="100.0" prefWidth="200.0" GridPane.columnIndex="0" GridPane.rowIndex="0">
<children>
<Label fx:id="team1name" alignment="CENTER_RIGHT" text="Team1">
<HBox.margin>
<Insets right="40.0" />
</HBox.margin></Label>
</children>
<opaqueInsets>
<Insets />
</opaqueInsets>
<GridPane.margin>
<Insets left="55.0"/>
<Insets />
</GridPane.margin>
</Label>
<Label fx:id="team2name" text="Team2" GridPane.columnIndex="1">
</HBox>
<HBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="0">
<children>
<Label fx:id="team2name" text="Team2" GridPane.columnIndex="1">
<HBox.margin>
<Insets left="40.0" />
</HBox.margin></Label>
</children>
<opaqueInsets>
<Insets />
</opaqueInsets>
<GridPane.margin>
<Insets left="120.0"/>
<Insets />
</GridPane.margin>
</Label>
</HBox>


</children>
<padding>
<Insets bottom="5.0" right="5.0" top="5.0"/>
<Insets bottom="5.0" right="5.0" top="5.0" />
</padding>
</GridPane>
<HBox alignment="CENTER_RIGHT">
<children>
<Button onAction="#buttonsHandler" fx:id="reset" mnemonicParsing="false" text="Reset"
textFill="RED"/>
<Button fx:id="reset" mnemonicParsing="false" onAction="#buttonsHandler" text="Reset" textFill="RED" />
<Button fx:id="run_10000" mnemonicParsing="false" onAction="#buttonsHandler" text="Run 10000">
<HBox.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0"/>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</HBox.margin>
</Button>
<Button fx:id="run_once" mnemonicParsing="false" onAction="#buttonsHandler" text="Run once"/>
<Button fx:id="run_once" mnemonicParsing="false" onAction="#buttonsHandler" text="Run once" />
</children>
</HBox>
</children>
Expand Down

0 comments on commit 13d3f3b

Please sign in to comment.