mirror of
https://github.com/klmp200/PQT_Gestionnaire_vente_stock.git
synced 2024-11-22 08:13:20 +00:00
Module Client, écran StartupFrame : ajout des classes (MVC + listeners) ainsi que les méthds de base (StartupFrame non fonctionnelle actuellement)
This commit is contained in:
parent
8ce7fba7a9
commit
0a9356fdbe
@ -0,0 +1,27 @@
|
||||
package com.pqt.client.gui.startup_frame;
|
||||
|
||||
import com.pqt.client.gui.ressources.components.generics.IFXComponent;
|
||||
import com.pqt.client.module.account.AccountService;
|
||||
import com.pqt.client.module.network.NetworkService;
|
||||
import javafx.scene.layout.Pane;
|
||||
|
||||
public class StartupFrame implements IFXComponent{
|
||||
|
||||
private StartupFrameView view;
|
||||
private StartupFrameController ctrl;
|
||||
|
||||
public StartupFrame(AccountService accountService, NetworkService networkService) {
|
||||
StartupFrameModel model = new StartupFrameModel(accountService, networkService);
|
||||
ctrl = new StartupFrameController(model);
|
||||
model.addListener(ctrl);
|
||||
|
||||
view = new StartupFrameView(ctrl);
|
||||
ctrl.setView(view);
|
||||
ctrl.updateView();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pane getMainPane() {
|
||||
return view.getMainPane();
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.pqt.client.gui.startup_frame;
|
||||
|
||||
import com.pqt.client.gui.startup_frame.listeners.IStartupFrameModelListener;
|
||||
|
||||
public class StartupFrameController implements IStartupFrameModelListener {
|
||||
|
||||
private final StartupFrameModel model;
|
||||
private StartupFrameView view;
|
||||
|
||||
public StartupFrameController(StartupFrameModel model) {
|
||||
this.model = model;
|
||||
}
|
||||
|
||||
public void setView(StartupFrameView view) {
|
||||
this.view = view;
|
||||
}
|
||||
|
||||
public void updateView() {
|
||||
//TODO écrire corps méthd StartupFrameController.updateView()
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.pqt.client.gui.startup_frame;
|
||||
|
||||
import com.pqt.client.gui.startup_frame.listeners.IStartupFrameModelListener;
|
||||
import com.pqt.client.module.account.AccountService;
|
||||
import com.pqt.client.module.network.NetworkService;
|
||||
|
||||
import javax.swing.event.EventListenerList;
|
||||
|
||||
public class StartupFrameModel {
|
||||
|
||||
private final AccountService accountService;
|
||||
private final NetworkService networkService;
|
||||
private final EventListenerList listenerList;
|
||||
|
||||
public StartupFrameModel(AccountService accountService, NetworkService networkService) {
|
||||
this.accountService = accountService;
|
||||
this.networkService = networkService;
|
||||
this.listenerList = new EventListenerList();
|
||||
}
|
||||
|
||||
public void addListener(IStartupFrameModelListener ctrl) {
|
||||
listenerList.add(IStartupFrameModelListener.class, ctrl);
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.pqt.client.gui.startup_frame;
|
||||
|
||||
import com.pqt.client.gui.ressources.components.generics.IFXComponent;
|
||||
import javafx.scene.layout.BorderPane;
|
||||
import javafx.scene.layout.Pane;
|
||||
|
||||
public class StartupFrameView implements IFXComponent{
|
||||
|
||||
private BorderPane mainPane;
|
||||
private final StartupFrameController ctrl;
|
||||
|
||||
public StartupFrameView(StartupFrameController ctrl) {
|
||||
this.ctrl = ctrl;
|
||||
initGui();
|
||||
}
|
||||
|
||||
private void initGui() {
|
||||
mainPane = new BorderPane();
|
||||
//TODO ajouter GUI StartupFrameView
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pane getMainPane() {
|
||||
return mainPane;
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
package com.pqt.client.gui.startup_frame.listeners;
|
||||
|
||||
import java.util.EventListener;
|
||||
|
||||
public interface IStartupFrameModelListener extends EventListener {
|
||||
}
|
Loading…
Reference in New Issue
Block a user