package Controllers.Dialog;

import Controllers.Traitement.MyWindow;
import java.io.IOException;
import org.apache.log4j.Logger;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.StackPane;
import javafx.scene.text.Text;
import javafx.stage.Stage;

/**
 * FXML Controller class
 * @author Maher Ben Tili
 */
public class DialogSuccessController {

    Logger logger = Logger.getLogger(DialogSuccessController.class.getName());
    
    public Node nodeFxml ;
    
    @FXML public Button Valider;
    @FXML public Text Message;
    @FXML public AnchorPane PaneDialog;
    
    
    public DialogSuccessController() {
        try {
            FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/Views/Dialog/DialogSuccess.fxml"));
            fxmlLoader.setController(this);
            nodeFxml = (Node) fxmlLoader.load();
        } catch (IOException ex) {
            logger.error("DialogSuccessController  : DialogSuccess.fxml :" + ex.getMessage());
        }
    }
    
    
    public void Show()
    {
        StackPane Sp = new StackPane();
            
        Scene scene = new Scene(Sp);
        
        Sp.setPrefSize((double)MyWindow.PrincipalContentWidth, (double)MyWindow.PrincipalContentHeight);
       
        Sp.getChildren().add(MyWindow.myParent);
        Sp.getChildren().add(nodeFxml);
       
        Stage stage = MyWindow.myStage;    
        stage.setScene(scene);
        stage.show();
    }
    
}
