
Transmitterinterface raus, nur noch ein Controller und ein Chatmodel mit GrafikDaten anstatt GrafikModel das einzige was noch nicht so ist wie in seinem UML ist, dass das Chatmodel kein Subscriber ist sondern immernoch der Transmitter
56 lines
1.1 KiB
Java
56 lines
1.1 KiB
Java
/*
|
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
|
*/
|
|
|
|
package ChatProgramm.controller.commands;
|
|
|
|
import ChatProgramm.model.ChatModel;
|
|
import ChatProgramm.model.Figur;
|
|
import ChatProgramm.util.OhmLogger;
|
|
import ChatProgramm.view.ChatView;
|
|
import java.util.logging.Logger;
|
|
|
|
/**
|
|
*
|
|
* @author ahren
|
|
*/
|
|
public class CommandSend implements CommandInterface
|
|
{
|
|
private static Logger lg = OhmLogger.getLogger();
|
|
|
|
private ChatView view;
|
|
private ChatModel model;
|
|
|
|
public CommandSend(ChatView view, ChatModel model)
|
|
{
|
|
this.view = view;
|
|
this.model = model;
|
|
}
|
|
|
|
@Override
|
|
public void execute()
|
|
{
|
|
Figur aktuelleFigur = model.getGrafikDaten().getFiguren().getLast();
|
|
try
|
|
{
|
|
model.getTransmitter().send(aktuelleFigur);
|
|
}
|
|
catch(Exception NullPointerExeption)
|
|
{
|
|
lg.info("Der Transmitter ist null");
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public boolean isUndoable()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
@Override
|
|
public void undo()
|
|
{
|
|
}
|
|
}
|