From d1fdc64cadbc8db7b1e305e49f00190bb8d71b89 Mon Sep 17 00:00:00 2001 From: Notmoo Date: Mon, 14 Aug 2017 16:38:03 +0200 Subject: [PATCH] =?UTF-8?q?Module=20Client=20:=20test=20de=20l'=C3=A9cran?= =?UTF-8?q?=20de=20composition=20des=20ventes;=20correction=20bugs;=20ajou?= =?UTF-8?q?t=20fichier=20css;=20r=C3=A9organisation=20packages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/pqt/client/Main.java | 32 +++ .../gui/modules/sale_screen/SaleScreen.java | 9 +- .../sale_screen/SaleScreenController.java | 16 +- .../modules/sale_screen/SaleScreenModel.java | 44 +++- .../modules/sale_screen/SaleScreenView.java | 87 ++++---- .../SaleValidationScreen.java | 28 ++- .../ISaleValidationScreenListener.java | 2 +- .../ressources/components/AccountManager.java | 14 +- .../components/CategoryTabStockDisplayer.java | 19 +- .../CommandComposerSaleDisplayer.java | 18 +- .../components/SimpleValidator.java | 27 ++- .../generics/IFXComponent.java | 2 +- .../creators/IFXCreatorComponent.java | 8 + .../displayers/IFXDisplayerComponent.java | 10 + .../listeners/IDisplayerComponentFirerer.java | 2 +- .../IDisplayerComponentListener.java | 2 +- .../SimpleDisplayerComponentFirerer.java | 2 +- .../javafx_override/CssEnabledGridPane.java | 11 + .../validators/IFXValidatorComponent.java | 9 + .../listeners/IValidatorComponentFirerer.java | 2 +- .../IValidatorComponentListener.java | 2 +- .../SimpleValidatorComponentFirerer.java | 2 +- .../IFXAccountsDisplayerComponent.java | 11 + .../listeners/IAccountComponentListener.java | 7 + .../SimpleAccountComponentFirerer.java | 4 +- .../IFXProductsDisplayerComponent.java | 10 + .../listeners/IStockComponentListener.java | 7 + .../SimpleStockComponentFirerer.java | 4 +- .../sale/IFXSaleDisplayerComponent.java | 8 + .../listeners/ISaleComponentListener.java | 4 +- .../listeners/SimpleSaleComponentFirerer.java | 4 +- .../client/gui/ressources/css/GUICssTool.java | 4 +- .../creators/IFXCreatorComponent.java | 8 - .../displayers/IFXDisplayerComponent.java | 10 - .../validators/IFXValidatorComponent.java | 9 - .../IFXAccountsDisplayerComponent.java | 11 - .../listeners/IAccountComponentListener.java | 7 - .../IFXProductsDisplayerComponent.java | 10 - .../listeners/IStockComponentListener.java | 7 - .../sale/IFXSaleDisplayerComponent.java | 8 - .../gui/ressources/strings/GUIStringTool.java | 5 +- .../listeners/AccountListenerAdapter.java | 7 + .../module/sale/listeners/ISaleListener.java | 8 +- .../pqt/client/module/stock/StockService.java | 2 +- .../client/src/main/resources/dark-theme.css | 209 ++++++++++++++++++ .../com/pqt/core/entities/members/Client.java | 15 -- 46 files changed, 522 insertions(+), 205 deletions(-) create mode 100644 Workspace/client/src/main/java/com/pqt/client/Main.java rename Workspace/client/src/main/java/com/pqt/client/gui/{ressources/components => modules/sale_screen}/sale_validation_screen/SaleValidationScreen.java (75%) rename Workspace/client/src/main/java/com/pqt/client/gui/{ressources/components => modules/sale_screen}/sale_validation_screen/listeners/ISaleValidationScreenListener.java (66%) rename Workspace/client/src/main/java/com/pqt/client/gui/ressources/{ => components}/generics/IFXComponent.java (60%) create mode 100644 Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/creators/IFXCreatorComponent.java create mode 100644 Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/displayers/IFXDisplayerComponent.java rename Workspace/client/src/main/java/com/pqt/client/gui/ressources/{ => components}/generics/displayers/listeners/IDisplayerComponentFirerer.java (84%) rename Workspace/client/src/main/java/com/pqt/client/gui/ressources/{ => components}/generics/displayers/listeners/IDisplayerComponentListener.java (82%) rename Workspace/client/src/main/java/com/pqt/client/gui/ressources/{ => components}/generics/displayers/listeners/SimpleDisplayerComponentFirerer.java (96%) create mode 100644 Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/javafx_override/CssEnabledGridPane.java create mode 100644 Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/validators/IFXValidatorComponent.java rename Workspace/client/src/main/java/com/pqt/client/gui/ressources/{ => components}/generics/validators/listeners/IValidatorComponentFirerer.java (73%) rename Workspace/client/src/main/java/com/pqt/client/gui/ressources/{ => components}/generics/validators/listeners/IValidatorComponentListener.java (66%) rename Workspace/client/src/main/java/com/pqt/client/gui/ressources/{ => components}/generics/validators/listeners/SimpleValidatorComponentFirerer.java (92%) create mode 100644 Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/specifics/account/IFXAccountsDisplayerComponent.java create mode 100644 Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/specifics/account/listeners/IAccountComponentListener.java rename Workspace/client/src/main/java/com/pqt/client/gui/ressources/{ => components}/specifics/account/listeners/SimpleAccountComponentFirerer.java (59%) create mode 100644 Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/specifics/products/IFXProductsDisplayerComponent.java create mode 100644 Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/specifics/products/listeners/IStockComponentListener.java rename Workspace/client/src/main/java/com/pqt/client/gui/ressources/{ => components}/specifics/products/listeners/SimpleStockComponentFirerer.java (58%) create mode 100644 Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/specifics/sale/IFXSaleDisplayerComponent.java rename Workspace/client/src/main/java/com/pqt/client/gui/ressources/{ => components}/specifics/sale/listeners/ISaleComponentListener.java (59%) rename Workspace/client/src/main/java/com/pqt/client/gui/ressources/{ => components}/specifics/sale/listeners/SimpleSaleComponentFirerer.java (75%) delete mode 100644 Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/creators/IFXCreatorComponent.java delete mode 100644 Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/displayers/IFXDisplayerComponent.java delete mode 100644 Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/validators/IFXValidatorComponent.java delete mode 100644 Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/account/IFXAccountsDisplayerComponent.java delete mode 100644 Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/account/listeners/IAccountComponentListener.java delete mode 100644 Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/products/IFXProductsDisplayerComponent.java delete mode 100644 Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/products/listeners/IStockComponentListener.java delete mode 100644 Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/sale/IFXSaleDisplayerComponent.java create mode 100644 Workspace/client/src/main/resources/dark-theme.css diff --git a/Workspace/client/src/main/java/com/pqt/client/Main.java b/Workspace/client/src/main/java/com/pqt/client/Main.java new file mode 100644 index 00000000..4eed78eb --- /dev/null +++ b/Workspace/client/src/main/java/com/pqt/client/Main.java @@ -0,0 +1,32 @@ +package com.pqt.client; + +import com.pqt.client.gui.modules.sale_screen.SaleScreen; +import com.pqt.client.gui.ressources.css.GUICssTool; +import com.pqt.client.module.account.AccountService; +import com.pqt.client.module.sale.SaleService; +import com.pqt.client.module.stock.StockService; +import javafx.application.Application; +import javafx.scene.Scene; +import javafx.stage.Stage; + +public class Main extends Application{ + + public static void main(String[] args){ + launch(args); + } + + @Override + public void start(Stage primaryStage) throws Exception { + SaleService saleService = new SaleService(); + StockService stockService = new StockService(); + AccountService accountService = new AccountService(); + + SaleScreen saleScreen = new SaleScreen(accountService, stockService, saleService); + Scene scene = new Scene(saleScreen.getPane(), 800, 600); + scene.getStylesheets().clear(); + scene.getStylesheets().addAll(getClass().getResource(GUICssTool.getCssFilePath()).toExternalForm()); + + primaryStage.setScene(scene); + primaryStage.show(); + } +} diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/modules/sale_screen/SaleScreen.java b/Workspace/client/src/main/java/com/pqt/client/gui/modules/sale_screen/SaleScreen.java index 82a8b8ca..ad94fafd 100644 --- a/Workspace/client/src/main/java/com/pqt/client/gui/modules/sale_screen/SaleScreen.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/modules/sale_screen/SaleScreen.java @@ -1,6 +1,6 @@ package com.pqt.client.gui.modules.sale_screen; -import com.pqt.client.gui.ressources.generics.IFXComponent; +import com.pqt.client.gui.ressources.components.generics.IFXComponent; import com.pqt.client.module.account.AccountService; import com.pqt.client.module.sale.SaleService; import com.pqt.client.module.stock.StockService; @@ -8,16 +8,15 @@ import javafx.scene.layout.Pane; public class SaleScreen implements IFXComponent { - private SaleScreenModel model; - private SaleScreenController ctrl; private SaleScreenView view; public SaleScreen(AccountService accountService, StockService stockService, SaleService saleService) { - model = new SaleScreenModel(accountService, stockService, saleService); - ctrl = new SaleScreenController(model); + SaleScreenModel model = new SaleScreenModel(accountService, stockService, saleService); + SaleScreenController ctrl = new SaleScreenController(model); view = new SaleScreenView(ctrl); ctrl.setView(view); + ctrl.updateView(); } @Override diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/modules/sale_screen/SaleScreenController.java b/Workspace/client/src/main/java/com/pqt/client/gui/modules/sale_screen/SaleScreenController.java index d907084c..a3f93988 100644 --- a/Workspace/client/src/main/java/com/pqt/client/gui/modules/sale_screen/SaleScreenController.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/modules/sale_screen/SaleScreenController.java @@ -1,11 +1,10 @@ package com.pqt.client.gui.modules.sale_screen; import com.pqt.client.gui.modules.sale_screen.listeners.ISaleScreenModelListener; -import com.pqt.client.gui.ressources.components.sale_validation_screen.listeners.ISaleValidationScreenListener; -import com.pqt.client.gui.ressources.specifics.products.listeners.IStockComponentListener; -import com.pqt.client.gui.ressources.generics.validators.listeners.IValidatorComponentListener; -import com.pqt.client.gui.ressources.specifics.sale.listeners.ISaleComponentListener; -import com.pqt.client.gui.ressources.strings.GUIStringTool; +import com.pqt.client.gui.modules.sale_screen.sale_validation_screen.listeners.ISaleValidationScreenListener; +import com.pqt.client.gui.ressources.components.specifics.products.listeners.IStockComponentListener; +import com.pqt.client.gui.ressources.components.generics.validators.listeners.IValidatorComponentListener; +import com.pqt.client.gui.ressources.components.specifics.sale.listeners.ISaleComponentListener; import com.pqt.core.entities.product.Product; import com.pqt.core.entities.sale.Sale; import com.pqt.core.entities.sale.SaleStatus; @@ -13,7 +12,6 @@ import com.pqt.core.entities.sale.SaleType; import com.pqt.core.entities.user_account.Account; import com.pqt.core.entities.user_account.AccountLevel; import javafx.event.Event; -import javafx.scene.control.Alert; import java.util.List; @@ -73,6 +71,8 @@ class SaleScreenController { view.setAccounts(fetchAccountList()); view.setSale(getCurrentSale()); + + view.setValidationButtonEnabled(model.checkValidity(getCurrentSale())); } private List fetchProductList(){ @@ -140,8 +140,8 @@ class SaleScreenController { return new IValidatorComponentListener() { @Override public void onValidationEvent() { - model.commitSale(); - view.switchToSaleValidationWaitingMode(model.getTempSaleId(), model.getCurrentSale()); + if(model.commitSale()) + view.switchToSaleValidationWaitingMode(model.getTempSaleId(), model.getCurrentSale()); } @Override diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/modules/sale_screen/SaleScreenModel.java b/Workspace/client/src/main/java/com/pqt/client/gui/modules/sale_screen/SaleScreenModel.java index 1bb32666..94d59bf2 100644 --- a/Workspace/client/src/main/java/com/pqt/client/gui/modules/sale_screen/SaleScreenModel.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/modules/sale_screen/SaleScreenModel.java @@ -31,6 +31,10 @@ class SaleScreenModel { private long tempSaleId; SaleScreenModel(AccountService accountService, StockService stockService, SaleService saleService) { + if(accountService==null || stockService==null || saleService==null) + throw new NullPointerException("At least one of the following services is null : account, stock, sale"); + + listeners = new EventListenerList(); this.accountService = accountService; this.stockService = stockService; this.saleService = saleService; @@ -104,6 +108,8 @@ class SaleScreenModel { fireAccountListUpdatedEvent(); } }); + + clearSale(); } private void fireSaleValidatedEvent() { @@ -135,7 +141,7 @@ class SaleScreenModel { } Sale getCurrentSale() { - return currentSaleBuilder.build(); + return currentSaleBuilder!=null?currentSaleBuilder.build():null; } List getProductList() { @@ -143,15 +149,29 @@ class SaleScreenModel { } void clearSale() { - currentSaleBuilder = saleService.getNewSaleBuilder(); - currentSaleBuilder.orderedBy(accountService.getCurrentAccount()); - currentSaleBuilder.saleType(SaleType.CASH); - + currentSaleBuilder = getNewSaleBuilder(); tempSaleId = -1; } - void commitSale() { + private SaleBuilder getNewSaleBuilder(){ + SaleBuilder saleBuilder = saleService.getNewSaleBuilder(); + saleBuilder.orderedBy(accountService.getCurrentAccount()); + saleBuilder.saleType(SaleType.CASH); + return saleBuilder; + } + + boolean commitSale() { + if(!checkValidity(currentSaleBuilder.build())) + return false; + tempSaleId = saleService.commitSale(currentSaleBuilder); + return tempSaleId!=-1; + } + + boolean checkValidity(Sale sale) { + return sale.getProducts().size()>0 + && sale.getOrderedBy()!=null + && sale.getType()!=null; } long getTempSaleId(){ @@ -159,19 +179,23 @@ class SaleScreenModel { } void addProductToSale(Product product) { - currentSaleBuilder.addProduct(product); + if(currentSaleBuilder!=null) + currentSaleBuilder.addProduct(product); } void removeProductFromSale(Product product) { - currentSaleBuilder.removeProduct(product); + if(currentSaleBuilder!=null) + currentSaleBuilder.removeProduct(product); } void setSaleType(SaleType saleType) { - currentSaleBuilder.saleType(saleType); + if(currentSaleBuilder!=null) + currentSaleBuilder.saleType(saleType); } void setSaleBeneficiary(Account saleBeneficiary) { - currentSaleBuilder.orderedFor(saleBeneficiary); + if(currentSaleBuilder!=null) + currentSaleBuilder.orderedFor(saleBeneficiary); } void addListener(ISaleScreenModelListener listener){ diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/modules/sale_screen/SaleScreenView.java b/Workspace/client/src/main/java/com/pqt/client/gui/modules/sale_screen/SaleScreenView.java index e35cb17f..ade15612 100644 --- a/Workspace/client/src/main/java/com/pqt/client/gui/modules/sale_screen/SaleScreenView.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/modules/sale_screen/SaleScreenView.java @@ -1,10 +1,11 @@ package com.pqt.client.gui.modules.sale_screen; -import com.pqt.client.gui.ressources.components.sale_validation_screen.SaleValidationScreen; +import com.pqt.client.gui.modules.sale_screen.sale_validation_screen.SaleValidationScreen; import com.pqt.client.gui.ressources.components.CommandComposerSaleDisplayer; import com.pqt.client.gui.ressources.components.SimpleValidator; +import com.pqt.client.gui.ressources.components.generics.javafx_override.CssEnabledGridPane; import com.pqt.client.gui.ressources.css.GUICssTool; -import com.pqt.client.gui.ressources.generics.IFXComponent; +import com.pqt.client.gui.ressources.components.generics.IFXComponent; import com.pqt.client.gui.ressources.strings.GUIStringTool; import com.pqt.client.gui.ressources.components.CategoryTabStockDisplayer; import com.pqt.core.entities.product.Product; @@ -14,6 +15,7 @@ import com.pqt.core.entities.sale.SaleType; import com.pqt.core.entities.user_account.Account; import javafx.application.Platform; +import javafx.geometry.Pos; import javafx.scene.Node; import javafx.scene.control.*; import javafx.scene.layout.*; @@ -35,6 +37,7 @@ class SaleScreenView implements IFXComponent { private ChoiceBox saleBeneficiaryAccountDisplayer; private ChoiceBox saleTypeDisplayer; private TextField salePriceDisplayer; + private SimpleValidator validator; SaleScreenView(SaleScreenController ctrl) { this.ctrl = ctrl; @@ -43,6 +46,7 @@ class SaleScreenView implements IFXComponent { private void initGui() { mainPane = new StackPane(); + mainPane.getStyleClass().add("main-module-pane"); mainPaneContent = new BorderPane(); @@ -50,7 +54,6 @@ class SaleScreenView implements IFXComponent { -----------------------CENTER PANE----------------------- */ { - mainPane.getChildren().add(mainPaneContent); mainPaneContent.prefWidthProperty().bind(mainPane.widthProperty()); mainPaneContent.prefHeightProperty().bind(mainPane.heightProperty()); @@ -72,7 +75,9 @@ class SaleScreenView implements IFXComponent { -----------------------BOTTOM PANE----------------------- */ { - AnchorPane mainContentBottomPane = new AnchorPane(); + HBox mainContentBottomPane = new HBox(); + mainContentBottomPane.setFillHeight(true); + mainContentBottomPane.setAlignment(Pos.CENTER); // Sale secondary data configuration (author, beneficiary, payment type, etc... { saleMakerAccountDisplayer = new TextField(); @@ -96,30 +101,29 @@ class SaleScreenView implements IFXComponent { salePriceDisplayer.setPromptText(GUIStringTool.getSalePriceTextFieldPromptText()); - GridPane mainContentBottomLeftPane = new GridPane(); - mainContentBottomLeftPane.add(new Label(GUIStringTool.getSaleMakerTextFieldLabel()), 0, 0); - mainContentBottomLeftPane.add(saleMakerAccountDisplayer, 1, 0); - mainContentBottomLeftPane.add(new Label(GUIStringTool.getSaleBeneficiaryTextFieldLabel()), 0, 1); - mainContentBottomLeftPane.add(saleBeneficiaryAccountDisplayer, 1, 1); - mainContentBottomLeftPane.add(new Label(GUIStringTool.getSaleTypeTextFieldLabel()), 0, 2); - mainContentBottomLeftPane.add(saleTypeDisplayer, 1, 2); - mainContentBottomLeftPane.add(new Label(GUIStringTool.getSalePriceTextFieldLabel()), 0, 3); - mainContentBottomLeftPane.add(salePriceDisplayer, 1, 3); + GridPane mainContentBottomCenterPane = new CssEnabledGridPane(); + mainContentBottomCenterPane.add(new Label(GUIStringTool.getSaleMakerTextFieldLabel()), 0, 0); + mainContentBottomCenterPane.add(saleMakerAccountDisplayer, 1, 0); + mainContentBottomCenterPane.add(new Label(GUIStringTool.getSaleBeneficiaryTextFieldLabel()), 0, 1); + mainContentBottomCenterPane.add(saleBeneficiaryAccountDisplayer, 1, 1); + mainContentBottomCenterPane.add(new Label(GUIStringTool.getSaleTypeTextFieldLabel()), 0, 2); + mainContentBottomCenterPane.add(saleTypeDisplayer, 1, 2); + mainContentBottomCenterPane.add(new Label(GUIStringTool.getSalePriceTextFieldLabel()), 0, 3); + mainContentBottomCenterPane.add(salePriceDisplayer, 1, 3); - mainContentBottomPane.getChildren().add(mainContentBottomLeftPane); - AnchorPane.setBottomAnchor(mainContentBottomLeftPane, 0d); - AnchorPane.setTopAnchor(mainContentBottomLeftPane, 0d); - AnchorPane.setLeftAnchor(mainContentBottomLeftPane, 0d); + mainContentBottomPane.getChildren().add(mainContentBottomCenterPane); } //Sale Validator { - SimpleValidator validator = new SimpleValidator(true); + AnchorPane anchorPane = new AnchorPane(); + validator = new SimpleValidator(true); validator.addListener(ctrl.getValidatorListener()); - - mainContentBottomPane.getChildren().add(validator.getPane()); - AnchorPane.setBottomAnchor(validator.getPane(), 0d); - AnchorPane.setTopAnchor(validator.getPane(), 0d); + anchorPane.getChildren().add(validator.getPane()); AnchorPane.setRightAnchor(validator.getPane(), 0d); + AnchorPane.setBottomAnchor(validator.getPane(), 0d); + + mainContentBottomPane.getChildren().add(anchorPane); + HBox.setHgrow(anchorPane, Priority.ALWAYS); } mainPaneContent.setBottom(mainContentBottomPane); } @@ -127,11 +131,6 @@ class SaleScreenView implements IFXComponent { ------------------------MAIN PANE------------------------ */ mainPane.getChildren().add(mainPaneContent); - - /* - -------------------------UPDATE-------------------------- - */ - ctrl.updateView(); } @Override @@ -143,7 +142,8 @@ class SaleScreenView implements IFXComponent { boolean clearChildren = mainPane.getChildren().size()>1; Pane greyIntermediaryPane = new Pane(); - greyIntermediaryPane.setId(GUICssTool.getGreyIntermediaryPaneCssId()); + greyIntermediaryPane.getStyleClass().clear(); + greyIntermediaryPane.getStyleClass().add("grey-intermediary-pane"); saleValidationScreen = new SaleValidationScreen(saleId, sale); saleValidationScreen.addListener(ctrl.getSaleValidationScreenListener()); @@ -153,6 +153,7 @@ class SaleScreenView implements IFXComponent { mainPane.getChildren().add(mainPaneContent); } + StackPane.setAlignment(saleValidationScreen.getPane(), Pos.CENTER); mainPane.getChildren().addAll(greyIntermediaryPane, saleValidationScreen.getPane()); }); } @@ -173,7 +174,8 @@ class SaleScreenView implements IFXComponent { void setSaleTypes(List saleTypes) { Platform.runLater(()->{ saleTypeDisplayer.getItems().clear(); - saleTypeDisplayer.getItems().addAll(saleTypes); + if(saleTypes!=null) + saleTypeDisplayer.getItems().addAll(saleTypes); }); } @@ -181,23 +183,26 @@ class SaleScreenView implements IFXComponent { Platform.runLater(()->{ saleBeneficiaryAccountDisplayer.getItems().clear(); saleBeneficiaryAccountDisplayer.getItems().add(ctrl.getDefaultAccount()); - saleBeneficiaryAccountDisplayer.getItems().addAll(accounts); + if(accounts!=null) + saleBeneficiaryAccountDisplayer.getItems().addAll(accounts); }); } void setSale(Sale sale) { - saleDisplayer.display(sale); + if(sale!=null) { + saleDisplayer.display(sale); - String price = GUIStringTool.getPriceRenderer().render(sale.getTotalPrice()); - String currentAccount = GUIStringTool.getAccountStringConverter().toString(sale.getOrderedBy()); + String price = GUIStringTool.getPriceRenderer().render(sale.getTotalPrice()); + String currentAccount = GUIStringTool.getAccountStringConverter().toString(sale.getOrderedBy()); - Platform.runLater(()->{ - salePriceDisplayer.setText(price); - saleMakerAccountDisplayer.setText(currentAccount); + Platform.runLater(() -> { + salePriceDisplayer.setText(price); + saleMakerAccountDisplayer.setText(currentAccount); - selectElement(saleTypeDisplayer, sale.getType()); - selectElement(saleBeneficiaryAccountDisplayer, sale.getOrderedFor()); - }); + selectElement(saleTypeDisplayer, sale.getType()); + selectElement(saleBeneficiaryAccountDisplayer, sale.getOrderedFor()); + }); + } } private void selectElement(ChoiceBox choiceBox, T element){ @@ -212,4 +217,8 @@ class SaleScreenView implements IFXComponent { void setSaleStatus(SaleStatus status){ this.saleValidationScreen.setSaleStatus(status); } + + void setValidationButtonEnabled(boolean validationButtonEnabled) { + validator.setValidationButtonEnable(validationButtonEnabled); + } } diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/sale_validation_screen/SaleValidationScreen.java b/Workspace/client/src/main/java/com/pqt/client/gui/modules/sale_screen/sale_validation_screen/SaleValidationScreen.java similarity index 75% rename from Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/sale_validation_screen/SaleValidationScreen.java rename to Workspace/client/src/main/java/com/pqt/client/gui/modules/sale_screen/sale_validation_screen/SaleValidationScreen.java index 8398ac61..9153b679 100644 --- a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/sale_validation_screen/SaleValidationScreen.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/modules/sale_screen/sale_validation_screen/SaleValidationScreen.java @@ -1,10 +1,12 @@ -package com.pqt.client.gui.ressources.components.sale_validation_screen; +package com.pqt.client.gui.modules.sale_screen.sale_validation_screen; -import com.pqt.client.gui.ressources.components.sale_validation_screen.listeners.ISaleValidationScreenListener; +import com.pqt.client.gui.modules.sale_screen.sale_validation_screen.listeners.ISaleValidationScreenListener; +import com.pqt.client.gui.ressources.components.generics.javafx_override.CssEnabledGridPane; import com.pqt.client.gui.ressources.strings.GUIStringTool; import com.pqt.core.entities.sale.Sale; import com.pqt.core.entities.sale.SaleStatus; import javafx.application.Platform; +import javafx.geometry.Pos; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.control.ProgressIndicator; @@ -31,9 +33,12 @@ public class SaleValidationScreen { listeners = new EventListenerList(); mainPane = new Pane(); + saleStatus = sale.getStatus(); + BorderPane mainPaneContent = new BorderPane(); - GridPane centerPane = new GridPane(); + GridPane centerPane = new CssEnabledGridPane(); + centerPane.setAlignment(Pos.CENTER); Label saleIdLabel = new Label(GUIStringTool.getSaleIdLabel()); centerPane.add(saleIdLabel, 0, 0); @@ -45,24 +50,29 @@ public class SaleValidationScreen { Label saleStatusLabel = new Label(GUIStringTool.getSaleStatusLabel()); centerPane.add(saleStatusLabel, 0, 1); - saleStatusTextField = new TextField(GUIStringTool.getSaleStatusRenderer().render(SaleStatus.PENDING)); + saleStatusTextField = new TextField(GUIStringTool.getSaleStatusRenderer().render(saleStatus)); saleStatusTextField.setEditable(false); centerPane.add(saleStatusTextField, 1, 1); + validationButton = new Button(GUIStringTool.getOkButtonLabel()); + validationButton.setDisable(saleStatus.equals(SaleStatus.PENDING)); + validationButton.setOnMouseClicked(event->fireScreenClose(saleStatus.equals(SaleStatus.ACCEPTED))); + centerPane.add(validationButton, 1,2); + mainPaneContent.setCenter(centerPane); progressIndicator = new ProgressIndicator(); - progressIndicator.setPrefSize(50, 50); mainPaneContent.setLeft(progressIndicator); - validationButton = new Button(GUIStringTool.getOkButtonLabel()); - validationButton.setOnMouseClicked(event->fireScreenClose(saleStatus.equals(SaleStatus.ACCEPTED))); + mainPaneContent.prefHeightProperty().bind(mainPane.heightProperty()); + mainPaneContent.prefWidthProperty().bind(mainPane.widthProperty()); + mainPane.getChildren().add(mainPaneContent); } - private void fireScreenClose(boolean saleValidateddSuccessFully) { + private void fireScreenClose(boolean saleValidatedSuccessFully) { if(!validationButton.isDisable()){ Arrays.stream(listeners.getListeners(ISaleValidationScreenListener.class)) - .forEach(listener->listener.onScreenClose(saleValidateddSuccessFully)); + .forEach(listener->listener.onScreenClose(saleValidatedSuccessFully)); } } diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/sale_validation_screen/listeners/ISaleValidationScreenListener.java b/Workspace/client/src/main/java/com/pqt/client/gui/modules/sale_screen/sale_validation_screen/listeners/ISaleValidationScreenListener.java similarity index 66% rename from Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/sale_validation_screen/listeners/ISaleValidationScreenListener.java rename to Workspace/client/src/main/java/com/pqt/client/gui/modules/sale_screen/sale_validation_screen/listeners/ISaleValidationScreenListener.java index 8bb1eb7c..e2011357 100644 --- a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/sale_validation_screen/listeners/ISaleValidationScreenListener.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/modules/sale_screen/sale_validation_screen/listeners/ISaleValidationScreenListener.java @@ -1,4 +1,4 @@ -package com.pqt.client.gui.ressources.components.sale_validation_screen.listeners; +package com.pqt.client.gui.modules.sale_screen.sale_validation_screen.listeners; import java.util.EventListener; diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/AccountManager.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/AccountManager.java index b5f8b213..34dd4cd3 100644 --- a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/AccountManager.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/AccountManager.java @@ -1,12 +1,12 @@ package com.pqt.client.gui.ressources.components; -import com.pqt.client.gui.ressources.generics.creators.IFXCreatorComponent; -import com.pqt.client.gui.ressources.generics.validators.IFXValidatorComponent; -import com.pqt.client.gui.ressources.specifics.account.listeners.IAccountComponentListener; -import com.pqt.client.gui.ressources.generics.validators.listeners.IValidatorComponentListener; -import com.pqt.client.gui.ressources.generics.validators.listeners.SimpleValidatorComponentFirerer; -import com.pqt.client.gui.ressources.specifics.account.IFXAccountsDisplayerComponent; -import com.pqt.client.gui.ressources.specifics.account.listeners.SimpleAccountComponentFirerer; +import com.pqt.client.gui.ressources.components.generics.creators.IFXCreatorComponent; +import com.pqt.client.gui.ressources.components.generics.validators.IFXValidatorComponent; +import com.pqt.client.gui.ressources.components.specifics.account.listeners.IAccountComponentListener; +import com.pqt.client.gui.ressources.components.generics.validators.listeners.IValidatorComponentListener; +import com.pqt.client.gui.ressources.components.generics.validators.listeners.SimpleValidatorComponentFirerer; +import com.pqt.client.gui.ressources.components.specifics.account.IFXAccountsDisplayerComponent; +import com.pqt.client.gui.ressources.components.specifics.account.listeners.SimpleAccountComponentFirerer; import com.pqt.client.gui.ressources.strings.GUIStringTool; import com.pqt.core.entities.user_account.Account; import javafx.application.Platform; diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/CategoryTabStockDisplayer.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/CategoryTabStockDisplayer.java index a4f2f582..d79b83c3 100644 --- a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/CategoryTabStockDisplayer.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/CategoryTabStockDisplayer.java @@ -1,17 +1,19 @@ package com.pqt.client.gui.ressources.components; -import com.pqt.client.gui.ressources.generics.displayers.IFXDisplayerComponent; -import com.pqt.client.gui.ressources.specifics.products.listeners.IStockComponentListener; -import com.pqt.client.gui.ressources.specifics.products.listeners.SimpleStockComponentFirerer; +import com.pqt.client.gui.ressources.components.generics.displayers.IFXDisplayerComponent; +import com.pqt.client.gui.ressources.components.specifics.products.listeners.IStockComponentListener; +import com.pqt.client.gui.ressources.components.specifics.products.listeners.SimpleStockComponentFirerer; import com.pqt.client.gui.ressources.strings.GUIStringTool; import com.pqt.client.gui.ressources.strings.IObjectStringRenderer; import com.pqt.core.entities.product.Product; import javafx.application.Platform; import javafx.collections.FXCollections; import javafx.collections.ObservableList; +import javafx.geometry.Pos; import javafx.scene.control.*; import javafx.scene.input.KeyCode; import javafx.scene.layout.BorderPane; +import javafx.scene.layout.HBox; import javafx.scene.layout.Pane; import java.util.Collection; @@ -64,8 +66,17 @@ public class CategoryTabStockDisplayer implements IFXDisplayerComponent(); listView.setCellFactory(list->new ListCell(){ diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/SimpleValidator.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/SimpleValidator.java index aeb426b7..0d895aa4 100644 --- a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/SimpleValidator.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/SimpleValidator.java @@ -1,12 +1,13 @@ package com.pqt.client.gui.ressources.components; -import com.pqt.client.gui.ressources.generics.validators.IFXValidatorComponent; -import com.pqt.client.gui.ressources.generics.validators.listeners.IValidatorComponentFirerer; -import com.pqt.client.gui.ressources.generics.validators.listeners.IValidatorComponentListener; +import com.pqt.client.gui.ressources.components.generics.validators.IFXValidatorComponent; +import com.pqt.client.gui.ressources.components.generics.validators.listeners.IValidatorComponentFirerer; +import com.pqt.client.gui.ressources.components.generics.validators.listeners.IValidatorComponentListener; import com.pqt.client.gui.ressources.strings.GUIStringTool; -import com.pqt.client.gui.ressources.generics.validators.listeners.SimpleValidatorComponentFirerer; +import com.pqt.client.gui.ressources.components.generics.validators.listeners.SimpleValidatorComponentFirerer; import javafx.application.Platform; import javafx.scene.control.Button; +import javafx.scene.layout.GridPane; import javafx.scene.layout.HBox; import javafx.scene.layout.Pane; @@ -24,7 +25,6 @@ public class SimpleValidator implements IFXValidatorComponent { public SimpleValidator(boolean askConfirmation) { firerer = new SimpleValidatorComponentFirerer(); this.askConfirmation = askConfirmation; - } @Override @@ -45,21 +45,22 @@ public class SimpleValidator implements IFXValidatorComponent { } private Pane createPane(){ - HBox hbox = new HBox(); + GridPane grid = new GridPane(); + grid.getStyleClass().add("validator"); validationButton = new Button(GUIStringTool.getValidationButtonLabel()); validationButton.setOnMouseClicked(event->{ getValidationButtonProcess().process(); }); - hbox.getChildren().add(validationButton); + grid.add(validationButton, 0,0); cancelButton = new Button(GUIStringTool.getCancelButtonLabel()); cancelButton.setOnMouseClicked(event->{ getCancelButtonProcess().process(); }); - hbox.getChildren().add(cancelButton); + grid.add(cancelButton, 1, 0); - return hbox; + return grid; } private IButtonProcess getValidationButtonProcess(){ @@ -96,4 +97,12 @@ public class SimpleValidator implements IFXValidatorComponent { private interface IButtonProcess{ void process(); } + + public void setValidationButtonEnable(boolean enable){ + this.validationButton.setDisable(!enable); + } + + public void setCancelationButtonEnable(boolean enable){ + this.cancelButton.setDisable(!enable); + } } diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/IFXComponent.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/IFXComponent.java similarity index 60% rename from Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/IFXComponent.java rename to Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/IFXComponent.java index 0bee2445..d333e909 100644 --- a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/IFXComponent.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/IFXComponent.java @@ -1,4 +1,4 @@ -package com.pqt.client.gui.ressources.generics; +package com.pqt.client.gui.ressources.components.generics; import javafx.scene.layout.Pane; diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/creators/IFXCreatorComponent.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/creators/IFXCreatorComponent.java new file mode 100644 index 00000000..4a79f9d1 --- /dev/null +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/creators/IFXCreatorComponent.java @@ -0,0 +1,8 @@ +package com.pqt.client.gui.ressources.components.generics.creators; + +import com.pqt.client.gui.ressources.components.generics.IFXComponent; + +public interface IFXCreatorComponent extends IFXComponent{ + T create(); + boolean isCreationPossible(); +} diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/displayers/IFXDisplayerComponent.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/displayers/IFXDisplayerComponent.java new file mode 100644 index 00000000..6d9ea7fb --- /dev/null +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/displayers/IFXDisplayerComponent.java @@ -0,0 +1,10 @@ +package com.pqt.client.gui.ressources.components.generics.displayers; + +import com.pqt.client.gui.ressources.components.generics.IFXComponent; +import com.pqt.client.gui.ressources.components.generics.displayers.listeners.IDisplayerComponentListener; + +public interface IFXDisplayerComponent extends IFXComponent{ + void display(T content); + void addListener(U l); + void removeListener(U l); +} diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/displayers/listeners/IDisplayerComponentFirerer.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/displayers/listeners/IDisplayerComponentFirerer.java similarity index 84% rename from Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/displayers/listeners/IDisplayerComponentFirerer.java rename to Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/displayers/listeners/IDisplayerComponentFirerer.java index f3bd32d7..9824dd5f 100644 --- a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/displayers/listeners/IDisplayerComponentFirerer.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/displayers/listeners/IDisplayerComponentFirerer.java @@ -1,4 +1,4 @@ -package com.pqt.client.gui.ressources.generics.displayers.listeners; +package com.pqt.client.gui.ressources.components.generics.displayers.listeners; import javafx.event.Event; diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/displayers/listeners/IDisplayerComponentListener.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/displayers/listeners/IDisplayerComponentListener.java similarity index 82% rename from Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/displayers/listeners/IDisplayerComponentListener.java rename to Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/displayers/listeners/IDisplayerComponentListener.java index d2da215f..e2c28d07 100644 --- a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/displayers/listeners/IDisplayerComponentListener.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/displayers/listeners/IDisplayerComponentListener.java @@ -1,4 +1,4 @@ -package com.pqt.client.gui.ressources.generics.displayers.listeners; +package com.pqt.client.gui.ressources.components.generics.displayers.listeners; import javafx.event.Event; diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/displayers/listeners/SimpleDisplayerComponentFirerer.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/displayers/listeners/SimpleDisplayerComponentFirerer.java similarity index 96% rename from Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/displayers/listeners/SimpleDisplayerComponentFirerer.java rename to Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/displayers/listeners/SimpleDisplayerComponentFirerer.java index e97916e4..c1909ad0 100644 --- a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/displayers/listeners/SimpleDisplayerComponentFirerer.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/displayers/listeners/SimpleDisplayerComponentFirerer.java @@ -1,4 +1,4 @@ -package com.pqt.client.gui.ressources.generics.displayers.listeners; +package com.pqt.client.gui.ressources.components.generics.displayers.listeners; import javafx.event.Event; diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/javafx_override/CssEnabledGridPane.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/javafx_override/CssEnabledGridPane.java new file mode 100644 index 00000000..3ef68e26 --- /dev/null +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/javafx_override/CssEnabledGridPane.java @@ -0,0 +1,11 @@ +package com.pqt.client.gui.ressources.components.generics.javafx_override; + +import javafx.scene.layout.GridPane; + +public class CssEnabledGridPane extends GridPane { + + public CssEnabledGridPane() { + super(); + this.getStyleClass().add("grid-pane"); + } +} diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/validators/IFXValidatorComponent.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/validators/IFXValidatorComponent.java new file mode 100644 index 00000000..01f96276 --- /dev/null +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/validators/IFXValidatorComponent.java @@ -0,0 +1,9 @@ +package com.pqt.client.gui.ressources.components.generics.validators; + +import com.pqt.client.gui.ressources.components.generics.IFXComponent; +import com.pqt.client.gui.ressources.components.generics.validators.listeners.IValidatorComponentListener; + +public interface IFXValidatorComponent extends IFXComponent{ + void addListener(IValidatorComponentListener l); + void removeListener(IValidatorComponentListener l); +} diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/validators/listeners/IValidatorComponentFirerer.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/validators/listeners/IValidatorComponentFirerer.java similarity index 73% rename from Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/validators/listeners/IValidatorComponentFirerer.java rename to Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/validators/listeners/IValidatorComponentFirerer.java index 083f6602..2e44be06 100644 --- a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/validators/listeners/IValidatorComponentFirerer.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/validators/listeners/IValidatorComponentFirerer.java @@ -1,4 +1,4 @@ -package com.pqt.client.gui.ressources.generics.validators.listeners; +package com.pqt.client.gui.ressources.components.generics.validators.listeners; public interface IValidatorComponentFirerer { void addListener(IValidatorComponentListener l); diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/validators/listeners/IValidatorComponentListener.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/validators/listeners/IValidatorComponentListener.java similarity index 66% rename from Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/validators/listeners/IValidatorComponentListener.java rename to Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/validators/listeners/IValidatorComponentListener.java index 34c29bbd..c4144f91 100644 --- a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/validators/listeners/IValidatorComponentListener.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/validators/listeners/IValidatorComponentListener.java @@ -1,4 +1,4 @@ -package com.pqt.client.gui.ressources.generics.validators.listeners; +package com.pqt.client.gui.ressources.components.generics.validators.listeners; import java.util.EventListener; diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/validators/listeners/SimpleValidatorComponentFirerer.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/validators/listeners/SimpleValidatorComponentFirerer.java similarity index 92% rename from Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/validators/listeners/SimpleValidatorComponentFirerer.java rename to Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/validators/listeners/SimpleValidatorComponentFirerer.java index ab0c32a1..cdaa979c 100644 --- a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/validators/listeners/SimpleValidatorComponentFirerer.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/validators/listeners/SimpleValidatorComponentFirerer.java @@ -1,4 +1,4 @@ -package com.pqt.client.gui.ressources.generics.validators.listeners; +package com.pqt.client.gui.ressources.components.generics.validators.listeners; import javax.swing.event.EventListenerList; import java.util.Arrays; diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/specifics/account/IFXAccountsDisplayerComponent.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/specifics/account/IFXAccountsDisplayerComponent.java new file mode 100644 index 00000000..1c459115 --- /dev/null +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/specifics/account/IFXAccountsDisplayerComponent.java @@ -0,0 +1,11 @@ +package com.pqt.client.gui.ressources.components.specifics.account; + +import com.pqt.client.gui.ressources.components.generics.displayers.IFXDisplayerComponent; +import com.pqt.client.gui.ressources.components.specifics.account.listeners.IAccountComponentListener; +import com.pqt.core.entities.user_account.Account; + +import java.util.Collection; + +public interface IFXAccountsDisplayerComponent extends IFXDisplayerComponent, IAccountComponentListener> { + +} diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/specifics/account/listeners/IAccountComponentListener.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/specifics/account/listeners/IAccountComponentListener.java new file mode 100644 index 00000000..9fe3ff70 --- /dev/null +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/specifics/account/listeners/IAccountComponentListener.java @@ -0,0 +1,7 @@ +package com.pqt.client.gui.ressources.components.specifics.account.listeners; + +import com.pqt.client.gui.ressources.components.generics.displayers.listeners.IDisplayerComponentListener; +import com.pqt.core.entities.user_account.Account; + +public interface IAccountComponentListener extends IDisplayerComponentListener{ +} diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/account/listeners/SimpleAccountComponentFirerer.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/specifics/account/listeners/SimpleAccountComponentFirerer.java similarity index 59% rename from Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/account/listeners/SimpleAccountComponentFirerer.java rename to Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/specifics/account/listeners/SimpleAccountComponentFirerer.java index d0e5cfbd..8f06f6a2 100644 --- a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/account/listeners/SimpleAccountComponentFirerer.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/specifics/account/listeners/SimpleAccountComponentFirerer.java @@ -1,6 +1,6 @@ -package com.pqt.client.gui.ressources.specifics.account.listeners; +package com.pqt.client.gui.ressources.components.specifics.account.listeners; -import com.pqt.client.gui.ressources.generics.displayers.listeners.SimpleDisplayerComponentFirerer; +import com.pqt.client.gui.ressources.components.generics.displayers.listeners.SimpleDisplayerComponentFirerer; import com.pqt.core.entities.user_account.Account; public class SimpleAccountComponentFirerer extends SimpleDisplayerComponentFirerer { diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/specifics/products/IFXProductsDisplayerComponent.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/specifics/products/IFXProductsDisplayerComponent.java new file mode 100644 index 00000000..5411b73d --- /dev/null +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/specifics/products/IFXProductsDisplayerComponent.java @@ -0,0 +1,10 @@ +package com.pqt.client.gui.ressources.components.specifics.products; + +import com.pqt.client.gui.ressources.components.generics.displayers.IFXDisplayerComponent; +import com.pqt.client.gui.ressources.components.specifics.products.listeners.IStockComponentListener; +import com.pqt.core.entities.product.Product; + +import java.util.Collection; + +public interface IFXProductsDisplayerComponent extends IFXDisplayerComponent, IStockComponentListener> { +} diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/specifics/products/listeners/IStockComponentListener.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/specifics/products/listeners/IStockComponentListener.java new file mode 100644 index 00000000..0dffba47 --- /dev/null +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/specifics/products/listeners/IStockComponentListener.java @@ -0,0 +1,7 @@ +package com.pqt.client.gui.ressources.components.specifics.products.listeners; + +import com.pqt.client.gui.ressources.components.generics.displayers.listeners.IDisplayerComponentListener; +import com.pqt.core.entities.product.Product; + +public interface IStockComponentListener extends IDisplayerComponentListener { +} diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/products/listeners/SimpleStockComponentFirerer.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/specifics/products/listeners/SimpleStockComponentFirerer.java similarity index 58% rename from Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/products/listeners/SimpleStockComponentFirerer.java rename to Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/specifics/products/listeners/SimpleStockComponentFirerer.java index daedf4b0..5832a288 100644 --- a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/products/listeners/SimpleStockComponentFirerer.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/specifics/products/listeners/SimpleStockComponentFirerer.java @@ -1,6 +1,6 @@ -package com.pqt.client.gui.ressources.specifics.products.listeners; +package com.pqt.client.gui.ressources.components.specifics.products.listeners; -import com.pqt.client.gui.ressources.generics.displayers.listeners.SimpleDisplayerComponentFirerer; +import com.pqt.client.gui.ressources.components.generics.displayers.listeners.SimpleDisplayerComponentFirerer; import com.pqt.core.entities.product.Product; public class SimpleStockComponentFirerer extends SimpleDisplayerComponentFirerer { diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/specifics/sale/IFXSaleDisplayerComponent.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/specifics/sale/IFXSaleDisplayerComponent.java new file mode 100644 index 00000000..5f0a0fbc --- /dev/null +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/specifics/sale/IFXSaleDisplayerComponent.java @@ -0,0 +1,8 @@ +package com.pqt.client.gui.ressources.components.specifics.sale; + +import com.pqt.client.gui.ressources.components.generics.displayers.IFXDisplayerComponent; +import com.pqt.client.gui.ressources.components.specifics.sale.listeners.ISaleComponentListener; +import com.pqt.core.entities.sale.Sale; + +public interface IFXSaleDisplayerComponent extends IFXDisplayerComponent { +} diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/sale/listeners/ISaleComponentListener.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/specifics/sale/listeners/ISaleComponentListener.java similarity index 59% rename from Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/sale/listeners/ISaleComponentListener.java rename to Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/specifics/sale/listeners/ISaleComponentListener.java index cc3510ec..f64fbc7f 100644 --- a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/sale/listeners/ISaleComponentListener.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/specifics/sale/listeners/ISaleComponentListener.java @@ -1,6 +1,6 @@ -package com.pqt.client.gui.ressources.specifics.sale.listeners; +package com.pqt.client.gui.ressources.components.specifics.sale.listeners; -import com.pqt.client.gui.ressources.generics.displayers.listeners.IDisplayerComponentListener; +import com.pqt.client.gui.ressources.components.generics.displayers.listeners.IDisplayerComponentListener; import com.pqt.core.entities.product.Product; import com.pqt.core.entities.sale.Sale; import javafx.event.Event; diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/sale/listeners/SimpleSaleComponentFirerer.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/specifics/sale/listeners/SimpleSaleComponentFirerer.java similarity index 75% rename from Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/sale/listeners/SimpleSaleComponentFirerer.java rename to Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/specifics/sale/listeners/SimpleSaleComponentFirerer.java index 9a669f88..aa83a903 100644 --- a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/sale/listeners/SimpleSaleComponentFirerer.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/specifics/sale/listeners/SimpleSaleComponentFirerer.java @@ -1,6 +1,6 @@ -package com.pqt.client.gui.ressources.specifics.sale.listeners; +package com.pqt.client.gui.ressources.components.specifics.sale.listeners; -import com.pqt.client.gui.ressources.generics.displayers.listeners.SimpleDisplayerComponentFirerer; +import com.pqt.client.gui.ressources.components.generics.displayers.listeners.SimpleDisplayerComponentFirerer; import com.pqt.core.entities.product.Product; import com.pqt.core.entities.sale.Sale; import javafx.event.Event; diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/css/GUICssTool.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/css/GUICssTool.java index b4c48833..3beba068 100644 --- a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/css/GUICssTool.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/css/GUICssTool.java @@ -1,7 +1,7 @@ package com.pqt.client.gui.ressources.css; public class GUICssTool { - public static String getGreyIntermediaryPaneCssId(){ - return "grey-pane"; + public static String getCssFilePath(){ + return "/dark-theme.css"; } } diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/creators/IFXCreatorComponent.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/creators/IFXCreatorComponent.java deleted file mode 100644 index 7a5e06f2..00000000 --- a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/creators/IFXCreatorComponent.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.pqt.client.gui.ressources.generics.creators; - -import com.pqt.client.gui.ressources.generics.IFXComponent; - -public interface IFXCreatorComponent extends IFXComponent{ - T create(); - boolean isCreationPossible(); -} diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/displayers/IFXDisplayerComponent.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/displayers/IFXDisplayerComponent.java deleted file mode 100644 index 1137609d..00000000 --- a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/displayers/IFXDisplayerComponent.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.pqt.client.gui.ressources.generics.displayers; - -import com.pqt.client.gui.ressources.generics.IFXComponent; -import com.pqt.client.gui.ressources.generics.displayers.listeners.IDisplayerComponentListener; - -public interface IFXDisplayerComponent extends IFXComponent{ - void display(T content); - void addListener(U l); - void removeListener(U l); -} diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/validators/IFXValidatorComponent.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/validators/IFXValidatorComponent.java deleted file mode 100644 index 67d961b4..00000000 --- a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/validators/IFXValidatorComponent.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.pqt.client.gui.ressources.generics.validators; - -import com.pqt.client.gui.ressources.generics.IFXComponent; -import com.pqt.client.gui.ressources.generics.validators.listeners.IValidatorComponentListener; - -public interface IFXValidatorComponent extends IFXComponent{ - void addListener(IValidatorComponentListener l); - void removeListener(IValidatorComponentListener l); -} diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/account/IFXAccountsDisplayerComponent.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/account/IFXAccountsDisplayerComponent.java deleted file mode 100644 index 29fe49d9..00000000 --- a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/account/IFXAccountsDisplayerComponent.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.pqt.client.gui.ressources.specifics.account; - -import com.pqt.client.gui.ressources.generics.displayers.IFXDisplayerComponent; -import com.pqt.client.gui.ressources.specifics.account.listeners.IAccountComponentListener; -import com.pqt.core.entities.user_account.Account; - -import java.util.Collection; - -public interface IFXAccountsDisplayerComponent extends IFXDisplayerComponent, IAccountComponentListener> { - -} diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/account/listeners/IAccountComponentListener.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/account/listeners/IAccountComponentListener.java deleted file mode 100644 index 12d70b4f..00000000 --- a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/account/listeners/IAccountComponentListener.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.pqt.client.gui.ressources.specifics.account.listeners; - -import com.pqt.client.gui.ressources.generics.displayers.listeners.IDisplayerComponentListener; -import com.pqt.core.entities.user_account.Account; - -public interface IAccountComponentListener extends IDisplayerComponentListener{ -} diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/products/IFXProductsDisplayerComponent.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/products/IFXProductsDisplayerComponent.java deleted file mode 100644 index d4186480..00000000 --- a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/products/IFXProductsDisplayerComponent.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.pqt.client.gui.ressources.specifics.products; - -import com.pqt.client.gui.ressources.generics.displayers.IFXDisplayerComponent; -import com.pqt.client.gui.ressources.specifics.products.listeners.IStockComponentListener; -import com.pqt.core.entities.product.Product; - -import java.util.Collection; - -public interface IFXProductsDisplayerComponent extends IFXDisplayerComponent, IStockComponentListener> { -} diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/products/listeners/IStockComponentListener.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/products/listeners/IStockComponentListener.java deleted file mode 100644 index 45bf72eb..00000000 --- a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/products/listeners/IStockComponentListener.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.pqt.client.gui.ressources.specifics.products.listeners; - -import com.pqt.client.gui.ressources.generics.displayers.listeners.IDisplayerComponentListener; -import com.pqt.core.entities.product.Product; - -public interface IStockComponentListener extends IDisplayerComponentListener { -} diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/sale/IFXSaleDisplayerComponent.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/sale/IFXSaleDisplayerComponent.java deleted file mode 100644 index e4e8c143..00000000 --- a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/sale/IFXSaleDisplayerComponent.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.pqt.client.gui.ressources.specifics.sale; - -import com.pqt.client.gui.ressources.generics.displayers.IFXDisplayerComponent; -import com.pqt.client.gui.ressources.specifics.sale.listeners.ISaleComponentListener; -import com.pqt.core.entities.sale.Sale; - -public interface IFXSaleDisplayerComponent extends IFXDisplayerComponent { -} diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/strings/GUIStringTool.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/strings/GUIStringTool.java index 4d33ab11..c4d5818a 100644 --- a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/strings/GUIStringTool.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/strings/GUIStringTool.java @@ -55,7 +55,10 @@ public class GUIStringTool { return new StringConverter() { @Override public String toString(Account object) { - return String.format("%s - %s)", object.getUsername(), object.getPermissionLevel().name()); + if(object!=null) + return String.format("%s - %s)", object.getUsername(), object.getPermissionLevel()); + + return "null"; } @Override diff --git a/Workspace/client/src/main/java/com/pqt/client/module/account/listeners/AccountListenerAdapter.java b/Workspace/client/src/main/java/com/pqt/client/module/account/listeners/AccountListenerAdapter.java index 421c1f6d..6abd0649 100644 --- a/Workspace/client/src/main/java/com/pqt/client/module/account/listeners/AccountListenerAdapter.java +++ b/Workspace/client/src/main/java/com/pqt/client/module/account/listeners/AccountListenerAdapter.java @@ -12,4 +12,11 @@ public class AccountListenerAdapter implements IAccountListener { } + /** + * @see com.pqt.client.module.account.listeners.IAccountListener#onAccountListChangedEvent() + */ + public void onAccountListChangedEvent() { + + } + } diff --git a/Workspace/client/src/main/java/com/pqt/client/module/sale/listeners/ISaleListener.java b/Workspace/client/src/main/java/com/pqt/client/module/sale/listeners/ISaleListener.java index ddb44c48..8369a112 100644 --- a/Workspace/client/src/main/java/com/pqt/client/module/sale/listeners/ISaleListener.java +++ b/Workspace/client/src/main/java/com/pqt/client/module/sale/listeners/ISaleListener.java @@ -1,15 +1,13 @@ package com.pqt.client.module.sale.listeners; -import com.pqt.core.entities.sale.Sale; - import java.util.EventListener; public interface ISaleListener extends EventListener { - public abstract void onSaleValidationSuccess(long saleId); + void onSaleValidationSuccess(long saleId); - public abstract void onSaleValidationError(long saleId, Throwable cause); + void onSaleValidationError(long saleId, Throwable cause); - public abstract void onSaleValidationRefused(long saleId, Throwable cause); + void onSaleValidationRefused(long saleId, Throwable cause); } diff --git a/Workspace/client/src/main/java/com/pqt/client/module/stock/StockService.java b/Workspace/client/src/main/java/com/pqt/client/module/stock/StockService.java index 95644e61..559fa0ae 100644 --- a/Workspace/client/src/main/java/com/pqt/client/module/stock/StockService.java +++ b/Workspace/client/src/main/java/com/pqt/client/module/stock/StockService.java @@ -13,7 +13,7 @@ public class StockService { private StockDao dao; - private StockService() { + public StockService() { dao = new StockDao(); } diff --git a/Workspace/client/src/main/resources/dark-theme.css b/Workspace/client/src/main/resources/dark-theme.css new file mode 100644 index 00000000..5789bca8 --- /dev/null +++ b/Workspace/client/src/main/resources/dark-theme.css @@ -0,0 +1,209 @@ +.root { + -fx-background-color: #1d1d1d; +} + +.label { + -fx-font-size: 11pt; + -fx-font-family: "Segoe UI Semibold"; + -fx-text-fill: white; + -fx-opacity: 0.6; +} + +.label-bright { + -fx-font-size: 11pt; + -fx-font-family: "Segoe UI Semibold"; + -fx-text-fill: white; + -fx-opacity: 1; +} + +.label-header { + -fx-font-size: 32pt; + -fx-font-family: "Segoe UI Light"; + -fx-text-fill: white; + -fx-opacity: 1; +} + +.list-view { + -fx-base: #1d1d1d; + -fx-control-inner-background: #1d1d1d; + -fx-background-color: #1d1d1d; + -fx-table-cell-border-color: transparent; + -fx-table-header-border-color: transparent; + -fx-padding: 5; +} + +.list-view .list-cell .label{ + -fx-font-size: 20pt; + -fx-font-family: "Segoe UI Light"; + -fx-text-fill: white; + -fx-alignment: center-left; + -fx-opacity: 1; +} + +.list-view:focused .list-cell:filled:focused:selected { + -fx-background-color: -fx-focus-color; +} + +.table-view { + -fx-base: #1d1d1d; + -fx-control-inner-background: #1d1d1d; + -fx-background-color: #1d1d1d; + -fx-table-cell-border-color: transparent; + -fx-table-header-border-color: transparent; + -fx-padding: 5; +} + +.table-view .column-header-background { + -fx-background-color: transparent; +} + +.table-view .column-header, .table-view .filler { + -fx-size: 35px; + -fx-border-width: 0 0 1 0; + -fx-background-color: transparent; + -fx-border-color: + transparent + transparent + derive(-fx-base, 80%) + transparent; + -fx-border-insets: 0 10 1 0; +} + +.table-view .column-header .label { + -fx-font-size: 20pt; + -fx-font-family: "Segoe UI Light"; + -fx-text-fill: white; + -fx-alignment: center-left; + -fx-opacity: 1; +} + +.table-view:focused .table-row-cell:filled:focused:selected { + -fx-background-color: -fx-focus-color; +} + +.split-pane:horizontal > .split-pane-divider { + -fx-border-color: transparent #1d1d1d transparent #1d1d1d; + -fx-background-color: transparent, derive(#1d1d1d,20%); +} + +.split-pane { + -fx-padding: 1 0 0 0; +} + +.grid-pane { + -fx-hgap: 10; + -fx-vgap: 10; +} + +.menu-bar { + -fx-background-color: derive(#1d1d1d,20%); +} + +.context-menu { + -fx-background-color: derive(#1d1d1d,50%); +} + +.menu-bar .label { + -fx-font-size: 14pt; + -fx-font-family: "Segoe UI Light"; + -fx-text-fill: white; + -fx-opacity: 0.9; +} + +.menu .left-container { + -fx-background-color: black; +} + +.text-field { + -fx-font-size: 12pt; + -fx-font-family: "Segoe UI Semibold"; + -fx-pref-width: 125; + -fx-pref-height: 30; + -fx-background-radius: 0; + -fx-background-color: #1d1d1d; + -fx-background-insets: 0 0 0 0, 0, 1, 2; + -fx-border-color: #e2e2e2; + -fx-border-width: 2; + -fx-text-fill: #d8d8d8; +} + +.button { + -fx-padding: 5 22 5 22; + -fx-border-color: #e2e2e2; + -fx-border-width: 2; + -fx-background-radius: 0; + -fx-background-color: #1d1d1d; + -fx-font-family: "Segoe UI", Helvetica, Arial, sans-serif; + -fx-font-size: 11pt; + -fx-text-fill: #d8d8d8; + -fx-background-insets: 0 0 0 0, 0, 1, 2; + -fx-pref-width: 125; + -fx-pref-height: 30; +} + +.button:hover { + -fx-background-color: #3a3a3a; +} + +.button:pressed, .button:default:hover:pressed { + -fx-background-color: white; + -fx-text-fill: #1d1d1d; +} + +.button:focused { + -fx-border-color: white, white; + -fx-border-width: 1, 1; + -fx-border-style: solid, segments(1, 1); + -fx-border-radius: 0, 0; + -fx-border-insets: 1 1 1 1, 0; +} + +.button:disabled, .button:default:disabled { + -fx-opacity: 0.4; + -fx-background-color: #1d1d1d; + -fx-text-fill: white; +} + +.button:default { + -fx-background-color: -fx-focus-color; + -fx-text-fill: #ffffff; +} + +.button:default:hover { + -fx-background-color: derive(-fx-focus-color,30%); +} + +.choice-box { + -fx-pref-width: 150; + -fx-pref-height: 30; + -fx-background-radius: 0; + -fx-background-color: #1d1d1d; + -fx-background-insets: 0 0 0 0, 0, 1, 2; + -fx-border-color: #e2e2e2; + -fx-border-width: 2; + -fx-text-fill: #d8d8d8; +} + +.progress-indicator { + -fx-pref-width: 50; + -fx-pref-height: 50; +} + +.grey-intermediary-pane { + -fx-background-color: #1d1d1d; + -fx-opacity: 60%; +} + +.main-module-pane { + -fx-padding: 10 10 10 10; +} + +.validator { + -fx-padding: 10 10 10 10; + -fx-hgap: 10; + -fx-vgap: 10; +} +.validator .button{ + -fx-pref-width: 150; + -fx-pref-height: 50; + } \ No newline at end of file diff --git a/Workspace/core/src/main/java/com/pqt/core/entities/members/Client.java b/Workspace/core/src/main/java/com/pqt/core/entities/members/Client.java index a4498012..aaa92a4d 100644 --- a/Workspace/core/src/main/java/com/pqt/core/entities/members/Client.java +++ b/Workspace/core/src/main/java/com/pqt/core/entities/members/Client.java @@ -27,21 +27,6 @@ public class Client extends PqtMember{ this.address = address; } - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - Client client = (Client) o; - - return address.equals(client.address) && id==client.id && type.equals(client.type); - } - - @Override - public int hashCode() { - return address.hashCode() + type.hashCode() + Integer.class.cast(id); - } - @Override public int hashCode() { return Objects.hash(super.hashCode(), address);