diff --git a/lib/javafx-swt.jar b/lib/javafx-swt.jar new file mode 100644 index 0000000..ec237d4 Binary files /dev/null and b/lib/javafx-swt.jar differ diff --git a/lib/javafx.base.jar b/lib/javafx.base.jar new file mode 100644 index 0000000..017cdc7 Binary files /dev/null and b/lib/javafx.base.jar differ diff --git a/lib/javafx.controls.jar b/lib/javafx.controls.jar new file mode 100644 index 0000000..e427125 Binary files /dev/null and b/lib/javafx.controls.jar differ diff --git a/lib/javafx.fxml.jar b/lib/javafx.fxml.jar new file mode 100644 index 0000000..94934ae Binary files /dev/null and b/lib/javafx.fxml.jar differ diff --git a/lib/javafx.graphics.jar b/lib/javafx.graphics.jar new file mode 100644 index 0000000..f9d8f3a Binary files /dev/null and b/lib/javafx.graphics.jar differ diff --git a/lib/javafx.media.jar b/lib/javafx.media.jar new file mode 100644 index 0000000..7e4bdd7 Binary files /dev/null and b/lib/javafx.media.jar differ diff --git a/lib/javafx.properties b/lib/javafx.properties new file mode 100644 index 0000000..efec880 --- /dev/null +++ b/lib/javafx.properties @@ -0,0 +1,3 @@ +javafx.version=11.0.2 +javafx.runtime.version=11.0.2+1 +javafx.runtime.build=1 diff --git a/lib/javafx.swing.jar b/lib/javafx.swing.jar new file mode 100644 index 0000000..2900148 Binary files /dev/null and b/lib/javafx.swing.jar differ diff --git a/lib/javafx.web.jar b/lib/javafx.web.jar new file mode 100644 index 0000000..d75a805 Binary files /dev/null and b/lib/javafx.web.jar differ diff --git a/src/database/QueryGenerator.java b/src/database/QueryGenerator.java index 3ec85ee..d91faae 100644 --- a/src/database/QueryGenerator.java +++ b/src/database/QueryGenerator.java @@ -18,4 +18,13 @@ public class QueryGenerator { return "public." + '"' + s + '"'; } + public static String getIdWithNameFrom(String table, String name) { + return "SELECT 'id' FROM " + getTable(table) + "WHERE nom ='" + name + "'"; + } + + public static String getNameWithIdFrom(String table, int d) { + return "SELECT name FROM " + getTable(table) + "WHERE id =" + d; + } + + } diff --git a/src/database/Record.java b/src/database/Record.java index f95f1b9..960f90f 100644 --- a/src/database/Record.java +++ b/src/database/Record.java @@ -39,6 +39,5 @@ public class Record { public String toString() { return String.format("%-20.30s %-30.30s %-20.30s%n", this.getId(), this.getNom(), this.getImg()); } - } diff --git a/src/database/Table.java b/src/database/Table.java index 2545740..8cf0936 100644 --- a/src/database/Table.java +++ b/src/database/Table.java @@ -84,6 +84,14 @@ public class Table { return " " + this.getList(); } + public boolean isEmpty() { + if(list.isEmpty()) { + return true; + } else { + return false; + } + } + diff --git a/src/ihm/Dice.java b/src/ihm/Dice.java deleted file mode 100644 index 586c07a..0000000 --- a/src/ihm/Dice.java +++ /dev/null @@ -1,60 +0,0 @@ -package ihm; - -/** - * @author https://www.programcreek.com/java-api-examples/?code=AlmasB%2FFXTutorials%2FFXTutorials-master%2Fsrc%2Fcom%2Falmasb%2Ftutorial5%2FDice.java - * - */ - -import javafx.animation.RotateTransition; -import javafx.beans.property.SimpleIntegerProperty; -import javafx.geometry.Pos; -import javafx.scene.layout.StackPane; -import javafx.scene.paint.Color; -import javafx.scene.shape.Rectangle; -import javafx.scene.text.Text; -import javafx.util.Duration; - -public class Dice extends StackPane { - - public static int MAX_VALUE = 6; - public static final int MIN_VALUE = 1; - - public final SimpleIntegerProperty valueProperty = new SimpleIntegerProperty(); - - int i = 0; - - public Dice(int valeurMax) { - - MAX_VALUE = valeurMax; - Rectangle rect = new Rectangle(50, 50); - - Text text = new Text(); - text.setFill(Color.WHITE); - text.textProperty().bind(valueProperty.asString()); - - this.setAlignment(Pos.CENTER); - getChildren().addAll(rect, text); - - this.setOnMouseClicked(event -> roll()); - } - - public void roll() { - RotateTransition rt = new RotateTransition(Duration.seconds(0.5), this); - rt.setFromAngle(0); - rt.setToAngle(360); - int cycles = 2000; - - rt.setOnFinished(event -> { - - valueProperty.set((int)(Math.random() * (MAX_VALUE - MIN_VALUE + 1)) + MIN_VALUE); - - if(cycles < i) { - - rt.play(); - i++; - } - - }); - rt.play(); - } -} \ No newline at end of file diff --git a/src/ihm/controller/JouerSonTour1Controller.java b/src/ihm/controller/JouerSonTour1Controller.java index dac0c00..1592964 100644 --- a/src/ihm/controller/JouerSonTour1Controller.java +++ b/src/ihm/controller/JouerSonTour1Controller.java @@ -2,6 +2,7 @@ package ihm.controller; import java.io.IOException; import java.net.URL; +import java.util.Locale; import java.util.Random; import java.util.ResourceBundle; @@ -34,12 +35,14 @@ public class JouerSonTour1Controller implements Initializable{ @Override public void initialize(URL arg0, ResourceBundle arg1) { + System.out.println("\tLancements des dès"); + //nomJoueur.setText(joueur.getNom()); int OFFSET_X = 0; int OFFSET_Y = 0; - int WIDTH = 200; - int HEIGHT = 200; + int WIDTH = 80; + int HEIGHT = 80; int COUNT = 6; int COLUMNS = 6; @@ -80,12 +83,11 @@ public class JouerSonTour1Controller implements Initializable{ @FXML public void lancerDes(MouseEvent mouseEvent) throws IOException, InterruptedException{ - - - Thread.sleep(1000); - - Pane pane = FXMLLoader.load(getClass().getResource("../ressources/Jouer_tour(2)carte_lieux.fxml")); - rootPane.getChildren().setAll(pane); + final URL fxmlURL = getClass().getResource("../ressources/Jouer_tour(2)carte_lieux.fxml"); + final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.ENGLISH); + final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle); + Pane root = fxmlLoader.load(); + rootPane.getChildren().setAll(root); } public void deplacerPion(CarteLieu lieux) { diff --git a/src/ihm/controller/JouerSonTour2Controller.java b/src/ihm/controller/JouerSonTour2Controller.java index 1f10dbf..df43ec4 100644 --- a/src/ihm/controller/JouerSonTour2Controller.java +++ b/src/ihm/controller/JouerSonTour2Controller.java @@ -21,6 +21,7 @@ public class JouerSonTour2Controller implements Initializable{ @Override public void initialize(URL arg0, ResourceBundle arg1) { + System.out.println("\tDescrption du lieux"); //descriptionLieu.setText(lieu.getDescription()); } diff --git a/src/ihm/controller/PlateauController.java b/src/ihm/controller/PlateauController.java index 49897ac..b2116f6 100644 --- a/src/ihm/controller/PlateauController.java +++ b/src/ihm/controller/PlateauController.java @@ -4,6 +4,7 @@ package ihm.controller; import java.io.IOException; import java.net.URL; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; @@ -11,33 +12,27 @@ import java.util.ResourceBundle; import ihm.PopUp; import ihm.PopUpBoolean; -import ihm.SpriteAnimation; -import javafx.animation.Animation; -import javafx.event.Event; -import javafx.event.EventHandler; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.fxml.Initializable; -import javafx.geometry.Rectangle2D; -import javafx.scene.Group; import javafx.scene.Parent; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.image.ImageView; import javafx.scene.layout.AnchorPane; import javafx.scene.layout.HBox; +import javafx.scene.layout.Pane; import javafx.scene.layout.VBox; +import javafx.scene.shape.Circle; +import main.GestionnaireJeu; import main.Joueur; -import main.View; public class PlateauController implements Initializable { - private List listJoueur = new ArrayList(); - private List vboxJoueur = new ArrayList(); - private List hboxJoueur = new ArrayList(); - private List - -