From ce9b3c71b0cdaf6f004417d957f3b3160c4fd2ef Mon Sep 17 00:00:00 2001 From: Maksim Date: Mon, 9 Dec 2019 15:49:45 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E5=BB=BA=E7=AB=8Bsocket=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E9=87=8D=E8=AF=95=E6=9C=BA=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/socketio/DesignerSocketIO.java | 167 +++++++++++------- 1 file changed, 104 insertions(+), 63 deletions(-) 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 e2b13b1ad..8ce0bdcec 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 @@ -13,7 +13,6 @@ import com.fr.report.RemoteDesignConstants; import com.fr.serialization.SerializerHelper; import com.fr.stable.ArrayUtils; import com.fr.third.apache.log4j.spi.LoggingEvent; -import com.fr.third.guava.base.Optional; import com.fr.workspace.WorkContext; import com.fr.workspace.Workspace; import com.fr.workspace.base.WorkspaceConstants; @@ -36,28 +35,19 @@ public class DesignerSocketIO { Disconnecting } - private static Optional socketIO = Optional.absent(); + private static Socket socket = null; private static Status status = Status.Disconnected; + //维护一个当前工作环境的uri列表 + private static String[] uri; + //维护一个关于uri列表的计数器 + private static int count; - private static final Emitter.Listener printLog = new Emitter.Listener() { - @Override - public void call(Object... objects) { - if (ArrayUtils.isNotEmpty(objects)) { - try { - LoggingEvent event = SerializerHelper.deserialize((byte[]) objects[0]); - DesignerLogger.log(event); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - } - } - }; public static void close() { - if (socketIO.isPresent()) { + if (socket != null) { status = Status.Disconnecting; - socketIO.get().close(); - socketIO = Optional.absent(); + socket.close(); + socket = null; } } @@ -66,57 +56,42 @@ public class DesignerSocketIO { if (current.isLocal()) { return; } + //每当更换工作环境,更新uri列表,同时更新计数器count try { - String[] uri = getSocketUri(current); - socketIO = Optional.of(IO.socket(new URI(uri[0]))); - socketIO.get().on(WorkspaceConstants.WS_LOGRECORD, printLog); - socketIO.get().on(WorkspaceConstants.CONFIG_MODIFY, new Emitter.Listener() { - @Override - public void call(Object... objects) { - assert objects != null && objects.length == 1; - String param = (String) objects[0]; - EventDispatcher.fire(RemoteConfigEvent.EDIT, param); - } - }); - socketIO.get().on(Socket.EVENT_DISCONNECT, new Emitter.Listener() { - @Override - public void call(Object... objects) { - /* - * todo 远程心跳断开不一定 socketio 断开 和远程紧密相关的业务都绑定在心跳上,切换成心跳断开之后进行提醒, - * socketio 只用推日志和通知配置变更 - */ - if (status != Status.Disconnecting) { - try { - UIUtil.invokeAndWaitIfNeeded(new Runnable() { - @Override - public void run() { - JOptionPane.showMessageDialog( - DesignerContext.getDesignerFrame(), - Toolkit.i18nText("Fine-Design_Basic_Remote_Disconnected"), - UIManager.getString("OptionPane.messageDialogTitle"), - JOptionPane.ERROR_MESSAGE, - UIManager.getIcon("OptionPane.errorIcon")); - EnvChangeEntrance.getInstance().chooseEnv(); - } - }); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - } - status = Status.Disconnected; - } - }); - socketIO.get().connect(); - status = Status.Connected; + uri = getSocketUri(); + } catch (IOException e) { + e.printStackTrace(); + } + count = 0; + //建立socket并注册监听 + CreateSocket(); + } + + private static void CreateSocket(){ + //根据uri和计数器建立连接,并注册监听 + try { + if(count Date: Mon, 9 Dec 2019 16:39:15 +0800 Subject: [PATCH 02/11] return --- .../fr/design/mainframe/socketio/DesignerSocketIO.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 8ce0bdcec..92f7e9771 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 @@ -60,14 +60,14 @@ public class DesignerSocketIO { try { uri = getSocketUri(); } catch (IOException e) { - e.printStackTrace(); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } count = 0; //建立socket并注册监听 - CreateSocket(); + createSocket(); } - private static void CreateSocket(){ + private static void createSocket(){ //根据uri和计数器建立连接,并注册监听 try { if(count Date: Mon, 9 Dec 2019 16:40:25 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E6=97=A5=E5=BF=97=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/socketio/DesignerSocketIO.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 92f7e9771..057eb6de9 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 @@ -138,7 +138,7 @@ public class DesignerSocketIO { @Override public void call(Object... objects) { /* - * todo 远程心跳断开不一定 socketio 断开 和远程紧密相关的业务都绑定在心跳上,切换成心跳断开之后进行提醒, + * todo 远程心跳断开不一定 socket 断开 和远程紧密相关的业务都绑定在心跳上,切换成心跳断开之后进行提醒, * socket 只用推日志和通知配置变更 */ if (status != Status.Disconnecting) { From a353e2ceb94a08b66dd72b896d88678959f40cef Mon Sep 17 00:00:00 2001 From: shine Date: Thu, 27 Feb 2020 21:01:15 +0800 Subject: [PATCH 04/11] =?UTF-8?q?CHART-12794=20=E5=9B=BE=E8=A1=A8=E5=88=87?= =?UTF-8?q?=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/chart/gui/ChartTypePane.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java index 3740e3e12..6c7edc2d2 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java @@ -294,13 +294,14 @@ public class ChartTypePane extends AbstractChartAttrPane{ * @param collection */ public void reLayoutEditPane(String lastPlotID, ChartCollection collection){ + if (editPane == null) { + return; + } ChartProvider chart = collection.getSelectedChartProvider(ChartProvider.class); String plotID = chart.getID(); boolean isUseDefault = ChartTypeInterfaceManager.getInstance().isUseDefaultPane(plotID); - if (editPane != null && editPane.isDefaultPane() != isUseDefault || (!isUseDefault && !ComparatorUtils.equals(lastPlotID, plotID))){ + if (editPane.isDefaultPane() != isUseDefault || (!isUseDefault && !ComparatorUtils.equals(lastPlotID, plotID))) { editPane.reLayout(chart); - }else { - throw new IllegalArgumentException("editPane can not be null."); } } From cf639760ed30490bace6aaa724be10a5bf7c4087 Mon Sep 17 00:00:00 2001 From: Maksim Date: Fri, 28 Feb 2020 16:41:48 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E6=8A=BD=E5=8F=96=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=B9=B6=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/EnvChangeEntrance.java | 78 ++++++++++++------- 1 file changed, 48 insertions(+), 30 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java index a60791c6b..124ace0b0 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -132,36 +132,7 @@ public class EnvChangeEntrance { if (template != null) { template.refreshToolArea(); } - - //是否需要做服务校验 - if(needCheckBranch(selectedEnv)) { - String localBranch; - String remoteBranch; - localBranch = GeneralUtils.readFullBuildNO(); - try { - remoteBranch = new FunctionalHttpRequest(connectionInfo).getServerBranch(); - } catch (WorkspaceConnectionException e) { - remoteBranch = Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Branch_Is_Old") + formatBranch(localBranch); - } - //通过是否包含#来避免当前版本为非安装版本(主要是内部开发版本) - if (localBranch.contains("#") && localBranch.equals(remoteBranch)) { - //说明版本一致,仅做日志记录 - FineLoggerFactory.getLogger().info("Remote Designer version consistency"); - } else { - localBranch = formatBranch(localBranch); - remoteBranch = formatBranch(remoteBranch); - Set noExistServiceSet = getNoExistServiceSet(connectionInfo); - StringBuilder textBuilder = new StringBuilder(); - for (Class clazz : noExistServiceSet) { - WorkspaceAPI workspaceAPI = (WorkspaceAPI) clazz.getAnnotation(WorkspaceAPI.class); - String descriptionOfCN = InterProviderFactory.getProvider().getLocText(workspaceAPI.description()); - textBuilder.append(descriptionOfCN).append("\n"); - } - String areaText = textBuilder.toString(); - CheckServiceDialog dialog = new CheckServiceDialog(DesignerContext.getDesignerFrame(), areaText, localBranch, remoteBranch); - dialog.setVisible(true); - } - } + showServiceDialog(selectedEnv); } catch (WorkspaceAuthException | RegistEditionException e) { // String title = Toolkit.i18nText("Fine-Design_Basic_Remote_Connect_Auth_Failed"); // String title = Toolkit.i18nText("Fine-Design_Basic_Lic_Does_Not_Support_Remote"); @@ -238,6 +209,43 @@ public class EnvChangeEntrance { return true; } + /** + * 对选择的环境做服务检测 + * @param selectedEnv 选择的工作环境 + */ + public void showServiceDialog(DesignerWorkspaceInfo selectedEnv) throws Exception { + //是否需要做服务校验 + if(needCheckBranch(selectedEnv)) { + String localBranch; + String remoteBranch; + WorkspaceConnectionInfo connectionInfo = selectedEnv.getConnection(); + localBranch = GeneralUtils.readFullBuildNO(); + try { + remoteBranch = new FunctionalHttpRequest(connectionInfo).getServerBranch(); + } catch (WorkspaceConnectionException e) { + remoteBranch = Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Branch_Is_Old") + formatBranch(localBranch); + } + //通过是否包含#来避免当前版本为非安装版本(主要是内部开发版本) + if (localBranch.contains("#") && localBranch.equals(remoteBranch)) { + //说明版本一致,仅做日志记录 + FineLoggerFactory.getLogger().info("Remote Designer version consistency"); + } else { + localBranch = formatBranch(localBranch); + remoteBranch = formatBranch(remoteBranch); + Set noExistServiceSet = getNoExistServiceSet(connectionInfo); + StringBuilder textBuilder = new StringBuilder(); + for (Class clazz : noExistServiceSet) { + WorkspaceAPI workspaceAPI = (WorkspaceAPI) clazz.getAnnotation(WorkspaceAPI.class); + String descriptionOfCN = InterProviderFactory.getProvider().getLocText(workspaceAPI.description()); + textBuilder.append(descriptionOfCN).append("\n"); + } + String areaText = textBuilder.toString(); + CheckServiceDialog dialog = new CheckServiceDialog(DesignerContext.getDesignerFrame(), areaText, localBranch, remoteBranch); + dialog.setVisible(true); + } + } + } + /** * 判断是否需要做版本验证,判断依据为 * 1、选择的环境为远程环境 @@ -249,6 +257,11 @@ public class EnvChangeEntrance { return selectedEnv.getType() == DesignerWorkspaceType.Remote; } + /** + * 获取不存在的服务列表 + * @param info 环境连接信息 + * @return 以Set形式返回不存在的服务 + */ public Set getNoExistServiceSet(WorkspaceConnectionInfo info){ Set noExistServiceSet = new HashSet(); Set remoteServiceSet = new HashSet(); @@ -295,6 +308,11 @@ public class EnvChangeEntrance { } } + /** + * 格式化分支版本号 + * @param branch 初始的分支版本号 + * @return 格式化后的版本号 + */ private String formatBranch(String branch){ if(branch.contains("#")){ return branch.substring(branch.lastIndexOf("#") + 1, branch.length() - 13); From a11aa4822d5f4ca5e753ce021e52455721ae6c35 Mon Sep 17 00:00:00 2001 From: Maksim Date: Fri, 28 Feb 2020 16:43:45 +0800 Subject: [PATCH 06/11] =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E6=97=B6=EF=BC=8C=E5=81=9A=E4=B8=80=E6=AC=A1=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../start/module/DesignerWorkspaceProvider.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java b/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java index 7d63571ad..e0fc4dfe9 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java @@ -6,6 +6,10 @@ import com.fr.design.constants.DesignerLaunchStatus; import com.fr.design.env.DesignerWorkspaceGenerator; import com.fr.design.env.DesignerWorkspaceInfo; import com.fr.design.env.LocalDesignerWorkspaceInfo; +import com.fr.event.Event; +import com.fr.event.EventDispatcher; +import com.fr.event.Listener; +import com.fr.event.Null; import com.fr.log.FineLoggerFactory; import com.fr.module.Activator; import com.fr.stable.StringUtils; @@ -54,6 +58,18 @@ public class DesignerWorkspaceProvider extends Activator { EnvChangeEntrance.getInstance().dealEvnExceptionWhenStartDesigner(); } else { WorkContext.switchTo(workspace); + //在设计器完全启动完成后,对初始环境进行一次服务检测,对主要功能无影响,异常仅做日志提示即可 + final DesignerWorkspaceInfo selectEnv = workspaceInfo; + EventDispatcher.listen(DesignerLaunchStatus.STARTUP_COMPLETE, new Listener() { + @Override + public void on(Event event, Null aNull) { + try { + EnvChangeEntrance.getInstance().showServiceDialog(selectEnv); + } catch (Exception e) { + FineLoggerFactory.getLogger().warn("Check Service Failed"); + } + } + }); } } catch (Throwable e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); From 8b7302459583ab5acd89ff2b0d346e4d65b268dd Mon Sep 17 00:00:00 2001 From: shine Date: Mon, 2 Mar 2020 14:35:31 +0800 Subject: [PATCH 07/11] =?UTF-8?q?CHART-12810=20//=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E7=9A=84tab=E9=9D=9E=E9=80=89=E4=B8=AD=E7=8A=B6=E6=80=81,=20?= =?UTF-8?q?=E5=8E=9F=E4=B8=BA=E9=80=89=E4=B8=AD=E7=8A=B6=E6=80=81=E7=9A=84?= =?UTF-8?q?tab=E4=BF=9D=E6=8C=81=E9=80=89=E4=B8=AD=E4=B8=8D=E5=8F=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/chart/gui/ChartTypeButtonPane.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java index 1fbb87c42..4d7673b3e 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java @@ -503,6 +503,13 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen if (this.isSelected()) { indexList.get(0).setSelected(true); changeCollectionSelected(indexList.get(0).getButtonName()); + } else {//删除的tab非选中状态, 原为选中状态的tab保持选中不变 + for (ChartChangeButton button : indexList) { + if (button.isSelected()) { + changeCollectionSelected(button.getButtonName()); + break; + } + } } } From 1838a00cd0012b9c391c35e16b16c6b8bdc53cc3 Mon Sep 17 00:00:00 2001 From: Maksim Date: Mon, 2 Mar 2020 21:21:32 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=9C=AC=E6=9C=88=E4=B8=8D=E5=86=8D=E6=8F=90?= =?UTF-8?q?=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/EnvChangeEntrance.java | 27 ++++++++- .../fr/design/env/DesignerWorkspaceInfo.java | 3 + .../env/LocalDesignerWorkspaceInfo.java | 5 ++ .../env/RemoteDesignerWorkspaceInfo.java | 13 +++++ .../write/submit/CheckServiceDialog.java | 54 ++++++++++++++---- .../fr/design/images/warnings/warning5.png | Bin 0 -> 3095 bytes 6 files changed, 88 insertions(+), 14 deletions(-) create mode 100644 designer-base/src/main/resources/com/fr/design/images/warnings/warning5.png diff --git a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java index 124ace0b0..9a368f342 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -43,7 +43,11 @@ import javax.swing.JOptionPane; import javax.swing.SwingUtilities; import javax.swing.UIManager; import java.lang.reflect.Method; +import java.text.ParseException; +import java.text.SimpleDateFormat; import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Set; @@ -240,7 +244,7 @@ public class EnvChangeEntrance { textBuilder.append(descriptionOfCN).append("\n"); } String areaText = textBuilder.toString(); - CheckServiceDialog dialog = new CheckServiceDialog(DesignerContext.getDesignerFrame(), areaText, localBranch, remoteBranch); + CheckServiceDialog dialog = new CheckServiceDialog(DesignerContext.getDesignerFrame(), selectedEnv, areaText, localBranch, remoteBranch); dialog.setVisible(true); } } @@ -249,12 +253,29 @@ public class EnvChangeEntrance { /** * 判断是否需要做版本验证,判断依据为 * 1、选择的环境为远程环境 - * 2、一个月内不弹出是否勾选(这里预留,还未实际增加) + * 2、一个月内不弹出是否勾选 * @param selectedEnv 选择的环境 * @return */ private boolean needCheckBranch(DesignerWorkspaceInfo selectedEnv){ - return selectedEnv.getType() == DesignerWorkspaceType.Remote; + if(selectedEnv.getType() == DesignerWorkspaceType.Remote){ + try { + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); + Calendar calendar = Calendar.getInstance(); + //获取记录的时间 + Date remindTime = format.parse(selectedEnv.getRemindTime()); + calendar.setTime(remindTime); + //获取一个月后的时间 + calendar.add(Calendar.MONTH,1); + //与当前时间作对比,然后判断是否提示 + if(new Date().after(calendar.getTime())){ + return true; + } + } catch (ParseException e) { + return true; + } + } + return false; } /** diff --git a/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceInfo.java b/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceInfo.java index 2e5cc9f8c..ccc98bfe3 100644 --- a/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceInfo.java +++ b/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceInfo.java @@ -10,6 +10,9 @@ public interface DesignerWorkspaceInfo extends XMLable { String getPath(); + //获取提醒时间,用于判断是否做服务检测 + String getRemindTime(); + WorkspaceConnectionInfo getConnection(); boolean checkValid(); diff --git a/designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java b/designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java index 19b085781..ef1f420d6 100644 --- a/designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java +++ b/designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java @@ -43,6 +43,11 @@ public class LocalDesignerWorkspaceInfo implements DesignerWorkspaceInfo { return path; } + @Override + public String getRemindTime() { + return null; + } + @Override public WorkspaceConnectionInfo getConnection() { return null; diff --git a/designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java b/designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java index 9d2af66cf..af0b8a01c 100644 --- a/designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java +++ b/designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java @@ -13,6 +13,8 @@ public class RemoteDesignerWorkspaceInfo implements DesignerWorkspaceInfo { private String name; + private String remindTime; + private WorkspaceConnectionInfo connection; public static RemoteDesignerWorkspaceInfo create(WorkspaceConnectionInfo connection) { @@ -45,11 +47,21 @@ public class RemoteDesignerWorkspaceInfo implements DesignerWorkspaceInfo { return connection; } + public void setRemindTime(String remindTime){ + this.remindTime = remindTime; + } + + @Override + public String getRemindTime(){ + return remindTime; + } + @Override public void readXML(XMLableReader reader) { if (reader.isAttr()) { this.name = reader.getAttrAsString("name", StringUtils.EMPTY); + this.remindTime = reader.getAttrAsString("remindTime", StringUtils.EMPTY); } if (reader.isChildNode()) { String tagName = reader.getTagName(); @@ -69,6 +81,7 @@ public class RemoteDesignerWorkspaceInfo implements DesignerWorkspaceInfo { public void writeXML(XMLPrintWriter writer) { writer.attr("name", name); + writer.attr("remindTime", remindTime); if (this.connection != null) { writer.startTAG("Connection"); writer.attr("url", connection.getUrl()); diff --git a/designer-base/src/main/java/com/fr/design/write/submit/CheckServiceDialog.java b/designer-base/src/main/java/com/fr/design/write/submit/CheckServiceDialog.java index 3797c0f8a..c88fa1fd9 100644 --- a/designer-base/src/main/java/com/fr/design/write/submit/CheckServiceDialog.java +++ b/designer-base/src/main/java/com/fr/design/write/submit/CheckServiceDialog.java @@ -1,10 +1,14 @@ package com.fr.design.write.submit; +import com.fr.design.env.DesignerWorkspaceInfo; +import com.fr.design.env.RemoteDesignerWorkspaceInfo; import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.FRFont; +import com.fr.general.GeneralContext; import com.fr.general.IOUtils; import javax.swing.BorderFactory; @@ -18,6 +22,9 @@ import java.awt.Dimension; import java.awt.Frame; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Locale; /** * @author: Maksim @@ -28,30 +35,33 @@ public class CheckServiceDialog extends JDialog implements ActionListener { private JPanel topPanel; private JPanel centerPanel; private JPanel bottomPanel; + private UICheckBox remindBox; + private DesignerWorkspaceInfo selectEnv; - public CheckServiceDialog(Frame parent, String areaText, String localBranch, String remoteBranch){ + public CheckServiceDialog(Frame parent, DesignerWorkspaceInfo selectEnv, String areaText, String localBranch, String remoteBranch){ super(parent,true); + this.selectEnv = selectEnv; //上面的标签面板 topPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); JPanel imagePanel = new JPanel(); - Icon icon = IOUtils.readIcon("com/fr/design/images/warnings/warning4.png"); + Icon icon = IOUtils.readIcon("com/fr/design/images/warnings/warning5.png"); JLabel imageLabel = new JLabel(); imageLabel.setIcon(icon); imagePanel.add(imageLabel); - imagePanel.setPreferredSize(new Dimension(100,80)); + imagePanel.setPreferredSize(new Dimension(110,80)); JPanel verticalPanel = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true); FRFont font = FRFont.getInstance(); font = font.applySize(15).applyStyle(1); JLabel label = new JLabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Branch_Inconsistency")); label.setFont(font); - label.setPreferredSize(new Dimension(500,30)); - JLabel label2 = new JLabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Local_Designer") - + localBranch + "/" + Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Remote_Server") + remoteBranch); - label2.setPreferredSize(new Dimension(500,20)); + label.setPreferredSize(new Dimension(600,30)); + JLabel label2 = new JLabel(""+Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Local_Designer") + + localBranch + "/" + Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Remote_Server") + remoteBranch+""); + label2.setPreferredSize(new Dimension(600,30)); JLabel label3 = new JLabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Branch_Need_Update")); - label3.setPreferredSize(new Dimension(500,20)); + label3.setPreferredSize(new Dimension(500,30)); verticalPanel.add(label); verticalPanel.add(label2); @@ -73,9 +83,13 @@ public class CheckServiceDialog extends JDialog implements ActionListener { centerPanel.add(checkArea,BorderLayout.CENTER); //下面的按钮面板 + remindBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Remind_Show")); + remindBox.addActionListener(remindCheckboxListener); UIButton okButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Button_Confirm")); - JPanel buttonPanel = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); - buttonPanel.add(okButton); + JPanel buttonPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); + buttonPanel.setBorder(BorderFactory.createEmptyBorder(0,10,10,10)); + buttonPanel.add(remindBox, BorderLayout.WEST); + buttonPanel.add(okButton,BorderLayout.EAST); okButton.addActionListener(this ); bottomPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); bottomPanel.add(buttonPanel); @@ -86,7 +100,7 @@ public class CheckServiceDialog extends JDialog implements ActionListener { this.add(topPanel,BorderLayout.NORTH); this.add(centerPanel, BorderLayout.CENTER); this.add(buttonPanel,BorderLayout.SOUTH); - this.setSize(new Dimension(600, 500)); + this.setSize(new Dimension(GeneralContext.getLocale().equals(Locale.US)? 700:600, 500)); GUICoreUtils.centerWindow(this); } @@ -94,4 +108,22 @@ public class CheckServiceDialog extends JDialog implements ActionListener { public void actionPerformed(ActionEvent e) { this.dispose(); } + + + private ActionListener remindCheckboxListener = new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + boolean needRemind = remindBox.isSelected(); + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); + String remindTime = format.format(new Date()); + if(needRemind){ + //前面做过验证,一定是远程环境,直接强转 + ((RemoteDesignerWorkspaceInfo)selectEnv).setRemindTime(remindTime); + }else { + ((RemoteDesignerWorkspaceInfo)selectEnv).setRemindTime(""); + } + } + }; + } diff --git a/designer-base/src/main/resources/com/fr/design/images/warnings/warning5.png b/designer-base/src/main/resources/com/fr/design/images/warnings/warning5.png new file mode 100644 index 0000000000000000000000000000000000000000..059206e0cc3393c10dd4a29ff1933df00be28ad2 GIT binary patch literal 3095 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 literal 0 HcmV?d00001 From ae73305f84e4dde3b2cc85c565fccb831fb2d4b4 Mon Sep 17 00:00:00 2001 From: Maksim Date: Mon, 2 Mar 2020 21:25:04 +0800 Subject: [PATCH 09/11] =?UTF-8?q?=E5=9B=9E=E6=BB=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/socketio/DesignerSocketIO.java | 167 +++++++----------- 1 file changed, 63 insertions(+), 104 deletions(-) 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 63bc3d999..e2b13b1ad 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 @@ -13,6 +13,7 @@ import com.fr.report.RemoteDesignConstants; import com.fr.serialization.SerializerHelper; import com.fr.stable.ArrayUtils; import com.fr.third.apache.log4j.spi.LoggingEvent; +import com.fr.third.guava.base.Optional; import com.fr.workspace.WorkContext; import com.fr.workspace.Workspace; import com.fr.workspace.base.WorkspaceConstants; @@ -35,19 +36,28 @@ public class DesignerSocketIO { Disconnecting } - private static Socket socket = null; + private static Optional socketIO = Optional.absent(); private static Status status = Status.Disconnected; - //维护一个当前工作环境的uri列表 - private static String[] uri; - //维护一个关于uri列表的计数器 - private static int count; + private static final Emitter.Listener printLog = new Emitter.Listener() { + @Override + public void call(Object... objects) { + if (ArrayUtils.isNotEmpty(objects)) { + try { + LoggingEvent event = SerializerHelper.deserialize((byte[]) objects[0]); + DesignerLogger.log(event); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + } + }; public static void close() { - if (socket != null) { + if (socketIO.isPresent()) { status = Status.Disconnecting; - socket.close(); - socket = null; + socketIO.get().close(); + socketIO = Optional.absent(); } } @@ -56,42 +66,57 @@ public class DesignerSocketIO { if (current.isLocal()) { return; } - //每当更换工作环境,更新uri列表,同时更新计数器count - try { - uri = getSocketUri(); - } catch (IOException e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - count = 0; - //建立socket并注册监听 - createSocket(); - } - - private static void createSocket(){ - //根据uri和计数器建立连接,并注册监听 try { - if(count Date: Mon, 2 Mar 2020 21:27:45 +0800 Subject: [PATCH 10/11] =?UTF-8?q?=E5=9B=9E=E6=BB=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/socketio/DesignerSocketIO.java | 167 +++++++++++------- 1 file changed, 104 insertions(+), 63 deletions(-) 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 e2b13b1ad..63bc3d999 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 @@ -13,7 +13,6 @@ import com.fr.report.RemoteDesignConstants; import com.fr.serialization.SerializerHelper; import com.fr.stable.ArrayUtils; import com.fr.third.apache.log4j.spi.LoggingEvent; -import com.fr.third.guava.base.Optional; import com.fr.workspace.WorkContext; import com.fr.workspace.Workspace; import com.fr.workspace.base.WorkspaceConstants; @@ -36,28 +35,19 @@ public class DesignerSocketIO { Disconnecting } - private static Optional socketIO = Optional.absent(); + private static Socket socket = null; private static Status status = Status.Disconnected; + //维护一个当前工作环境的uri列表 + private static String[] uri; + //维护一个关于uri列表的计数器 + private static int count; - private static final Emitter.Listener printLog = new Emitter.Listener() { - @Override - public void call(Object... objects) { - if (ArrayUtils.isNotEmpty(objects)) { - try { - LoggingEvent event = SerializerHelper.deserialize((byte[]) objects[0]); - DesignerLogger.log(event); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - } - } - }; public static void close() { - if (socketIO.isPresent()) { + if (socket != null) { status = Status.Disconnecting; - socketIO.get().close(); - socketIO = Optional.absent(); + socket.close(); + socket = null; } } @@ -66,57 +56,42 @@ public class DesignerSocketIO { if (current.isLocal()) { return; } + //每当更换工作环境,更新uri列表,同时更新计数器count try { - String[] uri = getSocketUri(current); - socketIO = Optional.of(IO.socket(new URI(uri[0]))); - socketIO.get().on(WorkspaceConstants.WS_LOGRECORD, printLog); - socketIO.get().on(WorkspaceConstants.CONFIG_MODIFY, new Emitter.Listener() { - @Override - public void call(Object... objects) { - assert objects != null && objects.length == 1; - String param = (String) objects[0]; - EventDispatcher.fire(RemoteConfigEvent.EDIT, param); - } - }); - socketIO.get().on(Socket.EVENT_DISCONNECT, new Emitter.Listener() { - @Override - public void call(Object... objects) { - /* - * todo 远程心跳断开不一定 socketio 断开 和远程紧密相关的业务都绑定在心跳上,切换成心跳断开之后进行提醒, - * socketio 只用推日志和通知配置变更 - */ - if (status != Status.Disconnecting) { - try { - UIUtil.invokeAndWaitIfNeeded(new Runnable() { - @Override - public void run() { - JOptionPane.showMessageDialog( - DesignerContext.getDesignerFrame(), - Toolkit.i18nText("Fine-Design_Basic_Remote_Disconnected"), - UIManager.getString("OptionPane.messageDialogTitle"), - JOptionPane.ERROR_MESSAGE, - UIManager.getIcon("OptionPane.errorIcon")); - EnvChangeEntrance.getInstance().chooseEnv(); - } - }); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - } - status = Status.Disconnected; - } - }); - socketIO.get().connect(); - status = Status.Connected; + uri = getSocketUri(); + } catch (IOException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + count = 0; + //建立socket并注册监听 + createSocket(); + } + + private static void createSocket(){ + //根据uri和计数器建立连接,并注册监听 + try { + if(count Date: Tue, 3 Mar 2020 10:43:52 +0800 Subject: [PATCH 11/11] =?UTF-8?q?=E9=80=9A=E8=BF=87=E5=BD=93=E5=89=8D?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E6=9D=A5=E5=A4=84=E7=90=86=E4=B8=8D=E5=86=8D?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=E4=BA=8E=E4=BC=A0=E5=85=A5=E5=AF=B9=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/EnvChangeEntrance.java | 2 +- .../design/write/submit/CheckServiceDialog.java | 17 ++++++----------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java index 9a368f342..eca98c8be 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -244,7 +244,7 @@ public class EnvChangeEntrance { textBuilder.append(descriptionOfCN).append("\n"); } String areaText = textBuilder.toString(); - CheckServiceDialog dialog = new CheckServiceDialog(DesignerContext.getDesignerFrame(), selectedEnv, areaText, localBranch, remoteBranch); + CheckServiceDialog dialog = new CheckServiceDialog(DesignerContext.getDesignerFrame(), areaText, localBranch, remoteBranch); dialog.setVisible(true); } } diff --git a/designer-base/src/main/java/com/fr/design/write/submit/CheckServiceDialog.java b/designer-base/src/main/java/com/fr/design/write/submit/CheckServiceDialog.java index c88fa1fd9..a5f5d752b 100644 --- a/designer-base/src/main/java/com/fr/design/write/submit/CheckServiceDialog.java +++ b/designer-base/src/main/java/com/fr/design/write/submit/CheckServiceDialog.java @@ -1,6 +1,6 @@ package com.fr.design.write.submit; -import com.fr.design.env.DesignerWorkspaceInfo; +import com.fr.design.DesignerEnvManager; import com.fr.design.env.RemoteDesignerWorkspaceInfo; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icheckbox.UICheckBox; @@ -36,11 +36,9 @@ public class CheckServiceDialog extends JDialog implements ActionListener { private JPanel centerPanel; private JPanel bottomPanel; private UICheckBox remindBox; - private DesignerWorkspaceInfo selectEnv; - public CheckServiceDialog(Frame parent, DesignerWorkspaceInfo selectEnv, String areaText, String localBranch, String remoteBranch){ + public CheckServiceDialog(Frame parent, String areaText, String localBranch, String remoteBranch){ super(parent,true); - this.selectEnv = selectEnv; //上面的标签面板 topPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); JPanel imagePanel = new JPanel(); @@ -114,15 +112,12 @@ public class CheckServiceDialog extends JDialog implements ActionListener { @Override public void actionPerformed(ActionEvent e) { - boolean needRemind = remindBox.isSelected(); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); String remindTime = format.format(new Date()); - if(needRemind){ - //前面做过验证,一定是远程环境,直接强转 - ((RemoteDesignerWorkspaceInfo)selectEnv).setRemindTime(remindTime); - }else { - ((RemoteDesignerWorkspaceInfo)selectEnv).setRemindTime(""); - } + //环境已切换,通过当前环境获取,一定是远程环境 + String currentEnvName = DesignerEnvManager.getEnvManager().getCurEnvName(); + RemoteDesignerWorkspaceInfo currentEnv = (RemoteDesignerWorkspaceInfo)DesignerEnvManager.getEnvManager().getWorkspaceInfo(currentEnvName); + currentEnv.setRemindTime(remindBox.isSelected()? remindTime : ""); } };