Versuch SendCommand mit invoker zu implementieren
This commit is contained in:
parent
19fd23c638
commit
1aa5b51e78
@ -25,11 +25,14 @@ public class Start
|
||||
ChatView view = new ChatView();
|
||||
GrafikView zeichenflaeche = view.getGvZeichenflaeche();
|
||||
zeichenflaeche.setModel(model);
|
||||
GrafikController controller = new GrafikController(zeichenflaeche, model);
|
||||
controller.registerEvents();
|
||||
|
||||
CommandController controller_commands = new CommandController(view);
|
||||
controller_commands.registerEvents();
|
||||
controller_commands.registerCommands();
|
||||
|
||||
GrafikController controller = new GrafikController(zeichenflaeche, model, controller_commands);
|
||||
controller.registerEvents();
|
||||
|
||||
view.setVisible(true);
|
||||
}
|
||||
|
||||
|
@ -24,9 +24,9 @@ public class GrafikController extends MouseAdapter implements MouseMotionListene
|
||||
{
|
||||
private GrafikView view;
|
||||
private GrafikModel model;
|
||||
private CommandInvoker invoker;
|
||||
private CommandControler commandController;
|
||||
|
||||
public GrafikController(GrafikView view, GrafikModel model)
|
||||
public GrafikController(GrafikView view, GrafikModel model, CommandController controller_commands)
|
||||
{
|
||||
this.view = view;
|
||||
this.model = model;
|
||||
@ -37,10 +37,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.getTfNachricht(), commandSend);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user