-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial params window template created
- Loading branch information
1 parent
dac82b4
commit 2bcba04
Showing
6 changed files
with
91 additions
and
23 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package sample; | ||
import java.net.URL; | ||
import java.util.ResourceBundle; | ||
import javafx.fxml.FXML; | ||
import javafx.scene.control.Button; | ||
import javafx.scene.control.Spinner; | ||
import javafx.scene.control.SpinnerValueFactory; | ||
|
||
public class InitialParamsWindowController { | ||
|
||
@FXML | ||
private ResourceBundle resources; | ||
|
||
@FXML | ||
private URL location; | ||
|
||
@FXML | ||
private Spinner<Integer> initialAnimalsSpinner; | ||
|
||
@FXML | ||
private Spinner<Integer> plantEnergySpinner; | ||
|
||
@FXML | ||
private Spinner<Integer> moveEnergySpinner; | ||
|
||
@FXML | ||
private Spinner<Double> jungleRatioSpinner; | ||
|
||
@FXML | ||
private Spinner<Integer> boardHeightSpinner; | ||
|
||
@FXML | ||
private Spinner<Integer> boardWidthSpinner; | ||
|
||
@FXML | ||
private Button startSimulationButton; | ||
|
||
@FXML | ||
void initialize() { | ||
assert initialAnimalsSpinner != null : "fx:id=\"initialAnimalsSpinner\" was not injected: check your FXML file 'initialParamsWindow.fxml'."; | ||
assert plantEnergySpinner != null : "fx:id=\"plantEnergySpinner\" was not injected: check your FXML file 'initialParamsWindow.fxml'."; | ||
assert moveEnergySpinner != null : "fx:id=\"moveEnergySpinner\" was not injected: check your FXML file 'initialParamsWindow.fxml'."; | ||
assert jungleRatioSpinner != null : "fx:id=\"jungleRatioSpinner\" was not injected: check your FXML file 'initialParamsWindow.fxml'."; | ||
assert boardHeightSpinner != null : "fx:id=\"boardHeightSpinner\" was not injected: check your FXML file 'initialParamsWindow.fxml'."; | ||
assert boardWidthSpinner != null : "fx:id=\"boardWidthSpinner\" was not injected: check your FXML file 'initialParamsWindow.fxml'."; | ||
assert startSimulationButton != null : "fx:id=\"startSimulationButton\" was not injected: check your FXML file 'initialParamsWindow.fxml'."; | ||
initialAnimalsSpinner.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(0, 25,10)); | ||
plantEnergySpinner.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(0, 100,50)); | ||
moveEnergySpinner.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(0, 100,10)); | ||
jungleRatioSpinner.setValueFactory(new SpinnerValueFactory.DoubleSpinnerValueFactory(0.1, 0.9,0.5,0.01)); | ||
boardHeightSpinner.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(10, 100)); | ||
boardWidthSpinner.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(10, 100)); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import javafx.scene.control.Button?> | ||
<?import javafx.scene.control.Label?> | ||
<?import javafx.scene.control.Spinner?> | ||
<?import javafx.scene.layout.Pane?> | ||
|
||
<Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="245.0" prefWidth="261.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sample.InitialParamsWindowController"> | ||
<children> | ||
<Spinner fx:id="initialAnimalsSpinner" layoutX="162.0" layoutY="80.0" maxWidth="75.0" /> | ||
<Label layoutX="20.0" layoutY="83.0" text="Initial number of animals" /> | ||
<Spinner fx:id="plantEnergySpinner" layoutX="162.0" layoutY="110.0" maxWidth="75.0" /> | ||
<Label layoutX="20.0" layoutY="113.0" text="Plant energy" /> | ||
<Spinner fx:id="moveEnergySpinner" layoutX="162.0" layoutY="140.0" maxWidth="75.0" /> | ||
<Label layoutX="20.0" layoutY="143.0" text="Move energy" /> | ||
<Spinner fx:id="jungleRatioSpinner" layoutX="162.0" layoutY="170.0" maxWidth="75.0" /> | ||
<Label layoutX="20.0" layoutY="173.0" text="Jungle ratio" /> | ||
<Spinner fx:id="boardHeightSpinner" layoutX="162.0" layoutY="50.0" maxWidth="75.0" /> | ||
<Label layoutX="20.0" layoutY="53.0" text="Board height" /> | ||
<Spinner fx:id="boardWidthSpinner" layoutX="162.0" layoutY="20.0" maxWidth="75.0" /> | ||
<Label layoutX="20.0" layoutY="23.0" text="Board width" /> | ||
<Button fx:id="startSimulationButton" layoutX="162.0" layoutY="200.0" maxWidth="75.0" mnemonicParsing="false" prefHeight="25.0" prefWidth="75.0" text="Start!" /> | ||
</children> | ||
</Pane> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters