mirror of
https://github.com/klmp200/PQT_Gestionnaire_vente_stock.git
synced 2024-11-25 10:34:15 +00:00
Module Client : update GUi suite modif services; Ajout clss ClientBackEndModuleManager pour gérer l'instanciation des services; Ajout TODO dans clss Main
This commit is contained in:
parent
2161dc2b72
commit
3b735c18ae
@ -5,15 +5,10 @@ import com.pqt.client.gui.modules.account_screen.AccountScreen;
|
||||
import com.pqt.client.gui.modules.sale_screen.SaleScreen;
|
||||
import com.pqt.client.gui.modules.stat_screen.StatScreen;
|
||||
import com.pqt.client.gui.modules.stock_screen.StockScreen;
|
||||
import com.pqt.client.gui.ressources.components.generics.others.SideBar;
|
||||
import com.pqt.client.gui.ressources.components.generics.others.listeners.ISideBarListener;
|
||||
import com.pqt.client.gui.ressources.components.generics.toast.ToastFactory;
|
||||
import com.pqt.client.gui.ressources.css.GUICssTool;
|
||||
import com.pqt.client.gui.ressources.strings.GUIStringTool;
|
||||
import com.pqt.client.module.account.AccountService;
|
||||
import com.pqt.client.module.sale.SaleService;
|
||||
import com.pqt.client.module.stat.StatService;
|
||||
import com.pqt.client.module.stock.StockService;
|
||||
import com.pqt.client.module.ClientBackEndModuleManager;
|
||||
import javafx.application.Application;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.stage.Stage;
|
||||
@ -26,16 +21,15 @@ public class Main extends Application{
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws Exception {
|
||||
SaleService saleService = new SaleService();
|
||||
StockService stockService = new StockService();
|
||||
AccountService accountService = new AccountService();
|
||||
StatService statService = new StatService();
|
||||
//TODO ajouter écran de préloading
|
||||
|
||||
MainFrame mainFrame = new MainFrame(accountService);
|
||||
mainFrame.addModule(new SaleScreen(accountService, stockService, saleService), true);
|
||||
mainFrame.addModule(new StockScreen(stockService, accountService));
|
||||
mainFrame.addModule(new StatScreen(statService));
|
||||
mainFrame.addModule(new AccountScreen(accountService));
|
||||
ClientBackEndModuleManager moduleManager = new ClientBackEndModuleManager(null);
|
||||
|
||||
MainFrame mainFrame = new MainFrame(moduleManager.getAccountService());
|
||||
mainFrame.addModule(new SaleScreen(moduleManager.getAccountService(), moduleManager.getStockService(), moduleManager.getSaleService()), true);
|
||||
mainFrame.addModule(new StockScreen(moduleManager.getStockService(), moduleManager.getAccountService()));
|
||||
mainFrame.addModule(new StatScreen(moduleManager.getStatService()));
|
||||
mainFrame.addModule(new AccountScreen(moduleManager.getAccountService()));
|
||||
|
||||
|
||||
Scene scene = new Scene(mainFrame.getPane(), 800, 600);
|
||||
|
@ -23,6 +23,11 @@ class MainFrameModel {
|
||||
MainFrameModel.this.fireAccountStatusChangedEvent(status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAccountStatusNotChangedEvent(Throwable cause) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAccountListChangedEvent() {
|
||||
MainFrameModel.this.fireAccountCollectionChangedEvent();
|
||||
|
@ -104,6 +104,11 @@ class SaleScreenModel {
|
||||
fireAccountConnectedStatusUpdateEvent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAccountStatusNotChangedEvent(Throwable cause) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAccountListChangedEvent() {
|
||||
fireAccountListUpdatedEvent();
|
||||
|
@ -34,6 +34,11 @@ class StockScreenModel {
|
||||
StockScreenModel.this.fireConnectedStatusChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAccountStatusNotChangedEvent(Throwable cause) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAccountListChangedEvent() {
|
||||
|
||||
|
@ -0,0 +1,41 @@
|
||||
package com.pqt.client.module;
|
||||
|
||||
import com.pqt.client.module.account.AccountService;
|
||||
import com.pqt.client.module.connection.ConnectionService;
|
||||
import com.pqt.client.module.query.QueryExecutor;
|
||||
import com.pqt.client.module.sale.SaleService;
|
||||
import com.pqt.client.module.stat.StatService;
|
||||
import com.pqt.client.module.stock.StockService;
|
||||
|
||||
public class ClientBackEndModuleManager {
|
||||
|
||||
private SaleService saleService;
|
||||
private StockService stockService;
|
||||
private AccountService accountService;
|
||||
private StatService statService;
|
||||
|
||||
public ClientBackEndModuleManager(String serverUrl) {
|
||||
ConnectionService connectionService = new ConnectionService(serverUrl);
|
||||
QueryExecutor queryExecutor = new QueryExecutor(connectionService);
|
||||
saleService = new SaleService(queryExecutor);
|
||||
stockService = new StockService(queryExecutor);
|
||||
accountService = new AccountService(queryExecutor);
|
||||
statService = new StatService(queryExecutor);
|
||||
}
|
||||
|
||||
public SaleService getSaleService() {
|
||||
return saleService;
|
||||
}
|
||||
|
||||
public StockService getStockService() {
|
||||
return stockService;
|
||||
}
|
||||
|
||||
public AccountService getAccountService() {
|
||||
return accountService;
|
||||
}
|
||||
|
||||
public StatService getStatService() {
|
||||
return statService;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user