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 { +}