wir hängen irgendwo in der IO

This commit is contained in:
ahren
2023-12-18 13:56:06 +01:00
parent e7034fc7a4
commit ba0f12561b
6 changed files with 64 additions and 41 deletions
@@ -34,7 +34,7 @@ public class CommandController implements ActionListener{
}
public void registerCommands(){
CommandSend commandSend = new CommandSend(view);
CommandSend commandSend = new CommandSend(view.getGvZeichenflaeche());
invoker.addCommand(view.getBtnConnect(), new CommandConnect(view, commandSend));
//invoker.addCommand(view.getTfNachricht(), commandSend);
}
@@ -5,8 +5,6 @@
package ChatProgramm.controller;
import ChatProgramm.controller.commands.CommandConnect;
import ChatProgramm.controller.commands.CommandInvoker;
import ChatProgramm.controller.commands.CommandSend;
import java.awt.Point;
import java.awt.event.MouseAdapter;
@@ -14,7 +12,6 @@ import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;
import ChatProgramm.model.GrafikModel;
import ChatProgramm.view.GrafikView;
import java.awt.Component;
/**
*
@@ -24,12 +21,13 @@ public class GrafikController extends MouseAdapter implements MouseMotionListene
{
private GrafikView view;
private GrafikModel model;
private CommandInvoker invoker;
private CommandSend commandSend;
public GrafikController(GrafikView view, GrafikModel model)
{
this.view = view;
this.model = model;
commandSend = new CommandSend(view);
}
public void registerEvents()
@@ -37,10 +35,7 @@ public class GrafikController extends MouseAdapter implements MouseMotionListene
view.addMouseMotionListener(this);
view.addMouseListener(this);
}
public void registerCommands(){
CommandSend commandSend = new CommandSend(view);
invoker.addCommand(view.getTNachricht(), commandSend);
}
@Override
@@ -60,8 +55,7 @@ public class GrafikController extends MouseAdapter implements MouseMotionListene
public void mouseReleased(MouseEvent evt)
{
model.endShape();
Component key = (Component)evt.getSource();
invoker.executeCommand(key);
commandSend.execute();
// if (evt.getButton() == MouseEvent.BUTTON3)
// {
// view.doPrint();
@@ -43,6 +43,7 @@ public class CommandSend implements CommandInterface
@Override
public void execute()
{
lg.info("wir sind drin");
//ToDo in dieser methode muss die Figur serialisiert werden und zum
//übermitteln bereitgestellt werden