Search in sources :

Example 1 with ConnectionHandler

use of com.cas.circuit.ConnectionHandler in project TeachingInSimulation by ScOrPiOzzy.

the class LinkMsgHandler method execute.

@Override
public void execute(Client client, Message m) {
    LinkerMsg respMsg = (LinkerMsg) m;
    Nifty nifty = Dispatcher.getIns().getNifty();
    ScreenController screenCtrl = nifty.getCurrentScreen().getScreenController();
    if (screenCtrl instanceof IConnectScreenControl) {
        ConnectionHandler handler = ((IConnectScreenControl) screenCtrl).getConnectionHandler();
        byte type = respMsg.getType();
        if (LinkerMsg.ADD_LINKER == type) {
            handler.connectByOnlineMsg(respMsg);
        } else if (LinkerMsg.DELETE_LINKER == type || LinkerMsg.DELETE_SINGLE_TARGET == type) {
            handler.onlineDeleteLinker(respMsg, type);
        } else if (LinkerMsg.MARK_LINKER == type) {
            handler.onlineMark(respMsg);
        }
    }
}
Also used : ConnectionHandler(com.cas.circuit.ConnectionHandler) Nifty(de.lessvoid.nifty.Nifty) IConnectScreenControl(com.cas.circuit.IConnectScreenControl) ScreenController(de.lessvoid.nifty.screen.ScreenController) LinkerMsg(com.cas.circuit.msg.LinkerMsg)

Aggregations

ConnectionHandler (com.cas.circuit.ConnectionHandler)1 IConnectScreenControl (com.cas.circuit.IConnectScreenControl)1 LinkerMsg (com.cas.circuit.msg.LinkerMsg)1 Nifty (de.lessvoid.nifty.Nifty)1 ScreenController (de.lessvoid.nifty.screen.ScreenController)1