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();
|
ChatView view = new ChatView();
|
||||||
GrafikView zeichenflaeche = view.getGvZeichenflaeche();
|
GrafikView zeichenflaeche = view.getGvZeichenflaeche();
|
||||||
zeichenflaeche.setModel(model);
|
zeichenflaeche.setModel(model);
|
||||||
GrafikController controller = new GrafikController(zeichenflaeche, model);
|
|
||||||
controller.registerEvents();
|
|
||||||
CommandController controller_commands = new CommandController(view);
|
CommandController controller_commands = new CommandController(view);
|
||||||
controller_commands.registerEvents();
|
controller_commands.registerEvents();
|
||||||
controller_commands.registerCommands();
|
controller_commands.registerCommands();
|
||||||
|
|
||||||
|
GrafikController controller = new GrafikController(zeichenflaeche, model, controller_commands);
|
||||||
|
controller.registerEvents();
|
||||||
|
|
||||||
view.setVisible(true);
|
view.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,9 +24,9 @@ public class GrafikController extends MouseAdapter implements MouseMotionListene
|
|||||||
{
|
{
|
||||||
private GrafikView view;
|
private GrafikView view;
|
||||||
private GrafikModel model;
|
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.view = view;
|
||||||
this.model = model;
|
this.model = model;
|
||||||
@ -37,10 +37,7 @@ public class GrafikController extends MouseAdapter implements MouseMotionListene
|
|||||||
view.addMouseMotionListener(this);
|
view.addMouseMotionListener(this);
|
||||||
view.addMouseListener(this);
|
view.addMouseListener(this);
|
||||||
}
|
}
|
||||||
public void registerCommands(){
|
|
||||||
CommandSend commandSend = new CommandSend(view);
|
|
||||||
invoker.addCommand(view.getTfNachricht(), commandSend);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user