adaptation interfaces boolean

This commit is contained in:
Chiara
2020-05-05 14:21:34 +02:00
16 changed files with 189 additions and 47 deletions

View File

@ -13,7 +13,6 @@ import javafx.stage.StageStyle;
public class PopUpBoolean {
@FXML private Pane rootPane;
private Scene scene;
private Stage popup;
@ -23,26 +22,19 @@ public class PopUpBoolean {
public PopUpBoolean (Parent p, String titre) {
popup = new Stage();
popup.initModality(Modality.WINDOW_MODAL);
popup.initStyle(StageStyle.UNDECORATED);
popup.setTitle(titre);
scene = new Scene(p);
p.setOnMousePressed(new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent event){
xOffSet = event.getSceneX();
yOffSet = event.getSceneY();
}
});
p.setOnMouseDragged(new EventHandler<MouseEvent>() {
@ -51,19 +43,14 @@ public class PopUpBoolean {
public void handle(MouseEvent event){
popup.setX(event.getScreenX() - xOffSet);
popup.setY(event.getScreenY() - yOffSet);
}
popup.setY(event.getScreenY() - yOffSet);
}
});
}
public boolean display() {
popup.setScene(scene);
popup.showAndWait();
return result;
}
}

View File

@ -22,15 +22,12 @@ public class ChoisirBoolean implements Initializable {
this.result = true;
GestionnaireJeu.notifyPlateau();
});
nonButton.setOnAction(x -> {
this.result = false;
GestionnaireJeu.notifyPlateau();
});
});
}
public boolean getResult() {

View File

@ -0,0 +1,33 @@
package ihm.controller;
import java.io.IOException;
import java.net.URL;
import java.util.Locale;
import java.util.ResourceBundle;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.Pane;
public class PiocherVisionController implements Initializable{
@FXML private Pane rootPane;
@Override
public void initialize(URL arg0, ResourceBundle arg1) {
// TODO Auto-generated method stub
}
@FXML
public void voirCarte(MouseEvent mouseEvent) throws IOException{
final URL fxmlURL = getClass().getResource("/ihm/ressources/jouer_Son_Tour_donner_vision.fxml");
final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE);
final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle);
Pane pane = fxmlLoader.load();
rootPane.getChildren().setAll(pane);
}
}

View File

@ -264,7 +264,6 @@ public class PlateauController implements Initializable {
public void rollDice(Joueur joueur, int typeDice, int[] rolls) {
}
public void afficherChoisir(Joueur j) throws IOException {