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 new file mode 100644 index 00000000..b5f8b213 --- /dev/null +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/AccountManager.java @@ -0,0 +1,153 @@ +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.strings.GUIStringTool; +import com.pqt.core.entities.user_account.Account; +import javafx.application.Platform; +import javafx.collections.FXCollections; +import javafx.scene.control.Button; +import javafx.scene.control.ChoiceBox; +import javafx.scene.control.PasswordField; +import javafx.scene.control.TextField; +import javafx.scene.input.KeyCode; +import javafx.scene.layout.HBox; +import javafx.scene.layout.Pane; +import javafx.scene.layout.VBox; + +import java.util.Collection; + +public class AccountManager implements IFXAccountsDisplayerComponent, IFXValidatorComponent, IFXCreatorComponent { + + private Pane mainPane; + + private HBox mainDisconnectedPane, mainConnectedPane; + private TextField connectedUsernameField; + private ChoiceBox disconnectedUsernameField; + private PasswordField passwordField; + + private SimpleAccountComponentFirerer accountEventFirerer; + private SimpleValidatorComponentFirerer validatorEventFirerer; + + private Account currentAccount; + + public AccountManager() { + accountEventFirerer = new SimpleAccountComponentFirerer(); + validatorEventFirerer = new SimpleValidatorComponentFirerer(); + + currentAccount = null; + + init(); + } + + private void init() { + mainPane = new Pane(); + + mainConnectedPane = new HBox(); + mainDisconnectedPane = new HBox(); + + connectedUsernameField = new TextField(); + connectedUsernameField.setEditable(false); + + Button disconnectButton = new Button(GUIStringTool.getLogoutButtonLabel()); + disconnectButton.setOnMouseClicked(event->validatorEventFirerer.fireCancelEvent()); + disconnectButton.setOnKeyTyped(event->{if(event.getCode().equals(KeyCode.ENTER)) validatorEventFirerer.fireCancelEvent();}); + + mainConnectedPane.getChildren().addAll(connectedUsernameField, disconnectButton); + + + disconnectedUsernameField = new ChoiceBox<>(); + disconnectedUsernameField.setConverter(GUIStringTool.getAccountStringConverter()); + + passwordField = new PasswordField(); + passwordField.setPromptText(GUIStringTool.getPasswordFieldPromptText()); + + VBox leftDisconnectedPaneContent = new VBox(); + leftDisconnectedPaneContent.getChildren().addAll(disconnectedUsernameField, passwordField); + + Button validationButton = new Button(GUIStringTool.getLoginButtonLabel()); + validationButton.setOnMouseClicked(event-> validatorEventFirerer.fireValidationEvent()); + validationButton.setOnKeyTyped(event->{if(event.getCode().equals(KeyCode.ENTER)) validatorEventFirerer.fireValidationEvent();}); + + mainDisconnectedPane.getChildren().addAll(leftDisconnectedPaneContent, validationButton); + + refreshMainPane(); + } + + @Override + public void display(Collection content) { + Platform.runLater(()->disconnectedUsernameField.setItems(FXCollections.observableArrayList(content))); + } + + public void setCurrentAccount(Account account){ + currentAccount = account; + Platform.runLater(()->connectedUsernameField.setText(GUIStringTool.getAccountStringConverter().toString(currentAccount))); + refreshMainPane(); + } + + private void refreshMainPane() { + if(currentAccount!=null) + Platform.runLater( + ()->{ + mainPane.getChildren().clear(); + mainPane.getChildren().add(mainConnectedPane); + } + ); + else + Platform.runLater( + ()->{ + mainPane.getChildren().clear(); + mainPane.getChildren().add(mainDisconnectedPane); + } + ); + } + + public Account getCurrentAccount() { + return currentAccount; + } + + @Override + public void addListener(IAccountComponentListener l) { + accountEventFirerer.addListener(l); + } + + @Override + public void removeListener(IAccountComponentListener l) { + accountEventFirerer.removeListener(l); + } + + @Override + public Pane getPane() { + return mainPane; + } + + @Override + public void addListener(IValidatorComponentListener l) { + validatorEventFirerer.addListener(l); + } + + @Override + public void removeListener(IValidatorComponentListener l) { + validatorEventFirerer.removeListener(l); + } + + @Override + public Account create() { + if(!isCreationPossible()) + return null; + + return new Account(disconnectedUsernameField.getValue().getUsername(), passwordField.getText(), disconnectedUsernameField.getValue().getPermissionLevel()); + } + + @Override + public boolean isCreationPossible() { + return currentAccount==null + && !disconnectedUsernameField.getAccessibleText().isEmpty() + && !passwordField.getText().isEmpty(); + } +} diff --git a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/components/CategoryTabStockDisplayer.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/CategoryTabStockDisplayer.java similarity index 86% rename from Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/components/CategoryTabStockDisplayer.java rename to Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/CategoryTabStockDisplayer.java index aa17ad38..a4f2f582 100644 --- a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/components/CategoryTabStockDisplayer.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/CategoryTabStockDisplayer.java @@ -1,10 +1,10 @@ -package com.pqt.client.module.gui.ressources.components; +package com.pqt.client.gui.ressources.components; -import com.pqt.client.module.gui.ressources.generics.displayers.IFXDisplayerComponent; -import com.pqt.client.module.gui.ressources.specifics.products.listeners.IStockComponentListener; -import com.pqt.client.module.gui.ressources.specifics.products.listeners.SimpleStockComponentFirerer; -import com.pqt.client.module.gui.ressources.strings.GUIStringTool; -import com.pqt.client.module.gui.ressources.strings.IObjectStringRenderer; +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.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; @@ -18,7 +18,7 @@ import java.util.Collection; import java.util.List; import java.util.stream.Collectors; -public class CategoryTabStockDisplayer implements IFXDisplayerComponent, IStockComponentListener>{ +public class CategoryTabStockDisplayer implements IFXDisplayerComponent, IStockComponentListener> { private SimpleStockComponentFirerer firerer; private BorderPane mainPane; diff --git a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/components/CommandComposerSaleDisplayer.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/CommandComposerSaleDisplayer.java similarity index 85% rename from Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/components/CommandComposerSaleDisplayer.java rename to Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/CommandComposerSaleDisplayer.java index 190aa7ac..300de5a1 100644 --- a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/components/CommandComposerSaleDisplayer.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/CommandComposerSaleDisplayer.java @@ -1,9 +1,9 @@ -package com.pqt.client.module.gui.ressources.components; +package com.pqt.client.gui.ressources.components; -import com.pqt.client.module.gui.ressources.specifics.sale.IFXSaleDisplayerComponent; -import com.pqt.client.module.gui.ressources.specifics.sale.listeners.ISaleComponentListener; -import com.pqt.client.module.gui.ressources.specifics.sale.listeners.SimpleSaleComponentFirerer; -import com.pqt.client.module.gui.ressources.strings.GUIStringTool; +import com.pqt.client.gui.ressources.specifics.sale.IFXSaleDisplayerComponent; +import com.pqt.client.gui.ressources.specifics.sale.listeners.ISaleComponentListener; +import com.pqt.client.gui.ressources.specifics.sale.listeners.SimpleSaleComponentFirerer; +import com.pqt.client.gui.ressources.strings.GUIStringTool; import com.pqt.core.entities.product.Product; import com.pqt.core.entities.sale.Sale; import javafx.application.Platform; @@ -14,7 +14,6 @@ import javafx.scene.layout.BorderPane; import javafx.scene.layout.Pane; import java.util.ArrayList; -import java.util.stream.Collectors; public class CommandComposerSaleDisplayer implements IFXSaleDisplayerComponent { diff --git a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/components/SimpleValidator.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/SimpleValidator.java similarity index 82% rename from Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/components/SimpleValidator.java rename to Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/SimpleValidator.java index 1f6a9e35..aeb426b7 100644 --- a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/components/SimpleValidator.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/SimpleValidator.java @@ -1,16 +1,16 @@ -package com.pqt.client.module.gui.ressources.components; +package com.pqt.client.gui.ressources.components; -import com.pqt.client.module.gui.ressources.generics.validators.IFXValidatorComponent; -import com.pqt.client.module.gui.ressources.generics.validators.listeners.IValidatorComponentFirerer; -import com.pqt.client.module.gui.ressources.generics.validators.listeners.IValidatorComponentListener; -import com.pqt.client.module.gui.ressources.generics.validators.listeners.SimpleValidatorComponentFirerer; -import com.pqt.client.module.gui.ressources.strings.GUIStringTool; +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.strings.GUIStringTool; +import com.pqt.client.gui.ressources.generics.validators.listeners.SimpleValidatorComponentFirerer; import javafx.application.Platform; import javafx.scene.control.Button; import javafx.scene.layout.HBox; import javafx.scene.layout.Pane; -public class SimpleValidator implements IFXValidatorComponent{ +public class SimpleValidator implements IFXValidatorComponent { private final IValidatorComponentFirerer firerer; private Pane pane; 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/ressources/components/sale_validation_screen/SaleValidationScreen.java new file mode 100644 index 00000000..8398ac61 --- /dev/null +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/sale_validation_screen/SaleValidationScreen.java @@ -0,0 +1,85 @@ +package com.pqt.client.gui.ressources.components.sale_validation_screen; + +import com.pqt.client.gui.ressources.components.sale_validation_screen.listeners.ISaleValidationScreenListener; +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.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.ProgressIndicator; +import javafx.scene.control.TextField; +import javafx.scene.layout.BorderPane; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.Pane; + +import javax.swing.event.EventListenerList; +import java.util.Arrays; + +public class SaleValidationScreen { + + private Pane mainPane; + + private TextField saleStatusTextField; + private SaleStatus saleStatus; + private ProgressIndicator progressIndicator; + private Button validationButton; + + private EventListenerList listeners; + + public SaleValidationScreen(long saleId, Sale sale) { + listeners = new EventListenerList(); + mainPane = new Pane(); + + BorderPane mainPaneContent = new BorderPane(); + + GridPane centerPane = new GridPane(); + + Label saleIdLabel = new Label(GUIStringTool.getSaleIdLabel()); + centerPane.add(saleIdLabel, 0, 0); + + TextField saleIdTextField = new TextField(Long.toString(saleId)); + saleIdTextField.setEditable(false); + centerPane.add(saleIdTextField, 1, 0); + + Label saleStatusLabel = new Label(GUIStringTool.getSaleStatusLabel()); + centerPane.add(saleStatusLabel, 0, 1); + + saleStatusTextField = new TextField(GUIStringTool.getSaleStatusRenderer().render(SaleStatus.PENDING)); + saleStatusTextField.setEditable(false); + centerPane.add(saleStatusTextField, 1, 1); + + 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))); + } + + private void fireScreenClose(boolean saleValidateddSuccessFully) { + if(!validationButton.isDisable()){ + Arrays.stream(listeners.getListeners(ISaleValidationScreenListener.class)) + .forEach(listener->listener.onScreenClose(saleValidateddSuccessFully)); + } + } + + public void addListener(ISaleValidationScreenListener listener){ + listeners.add(ISaleValidationScreenListener.class, listener); + } + + public void setSaleStatus(SaleStatus status){ + saleStatus = status; + Platform.runLater(()->{ + validationButton.setDisable(saleStatus.equals(SaleStatus.PENDING)); + saleStatusTextField.setText(GUIStringTool.getSaleStatusRenderer().render(status)); + progressIndicator.setProgress((status.equals(SaleStatus.PENDING)?ProgressIndicator.INDETERMINATE_PROGRESS:1F)); + }); + } + + public Pane getPane(){ + return mainPane; + } +} 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/ressources/components/sale_validation_screen/listeners/ISaleValidationScreenListener.java new file mode 100644 index 00000000..8bb1eb7c --- /dev/null +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/sale_validation_screen/listeners/ISaleValidationScreenListener.java @@ -0,0 +1,7 @@ +package com.pqt.client.gui.ressources.components.sale_validation_screen.listeners; + +import java.util.EventListener; + +public interface ISaleValidationScreenListener extends EventListener { + void onScreenClose(boolean saleValidatedSuccessfully); +} 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 new file mode 100644 index 00000000..b4c48833 --- /dev/null +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/css/GUICssTool.java @@ -0,0 +1,7 @@ +package com.pqt.client.gui.ressources.css; + +public class GUICssTool { + public static String getGreyIntermediaryPaneCssId(){ + return "grey-pane"; + } +} diff --git a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/generics/IFXComponent.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/IFXComponent.java similarity index 61% rename from Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/generics/IFXComponent.java rename to Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/IFXComponent.java index 973b1e74..0bee2445 100644 --- a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/generics/IFXComponent.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/IFXComponent.java @@ -1,4 +1,4 @@ -package com.pqt.client.module.gui.ressources.generics; +package com.pqt.client.gui.ressources.generics; import javafx.scene.layout.Pane; 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 new file mode 100644 index 00000000..7a5e06f2 --- /dev/null +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/creators/IFXCreatorComponent.java @@ -0,0 +1,8 @@ +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 new file mode 100644 index 00000000..1137609d --- /dev/null +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/displayers/IFXDisplayerComponent.java @@ -0,0 +1,10 @@ +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/module/gui/ressources/generics/displayers/listeners/IDisplayerComponentFirerer.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/displayers/listeners/IDisplayerComponentFirerer.java similarity index 85% rename from Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/generics/displayers/listeners/IDisplayerComponentFirerer.java rename to Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/displayers/listeners/IDisplayerComponentFirerer.java index 5df54246..f3bd32d7 100644 --- a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/generics/displayers/listeners/IDisplayerComponentFirerer.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/displayers/listeners/IDisplayerComponentFirerer.java @@ -1,4 +1,4 @@ -package com.pqt.client.module.gui.ressources.generics.displayers.listeners; +package com.pqt.client.gui.ressources.generics.displayers.listeners; import javafx.event.Event; diff --git a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/generics/displayers/listeners/IDisplayerComponentListener.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/displayers/listeners/IDisplayerComponentListener.java similarity index 82% rename from Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/generics/displayers/listeners/IDisplayerComponentListener.java rename to Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/displayers/listeners/IDisplayerComponentListener.java index 12ce0198..d2da215f 100644 --- a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/generics/displayers/listeners/IDisplayerComponentListener.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/displayers/listeners/IDisplayerComponentListener.java @@ -1,4 +1,4 @@ -package com.pqt.client.module.gui.ressources.generics.displayers.listeners; +package com.pqt.client.gui.ressources.generics.displayers.listeners; import javafx.event.Event; diff --git a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/generics/displayers/listeners/SimpleDisplayerComponentFirerer.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/displayers/listeners/SimpleDisplayerComponentFirerer.java similarity index 96% rename from Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/generics/displayers/listeners/SimpleDisplayerComponentFirerer.java rename to Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/displayers/listeners/SimpleDisplayerComponentFirerer.java index c2758529..e97916e4 100644 --- a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/generics/displayers/listeners/SimpleDisplayerComponentFirerer.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/displayers/listeners/SimpleDisplayerComponentFirerer.java @@ -1,4 +1,4 @@ -package com.pqt.client.module.gui.ressources.generics.displayers.listeners; +package com.pqt.client.gui.ressources.generics.displayers.listeners; import javafx.event.Event; 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 new file mode 100644 index 00000000..67d961b4 --- /dev/null +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/validators/IFXValidatorComponent.java @@ -0,0 +1,9 @@ +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/module/gui/ressources/generics/validators/listeners/IValidatorComponentFirerer.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/validators/listeners/IValidatorComponentFirerer.java similarity index 74% rename from Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/generics/validators/listeners/IValidatorComponentFirerer.java rename to Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/validators/listeners/IValidatorComponentFirerer.java index ab66cdf4..083f6602 100644 --- a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/generics/validators/listeners/IValidatorComponentFirerer.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/validators/listeners/IValidatorComponentFirerer.java @@ -1,4 +1,4 @@ -package com.pqt.client.module.gui.ressources.generics.validators.listeners; +package com.pqt.client.gui.ressources.generics.validators.listeners; public interface IValidatorComponentFirerer { void addListener(IValidatorComponentListener l); diff --git a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/generics/validators/listeners/IValidatorComponentListener.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/validators/listeners/IValidatorComponentListener.java similarity index 67% rename from Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/generics/validators/listeners/IValidatorComponentListener.java rename to Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/validators/listeners/IValidatorComponentListener.java index 57f7198f..34c29bbd 100644 --- a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/generics/validators/listeners/IValidatorComponentListener.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/validators/listeners/IValidatorComponentListener.java @@ -1,4 +1,4 @@ -package com.pqt.client.module.gui.ressources.generics.validators.listeners; +package com.pqt.client.gui.ressources.generics.validators.listeners; import java.util.EventListener; diff --git a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/generics/validators/listeners/SimpleValidatorComponentFirerer.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/validators/listeners/SimpleValidatorComponentFirerer.java similarity index 92% rename from Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/generics/validators/listeners/SimpleValidatorComponentFirerer.java rename to Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/validators/listeners/SimpleValidatorComponentFirerer.java index a06b07e9..ab0c32a1 100644 --- a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/generics/validators/listeners/SimpleValidatorComponentFirerer.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/generics/validators/listeners/SimpleValidatorComponentFirerer.java @@ -1,4 +1,4 @@ -package com.pqt.client.module.gui.ressources.generics.validators.listeners; +package com.pqt.client.gui.ressources.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/specifics/account/IFXAccountsDisplayerComponent.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/account/IFXAccountsDisplayerComponent.java new file mode 100644 index 00000000..29fe49d9 --- /dev/null +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/account/IFXAccountsDisplayerComponent.java @@ -0,0 +1,11 @@ +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 new file mode 100644 index 00000000..12d70b4f --- /dev/null +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/account/listeners/IAccountComponentListener.java @@ -0,0 +1,7 @@ +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/account/listeners/SimpleAccountComponentFirerer.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/account/listeners/SimpleAccountComponentFirerer.java new file mode 100644 index 00000000..d0e5cfbd --- /dev/null +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/account/listeners/SimpleAccountComponentFirerer.java @@ -0,0 +1,10 @@ +package com.pqt.client.gui.ressources.specifics.account.listeners; + +import com.pqt.client.gui.ressources.generics.displayers.listeners.SimpleDisplayerComponentFirerer; +import com.pqt.core.entities.user_account.Account; + +public class SimpleAccountComponentFirerer extends SimpleDisplayerComponentFirerer { + public SimpleAccountComponentFirerer() { + super(IAccountComponentListener.class); + } +} 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 new file mode 100644 index 00000000..d4186480 --- /dev/null +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/products/IFXProductsDisplayerComponent.java @@ -0,0 +1,10 @@ +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 new file mode 100644 index 00000000..45bf72eb --- /dev/null +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/products/listeners/IStockComponentListener.java @@ -0,0 +1,7 @@ +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/module/gui/ressources/specifics/products/listeners/SimpleStockComponentFirerer.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/products/listeners/SimpleStockComponentFirerer.java similarity index 59% rename from Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/specifics/products/listeners/SimpleStockComponentFirerer.java rename to Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/products/listeners/SimpleStockComponentFirerer.java index 0f3b5933..daedf4b0 100644 --- a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/specifics/products/listeners/SimpleStockComponentFirerer.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/products/listeners/SimpleStockComponentFirerer.java @@ -1,6 +1,6 @@ -package com.pqt.client.module.gui.ressources.specifics.products.listeners; +package com.pqt.client.gui.ressources.specifics.products.listeners; -import com.pqt.client.module.gui.ressources.generics.displayers.listeners.SimpleDisplayerComponentFirerer; +import com.pqt.client.gui.ressources.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/specifics/sale/IFXSaleDisplayerComponent.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/sale/IFXSaleDisplayerComponent.java new file mode 100644 index 00000000..e4e8c143 --- /dev/null +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/sale/IFXSaleDisplayerComponent.java @@ -0,0 +1,8 @@ +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/module/gui/ressources/specifics/sale/listeners/ISaleComponentListener.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/sale/listeners/ISaleComponentListener.java similarity index 60% rename from Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/specifics/sale/listeners/ISaleComponentListener.java rename to Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/sale/listeners/ISaleComponentListener.java index bc1284af..cc3510ec 100644 --- a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/specifics/sale/listeners/ISaleComponentListener.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/sale/listeners/ISaleComponentListener.java @@ -1,6 +1,6 @@ -package com.pqt.client.module.gui.ressources.specifics.sale.listeners; +package com.pqt.client.gui.ressources.specifics.sale.listeners; -import com.pqt.client.module.gui.ressources.generics.displayers.listeners.IDisplayerComponentListener; +import com.pqt.client.gui.ressources.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/module/gui/ressources/specifics/sale/listeners/SimpleSaleComponentFirerer.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/sale/listeners/SimpleSaleComponentFirerer.java similarity index 75% rename from Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/specifics/sale/listeners/SimpleSaleComponentFirerer.java rename to Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/sale/listeners/SimpleSaleComponentFirerer.java index fa746589..9a669f88 100644 --- a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/specifics/sale/listeners/SimpleSaleComponentFirerer.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/specifics/sale/listeners/SimpleSaleComponentFirerer.java @@ -1,6 +1,6 @@ -package com.pqt.client.module.gui.ressources.specifics.sale.listeners; +package com.pqt.client.gui.ressources.specifics.sale.listeners; -import com.pqt.client.module.gui.ressources.generics.displayers.listeners.SimpleDisplayerComponentFirerer; +import com.pqt.client.gui.ressources.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/strings/GUIStringTool.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/strings/GUIStringTool.java new file mode 100644 index 00000000..4d33ab11 --- /dev/null +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/strings/GUIStringTool.java @@ -0,0 +1,153 @@ +package com.pqt.client.gui.ressources.strings; + +import com.pqt.core.entities.product.Product; +import com.pqt.core.entities.sale.SaleStatus; +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.util.StringConverter; + +import java.text.NumberFormat; +import java.util.EnumSet; + +//TODO faire ça un peu mieux +public class GUIStringTool { + + private static String saleIdLabel; + + public static String getValidationButtonLabel() { + return "Valider"; + } + + public static String getConfirmationValidationButtonLabel() { + return "Confirmer"; + } + + public static String getCancelButtonLabel() { + return "Annuler"; + } + + public static String getConfirmationCancelButtonLabel() { + return "Confirmer"; + } + + public static String getCategorytabStockDisplayerTitle() { + return "Produits"; + } + + public static IObjectStringRenderer getProductStringRenderer(){ + return product->String.format("%s - %.2f€ (%s)", product.getName(), product.getPrice(), (product.getAmountRemaining()>=30?"30+": Integer.toString(product.getAmountRemaining()))); + } + + public static String getCommandComposerTitleTitle() { + return "Commande"; + } + + public static IObjectWithQuantityStringRenderer getSaleItemStringRenderer(){ + return (product, qte)->String.format("%dx %s", qte, product.getName()); + } + + public static String getPasswordFieldPromptText() { + return "mot de passe"; + } + + public static StringConverter getAccountStringConverter() { + return new StringConverter() { + @Override + public String toString(Account object) { + return String.format("%s - %s)", object.getUsername(), object.getPermissionLevel().name()); + } + + @Override + public Account fromString(String string) { + Account reply = new Account(); + + String[] pieces = string.split(" - "); + reply.setUsername(pieces[0]); + if(pieces.length>1) + for(AccountLevel al : EnumSet.allOf(AccountLevel.class)){ + if(al.name().equals(pieces[1])) + reply.setPermissionLevel(al); + } + + return reply; + } + }; + } + + public static String getLogoutButtonLabel() { + return "Déconnexion"; + } + + public static String getLoginButtonLabel() { + return "Connexion"; + } + + public static IObjectStringRenderer getPriceRenderer() { + return price -> NumberFormat.getCurrencyInstance().format(price); + } + + public static String getSaleMakerTextFieldPromptText() { + return "Auteur"; + } + + public static String getSaleMakerTextFieldLabel() { + return "Fait par : "; + } + + public static String getSaleBeneficiaryTextFieldLabel() { + return "Fait pour : "; + } + + public static String getSaleTypeTextFieldLabel() { + return "Type de paiement : "; + } + + public static String getSalePriceTextFieldLabel() { + return "Prix de la commande : "; + } + + public static StringConverter getSaleTypeStringConverter() { + return new StringConverter() { + @Override + public String toString(SaleType object) { + return object.name(); + } + + @Override + public SaleType fromString(String string) { + return EnumSet.allOf(SaleType.class).stream().filter(type->type.name().equals(string)).findFirst().orElse(null); + } + }; + } + + public static String getSalePriceTextFieldPromptText() { + return getPriceRenderer().render(0d); + } + + public static String getCommandValidationErrorMessage() { + return "La commande n'a pas pu être validée"; + } + + public static String getCommandValidationErrorMessage(Throwable cause) { + return "La commande n'a pas pu être validée : "+cause.getMessage(); + } + + public static String getSaleIdLabel() { + return "Numéro de commande : "; + } + + public static String getSaleStatusLabel() { + return "Etat actuel"; + } + + public static IObjectStringRenderer getSaleStatusRenderer() { + return Enum::name; + } + + public static String getOkButtonLabel() { + return "OK"; + } +} + + diff --git a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/strings/IObjectStringRenderer.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/strings/IObjectStringRenderer.java similarity index 57% rename from Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/strings/IObjectStringRenderer.java rename to Workspace/client/src/main/java/com/pqt/client/gui/ressources/strings/IObjectStringRenderer.java index 98709239..ebbb8c6a 100644 --- a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/strings/IObjectStringRenderer.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/strings/IObjectStringRenderer.java @@ -1,4 +1,4 @@ -package com.pqt.client.module.gui.ressources.strings; +package com.pqt.client.gui.ressources.strings; public interface IObjectStringRenderer { String render(T obj); diff --git a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/strings/IObjectWithQuantityStringRenderer.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/strings/IObjectWithQuantityStringRenderer.java similarity index 64% rename from Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/strings/IObjectWithQuantityStringRenderer.java rename to Workspace/client/src/main/java/com/pqt/client/gui/ressources/strings/IObjectWithQuantityStringRenderer.java index 8cc2fc9c..52dbbed2 100644 --- a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/strings/IObjectWithQuantityStringRenderer.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/strings/IObjectWithQuantityStringRenderer.java @@ -1,4 +1,4 @@ -package com.pqt.client.module.gui.ressources.strings; +package com.pqt.client.gui.ressources.strings; public interface IObjectWithQuantityStringRenderer { String render(T obj, int quantity); diff --git a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/generics/creators/IFXCreatorComponent.java b/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/generics/creators/IFXCreatorComponent.java deleted file mode 100644 index 70b1436d..00000000 --- a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/generics/creators/IFXCreatorComponent.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.pqt.client.module.gui.ressources.generics.creators; - -import com.pqt.client.module.gui.ressources.generics.IFXComponent; - -public interface IFXCreatorComponent extends IFXComponent{ - T create(); - boolean isCreationPossible(); -} diff --git a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/generics/displayers/IFXDisplayerComponent.java b/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/generics/displayers/IFXDisplayerComponent.java deleted file mode 100644 index df7f3e95..00000000 --- a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/generics/displayers/IFXDisplayerComponent.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.pqt.client.module.gui.ressources.generics.displayers; - -import com.pqt.client.module.gui.ressources.generics.IFXComponent; -import com.pqt.client.module.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/module/gui/ressources/generics/validators/IFXValidatorComponent.java b/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/generics/validators/IFXValidatorComponent.java deleted file mode 100644 index 4171c452..00000000 --- a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/generics/validators/IFXValidatorComponent.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.pqt.client.module.gui.ressources.generics.validators; - -import com.pqt.client.module.gui.ressources.generics.IFXComponent; -import com.pqt.client.module.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/module/gui/ressources/specifics/account/IFXAccountsDisplayerComponent.java b/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/specifics/account/IFXAccountsDisplayerComponent.java deleted file mode 100644 index 60b3a247..00000000 --- a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/specifics/account/IFXAccountsDisplayerComponent.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.pqt.client.module.gui.ressources.specifics.account; - -import com.pqt.client.module.gui.ressources.specifics.account.listeners.IAccountComponentListener; -import com.pqt.client.module.gui.ressources.generics.displayers.IFXDisplayerComponent; -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/module/gui/ressources/specifics/account/listeners/IAccountComponentListener.java b/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/specifics/account/listeners/IAccountComponentListener.java deleted file mode 100644 index 23fbf16c..00000000 --- a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/specifics/account/listeners/IAccountComponentListener.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.pqt.client.module.gui.ressources.specifics.account.listeners; - -import com.pqt.client.module.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/module/gui/ressources/specifics/account/listeners/SimpleAccountComponentFirerer.java b/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/specifics/account/listeners/SimpleAccountComponentFirerer.java deleted file mode 100644 index aa16640f..00000000 --- a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/specifics/account/listeners/SimpleAccountComponentFirerer.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.pqt.client.module.gui.ressources.specifics.account.listeners; - -import com.pqt.client.module.gui.ressources.generics.displayers.listeners.SimpleDisplayerComponentFirerer; -import com.pqt.core.entities.user_account.Account; - -public class SimpleAccountComponentFirerer extends SimpleDisplayerComponentFirerer{ - public SimpleAccountComponentFirerer() { - super(IAccountComponentListener.class); - } -} diff --git a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/specifics/products/IFXProductsDisplayerComponent.java b/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/specifics/products/IFXProductsDisplayerComponent.java deleted file mode 100644 index e69a6a85..00000000 --- a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/specifics/products/IFXProductsDisplayerComponent.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.pqt.client.module.gui.ressources.specifics.products; - -import com.pqt.client.module.gui.ressources.specifics.products.listeners.IStockComponentListener; -import com.pqt.client.module.gui.ressources.generics.displayers.IFXDisplayerComponent; -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/module/gui/ressources/specifics/products/listeners/IStockComponentListener.java b/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/specifics/products/listeners/IStockComponentListener.java deleted file mode 100644 index 05a8a695..00000000 --- a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/specifics/products/listeners/IStockComponentListener.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.pqt.client.module.gui.ressources.specifics.products.listeners; - -import com.pqt.client.module.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/module/gui/ressources/specifics/sale/IFXSaleDisplayerComponent.java b/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/specifics/sale/IFXSaleDisplayerComponent.java deleted file mode 100644 index c394a2d3..00000000 --- a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/specifics/sale/IFXSaleDisplayerComponent.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.pqt.client.module.gui.ressources.specifics.sale; - -import com.pqt.client.module.gui.ressources.specifics.sale.listeners.ISaleComponentListener; -import com.pqt.client.module.gui.ressources.generics.displayers.IFXDisplayerComponent; -import com.pqt.core.entities.sale.Sale; - -public interface IFXSaleDisplayerComponent extends IFXDisplayerComponent { -} diff --git a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/strings/GUIStringTool.java b/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/strings/GUIStringTool.java deleted file mode 100644 index 915ffc6b..00000000 --- a/Workspace/client/src/main/java/com/pqt/client/module/gui/ressources/strings/GUIStringTool.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.pqt.client.module.gui.ressources.strings; - -import com.pqt.core.entities.product.Product; - -//TODO faire ça un peu mieux -public class GUIStringTool { - public static String getValidationButtonLabel() { - return "Valider"; - } - - public static String getConfirmationValidationButtonLabel() { - return "Confirmer"; - } - - public static String getCancelButtonLabel() { - return "Annuler"; - } - - public static String getConfirmationCancelButtonLabel() { - return "Confirmer"; - } - - public static String getCategorytabStockDisplayerTitle() { - return "Produits"; - } - - public static IObjectStringRenderer getProductStringRenderer(){ - return product->String.format("%s - %.2f€ (%s)", product.getName(), product.getPrice(), (product.getAmountRemaining()>=30?"30+": Integer.toString(product.getAmountRemaining()))); - } - - public static String getCommandComposerTitleTitle() { - return "Commande"; - } - - public static IObjectWithQuantityStringRenderer getSaleItemStringRenderer(){ - return (product, qté)->String.format("%s - %.2f€ (%s)", product.getName(), product.getPrice(), (product.getAmountRemaining()>=30?"30+": Integer.toString(product.getAmountRemaining()))); - } -} - -