Skip to content
Snippets Groups Projects
Commit 68f9954e authored by KALLEL Mohamed ali's avatar KALLEL Mohamed ali
Browse files

Final commit, deso Mr. regis

parent 03fca001
No related branches found
No related tags found
No related merge requests found
Pipeline #26133 passed
Showing
with 421 additions and 371 deletions
package app;
import controller.fireFigther.ControllerFireFigtherBord;
import controller.ControllerBord;
import controller.ControllerMenu;
import controller.ControllerPutElementCount;
import javafx.application.Platform;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
......@@ -14,11 +16,11 @@ import java.net.URL;
import java.util.Map;
public class SimulatorApplication extends javafx.application.Application {
private static final String VIEW_RESOURCE_PATH = "/view/fireFigtherView/fireFigtherBord.fxml";
private static final String VIEW_RESOURCE_PATH = "/view/menu.fxml";
private static final String APP_NAME = "Firefighter simulator";
private static final int ROW_COUNT = 20;
private static final int COLUMN_COUNT = 20;
private static int ROW_COUNT = 20;
private static int COLUMN_COUNT = 20;
private static final int SQUARE_WIDTH = 40;
private static final int SQUARE_HEIGHT = 40;
private Map<ModelElement,Integer> INITIAL_ELEMENTS_COUNT;
......@@ -38,20 +40,10 @@ public class SimulatorApplication extends javafx.application.Application {
@Override
public void start(Stage primaryStage) throws IOException {
initializePrimaryStage(primaryStage);
initializeInitialElementCount();
initializeView();
showScene();
}
private void initializeInitialElementCount() {
INITIAL_ELEMENTS_COUNT = new HashMap<>();
INITIAL_ELEMENTS_COUNT.put(new Fire(), 10);
INITIAL_ELEMENTS_COUNT.put(new FireFigther(), 10);
INITIAL_ELEMENTS_COUNT.put(new Cloud(), 10);
INITIAL_ELEMENTS_COUNT.put(new MotorisedFirefigther(), 10);
INITIAL_ELEMENTS_COUNT.put(new Mountain(), 10);
INITIAL_ELEMENTS_COUNT.put(new Road(), 10);
INITIAL_ELEMENTS_COUNT.put(new Rockerie(), 10);
}
private void initializeView() throws IOException {
......@@ -59,9 +51,6 @@ public class SimulatorApplication extends javafx.application.Application {
URL location = SimulatorApplication.class.getResource(VIEW_RESOURCE_PATH);
loader.setLocation(location);
view = loader.load();
ControllerFireFigtherBord controller = loader.getController();
controller.initialize(SQUARE_WIDTH, SQUARE_HEIGHT, COLUMN_COUNT, ROW_COUNT,INITIAL_ELEMENTS_COUNT
);
}
private void showScene() {
......
package controller.fireFigther;
package controller;
import controller.fireFigther.PersistentToggleGroup;
import controller.PersistentToggleGroup;
import javafx.animation.Animation;
import javafx.animation.KeyFrame;
import javafx.animation.Timeline;
......@@ -26,7 +26,7 @@ import java.util.Map;
import static java.util.Objects.requireNonNull;
public class ControllerFireFigtherBord {
public class ControllerBord {
public static final int PERIOD_IN_MILLISECONDS = 50;
@FXML
......@@ -97,7 +97,7 @@ public class ControllerFireFigtherBord {
private void initializeTimeline() {
Duration duration = new Duration(ControllerFireFigtherBord.PERIOD_IN_MILLISECONDS);
Duration duration = new Duration(ControllerBord.PERIOD_IN_MILLISECONDS);
EventHandler<ActionEvent> eventHandler =
event -> updateBoard();
KeyFrame keyFrame = new KeyFrame(duration, eventHandler);
......
package controller;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.stage.Stage;
import java.net.URL;
public class ControllerMenu {
@FXML
private Button FireFighter;
@FXML
private Button Virus;
@FXML
public void exit() {
System.exit(0);
}
public void FireFighter() {
try {
FXMLLoader loader = new FXMLLoader();
URL location = getClass().getResource("/view/putElementCount.fxml");
loader.setLocation(location);
Parent parent = loader.load();
Stage stage = new Stage();
stage.setTitle("Put Element Count");
stage.setScene(new Scene(parent));
Stage currentStage = (Stage) FireFighter.getScene().getWindow();
currentStage.close();
stage.show();
} catch (Exception e) {
e.printStackTrace();
}
}
public void Virus() {
try {
FXMLLoader loader = new FXMLLoader();
URL location = getClass().getResource("/view/virusElementCount.fxml");
loader.setLocation(location);
Parent parent = loader.load();
Stage stage = new Stage();
stage.setTitle("Put Element Count");
stage.setScene(new Scene(parent));
Stage currentStage = (Stage) Virus.getScene().getWindow();
currentStage.close();
stage.show();
} catch (Exception e) {
e.printStackTrace();
}
}
}
package controller;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
import javafx.stage.Stage;
import model.Element.*;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
public class ControllerPutElementCount {
private static final int ROW_COUNT = 20;
private static final int COLUMN_COUNT = 20;
private static final int SQUARE_WIDTH = 40;
private static final int SQUARE_HEIGHT = 40;
@FXML
private TextField fire;
@FXML
private TextField firefighter;
@FXML
private TextField cloud;
@FXML
private TextField motorisedFireFighter;
@FXML
private TextField mountain;
@FXML
private TextField road;
@FXML
private TextField rockerie;
@FXML
private Button button;
@FXML
private void initialize() {
Map<ModelElement, Integer> INITIAL_ELEMENTS_COUNT = new HashMap<>();
int fireCount = parseIntOrDefault(fire.getText());
int firefighterCount = parseIntOrDefault(firefighter.getText());
int cloudCount = parseIntOrDefault(cloud.getText());
int motorisedFirefighterCount = parseIntOrDefault(motorisedFireFighter.getText());
int mountainCount = parseIntOrDefault(mountain.getText());
int roadCount = parseIntOrDefault(road.getText());
int rockerieCount = parseIntOrDefault(rockerie.getText());
INITIAL_ELEMENTS_COUNT.put(new Fire(), fireCount);
INITIAL_ELEMENTS_COUNT.put(new FireFigther(), firefighterCount);
INITIAL_ELEMENTS_COUNT.put(new Cloud(), cloudCount);
INITIAL_ELEMENTS_COUNT.put(new MotorisedFirefigther(), motorisedFirefighterCount);
INITIAL_ELEMENTS_COUNT.put(new Mountain(), mountainCount);
INITIAL_ELEMENTS_COUNT.put(new Road(), roadCount);
INITIAL_ELEMENTS_COUNT.put(new Rockerie(), rockerieCount);
loadScene(INITIAL_ELEMENTS_COUNT);
}
private int parseIntOrDefault(String input) {
try {
return input.isEmpty() ? 0 : Integer.parseInt(input);
} catch (NumberFormatException e) {
return 0;
}
}
@FXML
private void loadScene(Map<ModelElement, Integer> initialElementCount) {
try {
FXMLLoader loader = new FXMLLoader();
URL location = getClass().getResource("/view/viewBord.fxml");
loader.setLocation(location);
Parent parent = loader.load();
ControllerBord controller = loader.getController();
controller.initialize(SQUARE_WIDTH, SQUARE_HEIGHT, COLUMN_COUNT, ROW_COUNT, initialElementCount);
Stage currentStage = (Stage) fire.getScene().getWindow();
currentStage.close();
Stage newStage = new Stage();
newStage.setTitle("Fire Fighter");
newStage.setScene(new Scene(parent));
newStage.show();
} catch (Exception e) {
e.printStackTrace();
}
}
}
package controller;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
import javafx.stage.Stage;
import model.Element.*;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
public class ControllerVirusElementCount {
private static final int ROW_COUNT = 20;
private static final int COLUMN_COUNT = 20;
private static final int SQUARE_WIDTH = 40;
private static final int SQUARE_HEIGHT = 40;
@FXML
private TextField doctorsTextField;
@FXML
private TextField virusesTextField;
@FXML
private TextField humansTextField;
@FXML
private Button button;
@FXML
private void validate() {
Map<ModelElement, Integer> INITIAL_ELEMENTS_COUNT = new HashMap<>();
INITIAL_ELEMENTS_COUNT.put(new Doctor(), Integer.parseInt(doctorsTextField.getText()));
INITIAL_ELEMENTS_COUNT.put(new Virus(), Integer.parseInt(virusesTextField.getText()));
INITIAL_ELEMENTS_COUNT.put(new Humain(), Integer.parseInt(humansTextField.getText()));
loadScene(INITIAL_ELEMENTS_COUNT);
}
@FXML
private void loadScene(Map<ModelElement, Integer> initialElementCount) {
try {
FXMLLoader loader = new FXMLLoader();
URL location = getClass().getResource("/view/virusBoard.fxml");
loader.setLocation(location);
Parent parent = loader.load();
ControllerBord controller = loader.getController();
controller.initialize(SQUARE_WIDTH, SQUARE_HEIGHT, COLUMN_COUNT, ROW_COUNT,initialElementCount);
Stage currentStage = (Stage) doctorsTextField.getScene().getWindow();
currentStage.close();
Stage stage = new Stage();
stage.setTitle("Virus");
stage.setScene(new Scene(parent));
stage.show();
} catch (Exception e) {
e.printStackTrace();
}
}
}
package controller.fireFigther;
package controller;
import javafx.collections.ListChangeListener.Change;
import javafx.scene.control.Toggle;
......
package controller;
import javafx.fxml.FXML;
import javafx.scene.control.Spinner;
public class SettingsController {
@FXML
private Spinner<Integer> rowCountSpinner;
@FXML
private Spinner<Integer> columnCountSpinner;
public int getRowCount() {
return rowCountSpinner.getValue();
}
public int getColumnCount() {
return columnCountSpinner.getValue();
}
}
package controller;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
public class controllerMenu {
@FXML
private Button fireFighter;
@FXML
public void exit(ActionEvent actionEvent) {
System.exit(0);
}
public void FireFighter(ActionEvent actionEvent){
}
public void Virus(ActionEvent actionEvent){
}
public void Settings(ActionEvent actionEvent){
}
}
package controller.fireFigther;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.Spinner;
import javafx.scene.image.ImageView;
public class ControllerPutElementCountController {
@FXML
private Spinner<Integer> fire;
@FXML
private Spinner<Integer> firefighter;
@FXML
private Spinner<Integer> cloud;
@FXML
private Spinner<Integer> motorisedFireFighter;
@FXML
private Spinner<Integer> mountain;
@FXML
private Spinner<Integer> road;
@FXML
private Spinner<Integer> rockerie;
@FXML
private Button button;
@FXML
private Label cloudLabel;
@FXML
private Label motorisedFireFighterLabel;
@FXML
private Label mountainLabel;
@FXML
private Label roadLabel;
@FXML
private Label rockerieLabel;
@FXML
private ImageView imageView;
@FXML
private void initialize() {
}
@FXML
private void handleButtonClick(ActionEvent event) {
System.out.println("Button clicked!");
}
}
......@@ -16,6 +16,7 @@ public class Doctor implements ModelElement {
removeElement(position, board, new Doctor());
addElement(newPositionStep, board, new Doctor());
extinguishneighbor(newPositionStep,board,new Virus(),rowCount,columnCount);
}
}
......
......@@ -10,16 +10,24 @@ import java.util.Random;
import static util.Tools.*;
public class Virus implements ModelElement {
@Override
public void update(Position position, Map<Position, List<ModelElement>> board, int step, int columnCount, int rowCount) {
List<Position> neighbors = neighbors(position, rowCount, columnCount);
if (!neighbors.isEmpty()) {
Random nextCloud = new Random();
Position randomNeighbor = neighbors.get(nextCloud.nextInt(neighbors.size()));
if (board.get(randomNeighbor).contains(new Humain())) {
if (board.containsKey(randomNeighbor)) {
List<ModelElement> elementsAtRandomNeighbor = board.get(randomNeighbor);
if (elementsAtRandomNeighbor.contains(new Humain())) {
removeElement(randomNeighbor, board, new Humain());
addElement(randomNeighbor, board, new Virus());
}
}
addElement(randomNeighbor, board, new Virus());
}
......
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.Spinner?>
<?import javafx.scene.layout.GridPane?>
<GridPane xmlns:fx="http://javafx.com/fxml"
fx:controller="controller.SettingsController" alignment="center" hgap="10" vgap="10" padding="20">
<Label text="Settings" style="-fx-font-size: 16;" GridPane.columnIndex="0" GridPane.rowIndex="0" GridPane.columnSpan="2"/>
<!-- Row Count -->
<Label text="Row Count:" GridPane.columnIndex="0" GridPane.rowIndex="1"/>
<Spinner fx:id="rowCountSpinner" value="10" min="1" max="100" GridPane.columnIndex="1" GridPane.rowIndex="1"/>
<!-- Column Count -->
<Label text="Column Count:" GridPane.columnIndex="0" GridPane.rowIndex="2"/>
<Spinner fx:id="columnCountSpinner" value="10" min="1" max="100" GridPane.columnIndex="1" GridPane.rowIndex="2"/>
</GridPane>
.background {
-fx-background-color: #1d1d1d;
}
.label {
-fx-font-size: 11pt;
-fx-font-family: "Segoe UI Semibold";
-fx-text-fill: white;
-fx-opacity: 0.6;
}
.label-bright {
-fx-font-size: 11pt;
-fx-font-family: "Segoe UI Semibold";
-fx-text-fill: white;
-fx-opacity: 1;
}
.label-header {
-fx-font-size: 32pt;
-fx-font-family: "Segoe UI Light";
-fx-text-fill: white;
-fx-opacity: 1;
}
.table-view {
-fx-base: #1d1d1d;
-fx-control-inner-background: #1d1d1d;
-fx-background-color: #1d1d1d;
-fx-table-cell-border-color: transparent;
-fx-table-header-border-color: transparent;
-fx-padding: 5;
}
.table-view .column-header-background {
-fx-background-color: transparent;
}
.table-view .column-header, .table-view .filler {
-fx-border-width: 0 0 1 0;
-fx-background-color: transparent;
-fx-border-color:
transparent
transparent
derive(-fx-base, 80%)
transparent;
-fx-border-insets: 0 10 1 0;
}
.table-view .column-header .label {
-fx-font-size: 20pt;
-fx-font-family: "Segoe UI Light";
-fx-text-fill: white;
-fx-alignment: center-left;
-fx-opacity: 1;
}
.table-view:focused .table-row-cell:filled:focused:selected {
-fx-background-color: -fx-focus-color;
}
.split-pane:horizontal > .split-pane-divider {
-fx-border-color: transparent #1d1d1d transparent #1d1d1d;
-fx-background-color: transparent, derive(#1d1d1d,20%);
}
.split-pane {
-fx-padding: 1 0 0 0;
}
.menu-bar {
-fx-background-color: derive(#1d1d1d,20%);
}
.context-menu {
-fx-background-color: derive(#1d1d1d,50%);
}
.menu-bar .label {
-fx-font-size: 14pt;
-fx-font-family: "Segoe UI Light";
-fx-text-fill: white;
-fx-opacity: 0.9;
}
.menu .left-container {
-fx-background-color: black;
}
.text-field {
-fx-font-size: 12pt;
-fx-font-family: "Segoe UI Semibold";
}
/*
* Metro style Push Button
* Author: Pedro Duque Vieira
* http://pixelduke.wordpress.com/2012/10/23/jmetro-windows-8-controls-on-java/
*/
.button {
-fx-padding: 5 22 5 22;
-fx-border-color: #e2e2e2;
-fx-border-width: 2;
-fx-background-radius: 0;
-fx-background-color: #1d1d1d;
-fx-font-family: "Segoe UI", Helvetica, Arial, sans-serif;
-fx-font-size: 11pt;
-fx-text-fill: #d8d8d8;
-fx-background-insets: 0 0 0 0, 0, 1, 2;
}
.button:hover {
-fx-background-color: #3a3a3a;
}
.button:pressed, .button:default:hover:pressed {
-fx-background-color: white;
-fx-text-fill: #1d1d1d;
}
.button:focused {
-fx-border-color: white, white;
-fx-border-width: 1, 1;
-fx-border-style: solid;
-fx-border-radius: 0, 0;
-fx-border-insets: 1 1 1 1, 0;
}
.button:disabled, .button:default:disabled {
-fx-opacity: 0.4;
-fx-background-color: #1d1d1d;
-fx-text-fill: white;
}
.button:default {
-fx-background-color: -fx-focus-color;
-fx-text-fill: #ffffff;
}
.button:default:hover {
-fx-background-color: derive(-fx-focus-color,30%);
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import view.FirefighterGrid?>
<?import javafx.scene.control.ToggleButton?>
<?import javafx.scene.control.Separator?>
<?import javafx.scene.control.Label?>
<HBox styleClass="background" stylesheets="@DarkTheme.css"
xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml"
fx:controller="controller.fireFigther.ControllerFireFigtherBord">
<VBox>
<Separator maxHeight="-Infinity" maxWidth="-Infinity"
prefHeight="24.0" prefWidth="200.0"/>
<Label maxHeight="-Infinity" maxWidth="-Infinity" alignment="CENTER" prefHeight="24.0" prefWidth="200.0"
text="Generation number"/>
<Label fx:id="generationNumberLabel" alignment="CENTER" contentDisplay="TEXT_ONLY"
maxHeight="-Infinity" maxWidth="-Infinity" prefHeight="24.0" prefWidth="200.0"/>
<Separator maxHeight="-Infinity" maxWidth="-Infinity"
prefHeight="24.0" prefWidth="200.0"/>
<Button fx:id="restartButton" maxHeight="-Infinity" maxWidth="-Infinity"
mnemonicParsing="false" onAction="#restartButtonAction" prefHeight="24.0" prefWidth="200.0"
text="Restart"/>
<Button fx:id="oneStepButton" maxHeight="-Infinity" maxWidth="-Infinity"
mnemonicParsing="false" onAction="#oneStepButtonAction" prefHeight="24.0" prefWidth="200.0"
text="One step"/>
<ToggleButton fx:id="playToggleButton" maxHeight="-Infinity" maxWidth="-Infinity"
mnemonicParsing="false" onAction="#playToggleButtonAction" prefHeight="24.0"
prefWidth="200.0" styleClass="button" text="Play"/>
<ToggleButton fx:id="pauseToggleButton" maxHeight="-Infinity" maxWidth="-Infinity"
mnemonicParsing="false" onAction="#pauseToggleButtonAction" prefHeight="24.0"
prefWidth="200.0" styleClass="button" text="Pause"/>
</VBox>
<FirefighterGrid fx:id="grid" width="1000.0" height="1000.0"
xmlns="http://javafx.com/javafx"
xmlns:fx="http://javafx.com/fxml">
</FirefighterGrid>
</HBox>
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.*?>
<?import javafx.scene.image.*?>
<?import javafx.scene.layout.*?>
<AnchorPane fx:id="putElementCount" fx:controller="controller.fireFigther.ControllerPutElementCountController" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="434.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1">
<children>
<Spinner fx:id="fire" editable="true" layoutX="106.0" layoutY="31.0" prefHeight="25.0" prefWidth="363.0" value="10" min="1" max="100" />
<Label layoutX="265.0" layoutY="14.0" text="Fire" />
<Label layoutX="245.0" layoutY="64.0" text="Fire Fighter" />
<Spinner fx:id="firefighter" layoutX="106.0" layoutY="82.0" prefHeight="25.0" prefWidth="363.0" value="10" min="1" max="100"/>
<Spinner fx:id="Cloud" layoutX="102.0" layoutY="134.0" prefHeight="25.0" prefWidth="363.0" value="10" min="1" max="100" />
<Spinner fx:id="MotorisedFireFighter" layoutX="106.0" layoutY="186.0" prefHeight="25.0" prefWidth="363.0" value="10" min="1" max="100" />
<Spinner fx:id="Mountain" layoutX="102.0" layoutY="234.0" prefHeight="25.0" prefWidth="363.0" value="10" min="1" max="100"/>
<Spinner fx:id="Road" layoutX="101.0" layoutY="286.0" prefHeight="25.0" prefWidth="355.0" value="10" min="1" max="100"/>
<Spinner fx:id="Rockerie" layoutX="100.0" layoutY="335.0" prefHeight="25.0" prefWidth="355.0" value="10" min="1" max="100"/>
<Button layoutX="229.0" layoutY="376.0" mnemonicParsing="false" prefHeight="55.0" prefWidth="92.0" text="Button" />
<Label layoutX="259.0" layoutY="116.0" text="Cloud" />
<Label layoutX="215.0" layoutY="169.0" text="Motorised Fire Fighter" />
<Label layoutX="249.0" layoutY="217.0" text="Mountain" />
<Label layoutX="260.0" layoutY="269.0" text="Road" />
<Label layoutX="251.0" layoutY="318.0" text="Rockerie" />
<ImageView fitHeight="62.0" fitWidth="102.0" layoutX="223.0" layoutY="373.0" pickOnBounds="true" preserveRatio="true" />
</children>
</AnchorPane>
......@@ -3,11 +3,10 @@
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<AnchorPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="controller.controllerMenu">
<AnchorPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="controller.ControllerMenu">
<children>
<Button fx:id="FireFighter" layoutX="36.0" layoutY="119.0" mnemonicParsing="false" onAction="#FireFighter" prefHeight="106.0" prefWidth="259.0" text="firefiter" />
<Button fx:id="FireFighter" layoutX="36.0" layoutY="119.0" mnemonicParsing="false" onAction="#FireFighter" prefHeight="106.0" prefWidth="259.0" text="FireFighter" />
<Button fx:id="Virus" layoutX="321.0" layoutY="119.0" mnemonicParsing="false" onAction="#Virus" prefHeight="106.0" prefWidth="259.0" text="virus" />
<Button fx:id="Settings" layoutX="541.0" layoutY="14.0" mnemonicParsing="false" onAction="#Settings" prefHeight="41.0" prefWidth="45.0" text="setting" />
<Button layoutX="14.0" layoutY="14.0" mnemonicParsing="false" onAction="#exit" prefHeight="35.0" prefWidth="96.0" text="exit" />
<Button layoutX="14.0" layoutY="14.0" mnemonicParsing="false" prefHeight="35.0" prefWidth="96.0" text="exit" onAction="#exit" />
</children>
</AnchorPane>
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<AnchorPane xmlns="http://javafx.com/javafx"
xmlns:fx="http://javafx.com/fxml"
fx:controller="controller.ControllerPutElementCount"
prefHeight="400.0" prefWidth="600.0">
<VBox alignment="CENTER" spacing="20">
<Label text="Enter the Number of Elements" />
<HBox spacing="10">
<Label text="Fire:" />
<TextField fx:id="fire" text="3" />
</HBox>
<HBox spacing="10">
<Label text="FireFighter:" />
<TextField fx:id="firefighter" text="5" />
</HBox>
<HBox spacing="10">
<Label text="Motorised FireFighter:" />
<TextField fx:id="motorisedFireFighter" text="7" />
</HBox>
<HBox spacing="10">
<Label text="Mountain:" />
<TextField fx:id="mountain" text="5"/>
</HBox>
<HBox spacing="10">
<Label text="Cloud:" />
<TextField fx:id="cloud" text="5" />
</HBox>
<HBox spacing="10">
<Label text="Road:" />
<TextField fx:id="road" text="5" />
</HBox>
<HBox spacing="10">
<Label text="Rockerie:" />
<TextField fx:id="rockerie" text="5" />
</HBox>
<Button text="Validate" onAction="#initialize" />
</VBox>
</AnchorPane>
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import view.FirefighterGrid?>
<?import javafx.scene.control.ToggleButton?>
<?import javafx.scene.control.Separator?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.StackPane?>
<?import javafx.scene.shape.Rectangle?>
<HBox styleClass="background" stylesheets="@DarkTheme.css"
xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml"
fx:controller="controller.ControllerBord">
<VBox spacing="5"> <!-- Added spacing to VBox -->
<Separator maxHeight="-Infinity" maxWidth="-Infinity"
prefHeight="24.0" prefWidth="200.0"/>
<Label maxHeight="-Infinity" maxWidth="-Infinity" alignment="CENTER" prefHeight="24.0" prefWidth="200.0"
text="Generation number"/>
<Label fx:id="generationNumberLabel" alignment="CENTER" contentDisplay="TEXT_ONLY"
maxHeight="-Infinity" maxWidth="-Infinity" prefHeight="24.0" prefWidth="200.0"/>
<Separator maxHeight="-Infinity" maxWidth="-Infinity"
prefHeight="24.0" prefWidth="200.0"/>
<Button fx:id="restartButton" maxHeight="-Infinity" maxWidth="-Infinity"
mnemonicParsing="false" onAction="#restartButtonAction" prefHeight="24.0" prefWidth="200.0"
text="Restart"/>
<Button fx:id="oneStepButton" maxHeight="-Infinity" maxWidth="-Infinity"
mnemonicParsing="false" onAction="#oneStepButtonAction" prefHeight="24.0" prefWidth="200.0"
text="One step"/>
<ToggleButton fx:id="playToggleButton" maxHeight="-Infinity" maxWidth="-Infinity"
mnemonicParsing="false" onAction="#playToggleButtonAction" prefHeight="24.0"
prefWidth="200.0" styleClass="button" text="Play"/>
<ToggleButton fx:id="pauseToggleButton" maxHeight="-Infinity" maxWidth="-Infinity"
mnemonicParsing="false" onAction="#pauseToggleButtonAction" prefHeight="24.0"
prefWidth="200.0" styleClass="button" text="Pause"/>
<Label alignment="CENTER" contentDisplay="TEXT_ONLY" text="Légende :"
maxHeight="-Infinity" maxWidth="-Infinity" prefHeight="24.0" prefWidth="200.0"/>
<Label alignment="CENTER" contentDisplay="TEXT_ONLY" text="rouge = fire"
maxHeight="-Infinity" maxWidth="-Infinity" prefHeight="24.0" prefWidth="200.0"/>
<Label alignment="CENTER" contentDisplay="TEXT_ONLY" text="bleu = firefighter"
maxHeight="-Infinity" maxWidth="-Infinity" prefHeight="24.0" prefWidth="200.0"/>
<Label alignment="CENTER" contentDisplay="TEXT_ONLY" text="gris = cloud"
maxHeight="-Infinity" maxWidth="-Infinity" prefHeight="24.0" prefWidth="200.0"/>
<Label alignment="CENTER" contentDisplay="TEXT_ONLY" text="noir = road"
maxHeight="-Infinity" maxWidth="-Infinity" prefHeight="24.0" prefWidth="200.0"/>
<Label alignment="CENTER" contentDisplay="TEXT_ONLY" text="orange = motorisedFireFighter"
maxHeight="-Infinity" maxWidth="-Infinity" prefHeight="24.0" prefWidth="200.0"/>
<Label alignment="CENTER" contentDisplay="TEXT_ONLY" text="marron = mountain"
maxHeight="-Infinity" maxWidth="-Infinity" prefHeight="24.0" prefWidth="200.0"/>
<Label alignment="CENTER" contentDisplay="TEXT_ONLY" text="gris clair = rockerie"
maxHeight="-Infinity" maxWidth="-Infinity" prefHeight="24.0" prefWidth="200.0"/>
</VBox>
<FirefighterGrid fx:id="grid" width="1000.0" height="1000.0"
xmlns="http://javafx.com/javafx"
xmlns:fx="http://javafx.com/fxml">
</FirefighterGrid>
</HBox>
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import view.FirefighterGrid?>
<?import javafx.scene.control.ToggleButton?>
<?import javafx.scene.control.Separator?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.StackPane?>
<?import javafx.scene.shape.Rectangle?>
<HBox styleClass="background" stylesheets="@DarkTheme.css"
xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml"
fx:controller="controller.ControllerBord">
<VBox spacing="5"> <!-- Added spacing to VBox -->
<Separator maxHeight="-Infinity" maxWidth="-Infinity"
prefHeight="24.0" prefWidth="200.0"/>
<Label maxHeight="-Infinity" maxWidth="-Infinity" alignment="CENTER" prefHeight="24.0" prefWidth="200.0"
text="Generation number"/>
<Label fx:id="generationNumberLabel" alignment="CENTER" contentDisplay="TEXT_ONLY"
maxHeight="-Infinity" maxWidth="-Infinity" prefHeight="24.0" prefWidth="200.0"/>
<Separator maxHeight="-Infinity" maxWidth="-Infinity"
prefHeight="24.0" prefWidth="200.0"/>
<Button fx:id="restartButton" maxHeight="-Infinity" maxWidth="-Infinity"
mnemonicParsing="false" onAction="#restartButtonAction" prefHeight="24.0" prefWidth="200.0"
text="Restart"/>
<Button fx:id="oneStepButton" maxHeight="-Infinity" maxWidth="-Infinity"
mnemonicParsing="false" onAction="#oneStepButtonAction" prefHeight="24.0" prefWidth="200.0"
text="One step"/>
<ToggleButton fx:id="playToggleButton" maxHeight="-Infinity" maxWidth="-Infinity"
mnemonicParsing="false" onAction="#playToggleButtonAction" prefHeight="24.0"
prefWidth="200.0" styleClass="button" text="Play"/>
<ToggleButton fx:id="pauseToggleButton" maxHeight="-Infinity" maxWidth="-Infinity"
mnemonicParsing="false" onAction="#pauseToggleButtonAction" prefHeight="24.0"
prefWidth="200.0" styleClass="button" text="Pause"/>
<Label alignment="CENTER" contentDisplay="TEXT_ONLY" text="Légende :"
maxHeight="-Infinity" maxWidth="-Infinity" prefHeight="24.0" prefWidth="200.0"/>
<Label alignment="CENTER" contentDisplay="TEXT_ONLY" text="mauve = virus"
maxHeight="-Infinity" maxWidth="-Infinity" prefHeight="24.0" prefWidth="200.0"/>
<Label alignment="CENTER" contentDisplay="TEXT_ONLY" text="bleu clair = doctor"
maxHeight="-Infinity" maxWidth="-Infinity" prefHeight="24.0" prefWidth="200.0"/>
<Label alignment="CENTER" contentDisplay="TEXT_ONLY" text="noir = humain"
maxHeight="-Infinity" maxWidth="-Infinity" prefHeight="24.0" prefWidth="200.0"/>
</VBox>
<FirefighterGrid fx:id="grid" width="1000.0" height="1000.0"
xmlns="http://javafx.com/javafx"
xmlns:fx="http://javafx.com/fxml">
</FirefighterGrid>
</HBox>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment