InitIO klappt und wir landen in der senden Funktion

This commit is contained in:
2023-12-18 16:55:17 +01:00
parent f05b0f0014
commit 6642dc8179
5 changed files with 38 additions and 17 deletions
@@ -8,6 +8,7 @@ package ChatProgramm.controller;
import ChatProgramm.controller.commands.CommandConnect;
import ChatProgramm.controller.commands.CommandInvoker;
import ChatProgramm.controller.commands.CommandSend;
import ChatProgramm.model.GrafikModel;
import ChatProgramm.view.ChatView;
import java.awt.Component;
import java.awt.event.ActionEvent;
@@ -20,10 +21,12 @@ import java.awt.event.ActionListener;
public class CommandController implements ActionListener{
private ChatView view;
private GrafikModel model;
private CommandInvoker invoker;
public CommandController(ChatView view){
public CommandController(ChatView view, GrafikModel model){
this.view = view;
this.model = model;
this.invoker = new CommandInvoker();
}
@@ -34,7 +37,7 @@ public class CommandController implements ActionListener{
}
public void registerCommands(){
CommandSend commandSend = new CommandSend(view.getGvZeichenflaeche());
CommandSend commandSend = new CommandSend(view.getGvZeichenflaeche(), model);
invoker.addCommand(view.getBtnConnect(), new CommandConnect(view, commandSend));
//invoker.addCommand(view.getTfNachricht(), commandSend);
}