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

task 1

parent c3ec27ba
No related branches found
No related tags found
No related merge requests found
Showing
with 70 additions and 23 deletions
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import javafx.scene.image.*?>
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<AnchorPane fx:id="Fire" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1"> <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> <children>
<Spinner fx:id="fire" editable="true" layoutX="111.0" layoutY="67.0" prefHeight="25.0" prefWidth="363.0" /> <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="111.0" layoutY="50.0" text="Fire" /> <Label layoutX="265.0" layoutY="14.0" text="Fire" />
<Label layoutX="111.0" layoutY="103.0" text="Fire Fighter" /> <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> </children>
</AnchorPane> </AnchorPane>
...@@ -3,13 +3,11 @@ ...@@ -3,13 +3,11 @@
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?> <?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> <children>
<Button layoutX="36.0" layoutY="119.0" mnemonicParsing="false" 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="firefiter" />
<Button layoutX="321.0" layoutY="119.0" mnemonicParsing="false" prefHeight="106.0" prefWidth="259.0" text="virus" /> <Button fx:id="Virus" layoutX="321.0" layoutY="119.0" mnemonicParsing="false" onAction="#Virus" prefHeight="106.0" prefWidth="259.0" text="virus" />
<Button layoutX="193.0" layoutY="279.0" mnemonicParsing="false" prefHeight="56.0" prefWidth="231.0" text="play" /> <Button fx:id="Settings" layoutX="541.0" layoutY="14.0" mnemonicParsing="false" onAction="#Settings" prefHeight="41.0" prefWidth="45.0" text="setting" />
<Button layoutX="541.0" layoutY="14.0" mnemonicParsing="false" 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" />
</children> </children>
</AnchorPane> </AnchorPane>
No preview for this file type
No preview for this file type
...@@ -14,13 +14,13 @@ import java.net.URL; ...@@ -14,13 +14,13 @@ import java.net.URL;
import java.util.Map; import java.util.Map;
public class SimulatorApplication extends javafx.application.Application { public class SimulatorApplication extends javafx.application.Application {
private static final String VIEW_RESOURCE_PATH = "/view/fireFigtherView/putElementCount.fxml"; private static final String VIEW_RESOURCE_PATH = "/view/fireFigtherView/fireFigtherBord.fxml";
private static final String APP_NAME = "Firefighter simulator"; private static final String APP_NAME = "Firefighter simulator";
private static final int ROW_COUNT = 20; private static final int ROW_COUNT = 20;
private static final int COLUMN_COUNT = 20; private static final int COLUMN_COUNT = 20;
private static final int SQUARE_WIDTH = 30; private static final int SQUARE_WIDTH = 40;
private static final int SQUARE_HEIGHT = 30; private static final int SQUARE_HEIGHT = 40;
private Map<ModelElement,Integer> INITIAL_ELEMENTS_COUNT; private Map<ModelElement,Integer> INITIAL_ELEMENTS_COUNT;
...@@ -44,13 +44,13 @@ public class SimulatorApplication extends javafx.application.Application { ...@@ -44,13 +44,13 @@ public class SimulatorApplication extends javafx.application.Application {
} }
private void initializeInitialElementCount() { private void initializeInitialElementCount() {
INITIAL_ELEMENTS_COUNT = new HashMap<>(); INITIAL_ELEMENTS_COUNT = new HashMap<>();
INITIAL_ELEMENTS_COUNT.put(new Fire(), 1); INITIAL_ELEMENTS_COUNT.put(new Fire(), 10);
INITIAL_ELEMENTS_COUNT.put(new FireFigther(), 1); INITIAL_ELEMENTS_COUNT.put(new FireFigther(), 10);
INITIAL_ELEMENTS_COUNT.put(new Cloud(), 0); INITIAL_ELEMENTS_COUNT.put(new Cloud(), 10);
INITIAL_ELEMENTS_COUNT.put(new MotorisedFirefigther(), 0); INITIAL_ELEMENTS_COUNT.put(new MotorisedFirefigther(), 10);
INITIAL_ELEMENTS_COUNT.put(new Mountain(), 100); INITIAL_ELEMENTS_COUNT.put(new Mountain(), 10);
INITIAL_ELEMENTS_COUNT.put(new Road(), 0); INITIAL_ELEMENTS_COUNT.put(new Road(), 10);
INITIAL_ELEMENTS_COUNT.put(new Rockerie(), 0); INITIAL_ELEMENTS_COUNT.put(new Rockerie(), 10);
} }
...@@ -59,9 +59,9 @@ public class SimulatorApplication extends javafx.application.Application { ...@@ -59,9 +59,9 @@ public class SimulatorApplication extends javafx.application.Application {
URL location = SimulatorApplication.class.getResource(VIEW_RESOURCE_PATH); URL location = SimulatorApplication.class.getResource(VIEW_RESOURCE_PATH);
loader.setLocation(location); loader.setLocation(location);
view = loader.load(); view = loader.load();
//ControllerFireFigtherBord controller = loader.getController(); ControllerFireFigtherBord controller = loader.getController();
//controller.initialize(SQUARE_WIDTH, SQUARE_HEIGHT, COLUMN_COUNT, ROW_COUNT,INITIAL_ELEMENTS_COUNT controller.initialize(SQUARE_WIDTH, SQUARE_HEIGHT, COLUMN_COUNT, ROW_COUNT,INITIAL_ELEMENTS_COUNT
// ); );
} }
private void showScene() { private void showScene() {
......
package controller; package controller;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import java.awt.*;
public class controllerMenu { 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){
}
public void play(ActionEvent actionEvent){
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment