Files
PowerPME_maven/src/main/java/Controllers/Stock/BondeEntrerDialogConfirmation.java
T
2026-05-16 17:34:53 +02:00

248 lines
9.5 KiB
Java

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Controllers.Stock;
import Controllers.Traitement.MyWindow;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Group;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.Pane;
import javafx.scene.layout.StackPane;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import javafx.scene.text.FontWeight;
import javafx.scene.text.Text;
import javafx.scene.text.TextFlow;
import javafx.stage.Stage;
/**
*
* @author Maher
*/
public class BondeEntrerDialogConfirmation extends BondeEntrerController{
public double Height = MyWindow.myStage.getHeight() ;
public double Width = MyWindow.myStage.getWidth() ;
public ObservableList<ListProduitBon> Confdata=FXCollections.observableArrayList();
public Button bouttonNo = new Button();
public Button bouttonOK = new Button("Enregistrer");
public TableView ConfBondEnter = new TableView();
public Text titre = new Text();
public Text Source = new Text();
public Text Code = new Text();
public Text Tranporteur = new Text();
public Text Date = new Text();
public Text titreMSG = new Text();
public Text detail = new Text();
public StackPane stackpane = new StackPane();
public Node Setnotification(){
Group group = new Group();
AnchorPane Ap = new AnchorPane();
Ap.setStyle("-fx-background-color: rgba(0,0,0,0.6);");
Pane pa1 = new Pane();
pa1.setStyle("-fx-background-color:#ffffff; -fx-border-color: #212121; -fx-border-radius: 10 10 0 0; -fx-background-radius: 10 10 0 0;");
pa1.setPrefHeight(550);
pa1.setPrefWidth(750);
Pane pa2 = new Pane();
pa2.setStyle("-fx-background-color:linear-gradient(to bottom, #585858, #333333); -fx-background-radius: 10 10 0 0;");
pa2.setPrefHeight(30);
pa2.setPrefWidth(750);
TableColumn TabColBEReference = new TableColumn("Référence");
TabColBEReference.setMinWidth(125);
TabColBEReference.setCellValueFactory(new PropertyValueFactory<ListProduitBon, String>("reference"));
TableColumn TabColBEDesignaton = new TableColumn("Désignation");
TabColBEDesignaton.setMinWidth(155);
TabColBEDesignaton.setCellValueFactory(new PropertyValueFactory<ListProduitBon, String>("designaton"));
TableColumn TabColBEMarque = new TableColumn("Marque");
TabColBEMarque.setMinWidth(100);
TabColBEMarque.setCellValueFactory(new PropertyValueFactory<ListProduitBon, String>("marque"));
TableColumn TabColBECategorie = new TableColumn("Catégorie");
TabColBECategorie.setMinWidth(100);
TabColBECategorie.setCellValueFactory(new PropertyValueFactory<ListProduitBon, String>("categorie"));
TableColumn TabColBETVA = new TableColumn("TVA");
TabColBETVA.setMinWidth(70);
TabColBETVA.setCellValueFactory(new PropertyValueFactory<ListProduitBon, String>("tva"));
TableColumn TabColBEPrixTTC = new TableColumn("Prix TTC");
TabColBEPrixTTC.setMinWidth(70);
TabColBEPrixTTC.setCellValueFactory(new PropertyValueFactory<ListProduitBon, String>("prixttc"));
TabColBEPrixTTC.setStyle( "-fx-alignment: CENTER_RIGHT;");
TableColumn TabColBEQuantite = new TableColumn("Quantité");
TabColBEQuantite.setMinWidth(70);
TabColBEQuantite.setCellValueFactory(new PropertyValueFactory<ListProduitBon, String>("quantite"));
TabColBEQuantite.setStyle( "-fx-alignment: CENTER; -fx-font-weight:bold; -fx-font-size: 10pt;");
TableView<ListProduitBon> ConfBonEnter = new TableView<ListProduitBon>();
ConfBonEnter.getColumns().addAll(TabColBEReference, TabColBEDesignaton, TabColBEMarque, TabColBECategorie, TabColBETVA, TabColBEPrixTTC, TabColBEQuantite);
ConfBonEnter.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
ConfBonEnter.setLayoutX(12);
ConfBonEnter.setLayoutY(130);
ConfBonEnter.setPrefHeight(350);
ConfBonEnter.setItems(Confdata);
titre.setText("Dialog de confirmation");
titre.setFont(Font.font("System", FontWeight.BOLD, 14));
titre.setFill(Color.web("#ffffff"));
titre.setLayoutX(17);
titre.setLayoutY(22);
Image imgicon = new Image(getClass().getResourceAsStream("/Public/icon/dialoginform.png"));
ImageView icon = new ImageView(imgicon);
icon.setLayoutX(20);
icon.setLayoutY(60);
icon.setFitWidth(46);
icon.setFitHeight(50);
TextFlow DetailMSG = new TextFlow();
DetailMSG.setPrefHeight(120);
DetailMSG.setPrefWidth(400);
DetailMSG.setLayoutX(80);
DetailMSG.setLayoutY(55);
Text text1 = new Text("Bon d'entrée \n");
text1.setFont(Font.font("Arial", FontWeight.BOLD, 15));
text1.setFill(Color.web("#363a38"));
DetailMSG.getChildren().add(text1);
Text text2 = new Text("Êtes-vous sûr de vouloir enregistrer la bon d'entrée");
text2.setFont(Font.font("Arial", FontWeight.NORMAL, 15));
text2.setFill(Color.web("#363a38"));
DetailMSG.getChildren().add(text2);
Text code = new Text("Code:");
code.setFont(Font.font("Arial", FontWeight.BOLD, 15));
code.setFill(Color.web("#363a38"));
code.setLayoutX(80);
code.setLayoutY(115);
Code.setFont(Font.font("Arial", FontWeight.NORMAL, 15));
Code.setFill(Color.web("#363a38"));
Code.setLayoutX(130);
Code.setLayoutY(115);
Text source = new Text("Source:");
source.setFont(Font.font("Arial", FontWeight.BOLD, 15));
source.setFill(Color.web("#363a38"));
source.setLayoutX(180);
source.setLayoutY(115);
Source.setFont(Font.font("Arial", FontWeight.NORMAL, 15));
Source.setFill(Color.web("#363a38"));
Source.setLayoutX(240);
Source.setLayoutY(115);
Text date = new Text("Date:");
date.setFont(Font.font("Arial", FontWeight.BOLD, 15));
date.setFill(Color.web("#363a38"));
date.setLayoutX(350);
date.setLayoutY(115);
Date.setFont(Font.font("Arial", FontWeight.NORMAL, 15));
Date.setFill(Color.web("#363a38"));
Date.setLayoutX(390);
Date.setLayoutY(115);
Text tranporteur = new Text("Tranporteur:");
tranporteur.setFont(Font.font("Arial", FontWeight.BOLD, 15));
tranporteur.setFill(Color.web("#363a38"));
tranporteur.setLayoutX(500);
tranporteur.setLayoutY(115);
Tranporteur.setFont(Font.font("Arial", FontWeight.NORMAL, 15));
Tranporteur.setFill(Color.web("#363a38"));
Tranporteur.setLayoutX(600);
Tranporteur.setLayoutY(115);
bouttonOK.setFont(Font.font ("Arial", FontWeight.BOLD, 14));
bouttonOK.setStyle("-fx-background-color:#4DAE4D; -fx-text-fill: white; -fx-border-radius: 5 5 5 5;");
Image coffeeImage = new Image(getClass().getResourceAsStream("/Public/icon/iconsave.png"));
ImageView buttonGraphic = new ImageView();
buttonGraphic.setImage(coffeeImage);
bouttonOK.setGraphic(buttonGraphic);
bouttonOK.setPrefWidth(140);
bouttonOK.setPrefHeight(35);
bouttonOK.setLayoutX(600);
bouttonOK.setLayoutY(500);
bouttonNo.setText("Annuler");
bouttonNo.setFont(Font.font ("System", FontWeight.BOLD, 12));
bouttonNo.setStyle("{-fx-background-color:#EFEFEF; -fx-border-color: #959595; -fx-border-radius: 5 5 5 5;} hover:{-fx-background-color:#E6E6E6;}");
bouttonNo.setPrefWidth(73);
bouttonNo.setPrefHeight(30);
bouttonNo.setLayoutX(500);
bouttonNo.setLayoutY(503);
bouttonNo.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
stackpane.setVisible(false);
}
});
group.getChildren().addAll(pa1, pa2, titre, icon, code, Code, source, Source, date, Date, tranporteur, Tranporteur, ConfBonEnter, DetailMSG, bouttonOK, bouttonNo);
stackpane.setVisible(true);
stackpane.getChildren().add(Ap);
stackpane.getChildren().add(group);
return stackpane;
}
public void ShowDialg()
{
Node node = this.Setnotification();
StackPane Sp = new StackPane();
Sp.setPrefSize((double)MyWindow.PrincipalContentWidth, (double)MyWindow.PrincipalContentHeight);
Sp.getChildren().add(MyWindow.myParent);
Sp.getChildren().add(node);
Scene scene = new Scene(Sp);
Stage stage = MyWindow.myStage;
stage.setScene(scene);
stage.show();
}
}