From 0a9356fdbe20d2135f2d7948f0426910e2f086dd Mon Sep 17 00:00:00 2001 From: "Notmoo-PC\\Notmoo" Date: Sun, 8 Oct 2017 13:19:21 +0200 Subject: [PATCH] =?UTF-8?q?Module=20Client,=20=C3=A9cran=20StartupFrame=20?= =?UTF-8?q?:=20ajout=20des=20classes=20(MVC=20+=20listeners)=20ainsi=20que?= =?UTF-8?q?=20les=20m=C3=A9thds=20de=20base=20(StartupFrame=20non=20foncti?= =?UTF-8?q?onnelle=20actuellement)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/startup_frame/StartupFrame.java | 27 +++++++++++++++++++ .../startup_frame/StartupFrameController.java | 21 +++++++++++++++ .../gui/startup_frame/StartupFrameModel.java | 24 +++++++++++++++++ .../gui/startup_frame/StartupFrameView.java | 26 ++++++++++++++++++ .../listeners/IStartupFrameModelListener.java | 6 +++++ 5 files changed, 104 insertions(+) create mode 100644 Workspace/client/src/main/java/com/pqt/client/gui/startup_frame/StartupFrame.java create mode 100644 Workspace/client/src/main/java/com/pqt/client/gui/startup_frame/StartupFrameController.java create mode 100644 Workspace/client/src/main/java/com/pqt/client/gui/startup_frame/StartupFrameModel.java create mode 100644 Workspace/client/src/main/java/com/pqt/client/gui/startup_frame/StartupFrameView.java create mode 100644 Workspace/client/src/main/java/com/pqt/client/gui/startup_frame/listeners/IStartupFrameModelListener.java diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/startup_frame/StartupFrame.java b/Workspace/client/src/main/java/com/pqt/client/gui/startup_frame/StartupFrame.java new file mode 100644 index 00000000..330a1914 --- /dev/null +++ b/Workspace/client/src/main/java/com/pqt/client/gui/startup_frame/StartupFrame.java @@ -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(); + } +} diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/startup_frame/StartupFrameController.java b/Workspace/client/src/main/java/com/pqt/client/gui/startup_frame/StartupFrameController.java new file mode 100644 index 00000000..2aca60ca --- /dev/null +++ b/Workspace/client/src/main/java/com/pqt/client/gui/startup_frame/StartupFrameController.java @@ -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() + } +} diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/startup_frame/StartupFrameModel.java b/Workspace/client/src/main/java/com/pqt/client/gui/startup_frame/StartupFrameModel.java new file mode 100644 index 00000000..37d29221 --- /dev/null +++ b/Workspace/client/src/main/java/com/pqt/client/gui/startup_frame/StartupFrameModel.java @@ -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); + } +} diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/startup_frame/StartupFrameView.java b/Workspace/client/src/main/java/com/pqt/client/gui/startup_frame/StartupFrameView.java new file mode 100644 index 00000000..9b29aa2b --- /dev/null +++ b/Workspace/client/src/main/java/com/pqt/client/gui/startup_frame/StartupFrameView.java @@ -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; + } +} diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/startup_frame/listeners/IStartupFrameModelListener.java b/Workspace/client/src/main/java/com/pqt/client/gui/startup_frame/listeners/IStartupFrameModelListener.java new file mode 100644 index 00000000..154cfe07 --- /dev/null +++ b/Workspace/client/src/main/java/com/pqt/client/gui/startup_frame/listeners/IStartupFrameModelListener.java @@ -0,0 +1,6 @@ +package com.pqt.client.gui.startup_frame.listeners; + +import java.util.EventListener; + +public interface IStartupFrameModelListener extends EventListener { +}