From afaef5411b16730006f6f5ef3b9f35ff1e3a4a0f Mon Sep 17 00:00:00 2001 From: Paul Gross Date: Sun, 3 May 2020 17:08:45 +0200 Subject: [PATCH] Fix bug tours, choix fonctionnels --- src/ihm/controller/ChoisirBoolean.java | 2 -- src/ihm/controller/JoueurIHM.java | 13 +++++++++---- src/ihm/controller/PlateauController.java | 9 ++++++--- src/ihm/ressources/PlateauTest2.fxml | 18 +++++++++++++++--- src/ihm/ressources/choisirBoolean.fxml | 15 +++++---------- src/main/GestionnaireJeu.java | 2 +- src/main/Plateau.java | 7 ++++--- 7 files changed, 40 insertions(+), 26 deletions(-) diff --git a/src/ihm/controller/ChoisirBoolean.java b/src/ihm/controller/ChoisirBoolean.java index 16e50c1..ece7c98 100644 --- a/src/ihm/controller/ChoisirBoolean.java +++ b/src/ihm/controller/ChoisirBoolean.java @@ -6,8 +6,6 @@ import java.util.ResourceBundle; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.scene.control.Button; -import javafx.scene.control.Label; -import javafx.scene.layout.Pane; import main.GestionnaireJeu; public class ChoisirBoolean implements Initializable { diff --git a/src/ihm/controller/JoueurIHM.java b/src/ihm/controller/JoueurIHM.java index 2383358..656414f 100644 --- a/src/ihm/controller/JoueurIHM.java +++ b/src/ihm/controller/JoueurIHM.java @@ -69,10 +69,15 @@ public class JoueurIHM { public void setZoneJoueur(Pane p) { AnchorPane ap = (AnchorPane) zoneJoueur.getChildren().get(1); ap.getChildren().setAll(p); - AnchorPane.getBottomAnchor(p); - AnchorPane.getLeftAnchor(p); - AnchorPane.getRightAnchor(p); - AnchorPane.getTopAnchor(p); + + //ap.prefWidthProperty().bind(ap.widthProperty()); + //ap.prefHeightProperty().bind(ap.heightProperty()); + + AnchorPane.setBottomAnchor(p,0.0); + AnchorPane.setLeftAnchor(p,0.0); + AnchorPane.setRightAnchor(p,0.0); + AnchorPane.setTopAnchor(p,0.0); + } diff --git a/src/ihm/controller/PlateauController.java b/src/ihm/controller/PlateauController.java index 010c903..1e879c4 100644 --- a/src/ihm/controller/PlateauController.java +++ b/src/ihm/controller/PlateauController.java @@ -35,7 +35,8 @@ public class PlateauController implements Initializable { @FXML private AnchorPane rootPane; @FXML private GridPane gridPaneVie; //@FXML static public GridPane gridPaneLieux; - + + private ChoisirBoolean cb; public static int DICE_SIX = 2; public static int DICE_QUATRE = 1; @@ -268,14 +269,16 @@ public class PlateauController implements Initializable { final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE); final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle); Pane root = (Pane)fxmlLoader.load(); + this.cb = fxmlLoader.getController(); JoueurIHM jihm = getJoueurIHM(j); jihm.setZoneJoueur(root); - } public boolean getChoix(Joueur joueur) { JoueurIHM jihm = getJoueurIHM(joueur); + boolean result = this.cb.getResult(); + this.cb = null; jihm.getZoneJoueur().getChildren().setAll(); - return true; + return result; } } \ No newline at end of file diff --git a/src/ihm/ressources/PlateauTest2.fxml b/src/ihm/ressources/PlateauTest2.fxml index e3b07bb..c2ff297 100644 --- a/src/ihm/ressources/PlateauTest2.fxml +++ b/src/ihm/ressources/PlateauTest2.fxml @@ -24,7 +24,7 @@ - + @@ -110,6 +110,9 @@ + + + @@ -204,6 +207,9 @@ + + + @@ -665,12 +671,15 @@ + + + - + @@ -747,7 +756,7 @@