InitIO klappt und wir landen in der senden Funktion
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user