second commit

master
Ismail TAHA JANAN 3 years ago
parent a62580f770
commit 172cdae259

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

@ -3,23 +3,33 @@
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.layout.GridPane?>
<GridPane xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml" >
<VBox style="-fx-padding: 10;">
<HBox>
<VBox style="-fx-padding: 10;">
<TextField promptText="hello"/>
</VBox>
<VBox style="-fx-padding: 10;">
<?import javafx.geometry.Insets?>
<?import javafx.scene.shape.Rectangle?>
<?import javafx.scene.shape.Circle?>
<GridPane xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml" alignment="center" hgap="10" vgap="10" >
<padding><Insets top="25" right="25" bottom="10" left="25"/></padding>
<Label text="player 1" GridPane.rowIndex="0" GridPane.columnIndex="0" />
<TextField GridPane.rowIndex="1" GridPane.columnIndex="0" />
<Label text="player 2" GridPane.columnIndex="1" GridPane.rowIndex="0" />
<TextField GridPane.rowIndex="1" GridPane.columnIndex="1" />
<Button fx:id="boutonJ1" mnemonicParsing="false" text="Start"
GridPane.rowIndex="3" GridPane.columnIndex="0" GridPane.columnSpan="2" GridPane.halignment="CENTER">
<BorderPane.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</BorderPane.margin>
</Button>
<TextField promptText="hello"/>
</VBox>
</HBox>
<Button text="Click me!" style="-fx-margin: 10;width:100%;" />
</VBox>
</GridPane>

@ -3,23 +3,33 @@
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.layout.GridPane?>
<GridPane xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml" >
<VBox style="-fx-padding: 10;">
<HBox>
<VBox style="-fx-padding: 10;">
<TextField promptText="hello"/>
</VBox>
<VBox style="-fx-padding: 10;">
<?import javafx.geometry.Insets?>
<?import javafx.scene.shape.Rectangle?>
<?import javafx.scene.shape.Circle?>
<GridPane xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml" alignment="center" hgap="10" vgap="10" >
<padding><Insets top="25" right="25" bottom="10" left="25"/></padding>
<Label text="player 1" GridPane.rowIndex="0" GridPane.columnIndex="0" />
<TextField GridPane.rowIndex="1" GridPane.columnIndex="0" />
<Label text="player 2" GridPane.columnIndex="1" GridPane.rowIndex="0" />
<TextField GridPane.rowIndex="1" GridPane.columnIndex="1" />
<Button fx:id="boutonJ1" mnemonicParsing="false" text="Start"
GridPane.rowIndex="3" GridPane.columnIndex="0" GridPane.columnSpan="2" GridPane.halignment="CENTER">
<BorderPane.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</BorderPane.margin>
</Button>
<TextField promptText="hello"/>
</VBox>
</HBox>
<Button text="Click me!" style="-fx-margin: 10;width:100%;" />
</VBox>
</GridPane>

@ -5,10 +5,18 @@ import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.scene.layout.StackPane;
import javafx.scene.control.Button;
import model.Game;
import model.Player;
import model.Result;
public class Launcher extends Application {
public Player player1;
public Player player2;
public Game theGame;
public Result res;
@Override
public void start(Stage stage) throws Exception {
Parent root = FXMLLoader.load(getClass().getResource("/FXML/FormAddPlayer.fxml"));
@ -18,4 +26,9 @@ public class Launcher extends Application {
stage.setScene(scene);
stage.show();
}
public void setPlayers(Player p1, Player p2){
player1 = p1;
player2 = p2;
}
}

@ -0,0 +1,12 @@
package model;
import java.util.Random;
public class De {
final int NumFaces = 6;
public int getRandomFace(){
Random rn = new Random();
return rn.nextInt(10-1+1)+1;
}
}

@ -0,0 +1,11 @@
package model;
import java.util.ArrayList;
import java.util.List;
public class Game {
public Player player1;
public Player player2;
public De de;
List<Result> results = new ArrayList<Result>();
}

@ -0,0 +1,6 @@
package model;
public class Player {
public String Nom;
}

@ -0,0 +1,6 @@
package model;
public class Result {
public int resPlayer1;
public int resPlayer2;
}

@ -0,0 +1,17 @@
package view;
import javafx.fxml.FXML;
import model.Player;
import java.awt.*;
public class FormAddPlayer {
public TextField player1;
public TextField player2;
@FXML
public void clickStartGame(){
}
}
Loading…
Cancel
Save