From c6677e6906cb0f518aa8d76e56fb18e196a88928 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 10 Dec 2021 11:12:50 +0800 Subject: [PATCH 1/4] =?UTF-8?q?REPORT-64095=20websocket=E9=A2=91=E7=B9=81?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E6=96=AD=E5=BC=80=E5=8F=88=E8=BF=9E=E4=B8=8A?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/socketio/DesignerSocketIO.java | 3 +++ 1 file changed, 3 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 2cb2099bf..97e8692dc 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 @@ -34,6 +34,8 @@ import io.socket.client.IO; import io.socket.client.Socket; import io.socket.emitter.Emitter; +import io.socket.engineio.client.transports.Polling; +import io.socket.engineio.client.transports.WebSocket; import java.io.File; import java.io.FileInputStream; import java.security.KeyStore; @@ -116,6 +118,7 @@ public class DesignerSocketIO { private static IO.Options createOptions() { IO.Options options = new IO.Options(); options.path = WebSocketConfig.getInstance().getSocketContext(); + options.transports = new String[]{WebSocket.NAME, Polling.NAME}; try { if (ComparatorUtils.equals(currentProtocol, HTTPS)) { options.sslContext = getSSLContext(); From cbdbc9d5d06f4bcc31f8679eba2d8854f17096d5 Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 10 Dec 2021 11:25:49 +0800 Subject: [PATCH 2/4] =?UTF-8?q?KERNEL-9860=20=E6=8F=92=E4=BB=B6=E4=BF=AE?= =?UTF-8?q?=E6=94=B9xml=E4=B8=ADactive=E6=A0=87=E7=AD=BE=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E9=87=8D=E6=9E=84=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F?= =?UTF-8?q?=E5=9B=A0=E3=80=91rt=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D?= =?UTF-8?q?=E8=B7=AF=E3=80=91=E8=AF=A6=E8=A7=81https://kms.fineres.com/pag?= =?UTF-8?q?es/viewpage.action=3FpageId=3D289590798=20=E3=80=90review?= =?UTF-8?q?=E5=BB=BA=E8=AE=AE=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/extra/PluginInstalledPane.java | 29 ++++++++++++++----- .../fr/design/extra/PluginOperateUtils.java | 12 ++++---- 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/extra/PluginInstalledPane.java b/designer-base/src/main/java/com/fr/design/extra/PluginInstalledPane.java index 2fa1ea110..1923a2287 100644 --- a/designer-base/src/main/java/com/fr/design/extra/PluginInstalledPane.java +++ b/designer-base/src/main/java/com/fr/design/extra/PluginInstalledPane.java @@ -60,11 +60,14 @@ public class PluginInstalledPane extends PluginAbstractViewPane { public void actionPerformed(ActionEvent e) { PluginView plugin = controlPane.getSelectedPlugin(); if (plugin != null) { - boolean isActive = plugin.isActive(); - PluginMarker pluginMarker = PluginMarker.create(plugin.getID(), plugin.getVersion()); - final String modifyMessage = isActive ? com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Been_Actived") : com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Been_Disabled"); - if (isActive) { - PluginManager.getController().forbid(pluginMarker, new PluginTaskCallback() { + PluginContext pluginContext = getPluginContextByView(plugin); + if (pluginContext == null) { + return; + } + boolean running = pluginContext.isRunning(); + final String modifyMessage = running ? com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Been_Actived") : com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Been_Disabled"); + if (running) { + PluginManager.getController().forbidPersistently(pluginContext.getMarker(), new PluginTaskCallback() { @Override public void done(PluginTaskResult result) { if (result.isSuccess()) { @@ -75,7 +78,7 @@ public class PluginInstalledPane extends PluginAbstractViewPane { } }); } else { - PluginManager.getController().enable(pluginMarker, new PluginTaskCallback() { + PluginManager.getController().enablePersistently(pluginContext.getMarker(), new PluginTaskCallback() { @Override public void done(PluginTaskResult result) { if (result.isSuccess()) { @@ -145,13 +148,25 @@ public class PluginInstalledPane extends PluginAbstractViewPane { } private void changeTextForButton(PluginView plugin) { - if (plugin.isActive()) { + PluginContext pluginContext = getPluginContextByView(plugin); + if (pluginContext == null) { + return; + } + if (pluginContext.isRunning()) { disableButton.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Disable")); } else { disableButton.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Active")); } } + private PluginContext getPluginContextByView(PluginView pluginView) { + if (pluginView != null) { + PluginMarker pluginMarker = PluginMarker.create(pluginView.getID(), pluginView.getVersion()); + return PluginManager.getContext(pluginMarker); + } + return null; + } + @Override protected String title4PopupWindow() { return "Installed"; diff --git a/designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java b/designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java index 7dd2097dc..379daab28 100644 --- a/designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java +++ b/designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java @@ -99,9 +99,9 @@ public class PluginOperateUtils { public void run() { PluginMarker pluginMarker = PluginUtils.createPluginMarker(pluginInfo); PluginContext plugin = PluginManager.getContext(pluginMarker); - boolean active = plugin.isActive(); - PluginTaskCallback modifyStatusCallback = new ModifyStatusCallback(active, jsCallback); - if (active) { + boolean isRunning = plugin.isRunning(); + PluginTaskCallback modifyStatusCallback = new ModifyStatusCallback(isRunning, jsCallback); + if (isRunning) { PluginXmlElement forbidReminder = plugin.getXml().getElement(PluginElementName.ForbidReminder); if (forbidReminder != null && forbidReminder.getContent() != null) { // 禁用前提示 @@ -113,14 +113,14 @@ public class PluginOperateUtils { JOptionPane.WARNING_MESSAGE ); if (rv == JOptionPane.OK_OPTION) { - PluginManager.getController().forbid(pluginMarker, modifyStatusCallback); + PluginManager.getController().forbidPersistently(pluginMarker, modifyStatusCallback); } } else { // 正常禁用 - PluginManager.getController().forbid(pluginMarker, modifyStatusCallback); + PluginManager.getController().forbidPersistently(pluginMarker, modifyStatusCallback); } } else { - PluginManager.getController().enable(pluginMarker, modifyStatusCallback); + PluginManager.getController().enablePersistently(pluginMarker, modifyStatusCallback); } } }); From 6c57ae3713ab5b5bb8c807d6b5e33adcb29b7988 Mon Sep 17 00:00:00 2001 From: shine Date: Wed, 8 Dec 2021 17:08:57 +0800 Subject: [PATCH 3/4] =?UTF-8?q?CHART-22213=20fix:=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E8=AD=A6=E6=88=92=E7=BA=BF=20=E9=BB=98=E8=AE=A4=E5=BA=94?= =?UTF-8?q?=E8=AF=A5=E6=98=AF9px12px=20=E4=B8=8D=E6=98=AF9px?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/config/DefaultStyleConstants.java | 26 +++++------ .../chart/config/DefaultStyleHelper4Van.java | 45 ++++++++++++++----- 2 files changed, 43 insertions(+), 28 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleConstants.java b/designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleConstants.java index 6d0de41ce..4cbba6290 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleConstants.java +++ b/designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleConstants.java @@ -18,35 +18,35 @@ import java.awt.Font; * Created by shine on 2021/6/25 */ public class DefaultStyleConstants { - static final FRFont TITLE = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.BOLD, 14, new Color(241, 246, 255)); - static final FRFont LEGEND = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 9, new Color(159, 173, 191)); + static final FRFont TITLE = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.BOLD, 19, new Color(241, 246, 255)); + static final FRFont LEGEND = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 12, new Color(159, 173, 191)); - static final FRFont AXIS_LABEL = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 9, new Color(159, 173, 191)); - static final FRFont AXIS_TITLE = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 9, new Color(200, 211, 228)); + static final FRFont AXIS_LABEL = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 12, new Color(159, 173, 191)); + static final FRFont AXIS_TITLE = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 12, new Color(200, 211, 228)); static final Color AXIS_LINE = new Color(46, 75, 102); static final Color GRID_LINE = new Color(30, 55, 78); - static final FRFont ALERT_FONT = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 9, new Color(255, 0, 0)); + static final FRFont ALERT_FONT = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 12, new Color(255, 0, 0)); - static final FRFont DATA_SHEET = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 9, new Color(159, 173, 191)); + static final FRFont DATA_SHEET = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 12, new Color(159, 173, 191)); static final Color DATA_SHEET_BORDER = new Color(46, 75, 102); static final Color BORDER = Color.BLACK; static final int BORDER_WIDTH = Constants.LINE_NONE; static final int SPECIAL_BORDER_WIDTH = Constants.LINE_THIN; - static final FRFont PIE_CATEGORY_LABEL = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 10, new Color(232, 232, 232)); + static final FRFont PIE_CATEGORY_LABEL = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 13, new Color(232, 232, 232)); static final Color GAUGE_PANE_BACK_COLOR = null; static final Color GAUGE_HINGE = null; static final Color GAUGE_PANE_BACK_COLOR_4_RING = new Color(72, 73, 79); static final Color GAUGE_SLOT_BACKGROUND_COLOR = new Color(72, 73, 79); private static final String FONT_NAME = ChartBaseUtils.getLocalDefaultFont("verdana"); - static final FRFont THERMOMETER_LABEL_FONT = FRFont.getInstance(FONT_NAME, Font.BOLD, 9, new Color(232, 232, 232));//试管仪表盘标签的默认样式 - static final FRFont THERMOMETER_AXIS_LABEL = FRFont.getInstance(FONT_NAME, Font.PLAIN, 8, new Color(159, 173, 191)); + static final FRFont THERMOMETER_LABEL_FONT = FRFont.getInstance(FONT_NAME, Font.BOLD, 12, new Color(232, 232, 232));//试管仪表盘标签的默认样式 + static final FRFont THERMOMETER_AXIS_LABEL = FRFont.getInstance(FONT_NAME, Font.PLAIN, 11, new Color(159, 173, 191)); static final FRFont RING_VALUE_LABEL_FONT = FRFont.getInstance(FONT_NAME, Font.PLAIN, ChartConstants.AUTO_FONT_SIZE, new Color(232, 232, 232));//百分比圆环仪表盘值标签的默认样式 static final FRFont POINTER_VALUE_LABEL_FONT = FRFont.getInstance(FONT_NAME, Font.PLAIN, ChartConstants.AUTO_FONT_SIZE, new Color(232, 232, 232));//多指针仪表盘值标签的默认样式 - static final FRFont POINTER_CATE_LABEL_FONT = FRFont.getInstance(FONT_NAME, Font.PLAIN, 10, new Color(232, 232, 232));//多指针仪表盘分类标签的默认样式 + static final FRFont POINTER_CATE_LABEL_FONT = FRFont.getInstance(FONT_NAME, Font.PLAIN, 13, new Color(232, 232, 232));//多指针仪表盘分类标签的默认样式 static final Color MAP_NULL_VALUE_COLOR = new Color(168, 168, 168); static final Color MAP_BORDER = Color.BLACK; @@ -56,12 +56,6 @@ public class DefaultStyleConstants { static final Color DRILL_MAP_DRILL_TOOLS_BACK = Color.BLACK; static final float DRILL_MAP_DRILL_TOOLS_BACK_OPACITY = 0.8f; - //todo vancharts - private static final Color GANTT_OUT_LINE = GRID_LINE; - private static final FRFont GANTT_LABEL = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 8, new Color(217, 217, 217)); - private static final Color GANTT_BORDER_LINE = new Color(30, 36, 58); - private static final Color GAUGE_TICK = new Color(39, 49, 71); - static final Background BACK = null; static String COLORS = null; diff --git a/designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java b/designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java index d6fc30bd5..31694433f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java +++ b/designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java @@ -1,5 +1,7 @@ package com.fr.van.chart.config; +import com.fr.base.ChartColorMatching; +import com.fr.base.ChartPreStyleConfig; import com.fr.chart.base.AttrBorder; import com.fr.chart.base.AttrFillStyle; import com.fr.chart.base.ChartConstants; @@ -28,8 +30,17 @@ import com.fr.plugin.chart.type.GaugeStyle; */ public class DefaultStyleHelper4Van { + private static boolean duchampMode() { + try { + return ChartEditContext.duchampMode(); + } catch (Throwable e) { + //tomcat预览 默认数据的图表 + return true; + } + } + public static void dealVanPlot4Custom(VanChartPlot plot, CustomPlotType customPlotType) { - if (!ChartEditContext.duchampMode()) { + if (!duchampMode()) { return; } dealVanPlotCommonAttr(plot); @@ -60,7 +71,7 @@ public class DefaultStyleHelper4Van { } public static VanChartAxis dealAxisDefault(VanChartAxis axis) { - if (!ChartEditContext.duchampMode()) { + if (!duchampMode()) { return axis; } axis.getTitle().getTextAttr().setFRFont(DefaultStyleConstants.AXIS_TITLE); @@ -71,28 +82,38 @@ public class DefaultStyleHelper4Van { } public static void dealAxisAlert(VanChartAlertValue vanChartAlertValue) { - if (!ChartEditContext.duchampMode()) { + if (!duchampMode()) { return; } vanChartAlertValue.setAlertFont(DefaultStyleConstants.ALERT_FONT); } static void dealVanPlotCommonAttr(Plot plot) { - if (!ChartEditContext.duchampMode()) { + if (!duchampMode()) { return; } if (plot instanceof VanChartPlot) { VanChartPlot vanChartPlot = (VanChartPlot) plot; - ColorFillStyle colorFillStyle = new ColorFillStyle(); - colorFillStyle.setColorStyle(ChartConstants.COLOR_ACC); - colorFillStyle.setFillStyleName(DefaultStyleConstants.COLORS); - AttrFillStyle plotFillStyle = vanChartPlot.getPlotFillStyle(); - if (plotFillStyle == null) { - plotFillStyle = new AttrFillStyle(); - vanChartPlot.setPlotFillStyle(plotFillStyle); + ChartPreStyleConfig manager = ChartPreStyleConfig.getInstance(); + Object preStyle = manager.getPreStyle(DefaultStyleConstants.COLORS); + if (preStyle instanceof ChartColorMatching) { + ColorFillStyle colorFillStyle = new ColorFillStyle(); + //default是默认的意思,为服务器默认配色方案 + //acc为多个颜色组合 + //gradient为渐变颜色 + colorFillStyle.setColorStyle(ChartConstants.COLOR_ACC); + colorFillStyle.setFillStyleName(DefaultStyleConstants.COLORS); + colorFillStyle.setColorList(((ChartColorMatching) preStyle).getColorList()); + + AttrFillStyle plotFillStyle = vanChartPlot.getPlotFillStyle(); + if (plotFillStyle == null) { + plotFillStyle = new AttrFillStyle(); + vanChartPlot.setPlotFillStyle(plotFillStyle); + } + plotFillStyle.setColorFillStyle(colorFillStyle); } - plotFillStyle.setColorFillStyle(colorFillStyle); + if (vanChartPlot.getLegend() != null) { vanChartPlot.getLegend().setFRFont(DefaultStyleConstants.LEGEND); From b6d38f7f2eab0689ddcca04ad722bfc40841574c Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 10 Dec 2021 16:05:46 +0800 Subject: [PATCH 4/4] =?UTF-8?q?KERNEL-9860=20=E6=8F=92=E4=BB=B6=E4=BF=AE?= =?UTF-8?q?=E6=94=B9xml=E4=B8=ADactive=E6=A0=87=E7=AD=BE=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E9=87=8D=E6=9E=84=20=E8=B7=9Fvito=E8=AE=A8=E8=AE=BA=E4=BA=86?= =?UTF-8?q?=E4=B8=8B=EF=BC=8C=E5=86=B3=E5=AE=9A=E6=A8=A1=E6=9D=BF=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E7=9A=84=E4=B8=80=E9=94=AE=E5=A4=84=E7=90=86=E8=BF=99?= =?UTF-8?q?=E5=84=BF=EF=BC=8C=E4=B9=9F=E6=98=AF=E9=9C=80=E8=A6=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9xml=E7=9A=84=EF=BC=8C=E5=9B=A0=E4=B8=BA=E4=B9=9F?= =?UTF-8?q?=E6=98=AF=E7=94=A8=E6=88=B7=E8=87=AA=E5=B7=B1=E7=82=B9=E7=9A=84?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/mainframe/app/DesignerAppUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppUtils.java b/designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppUtils.java index 218ee4728..0075ae076 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppUtils.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppUtils.java @@ -220,7 +220,7 @@ public class DesignerAppUtils { Multimap stringPluginMarkerAdapterMultimap = popPluginInfoMap(key); Collection disablePlugins = stringPluginMarkerAdapterMultimap.get(TemplateIOErrorContextHolder.DISABLE_PLUGIN); for (PluginMarkerAdapter disablePlugin : disablePlugins) { - PluginManager.getController().enable(disablePlugin, new ModifyStatusCallback(false)); + PluginManager.getController().enablePersistently(disablePlugin, new ModifyStatusCallback(false)); } Collection uninstallPlugins = stringPluginMarkerAdapterMultimap.get(TemplateIOErrorContextHolder.NOT_INSTALLED_PLUGIN);