mirror of
https://github.com/klmp200/PQT_Gestionnaire_vente_stock.git
synced 2024-12-22 15:31:08 +00:00
Module Client : ajustements GUI (écran de vente)
This commit is contained in:
parent
aaaa45039e
commit
1d0628ffe9
@ -65,14 +65,20 @@ class SaleScreenController {
|
||||
return model.getCurrentSale();
|
||||
}
|
||||
|
||||
void updateView(){
|
||||
private void updateSale(){
|
||||
view.setSale(getCurrentSale());
|
||||
view.setValidationButtonEnabled(model.checkValidity(getCurrentSale()));
|
||||
}
|
||||
|
||||
private void updateData(){
|
||||
view.setProducts(fetchProductList());
|
||||
view.setSaleTypes(fetchSaleTypeList());
|
||||
view.setAccounts(fetchAccountList());
|
||||
}
|
||||
|
||||
view.setSale(getCurrentSale());
|
||||
|
||||
view.setValidationButtonEnabled(model.checkValidity(getCurrentSale()));
|
||||
void updateView(){
|
||||
updateData();
|
||||
updateSale();
|
||||
}
|
||||
|
||||
private List<Product> fetchProductList(){
|
||||
@ -90,7 +96,7 @@ class SaleScreenController {
|
||||
@Override
|
||||
public void onComponentClickEvent(Event event, Product product) {
|
||||
model.removeProductFromSale(product);
|
||||
SaleScreenController.this.updateView();
|
||||
SaleScreenController.this.updateSale();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -117,8 +123,10 @@ class SaleScreenController {
|
||||
|
||||
@Override
|
||||
public void onContentClickEvent(Event event, Product eventTarget) {
|
||||
model.addProductToSale(eventTarget);
|
||||
SaleScreenController.this.updateView();
|
||||
if(eventTarget!=null) {
|
||||
model.addProductToSale(eventTarget);
|
||||
SaleScreenController.this.updateSale();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -5,6 +5,7 @@ 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.components.generics.IFXComponent;
|
||||
import com.pqt.client.gui.ressources.css.GUICssTool;
|
||||
import com.pqt.client.gui.ressources.strings.GUIStringTool;
|
||||
import com.pqt.client.gui.ressources.components.CategoryTabStockDisplayer;
|
||||
import com.pqt.core.entities.product.Product;
|
||||
@ -45,7 +46,7 @@ class SaleScreenView implements IFXComponent {
|
||||
|
||||
private void initGui() {
|
||||
mainPane = new StackPane();
|
||||
mainPane.getStyleClass().add("main-module-pane");
|
||||
mainPane.getStyleClass().add(GUICssTool.getMainModulePaneCssClass());
|
||||
|
||||
mainPaneContent = new BorderPane();
|
||||
|
||||
@ -142,7 +143,7 @@ class SaleScreenView implements IFXComponent {
|
||||
|
||||
Pane greyIntermediaryPane = new Pane();
|
||||
greyIntermediaryPane.getStyleClass().clear();
|
||||
greyIntermediaryPane.getStyleClass().add("grey-intermediary-pane");
|
||||
greyIntermediaryPane.getStyleClass().add(GUICssTool.getIntermediaryPaneStyleClass());
|
||||
|
||||
saleValidationScreen = new SaleValidationScreen(saleId, sale);
|
||||
saleValidationScreen.addListener(ctrl.getSaleValidationScreenListener());
|
||||
|
@ -2,6 +2,7 @@ package com.pqt.client.gui.modules.sale_screen.sale_validation_screen;
|
||||
|
||||
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.css.GUICssTool;
|
||||
import com.pqt.client.gui.ressources.strings.GUIStringTool;
|
||||
import com.pqt.core.entities.sale.Sale;
|
||||
import com.pqt.core.entities.sale.SaleStatus;
|
||||
@ -32,6 +33,7 @@ public class SaleValidationScreen {
|
||||
public SaleValidationScreen(long saleId, Sale sale) {
|
||||
listeners = new EventListenerList();
|
||||
mainPane = new Pane();
|
||||
mainPane.getStyleClass().add(GUICssTool.getMainModulePaneCssClass());
|
||||
|
||||
saleStatus = sale.getStatus();
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.pqt.client.gui.modules.stat_screen;
|
||||
|
||||
import com.pqt.client.gui.ressources.components.generics.IFXComponent;
|
||||
import com.pqt.client.gui.ressources.css.GUICssTool;
|
||||
import com.sun.deploy.util.StringUtils;
|
||||
import javafx.application.Platform;
|
||||
import javafx.scene.control.TextArea;
|
||||
@ -22,7 +23,7 @@ class StatScreenView implements IFXComponent {
|
||||
|
||||
private void initGui() {
|
||||
mainPane = new Pane();
|
||||
mainPane.getStyleClass().add("main-module-pane");
|
||||
mainPane.getStyleClass().add(GUICssTool.getMainModulePaneCssClass());
|
||||
|
||||
statTextArea = new TextArea();
|
||||
mainPane.getChildren().add(statTextArea);
|
||||
|
@ -3,6 +3,7 @@ package com.pqt.client.gui.ressources.components;
|
||||
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.css.GUICssTool;
|
||||
import com.pqt.client.gui.ressources.strings.GUIStringTool;
|
||||
import com.pqt.client.gui.ressources.strings.IObjectStringRenderer;
|
||||
import com.pqt.core.entities.product.Product;
|
||||
@ -33,7 +34,7 @@ public class CategoryTabStockDisplayer implements IFXDisplayerComponent<Collecti
|
||||
|
||||
@Override
|
||||
public void display(Collection<Product> content) {
|
||||
final ObservableList<Tab> tabs = FXCollections.emptyObservableList();
|
||||
final ObservableList<Tab> tabs = FXCollections.observableArrayList();
|
||||
if(content!=null){
|
||||
List<String> categories = content.stream().map(product->product.getCategory().getName()).distinct().collect(Collectors.toList());
|
||||
|
||||
@ -70,6 +71,7 @@ public class CategoryTabStockDisplayer implements IFXDisplayerComponent<Collecti
|
||||
|
||||
Label title = new Label(GUIStringTool.getCategorytabStockDisplayerTitle());
|
||||
title.setAlignment(Pos.CENTER);
|
||||
title.getStyleClass().add(GUICssTool.getTitleTextStyleClass());
|
||||
|
||||
HBox topPane = new HBox();
|
||||
topPane.setFillHeight(true);
|
||||
@ -104,10 +106,14 @@ public class CategoryTabStockDisplayer implements IFXDisplayerComponent<Collecti
|
||||
|
||||
listView.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
|
||||
listView.setEditable(false);
|
||||
listView.setOnMouseClicked(event->firerer.fireContentClickEvent(event, listView.getSelectionModel().getSelectedItem()));
|
||||
listView.setOnMouseClicked(event->{
|
||||
firerer.fireContentClickEvent(event, listView.getSelectionModel().getSelectedItem());
|
||||
Platform.runLater(()->listView.getSelectionModel().clearSelection(listView.getSelectionModel().getSelectedIndex()));
|
||||
});
|
||||
listView.setOnKeyTyped(event -> {
|
||||
if(event.getCode().equals(KeyCode.ENTER)){
|
||||
firerer.fireContentClickEvent(event, listView.getSelectionModel().getSelectedItem());
|
||||
Platform.runLater(()->listView.getSelectionModel().clearSelection(listView.getSelectionModel().getSelectedIndex()));
|
||||
event.consume();
|
||||
}
|
||||
});
|
||||
@ -119,6 +125,6 @@ public class CategoryTabStockDisplayer implements IFXDisplayerComponent<Collecti
|
||||
}
|
||||
|
||||
private static IObjectStringRenderer<Product> getProductRenderer(){
|
||||
return GUIStringTool.getProductStringRenderer();
|
||||
return GUIStringTool.getDetailledProductStringRenderer();
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package com.pqt.client.gui.ressources.components;
|
||||
import com.pqt.client.gui.ressources.components.specifics.sale.IFXSaleDisplayerComponent;
|
||||
import com.pqt.client.gui.ressources.components.specifics.sale.listeners.ISaleComponentListener;
|
||||
import com.pqt.client.gui.ressources.components.specifics.sale.listeners.SimpleSaleComponentFirerer;
|
||||
import com.pqt.client.gui.ressources.css.GUICssTool;
|
||||
import com.pqt.client.gui.ressources.strings.GUIStringTool;
|
||||
import com.pqt.core.entities.product.Product;
|
||||
import com.pqt.core.entities.sale.Sale;
|
||||
@ -35,6 +36,8 @@ public class CommandComposerSaleDisplayer implements IFXSaleDisplayerComponent {
|
||||
mainPane.getStyleClass().add("sale-displayer");
|
||||
|
||||
Label title = new Label(GUIStringTool.getCommandComposerTitleTitle());
|
||||
title.setAlignment(Pos.CENTER);
|
||||
title.getStyleClass().add(GUICssTool.getTitleTextStyleClass());
|
||||
|
||||
HBox topPane = new HBox();
|
||||
topPane.setFillHeight(true);
|
||||
@ -74,7 +77,10 @@ public class CommandComposerSaleDisplayer implements IFXSaleDisplayerComponent {
|
||||
return;
|
||||
|
||||
this.sale = content;
|
||||
Platform.runLater(()->this.listView.setItems(FXCollections.observableList(new ArrayList<>(this.sale.getProducts().keySet()))));
|
||||
Platform.runLater(()->{
|
||||
this.listView.getItems().clear();
|
||||
this.listView.getItems().addAll(this.sale.getProducts().keySet());
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -6,7 +6,7 @@
|
||||
-fx-font-size: 11pt;
|
||||
-fx-font-family: "Segoe UI Semibold";
|
||||
-fx-text-fill: white;
|
||||
-fx-opacity: 0.6;
|
||||
-fx-opacity: 0.8;
|
||||
}
|
||||
|
||||
.label-bright {
|
||||
@ -17,12 +17,37 @@
|
||||
}
|
||||
|
||||
.label-header {
|
||||
-fx-font-size: 32pt;
|
||||
-fx-font-family: "Segoe UI Light";
|
||||
-fx-font-size: 25pt;
|
||||
-fx-font-family: "Segoe UI";
|
||||
-fx-text-fill: white;
|
||||
-fx-opacity: 1;
|
||||
}
|
||||
|
||||
.tab {
|
||||
-fx-background-color: #3a3a3a;
|
||||
}
|
||||
|
||||
.tab-label {
|
||||
-fx-text-fill: white;
|
||||
}
|
||||
|
||||
.tab:selected {
|
||||
-fx-background-color: #4d4d4d;
|
||||
}
|
||||
|
||||
.tab-pane *.tab-header-background {
|
||||
-fx-background-color: #1d1d1d;
|
||||
-fx-border-width: 1px;
|
||||
-fx-border-radius: 1px;
|
||||
-fx-border-color: gray;
|
||||
}
|
||||
|
||||
.tab-pane {
|
||||
-fx-border-width: 2px;
|
||||
-fx-border-radius: 1px;
|
||||
-fx-border-color: gray;
|
||||
}
|
||||
|
||||
.list-view {
|
||||
-fx-base: #1d1d1d;
|
||||
-fx-control-inner-background: #1d1d1d;
|
||||
@ -30,6 +55,9 @@
|
||||
-fx-table-cell-border-color: transparent;
|
||||
-fx-table-header-border-color: transparent;
|
||||
-fx-padding: 5;
|
||||
-fx-border-width: 2px;
|
||||
-fx-border-radius: 1px;
|
||||
-fx-border-color: gray;
|
||||
}
|
||||
|
||||
.list-view .list-cell .label{
|
||||
@ -165,7 +193,7 @@
|
||||
.button:focused {
|
||||
-fx-border-color: white, white;
|
||||
-fx-border-width: 1, 1;
|
||||
-fx-border-style: solid, segments(1, 1);
|
||||
-fx-border-style: solid;
|
||||
-fx-border-radius: 0, 0;
|
||||
-fx-border-insets: 1 1 1 1, 0;
|
||||
}
|
||||
@ -202,11 +230,13 @@
|
||||
|
||||
.grey-intermediary-pane {
|
||||
-fx-background-color: #1d1d1d;
|
||||
-fx-opacity: 60%;
|
||||
-fx-opacity: 85%;
|
||||
}
|
||||
|
||||
.main-module-pane {
|
||||
-fx-padding: 10 10 10 10;
|
||||
-fx-border-width: 2px;
|
||||
-fx-border-color: whitesmoke;
|
||||
}
|
||||
|
||||
.validator {
|
||||
@ -222,11 +252,11 @@
|
||||
.sidebar {
|
||||
-fx-background-color: #2e2e2e;
|
||||
-fx-padding: 5 22 5 22;
|
||||
-fx-border-color: #e2e2e2;
|
||||
-fx-border-color: whitesmoke;
|
||||
-fx-border-width: 2;
|
||||
-fx-background-radius: 0;
|
||||
-fx-background-insets: 0 0 0 0, 0, 1, 2;
|
||||
-pqt-expanded-width : 200px;
|
||||
-pqt-expanded-width : 175px;
|
||||
}
|
||||
|
||||
.tool-bar {
|
||||
|
Loading…
Reference in New Issue
Block a user