From 21d0422f021e4b5e7c3bf6044ab173b22dedd00e Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Wed, 2 Sep 2020 10:15:55 +0800 Subject: [PATCH 01/11] =?UTF-8?q?CHART-15510=20=E6=A0=87=E7=AD=BE=E5=92=8C?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E4=B8=AD=E6=8F=92=E5=85=A5BI=E7=9A=84?= =?UTF-8?q?=E5=AF=8C=E6=96=87=E6=9C=AC=E7=BC=96=E8=BE=91=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/VanChartRichEditorPane.java | 78 +++++++ .../component/VanChartTooltipContentPane.java | 194 ++++++++++++++++-- .../VanChartFormatPaneWithCheckBox.java | 13 +- 3 files changed, 264 insertions(+), 21 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java new file mode 100644 index 0000000000..c4588ce1cb --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java @@ -0,0 +1,78 @@ +package com.fr.van.chart.designer.component; + +import com.fr.design.ui.ModernUIPane; +import com.fr.plugin.chart.base.AttrTooltipRichEditor; +import com.fr.stable.StringUtils; + +import java.util.Map; + +public class VanChartRichEditorPane { + + private static ModernUIPane richEditorPane; + + public static ModernUIPane getInstance() { + if (richEditorPane == null) { + richEditorPane = new ModernUIPane.Builder() + .withEMB("/com/fr/design/editor/rich_editor.html") + .namespace("Pool").build(); + } + + return richEditorPane; + } + + public static RichEditorModel getRichEditorModel(AttrTooltipRichEditor richEditor) { + Map paramsMap = richEditor.getParams(); + StringBuilder paramsStr = new StringBuilder(StringUtils.EMPTY); + + if (paramsMap != null) { + for (Map.Entry entry : paramsMap.entrySet()) { + paramsStr.append(entry.getKey()).append(":").append(entry.getValue()); + paramsStr.append("-"); + } + } + + int len = paramsStr.length(); + + if (len > 0) { + paramsStr.deleteCharAt(len - 1); + } + + return new RichEditorModel(richEditor.getContent(), richEditor.isAuto(), paramsStr.toString()); + } + + public static class RichEditorModel { + private String content; + private boolean auto; + private String params; + + public RichEditorModel(String content, boolean auto, String params) { + this.content = content; + this.auto = auto; + this.params = params; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public boolean isAuto() { + return auto; + } + + public void setAuto(boolean auto) { + this.auto = auto; + } + + public String getParams() { + return params; + } + + public void setParams(String params) { + this.params = params; + } + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java index 5920dd969f..b52e4fda49 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java @@ -1,12 +1,23 @@ package com.fr.van.chart.designer.component; +import com.fr.design.DesignerEnvManager; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.dialog.BasicDialog; +import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.gui.autocomplete.AutoCompletion; +import com.fr.design.gui.autocomplete.DefaultCompletionProvider; import com.fr.design.gui.ibutton.UIButtonGroup; +import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.syntax.ui.rtextarea.RTextArea; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; - +import com.fr.design.ui.ModernUIPane; +import com.fr.log.FineLoggerFactory; import com.fr.plugin.chart.base.AttrTooltipContent; +import com.fr.plugin.chart.base.AttrTooltipRichEditor; +import com.fr.plugin.chart.base.format.AttrTooltipFormat; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithCheckBox; @@ -14,15 +25,23 @@ import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithChec import com.fr.van.chart.designer.component.format.PercentFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.format.ValueFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithCheckBox; import com.fr.van.chart.designer.style.VanChartStylePane; +import javax.swing.JComponent; +import javax.swing.JFrame; import javax.swing.JPanel; +import javax.swing.KeyStroke; +import javax.swing.SwingUtilities; +import javax.swing.text.Document; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Component; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; /** * 内容界面 。数据点提示 @@ -43,22 +62,29 @@ public class VanChartTooltipContentPane extends BasicBeanPane(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Common"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom")}); + content = new UIButtonGroup<>(new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Common"), + Toolkit.i18nText("Fine-Design_Chart_Custom") + }); initFormatPane(parent, showOnPane); @@ -80,8 +106,8 @@ public class VanChartTooltipContentPane extends BasicBeanPane pane = VanChartRichEditorPane.getInstance(); + BasicDialog dialog = pane.showWindow(new JFrame()); + + pane.populate(VanChartRichEditorPane.getRichEditorModel(richEditor)); + + dialog.addDialogActionListener(new DialogActionAdapter() { + + public void doOk() { + VanChartRichEditorPane.RichEditorModel model = pane.update(); + + String content = model.getContent(); + + populateContentTextArea(content); + + richEditor.setContent(content); + richEditor.setAuto(model.isAuto()); + + SwingUtilities.getWindowAncestor(pane).setVisible(false); + } + + public void doCancel() { + SwingUtilities.getWindowAncestor(pane).setVisible(false); + } + }); + + dialog.setVisible(true); + + if (parent != null) { + parent.attributeChanged(); + } + } + protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane){ categoryNameFormatPane = new CategoryNameFormatPaneWithCheckBox(parent, showOnPane); seriesNameFormatPane = new SeriesNameFormatPaneWithCheckBox(parent, showOnPane); @@ -154,13 +267,17 @@ public class VanChartTooltipContentPane extends BasicBeanPane paramMap, String value) { + String key = this.getCheckBoxText(); + + if (paramMap != null && !paramMap.containsKey(key)) { + paramMap.put(key, value); + } + } } From 133381c91481f375cb309e1bc32c7206da489d5b Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 3 Sep 2020 16:35:19 +0700 Subject: [PATCH 02/11] =?UTF-8?q?REPORT-38645=20=E3=80=90JDK11=E3=80=91?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=8F=B3=E4=B8=8A=E8=A7=92=EF=BC=8C?= =?UTF-8?q?fs=E6=8F=92=E4=BB=B6=E7=AE=A1=E7=90=86=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=97=A0=E5=8F=8D=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/extra/WebViewDlgHelper.java | 4 ++-- .../main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java b/designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java index d7f858b65f..628adfec64 100644 --- a/designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java +++ b/designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java @@ -159,7 +159,7 @@ public class WebViewDlgHelper { } public static void createLoginDialog() { - if (StableUtils.getMajorJavaVersion() == VERSION_8) { + if (StableUtils.getMajorJavaVersion() >= VERSION_8) { File file = new File(StableUtils.pathJoin(installHome, "scripts")); if (!file.exists()) { confirmDownLoadShopJS(); @@ -172,7 +172,7 @@ public class WebViewDlgHelper { public static void createLoginDialog(Window parent) { - if (StableUtils.getMajorJavaVersion() == VERSION_8) { + if (StableUtils.getMajorJavaVersion() >= VERSION_8) { File file = new File(StableUtils.pathJoin(installHome, "scripts")); if (!file.exists()) { confirmDownLoadShopJS(); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java index 6e423e1729..4d168557f6 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java @@ -199,7 +199,7 @@ public class UserInfoLabel extends UILabel { this.addMouseListener(userInfoAdapter); this.setHorizontalAlignment(SwingConstants.CENTER); - if (StableUtils.getMajorJavaVersion() == VERSION_8) { + if (StableUtils.getMajorJavaVersion() >= VERSION_8) { LoginWebBridge.getHelper().setUILabel(UserInfoLabel.this); PluginWebBridge.getHelper().setUILabel(UserInfoLabel.this); } From d15fad9502003b15d2ada766c8c0a4c854bc7075 Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 7 Sep 2020 14:29:14 +0800 Subject: [PATCH 03/11] =?UTF-8?q?REPORT-38534=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E7=95=8C=E9=9D=A2=E4=B8=AD=E7=9A=84=E5=89=AA=E5=88=87?= =?UTF-8?q?=E5=92=8C=E5=A4=8D=E5=88=B6=E6=8C=89=E9=92=AE=E7=81=B0=E5=8C=96?= =?UTF-8?q?=E4=B8=8D=E5=8F=AF=E7=94=A8=201.=20bug=E5=8E=9F=E5=9B=A0?= =?UTF-8?q?=EF=BC=9A=E5=AF=B9=E4=BA=8E=E5=B7=A5=E5=85=B7=E6=A0=8F=E4=B8=8A?= =?UTF-8?q?=E7=9A=84=E5=B7=A5=E5=85=B7=E6=9D=A1combineUp=EF=BC=8C=E5=BD=93?= =?UTF-8?q?=E5=A4=84=E4=BA=8E=E7=BC=96=E8=BE=91sheet=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=EF=BC=8C=E6=98=AF=E5=89=AA=E5=88=87+=E5=A4=8D?= =?UTF-8?q?=E5=88=B6+=E7=B2=98=E8=B4=B4+=E6=A0=BC=E5=BC=8F=E5=88=B7?= =?UTF-8?q?=EF=BC=8C=E5=85=B6=E5=AE=83=E6=83=85=E5=86=B5=E9=83=BD=E6=98=AF?= =?UTF-8?q?=E5=89=AA=E5=88=87+=E5=A4=8D=E5=88=B6+=E7=B2=98=E8=B4=B4+?= =?UTF-8?q?=E5=88=A0=E9=99=A4=EF=BC=8C=E8=80=8C=E5=B8=A6=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E7=9A=84=E8=BF=99=E7=A7=8D=EF=BC=8C=E6=98=AF=E4=BC=9A=E6=9C=89?= =?UTF-8?q?=E4=B8=A4=E7=A7=8D=E7=8A=B6=E6=80=81=EF=BC=8C=E9=80=89=E4=B8=AD?= =?UTF-8?q?=E4=BA=86=E6=9F=90=E4=B8=AA=E7=BB=84=E4=BB=B6=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E5=89=AA=E5=88=87=E3=80=81=E5=A4=8D=E5=88=B6=E3=80=81=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=B0=B1=E9=83=BD=E6=98=AF=E5=8F=AF=E7=94=A8=E7=9A=84?= =?UTF-8?q?=EF=BC=8C=E6=9C=AA=E9=80=89=E4=B8=AD=E6=97=B6=EF=BC=8C=E8=BF=99?= =?UTF-8?q?=E5=87=A0=E4=B8=AA=E9=83=BD=E4=B8=8D=E5=8F=AF=E7=94=A8=EF=BC=8C?= =?UTF-8?q?=E6=89=80=E4=BB=A5=E8=BF=99=E9=87=8C=E9=9C=80=E8=A6=81=E6=9C=89?= =?UTF-8?q?=E4=B8=AA=E9=80=BB=E8=BE=91=E6=9D=A5=E5=88=87=E6=8D=A2=E8=BF=99?= =?UTF-8?q?=E5=87=A0=E4=B8=AA=E6=8C=89=E9=92=AE=E7=9A=84=E7=8A=B6=E6=80=81?= =?UTF-8?q?=EF=BC=8C=E8=80=8C=E5=AF=B9=E4=BA=8E=E5=B8=A6=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=88=B7=E7=9A=84=EF=BC=8C=E4=B8=8D=E8=AE=BA=E6=9C=89=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E9=80=89=E4=B8=AD=E9=83=BD=E4=BC=9A=E8=B5=B0=E5=88=B0?= =?UTF-8?q?=E8=BF=99=E4=B8=AA=E9=80=BB=E8=BE=91=EF=BC=8C=E7=84=B6=E5=90=8E?= =?UTF-8?q?=E8=A2=AB=E6=97=A0=E8=84=91=E7=BD=AE=E4=B8=BA=E4=B8=8D=E5=8F=AF?= =?UTF-8?q?=E7=94=A8=202.=20=E4=BF=AE=E6=94=B9=E6=96=B9=E6=A1=88=EF=BC=9A?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=80=E4=B8=AA=E5=88=A4=E6=96=AD=EF=BC=8C?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E5=BD=93=E5=89=8D=E7=9A=84=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E6=98=AFWORK=5FSHEET=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C?= =?UTF-8?q?=E5=8D=B3=E7=BC=96=E8=BE=91sheet=E6=97=B6=EF=BC=8C=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E8=BF=94=E5=9B=9E=EF=BC=8C=E5=85=B6=E5=AE=83=E6=83=85?= =?UTF-8?q?=E5=86=B5=E6=AD=A3=E5=B8=B8=E8=B5=B0=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/mainframe/DesignerFrame.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 42365dcc57..8de3d89f32 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -748,9 +748,11 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta * @param al 组件名称 */ public void checkCombineUp(boolean flag, ArrayList al) { - + //Yvan: 检查当前是否为WORK_SHEET状态,因为只有WORK_SHEET中含有格式刷组件,此时是不需要进行checkComponentsByNames的 + if (HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getMenuState() == DesignState.WORK_SHEET) { + return; + } combineUp.checkComponentsByNames(flag, al); - } /** From 452e0bf30093c7a7dd1d93d49afdcc121db047c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Mon, 7 Sep 2020 15:31:26 +0800 Subject: [PATCH 04/11] =?UTF-8?q?CHART-15610=20=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E6=A0=BC=E5=BC=8F=E4=B8=8D=E4=BF=9D=E7=95=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/van/chart/designer/type/AbstractRectanglePlotPane.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractRectanglePlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractRectanglePlotPane.java index 6712fba900..6babd6a2f2 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractRectanglePlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractRectanglePlotPane.java @@ -68,6 +68,8 @@ public abstract class AbstractRectanglePlotPane extends AbstractVanChartTypePane VanChartAxis vanChartAxis = vanChartRectanglePlot.getValueAxisList().get(0); cloneAxis.setFormat(vanChartAxis.getFormat()); cloneAxis.setPercentage(vanChartAxis.isPercentage()); + cloneAxis.setCommonValueFormat(vanChartAxis.isCommonValueFormat()); + cloneAxis.setHtmlLabel(vanChartAxis.getHtmlLabel()); } return clonePlot; } catch (CloneNotSupportedException ex) { From d91768f8ffe489be57754ea3cb23b7ea16c853a8 Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 7 Sep 2020 16:21:20 +0800 Subject: [PATCH 05/11] REPORT-38529 && REPORT-38527 --- .../main/java/com/fr/design/form/util/FormDesignerUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java b/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java index 46377b1adf..352aa80e54 100644 --- a/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java +++ b/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java @@ -1,5 +1,6 @@ package com.fr.design.form.util; +import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.JTemplate; @@ -17,7 +18,7 @@ public class FormDesignerUtils { * @return */ public static boolean isAppRelayout(FormDesigner designer) { - if (!designer.getRootComponent().acceptType(WFitLayout.class)) { + if (!designer.getRootComponent().acceptType(XWFitLayout.class)) { return false; } return ((WFitLayout) designer.getRootComponent().toData()).isAppRelayout(); From bf14ab15b726ec35744850023e68fbb95d8abf5b Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 7 Sep 2020 17:28:15 +0800 Subject: [PATCH 06/11] =?UTF-8?q?CHART-15510=20=E5=AE=8C=E5=96=84=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E6=A0=B7=E5=BC=8F=E7=95=8C=E9=9D=A2=E4=BA=A4=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/VanChartRichEditorPane.java | 67 ++++++- .../component/VanChartTooltipContentPane.java | 163 +++++++++++------- .../VanChartFormatPaneWithCheckBox.java | 46 ++--- 3 files changed, 180 insertions(+), 96 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java index c4588ce1cb..b4b9dd32f3 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java @@ -1,27 +1,61 @@ package com.fr.van.chart.designer.component; import com.fr.design.ui.ModernUIPane; -import com.fr.plugin.chart.base.AttrTooltipRichEditor; +import com.fr.plugin.chart.base.AttrTooltipRichText; import com.fr.stable.StringUtils; +import com.teamdev.jxbrowser.chromium.Browser; +import com.teamdev.jxbrowser.chromium.JSValue; +import com.teamdev.jxbrowser.chromium.events.ScriptContextAdapter; +import com.teamdev.jxbrowser.chromium.events.ScriptContextEvent; +import java.util.ArrayList; +import java.util.List; import java.util.Map; public class VanChartRichEditorPane { + private static final String namespace = "Pool"; + private static final String variable = "data"; + private static final String richEditorPath = "/com/fr/design/editor/rich_editor.html"; + private static final String expression = "dispatch()"; + private static ModernUIPane richEditorPane; + private static Browser browser; + + public static ModernUIPane createRichEditorPane(AttrTooltipRichText richEditor) { + RichEditorModel model = getRichEditorModel(richEditor); - public static ModernUIPane getInstance() { if (richEditorPane == null) { - richEditorPane = new ModernUIPane.Builder() - .withEMB("/com/fr/design/editor/rich_editor.html") - .namespace("Pool").build(); + richEditorPane = initPane(model); + } else if (browser != null) { + updatePane(browser, model); } return richEditorPane; } - public static RichEditorModel getRichEditorModel(AttrTooltipRichEditor richEditor) { - Map paramsMap = richEditor.getParams(); + public static ModernUIPane initPane(RichEditorModel model) { + return new ModernUIPane.Builder() + .prepare(new ScriptContextAdapter() { + public void onScriptContextCreated(ScriptContextEvent event) { + browser = event.getBrowser(); + + JSValue ns = browser.executeJavaScriptAndReturnValue("window." + namespace); + ns.asObject().setProperty(variable, model); + } + }) + .withEMB(richEditorPath) + .namespace(namespace).build(); + } + + public static void updatePane(Browser browser, RichEditorModel model) { + JSValue ns = browser.executeJavaScriptAndReturnValue("window." + namespace); + ns.asObject().setProperty(variable, model); + browser.executeJavaScript("window." + namespace + "." + expression); + } + + public static RichEditorModel getRichEditorModel(AttrTooltipRichText richText) { + Map paramsMap = richText.getParams(); StringBuilder paramsStr = new StringBuilder(StringUtils.EMPTY); if (paramsMap != null) { @@ -37,7 +71,24 @@ public class VanChartRichEditorPane { paramsStr.deleteCharAt(len - 1); } - return new RichEditorModel(richEditor.getContent(), richEditor.isAuto(), paramsStr.toString()); + return new RichEditorModel(richText.getContent(), richText.isAuto(), paramsStr.toString()); + } + + public static List richParamsParser(String content, Map paramsMap) { + if (content == null || paramsMap == null) { + return null; + } + + List result = new ArrayList<>(); + + for (Map.Entry entry : paramsMap.entrySet()) { + String param = entry.getValue(); + if (content.contains(param)) { + result.add(param); + } + } + + return result; } public static class RichEditorModel { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java index b52e4fda49..084d121942 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java @@ -1,22 +1,19 @@ package com.fr.van.chart.designer.component; -import com.fr.design.DesignerEnvManager; import com.fr.design.beans.BasicBeanPane; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; -import com.fr.design.gui.autocomplete.AutoCompletion; -import com.fr.design.gui.autocomplete.DefaultCompletionProvider; +import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButtonGroup; -import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.syntax.ui.rtextarea.RTextArea; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.ui.ModernUIPane; +import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; import com.fr.plugin.chart.base.AttrTooltipContent; -import com.fr.plugin.chart.base.AttrTooltipRichEditor; +import com.fr.plugin.chart.base.AttrTooltipRichText; import com.fr.plugin.chart.base.format.AttrTooltipFormat; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithCheckBox; @@ -31,9 +28,7 @@ import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JComponent; import javax.swing.JFrame; import javax.swing.JPanel; -import javax.swing.KeyStroke; import javax.swing.SwingUtilities; -import javax.swing.text.Document; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Component; @@ -42,6 +37,7 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; +import java.util.List; /** * 内容界面 。数据点提示 @@ -63,18 +59,17 @@ public class VanChartTooltipContentPane extends BasicBeanPane pane = VanChartRichEditorPane.getInstance(); + final ModernUIPane pane = VanChartRichEditorPane.createRichEditorPane(richText); BasicDialog dialog = pane.showWindow(new JFrame()); - pane.populate(VanChartRichEditorPane.getRichEditorModel(richEditor)); + pane.populate(VanChartRichEditorPane.getRichEditorModel(richText)); dialog.addDialogActionListener(new DialogActionAdapter() { @@ -209,11 +189,9 @@ public class VanChartTooltipContentPane extends BasicBeanPane params = VanChartRichEditorPane.richParamsParser(content, richText.getParams()); + populateFormatParams(params); + updateLocalRichText(content, model.isAuto()); SwingUtilities.getWindowAncestor(pane).setVisible(false); } @@ -304,6 +282,59 @@ public class VanChartTooltipContentPane extends BasicBeanPane", + "\"seriesFormat\"", + "\"valueFormat\"", + "\"percentFormat\"", + "\"changedValueFormat\"", + "\"changedPercentFormat\"" + }; + + StringBuilder result = new StringBuilder("

"); + + for (int i = 0, len = formatPaneGroup.length; i < len; i++) { + VanChartFormatPaneWithCheckBox formatPane = formatPaneGroup[i]; + String paramRichText = richTextGroup[i]; + + if (formatPane != null && formatPane.isSelected()) { + result.append(paramRichText); + } + } + + result.append("

"); + + return result.toString(); + } + @Override protected String title4PopupWindow() { return ""; @@ -328,10 +359,7 @@ public class VanChartTooltipContentPane extends BasicBeanPane params) { + if (params == null) { + return; + } + + for (String param : params) { + VanChartFormatPaneWithCheckBox formatPane = getTargetFormatPane(param); + + if (formatPane != null) { + formatPane.setSelected(true); } - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); } } public AttrTooltipContent updateBean() { AttrTooltipContent attrTooltipContent = createAttrTooltip(); - attrTooltipContent.setCommon(content.getSelectedIndex() == 0); + boolean isCommon = content.getSelectedIndex() == 0; - updateFormatPane(attrTooltipContent); - updateRichEditor(attrTooltipContent); + attrTooltipContent.setCommon(isCommon); + if (isDirty() && isCommon) { + updateLocalRichText(getParamsRichText(), false); + setDirty(false); + } + updateFormatPane(attrTooltipContent); + updateTooltipRichText(attrTooltipContent); updateFormatsWithPaneWidth(attrTooltipContent); htmlLabelPane.update(attrTooltipContent.getHtmlLabel()); @@ -406,9 +442,18 @@ public class VanChartTooltipContentPane extends BasicBeanPane Date: Tue, 8 Sep 2020 10:29:57 +0800 Subject: [PATCH 07/11] CHART-15510 toJSON --- .../component/VanChartTooltipContentPane.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java index 084d121942..20aacca017 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java @@ -159,14 +159,14 @@ public class VanChartTooltipContentPane extends BasicBeanPane Date: Tue, 8 Sep 2020 12:22:57 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/VanChartRichEditorPane.java | 3 ++- .../component/VanChartTooltipContentPane.java | 27 ++++++++----------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java index b4b9dd32f3..4dfd250a1d 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java @@ -8,6 +8,7 @@ import com.teamdev.jxbrowser.chromium.JSValue; import com.teamdev.jxbrowser.chromium.events.ScriptContextAdapter; import com.teamdev.jxbrowser.chromium.events.ScriptContextEvent; +import java.net.URLEncoder; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -83,7 +84,7 @@ public class VanChartRichEditorPane { for (Map.Entry entry : paramsMap.entrySet()) { String param = entry.getValue(); - if (content.contains(param)) { + if (content.contains(URLEncoder.encode(param))) { result.add(param); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java index 20aacca017..a5aafc79af 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java @@ -11,7 +11,6 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.ui.ModernUIPane; import com.fr.general.ComparatorUtils; -import com.fr.log.FineLoggerFactory; import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.base.AttrTooltipRichText; import com.fr.plugin.chart.base.format.AttrTooltipFormat; @@ -311,12 +310,12 @@ public class VanChartTooltipContentPane extends BasicBeanPane", - "\"seriesFormat\"", - "\"valueFormat\"", - "\"percentFormat\"", - "\"changedValueFormat\"", - "\"changedPercentFormat\"" + "\"%24%7BCATEGORY%7D\"", + "\"%24%7BSERIES%7D\"", + "\"%24%7BVALUE%7D\"", + "\"%24%7BPERCENT%7D\"", + "\"%24%7BCHANGEDVALUE%7D\"", + "\"%24%7BCHANGEDPERCENT%7D\"" }; StringBuilder result = new StringBuilder("

"); @@ -378,7 +377,7 @@ public class VanChartTooltipContentPane extends BasicBeanPane Date: Tue, 8 Sep 2020 15:51:26 +0800 Subject: [PATCH 09/11] =?UTF-8?q?CHART-15664=20=E9=9B=B7=E8=BE=BE=E5=9B=BE?= =?UTF-8?q?=E9=A5=BC=E5=9B=BE=E7=BB=A7=E6=89=BF=E5=A4=9A=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../type/AbstractVanChartTypePane.java | 19 +++++++++++++++++-- .../fr/van/chart/pie/VanChartPiePlotPane.java | 5 +++++ .../chart/radar/VanChartRadarPlotPane.java | 4 ++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java index a4b53796fd..9cf9165547 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java @@ -1,10 +1,13 @@ package com.fr.van.chart.designer.type; import com.fr.base.BaseUtils; +import com.fr.base.chart.chartdata.TopDefinitionProvider; import com.fr.chart.base.AttrFillStyle; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Legend; import com.fr.chart.chartattr.Plot; +import com.fr.chart.chartdata.NormalReportDataDefinition; +import com.fr.chart.chartdata.NormalTableDataDefinition; import com.fr.chart.chartglyph.ConditionAttr; import com.fr.chart.chartglyph.ConditionCollection; import com.fr.chart.chartglyph.DataSheet; @@ -167,6 +170,7 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane Date: Tue, 8 Sep 2020 16:15:04 +0800 Subject: [PATCH 10/11] =?UTF-8?q?REPORT-39318=20=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=84=9A=E6=9C=AC=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 6446da4044..fa342ced2f 100644 --- a/build.gradle +++ b/build.gradle @@ -64,7 +64,7 @@ allprojects { implementation 'org.swingexplorer:swexpl:2.0.1' implementation 'org.swingexplorer:swag:1.0' implementation 'net.java.dev.jna:jna:5.4.0' - implementation 'org.apache.tomcat:tomcat-catalina:8.5.32' + implementation 'org.apache.tomcat:tomcat-catalina:8.5.57' implementation 'io.socket:socket.io-client:0.7.0' implementation 'com.fr.third:fine-third:' + frVersion implementation 'com.fr.core:fine-core:' + frDevVersion @@ -73,6 +73,7 @@ allprojects { implementation 'com.fr.decision:fine-decision:' + frVersion implementation 'com.fr.schedule:fine-schedule:' + frVersion implementation 'com.fr.report:fine-report-engine:' + frDevVersion + implementation 'com.fr.design:design-i18n' + frDevVersion testImplementation 'org.easymock:easymock:3.5.1' testImplementation 'org.powermock:powermock-module-junit4:1.7.1' testImplementation 'org.powermock:powermock-api-easymock:1.7.1' From 768129ab62f8b9e16fa8893eea6a558c3a75d0a5 Mon Sep 17 00:00:00 2001 From: Lanlan Date: Wed, 9 Sep 2020 11:10:56 +0800 Subject: [PATCH 11/11] =?UTF-8?q?REPORT-38525=20=E3=80=90JDK11=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E3=80=91=E6=8F=92=E4=BB=B6=E5=95=86=E5=9F=8E?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/extra/LoginDialog.java | 2 +- .../src/main/java/com/fr/design/extra/ShopDialog.java | 2 +- .../src/main/java/com/fr/design/extra/WebViewDlgHelper.java | 4 ++-- .../main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/extra/LoginDialog.java b/designer-base/src/main/java/com/fr/design/extra/LoginDialog.java index 42791ad522..8fbb2d2a5d 100644 --- a/designer-base/src/main/java/com/fr/design/extra/LoginDialog.java +++ b/designer-base/src/main/java/com/fr/design/extra/LoginDialog.java @@ -24,7 +24,7 @@ public class LoginDialog extends UIDialog { } private void init(Component pane) { - if (StableUtils.getMajorJavaVersion() == 8) { + if (StableUtils.getMajorJavaVersion() >= 8) { setUndecorated(true); } JPanel panel = (JPanel) getContentPane(); diff --git a/designer-base/src/main/java/com/fr/design/extra/ShopDialog.java b/designer-base/src/main/java/com/fr/design/extra/ShopDialog.java index 72fa6149b6..69ad0f08d1 100644 --- a/designer-base/src/main/java/com/fr/design/extra/ShopDialog.java +++ b/designer-base/src/main/java/com/fr/design/extra/ShopDialog.java @@ -16,7 +16,7 @@ public class ShopDialog extends UIDialog { public ShopDialog(Frame frame, BasicPane pane) { super(frame); - if (StableUtils.getMajorJavaVersion() == 8) { + if (StableUtils.getMajorJavaVersion() >= 8) { setUndecorated(true); } JPanel panel = (JPanel) getContentPane(); diff --git a/designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java b/designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java index d7f858b65f..628adfec64 100644 --- a/designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java +++ b/designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java @@ -159,7 +159,7 @@ public class WebViewDlgHelper { } public static void createLoginDialog() { - if (StableUtils.getMajorJavaVersion() == VERSION_8) { + if (StableUtils.getMajorJavaVersion() >= VERSION_8) { File file = new File(StableUtils.pathJoin(installHome, "scripts")); if (!file.exists()) { confirmDownLoadShopJS(); @@ -172,7 +172,7 @@ public class WebViewDlgHelper { public static void createLoginDialog(Window parent) { - if (StableUtils.getMajorJavaVersion() == VERSION_8) { + if (StableUtils.getMajorJavaVersion() >= VERSION_8) { File file = new File(StableUtils.pathJoin(installHome, "scripts")); if (!file.exists()) { confirmDownLoadShopJS(); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java index 6e423e1729..4d168557f6 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java @@ -199,7 +199,7 @@ public class UserInfoLabel extends UILabel { this.addMouseListener(userInfoAdapter); this.setHorizontalAlignment(SwingConstants.CENTER); - if (StableUtils.getMajorJavaVersion() == VERSION_8) { + if (StableUtils.getMajorJavaVersion() >= VERSION_8) { LoginWebBridge.getHelper().setUILabel(UserInfoLabel.this); PluginWebBridge.getHelper().setUILabel(UserInfoLabel.this); }