Module Client : déplacement du packg "gui" du packg "client.module" vers le packg "client"

This commit is contained in:
Notmoo 2017-08-13 21:55:25 +02:00
parent 5c1d71f733
commit 29bd24ad65
39 changed files with 519 additions and 155 deletions

View File

@ -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<Account> {
private Pane mainPane;
private HBox mainDisconnectedPane, mainConnectedPane;
private TextField connectedUsernameField;
private ChoiceBox<Account> 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<Account> 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();
}
}

View File

@ -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<Collection<Product>, IStockComponentListener>{
public class CategoryTabStockDisplayer implements IFXDisplayerComponent<Collection<Product>, IStockComponentListener> {
private SimpleStockComponentFirerer firerer;
private BorderPane mainPane;

View File

@ -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 {

View File

@ -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;

View File

@ -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;
}
}

View File

@ -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);
}

View File

@ -0,0 +1,7 @@
package com.pqt.client.gui.ressources.css;
public class GUICssTool {
public static String getGreyIntermediaryPaneCssId(){
return "grey-pane";
}
}

View File

@ -1,4 +1,4 @@
package com.pqt.client.module.gui.ressources.generics;
package com.pqt.client.gui.ressources.generics;
import javafx.scene.layout.Pane;

View File

@ -0,0 +1,8 @@
package com.pqt.client.gui.ressources.generics.creators;
import com.pqt.client.gui.ressources.generics.IFXComponent;
public interface IFXCreatorComponent<T> extends IFXComponent{
T create();
boolean isCreationPossible();
}

View File

@ -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<T, U extends IDisplayerComponentListener> extends IFXComponent{
void display(T content);
void addListener(U l);
void removeListener(U l);
}

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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);
}

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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<Collection<Account>, IAccountComponentListener> {
}

View File

@ -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<Account>{
}

View File

@ -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<Account, IAccountComponentListener> {
public SimpleAccountComponentFirerer() {
super(IAccountComponentListener.class);
}
}

View File

@ -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<Collection<Product>, IStockComponentListener> {
}

View File

@ -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<Product> {
}

View File

@ -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<Product, IStockComponentListener> {

View File

@ -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<Sale, ISaleComponentListener> {
}

View File

@ -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;

View File

@ -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;

View File

@ -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<Product> 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<Product> getSaleItemStringRenderer(){
return (product, qte)->String.format("%dx %s", qte, product.getName());
}
public static String getPasswordFieldPromptText() {
return "mot de passe";
}
public static StringConverter<Account> getAccountStringConverter() {
return new StringConverter<Account>() {
@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<Double> 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<SaleType> getSaleTypeStringConverter() {
return new StringConverter<SaleType>() {
@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<SaleStatus> getSaleStatusRenderer() {
return Enum::name;
}
public static String getOkButtonLabel() {
return "OK";
}
}

View File

@ -1,4 +1,4 @@
package com.pqt.client.module.gui.ressources.strings;
package com.pqt.client.gui.ressources.strings;
public interface IObjectStringRenderer<T> {
String render(T obj);

View File

@ -1,4 +1,4 @@
package com.pqt.client.module.gui.ressources.strings;
package com.pqt.client.gui.ressources.strings;
public interface IObjectWithQuantityStringRenderer<T> {
String render(T obj, int quantity);

View File

@ -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<T> extends IFXComponent{
T create();
boolean isCreationPossible();
}

View File

@ -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<T, U extends IDisplayerComponentListener> extends IFXComponent{
void display(T content);
void addListener(U l);
void removeListener(U l);
}

View File

@ -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);
}

View File

@ -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<Collection<Account>, IAccountComponentListener>{
}

View File

@ -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<Account>{
}

View File

@ -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<Account, IAccountComponentListener>{
public SimpleAccountComponentFirerer() {
super(IAccountComponentListener.class);
}
}

View File

@ -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<Collection<Product>, IStockComponentListener> {
}

View File

@ -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<Product> {
}

View File

@ -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<Sale, ISaleComponentListener> {
}

View File

@ -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<Product> 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<Product> getSaleItemStringRenderer(){
return (product, qté)->String.format("%s - %.2f€ (%s)", product.getName(), product.getPrice(), (product.getAmountRemaining()>=30?"30+": Integer.toString(product.getAmountRemaining())));
}
}