From f58b06d0b9f57bf5ed99f1629aec44b72466b943 Mon Sep 17 00:00:00 2001 From: hzzz Date: Thu, 12 Jul 2018 08:57:39 +0800 Subject: [PATCH 1/2] . --- .../main/java/com/fr/start/module/DesignerActivator.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java index 2090c0ff58..12a7e9c058 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java @@ -51,8 +51,6 @@ import com.fr.design.mainframe.loghandler.DesignerLogAppender; import com.fr.design.mainframe.loghandler.DesignerLogImpl; import com.fr.design.mainframe.loghandler.LogMessageBar; import com.fr.design.mainframe.socketio.DesignerSocketIO; -import com.fr.env.operator.socket.FineSocketInfoOperator; -import com.fr.env.operator.socket.SocketInfoOperator; import com.fr.design.module.DesignModuleFactory; import com.fr.design.parameter.FormParameterReader; import com.fr.design.parameter.ParameterPropertyPane; @@ -100,8 +98,6 @@ import com.fr.stable.script.ValueConverter; import com.fr.stable.xml.ObjectTokenizer; import com.fr.stable.xml.ObjectXMLWriterFinder; import com.fr.start.BBSGuestPaneProvider; -import com.fr.workspace.base.WorkspaceKey; -import com.fr.workspace.pool.WorkPRCRegister; import com.fr.xml.ReportXMLUtils; import java.awt.Image; @@ -413,8 +409,5 @@ public class DesignerActivator extends Activator implements Prepare { public void prepare() { addMutable(InterMutableKey.Path, "com/fr/design/i18n/main", "com/fr/design/i18n/chart"); - - addMutable(WorkspaceKey.RPC, WorkPRCRegister.wrap(SocketInfoOperator.class, new FineSocketInfoOperator())); - } } \ No newline at end of file From 62dfc93919260599e44ddccbeff7b4af2f5125e8 Mon Sep 17 00:00:00 2001 From: hzzz Date: Thu, 12 Jul 2018 09:21:56 +0800 Subject: [PATCH 2/2] disconnecte --- .../design/mainframe/socketio/DesignerSocketIO.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java index a44bdf8b20..8908fb9821 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java @@ -1,8 +1,10 @@ package com.fr.design.mainframe.socketio; import com.fr.decision.webservice.utils.DecisionServiceConstants; +import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.loghandler.DesignerLogHandler; import com.fr.env.operator.socket.SocketInfoOperator; +import com.fr.general.Inter; import com.fr.general.LogRecordTime; import com.fr.general.LogUtils; import com.fr.log.FineLoggerFactory; @@ -15,6 +17,8 @@ import io.socket.client.IO; import io.socket.client.Socket; import io.socket.emitter.Emitter; +import javax.swing.JOptionPane; +import javax.swing.UIManager; import java.io.ByteArrayInputStream; import java.io.IOException; import java.net.URI; @@ -54,6 +58,13 @@ public class DesignerSocketIO { String uri = getSocketUri(current); socketIO = Optional.of(IO.socket(new URI(uri))); socketIO.get().on(WorkspaceConstants.WS_LOGRECORD, printLog); + socketIO.get().on(Socket.EVENT_DISCONNECT, new Emitter.Listener() { + @Override + public void call(Object... objects) { + JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"Fine-Designer_Basic_Remote_Disconnected"}), + null, 0, UIManager.getIcon("OptionPane.errorIcon")); + } + }); socketIO.get().connect(); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e);