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:
Notmoo-PC\Notmoo 2017-10-08 13:19:21 +02:00
parent 8ce7fba7a9
commit 0a9356fdbe
5 changed files with 104 additions and 0 deletions

View File

@ -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();
}
}

View File

@ -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()
}
}

View File

@ -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);
}
}

View File

@ -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;
}
}

View File

@ -0,0 +1,6 @@
package com.pqt.client.gui.startup_frame.listeners;
import java.util.EventListener;
public interface IStartupFrameModelListener extends EventListener {
}