From 9391e36c98d529b61c06c46adc444f7bf930075c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Fri, 18 Sep 2020 10:10:35 +0800 Subject: [PATCH 01/64] =?UTF-8?q?CHART-15840=20=E5=9B=BE=E8=A1=A8=E7=AC=AC?= =?UTF-8?q?=E4=B8=80=E6=AC=A1=E5=8A=A0=E8=BD=BD=E6=85=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/chart/ChartDesignerActivator.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java b/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java index 0cd81f783..8a5e0e7d8 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java +++ b/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java @@ -15,6 +15,7 @@ import com.fr.locale.LocaleScope; import com.fr.module.Activator; import com.fr.module.extension.Prepare; import com.fr.plugin.chart.vanchart.export.ImagePainter; +import com.fr.plugin.chart.vanchart.export.PainterDispatcher; import com.fr.stable.bridge.StableFactory; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import com.fr.van.chart.DownloadOnlineSourcesHelper; @@ -46,6 +47,7 @@ public class ChartDesignerActivator extends Activator implements Prepare { ImagePainter.registerDownloadSourcesEvent(new DownloadOnlineSourcesHelper()); ImagePainter.registerDefaultCallbackEvent(HistoryTemplateListCache.getInstance()); + PainterDispatcher.getInstance().distributeDesignPainter(); ChartTypeInterfaceManager.addPluginChangedListener(); } From d1cce51256d5339b30b9a3458048ee41f7abb682 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Fri, 18 Sep 2020 16:22:37 +0800 Subject: [PATCH 02/64] =?UTF-8?q?CHART-15510=20=E8=B0=83=E6=95=B4=E5=AF=8C?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E6=A0=87=E7=AD=BE=E5=92=8C=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=82=B9=E6=8F=90=E7=A4=BA=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../box/VanChartBoxTooltipContentPane.java | 2 +- .../VanChartRefreshTooltipContentPane.java | 21 + .../component/VanChartRichEditorPane.java | 20 - .../component/VanChartTooltipContentPane.java | 406 ++++++++----- ...CategoryNameFormatPaneWithoutCheckBox.java | 17 + ...angedPercentFormatPaneWithoutCheckBox.java | 21 + ...ChangedValueFormatPaneWithoutCheckBox.java | 17 + .../MapAreaNameFormatPaneWithoutCheckBox.java | 17 + .../PercentFormatPaneWithoutCheckBox.java | 21 + .../SeriesNameFormatPaneWithoutCheckBox.java | 17 + .../ValueFormatPaneWithoutCheckBox.java | 17 + .../VanChartFormatPaneWithCheckBox.java | 57 +- .../VanChartFormatPaneWithoutCheckBox.java | 16 + .../format/XFormatPaneWithoutCheckBox.java | 16 + .../format/YFormatPaneWithoutCheckBox.java | 16 + ...efreshTooltipContentPaneWithOutSeries.java | 20 + .../TooltipContentPaneWithOutSeries.java | 8 + .../label/VanChartGaugeLabelDetailPane.java | 24 +- .../label/VanChartPlotLabelDetailPane.java | 50 +- .../VanChartPlotRefreshTooltipPane.java | 1 - .../tooltip/VanChartPlotTooltipPane.java | 49 -- ...unnelPercentFormatPaneWithoutCheckBox.java | 18 + .../style/VanChartFunnelLabelContentPane.java | 19 + ...nChartFunnelRefreshTooltipContentPane.java | 20 + .../VanChartFunnelTooltipContentPane.java | 19 + .../label/VanChartMapLabelContentPane.java | 12 + .../VanChartMapRefreshTooltipContentPane.java | 22 + .../VanChartMapTooltipContentPane.java | 12 + ...rtAndEndNameFormatPaneWithoutCheckBox.java | 17 + .../VanChartLineMapTooltipContentPane.java | 12 + ...PieLevelNameFormatPaneWithoutCheckBox.java | 18 + ...ieSeriesNameFormatPaneWithoutCheckBox.java | 18 + .../VanChartMultiPieLabelContentPane.java | 9 + .../VanChartMultiPieTooltipContentPane.java | 9 + ...ChartMutiPieRefreshTooltipContentPane.java | 21 + ...ChartScatterRefreshTooltipContentPane.java | 26 +- .../VanChartScatterTooltipContentPane.java | 42 +- ...artStructureRefreshTooltipContentPane.java | 20 + .../VanChartStructureTooltipContentPane.java | 33 +- ...hartWordCloudRefreshTootipContentPane.java | 28 +- .../VanChartWordCloudTooltipContentPane.java | 30 +- .../com/fr/design/editor/rich_editor.html | 103 ++++ .../design/editor/script/editor.constant.js | 6 + .../com/fr/design/editor/script/editor.js | 241 ++++++++ .../fr/design/editor/script/editor.model.js | 53 ++ .../fr/design/editor/script/editor.service.js | 562 ++++++++++++++++++ .../script/insertcombo/combo.insert_param.js | 114 ++++ .../insertcombo/combo.insert_param.model.js | 40 ++ .../editor/script/insertcombo/item/item.js | 38 ++ .../script/toolbar/disabled_bar_wrapper.js | 22 + .../design/editor/script/toolbar/toolbar.js | 124 ++++ .../editor/script/toolbar/toolbar.model.js | 12 + 52 files changed, 2261 insertions(+), 292 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/component/format/CategoryNameFormatPaneWithoutCheckBox.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/component/format/ChangedPercentFormatPaneWithoutCheckBox.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/component/format/ChangedValueFormatPaneWithoutCheckBox.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/component/format/MapAreaNameFormatPaneWithoutCheckBox.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/component/format/PercentFormatPaneWithoutCheckBox.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/component/format/SeriesNameFormatPaneWithoutCheckBox.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/component/format/ValueFormatPaneWithoutCheckBox.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/component/format/VanChartFormatPaneWithoutCheckBox.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/component/format/XFormatPaneWithoutCheckBox.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/component/format/YFormatPaneWithoutCheckBox.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/FunnelPercentFormatPaneWithoutCheckBox.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/line/StartAndEndNameFormatPaneWithoutCheckBox.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/multilayer/style/MultiPieLevelNameFormatPaneWithoutCheckBox.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/multilayer/style/MultiPieSeriesNameFormatPaneWithoutCheckBox.java create mode 100644 designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html create mode 100644 designer-chart/src/main/resources/com/fr/design/editor/script/editor.constant.js create mode 100644 designer-chart/src/main/resources/com/fr/design/editor/script/editor.js create mode 100644 designer-chart/src/main/resources/com/fr/design/editor/script/editor.model.js create mode 100644 designer-chart/src/main/resources/com/fr/design/editor/script/editor.service.js create mode 100644 designer-chart/src/main/resources/com/fr/design/editor/script/insertcombo/combo.insert_param.js create mode 100644 designer-chart/src/main/resources/com/fr/design/editor/script/insertcombo/combo.insert_param.model.js create mode 100644 designer-chart/src/main/resources/com/fr/design/editor/script/insertcombo/item/item.js create mode 100644 designer-chart/src/main/resources/com/fr/design/editor/script/toolbar/disabled_bar_wrapper.js create mode 100644 designer-chart/src/main/resources/com/fr/design/editor/script/toolbar/toolbar.js create mode 100644 designer-chart/src/main/resources/com/fr/design/editor/script/toolbar/toolbar.model.js diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java index 77b16b499..98dbbbb6e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java @@ -76,7 +76,7 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { }; } - protected JPanel createCommonPanel() { + protected JPanel createCommonFormatPanel() { JPanel commonPanel = new JPanel(new BorderLayout()); commonPanel.add(createCateAndSeriesPane(), BorderLayout.NORTH); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRefreshTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRefreshTooltipContentPane.java index 0c3b5a454..18f50e143 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRefreshTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRefreshTooltipContentPane.java @@ -1,7 +1,9 @@ package com.fr.van.chart.designer.component; import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -28,6 +30,14 @@ public class VanChartRefreshTooltipContentPane extends VanChartTooltipContentPan changedPercentFormatPane = new ChangedPercentFormatPaneWithCheckBox(parent, showOnPane); } + @Override + protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { + super.initRichTextFormatPane(parent, showOnPane); + + richTextChangedValueFormatPane = new ChangedValueFormatPaneWithoutCheckBox(parent, showOnPane); + richTextChangedPercentFormatPane = new ChangedPercentFormatPaneWithoutCheckBox(parent, showOnPane); + } + protected Component[][] getPaneComponents(){ return new Component[][]{ new Component[]{categoryNameFormatPane,null}, @@ -39,4 +49,15 @@ public class VanChartRefreshTooltipContentPane extends VanChartTooltipContentPan }; } + protected Component[][] getRichTextComponents() { + return new Component[][]{ + new Component[]{richTextCategoryNameFormatPane, null}, + new Component[]{richTextSeriesNameFormatPane, null}, + new Component[]{richTextValueFormatPane, null}, + new Component[]{richTextChangedValueFormatPane, null}, + new Component[]{richTextPercentFormatPane, null}, + new Component[]{richTextChangedPercentFormatPane, null} + }; + } + } 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 4dfd250a1..d1f294e41 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,9 +8,6 @@ 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; public class VanChartRichEditorPane { @@ -75,23 +72,6 @@ public class VanChartRichEditorPane { 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(URLEncoder.encode(param))) { - result.add(param); - } - } - - return result; - } - public static class RichEditorModel { private String content; private boolean auto; 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 a5aafc79a..e8825f246 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 @@ -9,19 +9,26 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.ui.ModernUIPane; -import com.fr.general.ComparatorUtils; import com.fr.plugin.chart.base.AttrTooltipContent; 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; +import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.PercentFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.PercentFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.ValueFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.ValueFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JComponent; @@ -36,28 +43,38 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import java.util.List; /** - * 内容界面 。数据点提示 + * 数据点提示内容界面,含有通用设置、富文本编辑器、自定义JS界面 */ public class VanChartTooltipContentPane extends BasicBeanPane { private static final long serialVersionUID = 8825929000117843641L; protected UIButtonGroup content; - protected ValueFormatPaneWithCheckBox valueFormatPane; - protected PercentFormatPaneWithCheckBox percentFormatPane; + protected CategoryNameFormatPaneWithCheckBox categoryNameFormatPane; protected SeriesNameFormatPaneWithCheckBox seriesNameFormatPane; + protected ValueFormatPaneWithCheckBox valueFormatPane; + protected PercentFormatPaneWithCheckBox percentFormatPane; //监控刷新时,自动数据点提示使用 protected ChangedValueFormatPaneWithCheckBox changedValueFormatPane; protected ChangedPercentFormatPaneWithCheckBox changedPercentFormatPane; - private JPanel centerPane; + protected CategoryNameFormatPaneWithoutCheckBox richTextCategoryNameFormatPane; + protected SeriesNameFormatPaneWithoutCheckBox richTextSeriesNameFormatPane; + protected ValueFormatPaneWithoutCheckBox richTextValueFormatPane; + protected PercentFormatPaneWithoutCheckBox richTextPercentFormatPane; + protected ChangedValueFormatPaneWithoutCheckBox richTextChangedValueFormatPane; + protected ChangedPercentFormatPaneWithoutCheckBox richTextChangedPercentFormatPane; + + private JPanel centerPanel; private JPanel commonPanel; - private JPanel editorPane; + private JPanel editorPanel; + private JPanel htmlPanel; + private UIButtonGroup styleButton; + private ChartTextAttrPane textAttrPane; private VanChartHtmlLabelPane htmlLabelPane; private VanChartStylePane parent; @@ -75,55 +92,44 @@ public class VanChartTooltipContentPane extends BasicBeanPane(new String[]{ - Toolkit.i18nText("Fine-Design_Chart_Common"), - Toolkit.i18nText("Fine-Design_Chart_Custom") - }); - initFormatPane(parent, showOnPane); + initRichTextFormatPane(parent, showOnPane); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; + initDetailPane(); + initCenterPane(); + + JPanel content = new JPanel(new BorderLayout()); + + content.add(createButtonPane(), BorderLayout.NORTH); + content.add(centerPanel, BorderLayout.CENTER); + + initContentListener(); + + return getLabelContentPane(content); + } + private void initDetailPane() { commonPanel = createCommonPanel(); - htmlLabelPane = createHtmlLabelPane(); - htmlLabelPane.setParent(parent); + editorPanel = createRichEditorPanel(); + htmlPanel = createHtmlPane(); + } - centerPane = new JPanel(new CardLayout()){ - @Override + private void initCenterPane() { + centerPanel = new JPanel(new CardLayout()) { public Dimension getPreferredSize() { - if(content.getSelectedIndex() == 0){ + if (content.getSelectedIndex() == 0) { return commonPanel.getPreferredSize(); + } else if (content.getSelectedIndex() == 1) { + return editorPanel.getPreferredSize(); } else { - return new Dimension(commonPanel.getPreferredSize().width,htmlLabelPane.getPreferredSize().height); + return htmlPanel.getPreferredSize(); } } }; - centerPane.add(htmlLabelPane, Toolkit.i18nText("Fine-Design_Chart_Custom")); - centerPane.add(commonPanel, Toolkit.i18nText("Fine-Design_Chart_Common")); - - double[] column = {f, e}; - double[] row = {p,p,p}; - Component[][] components = new Component[][]{ - new Component[]{null,null}, - new Component[]{new UILabel(getLabelContentTitle()),content}, - new Component[]{null,centerPane}, - }; - - JPanel contentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, column); - - // editorPane = createRichEditorPanel(); - - JPanel panel = new JPanel(); - panel.setLayout(new BorderLayout()); - panel.add(contentPane, BorderLayout.CENTER); - // panel.add(editorPane, BorderLayout.SOUTH); - - initContentListener(); - - return getLabelContentPane(panel); + centerPanel.add(commonPanel, Toolkit.i18nText("Fine-Design_Chart_Common")); + centerPanel.add(editorPanel, Toolkit.i18nText("Fine-Design_Chart_Rich_Text")); + centerPanel.add(htmlPanel, Toolkit.i18nText("Fine-Design_Chart_Custom")); } protected String getLabelContentTitle () { @@ -134,18 +140,88 @@ public class VanChartTooltipContentPane extends BasicBeanPane(new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Common"), + Toolkit.i18nText("Fine-Design_Chart_Rich_Text"), + Toolkit.i18nText("Fine-Design_Chart_Custom") + }); + + Component[][] components = new Component[][]{ + new Component[]{null, null}, + new Component[]{content, null} + }; + + return TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, column); + } + + private JPanel createCommonPanel() { + JPanel common = new JPanel(new BorderLayout()); + + common.add(createCommonFormatPanel(), BorderLayout.CENTER); + common.add(createCommonStylePane(), BorderLayout.SOUTH); + + return common; } - protected JPanel createCommonPanel() { + protected JPanel createCommonFormatPanel() { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; + double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] columnSize = {f, p}; - double[] rowSize = getRowSize(p); + JPanel formatContent = TableLayoutHelper.createTableLayoutPane(getPaneComponents(), getRowSize(p), new double[]{f, p}); + + Component[][] components = new Component[][]{ + new Component[]{null, null}, + new Component[]{new UILabel(getLabelContentTitle()), formatContent} + }; - return TableLayoutHelper.createTableLayoutPane(getPaneComponents(), rowSize, columnSize); + return TableLayoutHelper.createTableLayoutPane(components, new double[]{p, p}, new double[]{f, e}); + } + + private JPanel createCommonStylePane() { + styleButton = new UIButtonGroup<>(new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Automatic"), + Toolkit.i18nText("Fine-Design_Chart_Custom") + }); + + textAttrPane = new ChartTextAttrPane() { + protected Component[][] getComponents(JPanel buttonPane) { + return new Component[][]{ + new Component[]{null, null}, + new Component[]{null, getFontNameComboBox()}, + new Component[]{null, buttonPane} + }; + } + }; + + JPanel buttonPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), styleButton); + + JPanel stylePanel = new JPanel(new BorderLayout()); + stylePanel.add(buttonPane, BorderLayout.CENTER); + stylePanel.add(textAttrPane, BorderLayout.SOUTH); + + initStyleButtonListener(); + + return stylePanel; + } + + private void initStyleButtonListener() { + styleButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + checkStylePane(); + } + }); + } + + private void checkStylePane() { + textAttrPane.setVisible(styleButton.getSelectedIndex() == 1); } private JPanel createRichEditorPanel() { @@ -154,18 +230,21 @@ public class VanChartTooltipContentPane extends BasicBeanPane params = VanChartRichEditorPane.richParamsParser(content, richText.getParams()); - populateFormatParams(params); updateLocalRichText(content, model.isAuto()); SwingUtilities.getWindowAncestor(pane).setVisible(false); @@ -207,6 +284,28 @@ public class VanChartTooltipContentPane extends BasicBeanPane", - "\"%24%7BSERIES%7D\"", - "\"%24%7BVALUE%7D\"", - "\"%24%7BPERCENT%7D\"", - "\"%24%7BCHANGEDVALUE%7D\"", - "\"%24%7BCHANGEDPERCENT%7D\"" + return new VanChartFormatPaneWithoutCheckBox[]{ + richTextCategoryNameFormatPane, + richTextSeriesNameFormatPane, + richTextValueFormatPane, + richTextPercentFormatPane, + richTextChangedValueFormatPane, + richTextChangedPercentFormatPane }; - - 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 @@ -346,19 +435,36 @@ public class VanChartTooltipContentPane extends BasicBeanPane params) { - if (params == null) { - return; - } + for (int i = 0, len = formatPaneGroup.length; i < len; i++) { + VanChartFormatPaneWithCheckBox formatPane = formatPaneGroup[i]; + AttrTooltipFormat format = formatGroup[i]; - VanChartFormatPaneWithCheckBox[] formatPaneGroup = getFormatPaneGroup(); + if (formatPane != null && format != null) { + formatPane.populate(format); - for (VanChartFormatPaneWithCheckBox formatPane : formatPaneGroup) { - if (formatPane != null) { - formatPane.setSelected(false); + // 填充面板时,更新富文本编辑器参数 + formatPane.updateFormatParams(richText.getParams(), format.getJs()); } } - for (String param : params) { - VanChartFormatPaneWithCheckBox formatPane = getTargetFormatPane(param); + AttrTooltipRichText tooltipRichText = attrTooltipContent.getRichTextAttr(); - if (formatPane != null) { - formatPane.setSelected(true); - } + if (tooltipRichText != null) { + updateLocalRichText(tooltipRichText.getContent(), tooltipRichText.isAuto()); + setDirty(false); } } public AttrTooltipContent updateBean() { AttrTooltipContent attrTooltipContent = createAttrTooltip(); - boolean isCommon = content.getSelectedIndex() == 0; - - attrTooltipContent.setCommon(isCommon); - if (isDirty() && isCommon) { - updateLocalRichText(getParamsRichText(), false); - setDirty(false); - } + attrTooltipContent.setCommon(content.getSelectedIndex() == 0); + attrTooltipContent.setRichText(content.getSelectedIndex() == 1); + attrTooltipContent.setCustom(styleButton.getSelectedIndex() == 1); + attrTooltipContent.setTextAttr(this.textAttrPane.update()); updateFormatPane(attrTooltipContent); + updateRichEditor(attrTooltipContent); updateTooltipRichText(attrTooltipContent); updateFormatsWithPaneWidth(attrTooltipContent); @@ -449,6 +553,20 @@ public class VanChartTooltipContentPane extends BasicBeanPane align; private JPanel alignPane; private Integer[] oldAlignValues; + protected UIButtonGroup style; + protected ChartTextAttrPane textFontPane; public VanChartGaugeLabelDetailPane(Plot plot, VanChartStylePane parent) { super(plot, parent); @@ -63,6 +67,15 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { return TableLayoutHelper.createTableLayoutPane(getLabelStyleComponents(plot), row, col); } + protected void initStyleListener() { + style.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + checkStyleUse(); + } + }); + } + protected boolean isFontSizeAuto() { return false; } @@ -120,7 +133,10 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { }; } else { - return super.getLabelPaneComponents(plot, p, columnSize); + return new Component[][]{ + new Component[]{dataLabelContentPane, null}, + new Component[]{createLabelStylePane(getLabelStyleRowSize(p), columnSize, plot), null}, + }; } } @@ -210,15 +226,21 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { super.populate(detail); style.setSelectedIndex(1); + textFontPane.populate(detail.getTextAttr()); if (hasLabelAlign(this.getPlot()) && align != null) { align.setSelectedItem(detail.getAlign()); } + + checkStyleUse(); } public void update(AttrLabelDetail detail) { super.update(detail); detail.setCustom(true); + if (textFontPane != null) { + detail.setTextAttr(textFontPane.update()); + } if (align != null) { if (align.getSelectedItem() != null) { detail.setAlign(align.getSelectedItem()); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java index c506d89ea..b5d36b07a 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java @@ -44,9 +44,6 @@ public class VanChartPlotLabelDetailPane extends BasicPane { protected UIButtonGroup autoAdjust; protected UIToggleButton tractionLine; - protected UIButtonGroup style; - protected ChartTextAttrPane textFontPane; - protected ColorSelectBox backgroundColor; private JPanel tractionLinePane; @@ -93,13 +90,11 @@ public class VanChartPlotLabelDetailPane extends BasicPane { if(hasLabelPosition(plot)){ return new Component[][]{ new Component[]{dataLabelContentPane,null}, - new Component[]{createLabelPositionPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Position"), plot), null}, - new Component[]{createLabelStylePane(getLabelStyleRowSize(p), columnSize, plot),null}, + new Component[]{createLabelPositionPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Position"), plot), null} }; } else { return new Component[][]{ - new Component[]{dataLabelContentPane,null}, - new Component[]{createLabelStylePane(getLabelStyleRowSize(p), columnSize, plot),null}, + new Component[]{dataLabelContentPane,null} }; } } @@ -214,17 +209,6 @@ public class VanChartPlotLabelDetailPane extends BasicPane { }); } - protected JPanel createLabelStylePane(double[] row, double[] col, Plot plot) { - style = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Automatic"), - Toolkit.i18nText("Fine-Design_Chart_Custom")}); - textFontPane =initTextFontPane(); - - initStyleListener(); - - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(getLabelStyleComponents(plot),row,col); - return createTableLayoutPaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), panel); - } - protected ChartTextAttrPane initTextFontPane () { return new ChartTextAttrPane(){ protected Component[][] getComponents(JPanel buttonPane) { @@ -237,24 +221,6 @@ public class VanChartPlotLabelDetailPane extends BasicPane { }; } - protected Component[][] getLabelStyleComponents(Plot plot) { - UILabel text = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Character"), SwingConstants.LEFT); - return new Component[][]{ - new Component[]{null,null}, - new Component[]{text,style}, - new Component[]{textFontPane,null}, - }; - } - - protected void initStyleListener() { - style.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - checkStyleUse(); - } - }); - } - protected JPanel createBackgroundColorPane() { backgroundColor = new ColorSelectBox(100); return createTableLayoutPaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundColor); @@ -265,18 +231,12 @@ public class VanChartPlotLabelDetailPane extends BasicPane { } private void checkAllUse() { - checkStyleUse(); if(tractionLine == null){ return; } checkPositionEnabled(); } - protected void checkStyleUse() { - textFontPane.setVisible(style.getSelectedIndex() == 1); - textFontPane.setPreferredSize(style.getSelectedIndex() == 1 ? new Dimension(0, 60) : new Dimension(0, 0)); - } - private void checkPosition() { tractionLine.setSelected(position.getSelectedItem() == Constants.OUTSIDE); checkPositionEnabled(); @@ -301,8 +261,6 @@ public class VanChartPlotLabelDetailPane extends BasicPane { if(autoAdjust != null){ autoAdjust.setSelectedIndex(detail.isAutoAdjust() == true ? 0 : 1); } - style.setSelectedIndex(detail.isCustom() ? 1 : 0); - textFontPane.populate(detail.getTextAttr()); if(backgroundColor != null){ backgroundColor.setSelectObject(detail.getBackgroundColor()); @@ -327,10 +285,6 @@ public class VanChartPlotLabelDetailPane extends BasicPane { if(tractionLine != null){ detail.setShowGuidLine(tractionLine.isSelected() && detail.getPosition() == Constants.OUTSIDE); } - detail.setCustom(style.getSelectedIndex() == 1); - if(textFontPane != null){ - detail.setTextAttr(textFontPane.update()); - } if(backgroundColor != null){ detail.setBackgroundColor(backgroundColor.getSelectObject()); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartPlotRefreshTooltipPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartPlotRefreshTooltipPane.java index ade1d85bd..0f71c9de6 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartPlotRefreshTooltipPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartPlotRefreshTooltipPane.java @@ -72,7 +72,6 @@ public class VanChartPlotRefreshTooltipPane extends VanChartPlotTooltipNoCheckPa Component[][] components = new Component[][]{ new Component[]{refreshTooltipContentPane,null}, new Component[]{initDurationPane(),null}, - new Component[]{createLabelStylePane(),null}, new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Border"),borderPane),null}, new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane),null}, diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartPlotTooltipPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartPlotTooltipPane.java index 1c3ed4aa5..bb5b46b63 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartPlotTooltipPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartPlotTooltipPane.java @@ -7,8 +7,6 @@ import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; - import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.widget.FRWidgetFactory; import com.fr.plugin.chart.base.AttrTooltip; @@ -32,9 +30,6 @@ public class VanChartPlotTooltipPane extends BasicPane { protected VanChartTooltipContentPane tooltipContentPane; - protected UIButtonGroup style; - protected ChartTextAttrPane textFontPane; - protected VanChartBorderWithRadiusPane borderPane; protected VanChartBackgroundWithOutImagePane backgroundPane; @@ -95,7 +90,6 @@ public class VanChartPlotTooltipPane extends BasicPane { protected Component[][] createComponents(Plot plot) { Component[][] components = new Component[][]{ new Component[]{tooltipContentPane,null}, - new Component[]{createLabelStylePane(),null}, new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"),borderPane),null}, new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane),null}, new Component[]{createDisplayStrategy(plot),null}, @@ -108,38 +102,6 @@ public class VanChartPlotTooltipPane extends BasicPane { tooltipContentPane = PlotFactory.createPlotTooltipContentPane(plot, parent, VanChartPlotTooltipPane.this); } - protected JPanel createLabelStylePane() { - style = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Automatic"),Toolkit.i18nText("Fine-Design_Chart_Custom")}); - textFontPane = new ChartTextAttrPane() { - protected Component[][] getComponents(JPanel buttonPane) { - return new Component[][]{ - new Component[]{null, null}, - new Component[]{null, getFontNameComboBox()}, - new Component[]{null, buttonPane} - }; - } - }; - - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Character"), style); - JPanel panel1 = new JPanel(new BorderLayout()); - panel1.add(panel, BorderLayout.CENTER); - panel1.add(textFontPane, BorderLayout.SOUTH); - - initStyleListener(); - - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), panel1); - } - - - private void initStyleListener() { - style.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - checkStyleUse(); - } - }); - } - protected JPanel createDisplayStrategy(Plot plot) { showAllSeries = new UICheckBox(getShowAllSeriesLabelText()); followMouse = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Follow_Mouse"), @@ -175,7 +137,6 @@ public class VanChartPlotTooltipPane extends BasicPane { private void checkAllUse() { checkBoxUse(); - checkStyleUse(); } /** * 检查box使用. @@ -184,10 +145,6 @@ public class VanChartPlotTooltipPane extends BasicPane { tooltipPane.setVisible(isTooltipShow.isSelected()); } - private void checkStyleUse() { - textFontPane.setVisible(style.getSelectedIndex() == 1); - } - protected AttrTooltip getAttrTooltip() { return new AttrTooltip(); } @@ -202,8 +159,6 @@ public class VanChartPlotTooltipPane extends BasicPane { tooltipContentPane.populateBean(attr.getContent()); } - style.setSelectedIndex(attr.isCustom() ? 1 : 0); - textFontPane.populate(attr.getTextAttr()); borderPane.populate(attr.getGeneralInfo()); backgroundPane.populate(attr.getGeneralInfo()); if(showAllSeries != null) { @@ -224,10 +179,6 @@ public class VanChartPlotTooltipPane extends BasicPane { attrTooltip.setContent(tooltipContentPane.updateBean()); } - attrTooltip.setCustom(style.getSelectedIndex() == 1); - if(textFontPane != null){ - attrTooltip.setTextAttr(textFontPane.update()); - } borderPane.update(attrTooltip.getGeneralInfo()); backgroundPane.update(attrTooltip.getGeneralInfo()); if(showAllSeries != null) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/FunnelPercentFormatPaneWithoutCheckBox.java b/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/FunnelPercentFormatPaneWithoutCheckBox.java new file mode 100644 index 000000000..5495131b3 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/FunnelPercentFormatPaneWithoutCheckBox.java @@ -0,0 +1,18 @@ +package com.fr.van.chart.funnel.designer.style; + +import com.fr.design.i18n.Toolkit; +import com.fr.van.chart.designer.component.format.PercentFormatPaneWithoutCheckBox; +import com.fr.van.chart.designer.style.VanChartStylePane; + +import javax.swing.JPanel; + +public class FunnelPercentFormatPaneWithoutCheckBox extends PercentFormatPaneWithoutCheckBox { + + public FunnelPercentFormatPaneWithoutCheckBox(VanChartStylePane parent, JPanel showOnPane) { + super(parent, showOnPane); + } + + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_Value_Conversion"); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelLabelContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelLabelContentPane.java index e2382c685..20451e343 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelLabelContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelLabelContentPane.java @@ -4,8 +4,12 @@ import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.base.format.AttrTooltipNameFormat; import com.fr.van.chart.designer.component.VanChartLabelContentPane; import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithoutCheckBox; +import com.fr.van.chart.designer.component.format.PercentFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.ValueFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.ValueFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -31,6 +35,14 @@ public class VanChartFunnelLabelContentPane extends VanChartLabelContentPane { }; } + protected Component[][] getRichTextComponents() { + return new Component[][]{ + new Component[]{richTextSeriesNameFormatPane, null}, + new Component[]{richTextValueFormatPane, null}, + new Component[]{richTextPercentFormatPane, null} + }; + } + @Override protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) { categoryNameFormatPane = new CategoryNameFormatPaneWithCheckBox(parent, showOnPane); @@ -39,6 +51,13 @@ public class VanChartFunnelLabelContentPane extends VanChartLabelContentPane { percentFormatPane = new FunnelPercentFormatPaneWithCheckBox(parent, showOnPane); } + protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { + richTextCategoryNameFormatPane = new CategoryNameFormatPaneWithoutCheckBox(parent, showOnPane); + richTextSeriesNameFormatPane = new SeriesNameFormatPaneWithoutCheckBox(parent, showOnPane); + richTextValueFormatPane = new ValueFormatPaneWithoutCheckBox(parent, showOnPane); + richTextPercentFormatPane = new FunnelPercentFormatPaneWithoutCheckBox(parent, showOnPane); + } + protected AttrTooltipContent createAttrTooltip() { AttrTooltipContent attrTooltipContent = new AttrTooltipContent(); attrTooltipContent.getCategoryFormat().setEnable(false); diff --git a/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelRefreshTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelRefreshTooltipContentPane.java index c98dfcce4..c751e1731 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelRefreshTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelRefreshTooltipContentPane.java @@ -1,7 +1,9 @@ package com.fr.van.chart.funnel.designer.style; import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -22,6 +24,14 @@ public class VanChartFunnelRefreshTooltipContentPane extends VanChartFunnelToolt changedPercentFormatPane = new ChangedPercentFormatPaneWithCheckBox(parent, showOnPane); } + @Override + protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { + super.initRichTextFormatPane(parent, showOnPane); + + richTextChangedValueFormatPane = new ChangedValueFormatPaneWithoutCheckBox(parent, showOnPane); + richTextChangedPercentFormatPane = new ChangedPercentFormatPaneWithoutCheckBox(parent, showOnPane); + } + protected double[] getRowSize(double p){ return new double[]{p,p,p,p,p}; } @@ -35,4 +45,14 @@ public class VanChartFunnelRefreshTooltipContentPane extends VanChartFunnelToolt new Component[]{changedPercentFormatPane,null}, }; } + + protected Component[][] getRichTextComponents() { + return new Component[][]{ + new Component[]{richTextSeriesNameFormatPane, null}, + new Component[]{richTextValueFormatPane, null}, + new Component[]{richTextChangedValueFormatPane, null}, + new Component[]{richTextPercentFormatPane, null}, + new Component[]{richTextChangedPercentFormatPane, null} + }; + } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelTooltipContentPane.java index 1a5199c09..280d7e2bc 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelTooltipContentPane.java @@ -4,8 +4,11 @@ import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.base.format.AttrTooltipNameFormat; import com.fr.van.chart.designer.component.VanChartTooltipContentPane; import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.ValueFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.ValueFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -31,6 +34,14 @@ public class VanChartFunnelTooltipContentPane extends VanChartTooltipContentPane }; } + protected Component[][] getRichTextComponents() { + return new Component[][]{ + new Component[]{richTextSeriesNameFormatPane, null}, + new Component[]{richTextValueFormatPane, null}, + new Component[]{richTextPercentFormatPane, null} + }; + } + @Override protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) { categoryNameFormatPane = new CategoryNameFormatPaneWithCheckBox(parent, showOnPane); @@ -39,6 +50,14 @@ public class VanChartFunnelTooltipContentPane extends VanChartTooltipContentPane percentFormatPane = new FunnelPercentFormatPaneWithCheckBox(parent, showOnPane); } + @Override + protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { + richTextCategoryNameFormatPane = new CategoryNameFormatPaneWithoutCheckBox(parent, showOnPane); + richTextSeriesNameFormatPane = new SeriesNameFormatPaneWithoutCheckBox(parent, showOnPane); + richTextValueFormatPane = new ValueFormatPaneWithoutCheckBox(parent, showOnPane); + richTextPercentFormatPane = new FunnelPercentFormatPaneWithoutCheckBox(parent, showOnPane); + } + protected AttrTooltipContent createAttrTooltip() { AttrTooltipContent attrTooltipContent = new AttrTooltipContent(); attrTooltipContent.getCategoryFormat().setEnable(false); diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelContentPane.java index c918088ca..c257c8ffd 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelContentPane.java @@ -5,9 +5,13 @@ import com.fr.plugin.chart.base.format.AttrTooltipAreaNameFormat; import com.fr.plugin.chart.base.format.AttrTooltipMapValueFormat; import com.fr.van.chart.designer.component.VanChartLabelContentPane; import com.fr.van.chart.designer.component.format.MapAreaNameFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.MapAreaNameFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.PercentFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.PercentFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.ValueFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.ValueFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -28,6 +32,14 @@ public class VanChartMapLabelContentPane extends VanChartLabelContentPane { percentFormatPane = new PercentFormatPaneWithCheckBox(parent, showOnPane); } + @Override + protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { + richTextCategoryNameFormatPane = new MapAreaNameFormatPaneWithoutCheckBox(parent, showOnPane); + richTextSeriesNameFormatPane = new SeriesNameFormatPaneWithoutCheckBox(parent, showOnPane); + richTextValueFormatPane = new ValueFormatPaneWithoutCheckBox(parent, showOnPane); + richTextPercentFormatPane = new PercentFormatPaneWithoutCheckBox(parent, showOnPane); + } + @Override protected AttrTooltipContent createAttrTooltip() { AttrTooltipContent content = new AttrTooltipContent(); diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/tooltip/VanChartMapRefreshTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/tooltip/VanChartMapRefreshTooltipContentPane.java index 76bd33f59..9b9b3aac4 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/tooltip/VanChartMapRefreshTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/tooltip/VanChartMapRefreshTooltipContentPane.java @@ -3,7 +3,9 @@ package com.fr.van.chart.map.designer.style.tooltip; import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.base.format.AttrTooltipAreaNameFormat; import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -20,10 +22,19 @@ public class VanChartMapRefreshTooltipContentPane extends VanChartMapTooltipCont @Override protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) { super.initFormatPane(parent, showOnPane); + changedValueFormatPane = new ChangedValueFormatPaneWithCheckBox(parent, showOnPane); changedPercentFormatPane = new ChangedPercentFormatPaneWithCheckBox(parent, showOnPane); + } + @Override + protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { + super.initRichTextFormatPane(parent, showOnPane); + + richTextChangedValueFormatPane = new ChangedValueFormatPaneWithoutCheckBox(parent, showOnPane); + richTextChangedPercentFormatPane = new ChangedPercentFormatPaneWithoutCheckBox(parent, showOnPane); } + protected double[] getRowSize(double p){ return new double[]{p,p,p,p,p,p}; } @@ -39,6 +50,17 @@ public class VanChartMapRefreshTooltipContentPane extends VanChartMapTooltipCont }; } + protected Component[][] getRichTextComponents() { + return new Component[][]{ + new Component[]{richTextCategoryNameFormatPane, null}, + new Component[]{richTextSeriesNameFormatPane, null}, + new Component[]{richTextValueFormatPane, null}, + new Component[]{richTextChangedValueFormatPane, null}, + new Component[]{richTextPercentFormatPane, null}, + new Component[]{richTextChangedPercentFormatPane, null} + }; + } + @Override protected AttrTooltipContent createAttrTooltip() { AttrTooltipContent content = new AttrTooltipContent(); diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/tooltip/VanChartMapTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/tooltip/VanChartMapTooltipContentPane.java index 1a2b593a3..f39107d6d 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/tooltip/VanChartMapTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/tooltip/VanChartMapTooltipContentPane.java @@ -5,9 +5,13 @@ import com.fr.plugin.chart.base.format.AttrTooltipAreaNameFormat; import com.fr.plugin.chart.base.format.AttrTooltipMapValueFormat; import com.fr.van.chart.designer.component.VanChartTooltipContentPane; import com.fr.van.chart.designer.component.format.MapAreaNameFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.MapAreaNameFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.PercentFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.PercentFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.ValueFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.ValueFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -28,6 +32,14 @@ public class VanChartMapTooltipContentPane extends VanChartTooltipContentPane { percentFormatPane = new PercentFormatPaneWithCheckBox(parent, showOnPane); } + @Override + protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { + richTextCategoryNameFormatPane = new MapAreaNameFormatPaneWithoutCheckBox(parent, showOnPane); + richTextSeriesNameFormatPane = new SeriesNameFormatPaneWithoutCheckBox(parent, showOnPane); + richTextValueFormatPane = new ValueFormatPaneWithoutCheckBox(parent, showOnPane); + richTextPercentFormatPane = new PercentFormatPaneWithoutCheckBox(parent, showOnPane); + } + @Override protected AttrTooltipContent createAttrTooltip() { AttrTooltipContent content = new AttrTooltipContent(); diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/line/StartAndEndNameFormatPaneWithoutCheckBox.java b/designer-chart/src/main/java/com/fr/van/chart/map/line/StartAndEndNameFormatPaneWithoutCheckBox.java new file mode 100644 index 000000000..9630f9b12 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/map/line/StartAndEndNameFormatPaneWithoutCheckBox.java @@ -0,0 +1,17 @@ +package com.fr.van.chart.map.line; + +import com.fr.design.i18n.Toolkit; +import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithoutCheckBox; +import com.fr.van.chart.designer.style.VanChartStylePane; + +import javax.swing.JPanel; + +public class StartAndEndNameFormatPaneWithoutCheckBox extends CategoryNameFormatPaneWithoutCheckBox { + public StartAndEndNameFormatPaneWithoutCheckBox(VanChartStylePane parent, JPanel showOnPane) { + super(parent, showOnPane); + } + + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_Start_And_End"); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/line/VanChartLineMapTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/line/VanChartLineMapTooltipContentPane.java index 66566c6bf..9c46c351b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/line/VanChartLineMapTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/line/VanChartLineMapTooltipContentPane.java @@ -4,9 +4,13 @@ import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.base.format.AttrTooltipStartAndEndNameFormat; import com.fr.plugin.chart.base.format.AttrTooltipValueFormat; import com.fr.van.chart.designer.component.VanChartTooltipContentPane; +import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.PercentFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.PercentFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.ValueFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.ValueFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -27,6 +31,14 @@ public class VanChartLineMapTooltipContentPane extends VanChartTooltipContentPan percentFormatPane = new PercentFormatPaneWithCheckBox(parent, showOnPane); } + + protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { + richTextCategoryNameFormatPane = new StartAndEndNameFormatPaneWithoutCheckBox(parent, showOnPane); + richTextSeriesNameFormatPane = new SeriesNameFormatPaneWithoutCheckBox(parent, showOnPane); + richTextValueFormatPane = new ValueFormatPaneWithoutCheckBox(parent, showOnPane); + richTextPercentFormatPane = new PercentFormatPaneWithoutCheckBox(parent, showOnPane); + } + @Override protected AttrTooltipContent createAttrTooltip() { AttrTooltipContent content = new AttrTooltipContent(); diff --git a/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/MultiPieLevelNameFormatPaneWithoutCheckBox.java b/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/MultiPieLevelNameFormatPaneWithoutCheckBox.java new file mode 100644 index 000000000..71789e63a --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/MultiPieLevelNameFormatPaneWithoutCheckBox.java @@ -0,0 +1,18 @@ +package com.fr.van.chart.multilayer.style; + +import com.fr.design.i18n.Toolkit; +import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithoutCheckBox; +import com.fr.van.chart.designer.style.VanChartStylePane; + +import javax.swing.JPanel; + +public class MultiPieLevelNameFormatPaneWithoutCheckBox extends CategoryNameFormatPaneWithoutCheckBox { + + public MultiPieLevelNameFormatPaneWithoutCheckBox(VanChartStylePane parent, JPanel showOnPane) { + super(parent, showOnPane); + } + + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_Level_Name"); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/MultiPieSeriesNameFormatPaneWithoutCheckBox.java b/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/MultiPieSeriesNameFormatPaneWithoutCheckBox.java new file mode 100644 index 000000000..95cf23f2e --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/MultiPieSeriesNameFormatPaneWithoutCheckBox.java @@ -0,0 +1,18 @@ +package com.fr.van.chart.multilayer.style; + +import com.fr.design.i18n.Toolkit; +import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithoutCheckBox; +import com.fr.van.chart.designer.style.VanChartStylePane; + +import javax.swing.JPanel; + +public class MultiPieSeriesNameFormatPaneWithoutCheckBox extends SeriesNameFormatPaneWithoutCheckBox { + + public MultiPieSeriesNameFormatPaneWithoutCheckBox(VanChartStylePane parent, JPanel showOnPane) { + super(parent, showOnPane); + } + + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_MultiPie_Series_Name"); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieLabelContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieLabelContentPane.java index 637279d13..8b755a18c 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieLabelContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieLabelContentPane.java @@ -4,7 +4,9 @@ import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.multilayer.style.AttrTooltipMultiLevelNameFormat; import com.fr.van.chart.designer.component.VanChartLabelContentPane; import com.fr.van.chart.designer.component.format.PercentFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.PercentFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.ValueFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.ValueFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -25,6 +27,13 @@ public class VanChartMultiPieLabelContentPane extends VanChartLabelContentPane { percentFormatPane = new PercentFormatPaneWithCheckBox(parent, showOnPane); } + protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { + richTextCategoryNameFormatPane = new MultiPieLevelNameFormatPaneWithoutCheckBox(parent, showOnPane); + richTextSeriesNameFormatPane = new MultiPieSeriesNameFormatPaneWithoutCheckBox(parent, showOnPane); + richTextValueFormatPane = new ValueFormatPaneWithoutCheckBox(parent, showOnPane); + richTextPercentFormatPane = new PercentFormatPaneWithoutCheckBox(parent, showOnPane); + } + protected AttrTooltipContent createAttrTooltip() { AttrTooltipContent content = new AttrTooltipContent(); content.setCategoryFormat(new AttrTooltipMultiLevelNameFormat()); diff --git a/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieTooltipContentPane.java index 3c500d3bf..7e94fb8cb 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieTooltipContentPane.java @@ -4,7 +4,9 @@ import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.multilayer.style.AttrTooltipMultiLevelNameFormat; import com.fr.van.chart.designer.component.VanChartTooltipContentPane; import com.fr.van.chart.designer.component.format.PercentFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.PercentFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.ValueFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.ValueFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -25,6 +27,13 @@ public class VanChartMultiPieTooltipContentPane extends VanChartTooltipContentPa percentFormatPane = new PercentFormatPaneWithCheckBox(parent, showOnPane); } + protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { + richTextCategoryNameFormatPane = new MultiPieLevelNameFormatPaneWithoutCheckBox(parent, showOnPane); + richTextSeriesNameFormatPane = new MultiPieSeriesNameFormatPaneWithoutCheckBox(parent, showOnPane); + richTextValueFormatPane = new ValueFormatPaneWithoutCheckBox(parent, showOnPane); + richTextPercentFormatPane = new PercentFormatPaneWithoutCheckBox(parent, showOnPane); + } + @Override protected AttrTooltipContent createAttrTooltip() { AttrTooltipContent content = new AttrTooltipContent(); diff --git a/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMutiPieRefreshTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMutiPieRefreshTooltipContentPane.java index 56893ec66..1cd5a6e84 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMutiPieRefreshTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMutiPieRefreshTooltipContentPane.java @@ -1,7 +1,9 @@ package com.fr.van.chart.multilayer.style; import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -25,6 +27,14 @@ public class VanChartMutiPieRefreshTooltipContentPane extends VanChartMultiPieTo changedPercentFormatPane = new ChangedPercentFormatPaneWithCheckBox(parent, showOnPane); } + @Override + protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { + super.initRichTextFormatPane(parent, showOnPane); + + richTextChangedValueFormatPane = new ChangedValueFormatPaneWithoutCheckBox(parent, showOnPane); + richTextChangedPercentFormatPane = new ChangedPercentFormatPaneWithoutCheckBox(parent, showOnPane); + } + protected double[] getRowSize(double p){ return new double[]{p,p,p,p,p,p}; } @@ -40,4 +50,15 @@ public class VanChartMutiPieRefreshTooltipContentPane extends VanChartMultiPieTo }; } + protected Component[][] getRichTextComponents() { + return new Component[][]{ + new Component[]{richTextCategoryNameFormatPane, null}, + new Component[]{richTextSeriesNameFormatPane, null}, + new Component[]{richTextValueFormatPane, null}, + new Component[]{richTextChangedValueFormatPane, null}, + new Component[]{richTextPercentFormatPane, null}, + new Component[]{richTextChangedPercentFormatPane, null} + }; + } + } diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterRefreshTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterRefreshTooltipContentPane.java index 902f65517..37a846076 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterRefreshTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterRefreshTooltipContentPane.java @@ -3,7 +3,9 @@ package com.fr.van.chart.scatter; import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.scatter.attr.ScatterAttrTooltipContent; import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -15,7 +17,7 @@ import java.awt.Component; public class VanChartScatterRefreshTooltipContentPane extends VanChartScatterTooltipContentPane { private ChangedValueFormatPaneWithCheckBox changedSizeFormatPane; - + private ChangedValueFormatPaneWithoutCheckBox richTextChangedSizeFormatPane; public VanChartScatterRefreshTooltipContentPane(VanChartStylePane parent, JPanel showOnPane) { super(null, showOnPane); @@ -28,6 +30,12 @@ public class VanChartScatterRefreshTooltipContentPane extends VanChartScatterToo changedPercentFormatPane = new ChangedPercentFormatPaneWithCheckBox(parent, showOnPane); } + protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { + super.initRichTextFormatPane(parent, showOnPane); + + richTextChangedSizeFormatPane = new ChangedValueFormatPaneWithoutCheckBox(parent, showOnPane); + richTextChangedPercentFormatPane = new ChangedPercentFormatPaneWithoutCheckBox(parent, showOnPane); + } protected double[] getRowSize(double p) { return new double[]{p, p, p, p, p, p}; @@ -36,14 +44,26 @@ public class VanChartScatterRefreshTooltipContentPane extends VanChartScatterToo protected Component[][] getPaneComponents() { return new Component[][]{ new Component[]{seriesNameFormatPane, null}, - new Component[]{getxFormatPane(), null}, - new Component[]{getyFormatPane(), null}, + new Component[]{getXFormatPane(), null}, + new Component[]{getYFormatPane(), null}, new Component[]{getSizeFormatPane(), null}, new Component[]{changedSizeFormatPane, null}, new Component[]{changedPercentFormatPane, null}, }; } + @Override + protected Component[][] getRichTextComponents() { + return new Component[][]{ + new Component[]{richTextSeriesNameFormatPane, null}, + new Component[]{getRichTextXFormatPane(), null}, + new Component[]{getRichTextYFormatPane(), null}, + new Component[]{getRichTextSizeFormatPane(), null}, + new Component[]{richTextChangedSizeFormatPane, null}, + new Component[]{richTextChangedPercentFormatPane, null} + }; + } + @Override protected void populateFormatPane(AttrTooltipContent attrTooltipContent) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterTooltipContentPane.java index 705ea1a0f..f1a13d8cf 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterTooltipContentPane.java @@ -4,8 +4,11 @@ import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.scatter.attr.ScatterAttrTooltipContent; import com.fr.van.chart.designer.component.VanChartTooltipContentPane; import com.fr.van.chart.designer.component.format.ValueFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.ValueFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.XFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.XFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.YFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.YFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -20,11 +23,15 @@ public class VanChartScatterTooltipContentPane extends VanChartTooltipContentPa private YFormatPaneWithCheckBox yFormatPane; private ValueFormatPaneWithCheckBox sizeFormatPane; - public XFormatPaneWithCheckBox getxFormatPane() { + private XFormatPaneWithoutCheckBox richTextXFormatPane; + private YFormatPaneWithoutCheckBox richTextYFormatPane; + private ValueFormatPaneWithoutCheckBox richTextSizeFormatPane; + + public XFormatPaneWithCheckBox getXFormatPane() { return xFormatPane; } - public YFormatPaneWithCheckBox getyFormatPane() { + public YFormatPaneWithCheckBox getYFormatPane() { return yFormatPane; } @@ -32,6 +39,18 @@ public class VanChartScatterTooltipContentPane extends VanChartTooltipContentPa return sizeFormatPane; } + public XFormatPaneWithoutCheckBox getRichTextXFormatPane() { + return richTextXFormatPane; + } + + public YFormatPaneWithoutCheckBox getRichTextYFormatPane() { + return richTextYFormatPane; + } + + public ValueFormatPaneWithoutCheckBox getRichTextSizeFormatPane() { + return richTextSizeFormatPane; + } + public VanChartScatterTooltipContentPane(VanChartStylePane parent, JPanel showOnPane){ super(parent, showOnPane); } @@ -45,6 +64,15 @@ public class VanChartScatterTooltipContentPane extends VanChartTooltipContentPa sizeFormatPane = new ValueFormatPaneWithCheckBox(parent, showOnPane); } + @Override + protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { + super.initRichTextFormatPane(parent, showOnPane); + + richTextXFormatPane = new XFormatPaneWithoutCheckBox(parent, showOnPane); + richTextYFormatPane = new YFormatPaneWithoutCheckBox(parent, showOnPane); + richTextSizeFormatPane = new ValueFormatPaneWithoutCheckBox(parent, showOnPane); + } + @Override protected Component[][] getPaneComponents(){ return new Component[][]{ @@ -55,6 +83,16 @@ public class VanChartScatterTooltipContentPane extends VanChartTooltipContentPa }; } + @Override + protected Component[][] getRichTextComponents() { + return new Component[][]{ + new Component[]{richTextSeriesNameFormatPane, null}, + new Component[]{richTextXFormatPane, null}, + new Component[]{richTextYFormatPane, null}, + new Component[]{richTextSizeFormatPane, null} + }; + } + @Override protected void populateFormatPane(AttrTooltipContent attrTooltipContent) { super.populateFormatPane(attrTooltipContent); diff --git a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureRefreshTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureRefreshTooltipContentPane.java index 5fa83be5b..f5dd6fbd5 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureRefreshTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureRefreshTooltipContentPane.java @@ -1,7 +1,9 @@ package com.fr.van.chart.structure.desinger.style; import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -23,6 +25,13 @@ public class VanChartStructureRefreshTooltipContentPane extends VanChartStructur changedPercentFormatPane = new ChangedPercentFormatPaneWithCheckBox(parent, showOnPane); } + protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { + super.initRichTextFormatPane(parent, showOnPane); + + richTextChangedValueFormatPane = new ChangedValueFormatPaneWithoutCheckBox(parent, showOnPane); + richTextChangedPercentFormatPane = new ChangedPercentFormatPaneWithoutCheckBox(parent, showOnPane); + } + protected double[] getRowSize(double p){ return new double[]{p,p,p,p,p}; } @@ -37,4 +46,15 @@ public class VanChartStructureRefreshTooltipContentPane extends VanChartStructur new Component[]{changedPercentFormatPane,null}, }; } + + @Override + protected Component[][] getRichTextComponents() { + return new Component[][]{ + new Component[]{richTextCategoryNameFormatPane, null}, + new Component[]{richTextSeriesNameFormatPane, null}, + new Component[]{richTextValueFormatPane, null}, + new Component[]{richTextChangedValueFormatPane, null}, + new Component[]{richTextChangedPercentFormatPane, null} + }; + } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureTooltipContentPane.java index 63490eaff..29fd61739 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureTooltipContentPane.java @@ -1,13 +1,18 @@ package com.fr.van.chart.structure.desinger.style; +import com.fr.design.i18n.Toolkit; import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.multilayer.style.AttrTooltipMultiLevelNameFormat; import com.fr.van.chart.designer.component.VanChartTooltipContentPane; import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.PercentFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.PercentFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.ValueFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.ValueFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -30,24 +35,48 @@ public class VanChartStructureTooltipContentPane extends VanChartTooltipContentP }; } + @Override + protected Component[][] getRichTextComponents() { + return new Component[][]{ + new Component[]{richTextCategoryNameFormatPane, null}, + new Component[]{richTextSeriesNameFormatPane, null}, + new Component[]{richTextValueFormatPane, null} + }; + } + @Override protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane){ categoryNameFormatPane = new CategoryNameFormatPaneWithCheckBox(parent, showOnPane){ @Override protected String getCheckBoxText() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Node_Name"); + return Toolkit.i18nText("Fine-Design_Chart_Node_Name"); } }; seriesNameFormatPane = new SeriesNameFormatPaneWithCheckBox(parent, showOnPane){ @Override protected String getCheckBoxText() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_MultiPie_Series_Name"); + return Toolkit.i18nText("Fine-Design_Chart_MultiPie_Series_Name"); } }; valueFormatPane = new ValueFormatPaneWithCheckBox(parent, showOnPane); percentFormatPane = new PercentFormatPaneWithCheckBox(parent, showOnPane); } + protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { + richTextCategoryNameFormatPane = new CategoryNameFormatPaneWithoutCheckBox(parent, showOnPane) { + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_Node_Name"); + } + }; + richTextSeriesNameFormatPane = new SeriesNameFormatPaneWithoutCheckBox(parent, showOnPane) { + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_MultiPie_Series_Name"); + } + }; + richTextValueFormatPane = new ValueFormatPaneWithoutCheckBox(parent, showOnPane); + richTextPercentFormatPane = new PercentFormatPaneWithoutCheckBox(parent, showOnPane); + } + @Override protected AttrTooltipContent createAttrTooltip() { AttrTooltipContent attrTooltipContent = new AttrTooltipContent(); diff --git a/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudRefreshTootipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudRefreshTootipContentPane.java index 4f748214f..513f9f386 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudRefreshTootipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudRefreshTootipContentPane.java @@ -1,8 +1,11 @@ package com.fr.van.chart.wordcloud.designer.style; +import com.fr.design.i18n.Toolkit; import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -23,13 +26,25 @@ public class VanChartWordCloudRefreshTootipContentPane extends VanChartWordCloud changedValueFormatPane = new ChangedValueFormatPaneWithCheckBox(parent, showOnPane){ @Override protected String getCheckBoxText() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Change_Word_Value"); + return Toolkit.i18nText("Fine-Design_Chart_Change_Word_Value"); } }; changedPercentFormatPane = new ChangedPercentFormatPaneWithCheckBox(parent, showOnPane); } + protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { + super.initRichTextFormatPane(parent, showOnPane); + + richTextChangedValueFormatPane = new ChangedValueFormatPaneWithoutCheckBox(parent, showOnPane) { + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_Change_Word_Value"); + } + }; + + richTextChangedPercentFormatPane = new ChangedPercentFormatPaneWithoutCheckBox(parent, showOnPane); + } + protected double[] getRowSize(double p){ return new double[]{p,p,p,p,p,p}; } @@ -44,4 +59,15 @@ public class VanChartWordCloudRefreshTootipContentPane extends VanChartWordCloud new Component[]{changedPercentFormatPane,null}, }; } + + protected Component[][] getRichTextComponents() { + return new Component[][]{ + new Component[]{richTextCategoryNameFormatPane, null}, + new Component[]{richTextSeriesNameFormatPane, null}, + new Component[]{richTextValueFormatPane, null}, + new Component[]{richTextChangedValueFormatPane, null}, + new Component[]{richTextPercentFormatPane, null}, + new Component[]{richTextChangedPercentFormatPane, null} + }; + } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudTooltipContentPane.java index 08845b2b7..90c017b82 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudTooltipContentPane.java @@ -1,13 +1,18 @@ package com.fr.van.chart.wordcloud.designer.style; +import com.fr.design.i18n.Toolkit; import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.base.format.AttrTooltipNameFormat; import com.fr.van.chart.designer.component.VanChartTooltipContentPane; import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.PercentFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.PercentFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.ValueFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.ValueFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -25,24 +30,43 @@ public class VanChartWordCloudTooltipContentPane extends VanChartTooltipContentP categoryNameFormatPane = new CategoryNameFormatPaneWithCheckBox(parent, showOnPane){ @Override protected String getCheckBoxText() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_MultiPie_Series_Name"); + return Toolkit.i18nText("Fine-Design_Chart_MultiPie_Series_Name"); } }; seriesNameFormatPane = new SeriesNameFormatPaneWithCheckBox(parent, showOnPane){ @Override protected String getCheckBoxText() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Word_Name"); + return Toolkit.i18nText("Fine-Design_Chart_Word_Name"); } }; valueFormatPane = new ValueFormatPaneWithCheckBox(parent, showOnPane){ @Override protected String getCheckBoxText() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Word_Value"); + return Toolkit.i18nText("Fine-Design_Chart_Word_Value"); } }; percentFormatPane = new PercentFormatPaneWithCheckBox(parent, showOnPane); } + protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { + richTextCategoryNameFormatPane = new CategoryNameFormatPaneWithoutCheckBox(parent, showOnPane){ + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_MultiPie_Series_Name"); + } + }; + richTextSeriesNameFormatPane = new SeriesNameFormatPaneWithoutCheckBox(parent, showOnPane){ + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_Word_Name"); + } + }; + richTextValueFormatPane = new ValueFormatPaneWithoutCheckBox(parent, showOnPane){ + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_Word_Value"); + } + }; + richTextPercentFormatPane = new PercentFormatPaneWithoutCheckBox(parent, showOnPane); + } + @Override protected AttrTooltipContent createAttrTooltip() { AttrTooltipContent attrTooltipContent = new AttrTooltipContent(); diff --git a/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html b/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html new file mode 100644 index 000000000..3189374da --- /dev/null +++ b/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/editor.constant.js b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.constant.js new file mode 100644 index 000000000..3642aed28 --- /dev/null +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.constant.js @@ -0,0 +1,6 @@ +!(function () { + + BI.constant("bi.constant.design.chart.common.editor.placeholder_style", { + fontColor: "#c4c9d1" + }); +}()); \ No newline at end of file diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js new file mode 100644 index 000000000..216243069 --- /dev/null +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js @@ -0,0 +1,241 @@ +!(function () { + var Widget = BI.inherit(BI.Widget, { + props: { + baseCls: "bi-design-chart-common-editor", + isAuto: true, + content: "", + placeholder: "", + fontStyle: {}, + dimensionIds: [], + toolbar: { + buttons: [] + }, + textAlign: "center" + }, + + _store: function () { + var o = this.options; + + return BI.Models.getModel("bi.model.design.chart.common.editor", { + dimensionIds: o.dimensionIds, + isAuto: o.isAuto + }); + }, + + render: function () { + var self = this, o = this.options; + this.editor = BI.createWidget({ + type: "bi.nic_editor", + $value: "chart-common-editor", + height: 365, + cls: "editor bi-border bi-focus-shadow " + (o.textAlign === "center" ? "editor-center-text" : ""), + listeners: [{ + eventName: BI.NicEditor.EVENT_FOCUS, + action: function () { + self.clearPlaceholder(); + self.store.setEditorBlurState(false); + } + }, { + eventName: BI.NicEditor.EVENT_BLUR, + action: function () { + self.setPlaceholder(); + self.store.setEditorBlurState(true); + } + }] + }); + + return { + type: "bi.vtape", + ref: function (_ref) { + self.bar = _ref; + }, + items: [{ + type: "bi.htape", + items: [{ + type: "bi.label", + text: "字体样式: ", + textAlign: "left", + width: 70 + }, { + type: "bi.button_group", + items: this.model.fontStyleItems, + ref: function (_ref) { + self.fontStyleGroup = _ref; + }, + listeners: [{ + eventName: BI.ButtonGroup.EVENT_CHANGE, + action: function () { + var isAuto = this.getValue()[0]; + self.store.changeIsAuto(isAuto); + self.changeFontStyleMode(isAuto); + } + }], + layouts: [{ + type: "bi.left", + rgap: 5 + }], + value: this.model.mode, + width: 125 + }, this._getToolBar()], + height: 24 + }, { + el: this.editor, + tgap: 10 + }] + }; + }, + + _getToolBar: function () { + var self = this; + return { + type: "bi.design.chart.common.editor.toolbar", + cls: "toolbar-region", + wId: this.options.wId, + editor: this.editor, + buttons: this.options.toolbar.buttons, + ref: function (_ref) { + self.toolbar = _ref; + } + }; + }, + + mounted: function () { + this.editor.bindToolbar(this.bar); + this.editor.setValue(this._formatContent(this.options.content)); + this.setFocus(); + }, + + _cleanHtml: function (value) { + var editorService = BI.Services.getService("bi.service.design.chart.common.editor"); + var result = BI.replaceAll(value, "

", ""); + // 去掉image的src属性,因为数据太大了 + result = value.replaceAll("", function (imageStr) { + var attrs = editorService.getImageAttr(imageStr); + var str = ""; + }); + + return result; + }, + + getValue: function () { + var editorService = BI.Services.getService("bi.service.design.chart.common.editor"); + var value = this._cleanHtml(this.editor.getValue(BI.NicEditor.FormatType.ESCAPE)); + // BI.each(this.model.dimensionIds, function (idx, dId) { + // var fullName = BI.Utils.getNotGeoDimensionFullName(dId); + // value = editorService.appendImageAttr(value, fullName, BICst.RICH_TEXT_INFO.DATA_ID, dId); + // }); + + if (editorService.isEmptyRichText(value)) { + value = ""; + } + + if (BI.isNotEmptyString(this.options.placeholder) && editorService.isRichTextEqual(value, this.options.placeholder)) { + value = null; + } + + return { + isAuto: this.model.isAuto, + content: value + }; + }, + + setValue: function (obj) { + var keys = BI.keys(obj); + if (BI.contains(keys, "content")) { + this.editor.setValue(this._formatContent(obj.content)); + } + if (BI.contains(keys, "isAuto")) { + this.store.changeIsAuto(obj.isAuto); + this.fontStyleGroup.setValue(obj.isAuto); + } + }, + + _formatContent: function (content) { + var editorService = BI.Services.getService("bi.service.design.chart.common.editor"); + + content = editorService.setImageSrc(content); + + if (editorService.isBlankRichText(content) + || editorService.isRichTextEqual(content, this.options.placeholder)) { + content = this.options.placeholder || ""; + } + + return content; + }, + + // 切换到“自动”时的处理方法 + _switchToAutoStyle: function () { + var editorService = BI.Services.getService("bi.service.design.chart.common.editor"), + content = this.editor.getValue(BI.NicEditor.FormatType.ESCAPE), + isEqualToPlaceholder = editorService.isRichTextEqual(content, this.options.placeholder); + + var HTML_ONLY_STYLE_TAG = "||||||||||||||||||||

"; + + if (!isEqualToPlaceholder) { + content = content.replaceAll(HTML_ONLY_STYLE_TAG, ""); + } + + return content; + }, + + clearPlaceholder: function () { + var editorService = BI.Services.getService("bi.service.design.chart.common.editor"); + var content = this.editor.getValue(BI.NicEditor.FormatType.ESCAPE); + var isSameContent = editorService.isRichTextEqual(content, this.options.placeholder); + + if (isSameContent) { + content = editorService.convertText2RichText("", this.options.fontStyle); + this.editor.setValue(content); + this.setFocus(); + } + }, + + setPlaceholder: function () { + var editorService = BI.Services.getService("bi.service.design.chart.common.editor"); + var content = this.editor.getValue(BI.NicEditor.FormatType.ESCAPE); + var isSameContent = editorService.isBlankRichText(content); + + if (isSameContent) { + this.editor.setValue(this.options.placeholder); + } + }, + + // 字体样式切换 + changeFontStyleMode: function (isAuto) { + var editorService = BI.Services.getService("bi.service.design.chart.common.editor"); + var switchFn = this.options.switchFn, + content = this.editor.getValue(BI.NicEditor.FormatType.ESCAPE), + origin = content; + if (isAuto) { + content = this._switchToAutoStyle(); + this.setFocus(); + } else if (editorService.isRichTextEqual(content, this.options.placeholder)) { + content = ""; + } + if (BI.isFunction(switchFn)) { + content = switchFn(isAuto, content); + } + if (content !== origin) { + this.editor.setValue(content); + } + }, + + setFocus: function () { + var instance = this.editor.instance; + instance && instance.initSelection(); + } + }); + + Widget.EVENT_CHANGE = "EVENT_CHANGE"; + + BI.shortcut("bi.design.chart.common.editor", Widget); + +}()); diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/editor.model.js b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.model.js new file mode 100644 index 000000000..dbe278446 --- /dev/null +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.model.js @@ -0,0 +1,53 @@ +!(function () { + + var Model = BI.inherit(Fix.Model, { + childContext: ["isAuto", "dimensionIds"], + + state: function () { + var o = this.options; + + return { + isAuto: o.isAuto, + dimensionIds: o.dimensionIds, + isEditorBlur: true + }; + }, + + computed: { + fontStyleItems: function () { + return [{ + type: "bi.single_select_radio_item", + text: "自动", + hgap: 5, + logic: { + dynamic: true + }, + value: true, + selected: this.options.isAuto + }, { + type: "bi.single_select_radio_item", + text: "自定义", + hgap: 5, + logic: { + dynamic: true + }, + value: false, + selected: !this.options.isAuto + }]; + } + }, + + actions: { + changeIsAuto: function (isAuto) { + this.model.isAuto = isAuto; + }, + + setEditorBlurState: function (isBlur) { + this.model.isEditorBlur = isBlur; + } + } + }); + + BI.model("bi.model.design.chart.common.editor", Model); + +}()); diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/editor.service.js b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.service.js new file mode 100644 index 000000000..87fa2bdf6 --- /dev/null +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.service.js @@ -0,0 +1,562 @@ +!(function () { + + /** + * HTML解析类,使用方法: + * new HTMLParser().parse(htmlText, { + * startTag: function (tagName, attrs) {}, + * endTag: function (tagName) {}, + * text: function (text) {} + * }) + */ + function HTMLParser () { + + } + + HTMLParser.prototype = { + constructor: HTMLParser, + + startTagPattern: /<([-\w\d_]+)\s*([^>]*)\s*(\/?)>/, + endTagPattern: /^<\/([-\w\d_]+)[^>]*>/, + attrPattern: /([-\w\d_]+)\s*=\s*["']([^"']*)["']/g, + // 特殊的字符 + specialCharsPatterns: [{ + pattern: / /g, + subStr: " " + }, { + pattern: /</g, + subStr: "<" + }, { + pattern: />/g, + subStr: ">" + }, { + pattern: /&/g, + subStr: "&" + }], + + handle: { + // 以下为处理开始标签和文本的时候触发的函数,可以自定义 + startTag: function () { + }, + endTag: function () { + }, + text: function () { + } + }, + + /** + * + * @param html + * @param handle + * @param isReplaceSpecialChars 是否需要替换HTML中的特殊字符 + */ + parse: function (html, handle, isReplaceSpecialChars) { + var index, isText = false, + match, last = html, + me = this; + + isReplaceSpecialChars = isReplaceSpecialChars !== null ? isReplaceSpecialChars : true; + + if (BI.isPlainObject(handle)) { + BI.isFunction(handle.startTag) && (this.handle.startTag = handle.startTag); + BI.isFunction(handle.endTag) && (this.handle.endTag = handle.endTag); + BI.isFunction(handle.text) && (this.handle.text = handle.text); + } + + while (html) { + isText = true; + + // 结束标签 + if (html.indexOf("'$%{}"]/.test(params)) { + return window.encodeURIComponent(params).replace(/'/g, escape); + } + return params; + }, + + decode: function (params) { + try { + var result = window.decodeURIComponent(params); + if (/[<>'$%{}"]/.test(result)) { + return result; + } + return params; + } catch (e) { + return params; + } + }, + + HTMLParser: HTMLParser, + + getImageAttr: getImageAttr, + + /** + * 构造一个富文本中的参数图片 + */ + getEditorParamImage: function (param, fillStyle) { + var attr = BI.DOM.getImage(param, fillStyle); + return "" + this.encode(attr.param)
+                + ""; + }, + + /** + * 给image设置属性 + */ + appendImageAttr: function (html, altValue, attrName, attrValue, isCovered) { + altValue = this.encode(altValue); + attrName = this.encode(attrName); + attrValue = this.encode(attrValue); + isCovered = isCovered || false; // 属性是否可以覆盖 + + return html.replaceAll("", function (imageStr) { + var attrs = getImageAttr(imageStr); + + if (attrs && attrs["alt"] === altValue && (BI.isNull(attrs[attrName]) || isCovered)) { + attrs[attrName] = attrValue; + imageStr = ""; + }); + + return { + startHtml: startHtml, + endHtml: endHtml + }; + }, + + /** + * 将富文本HTML转化成普通的文本,不需要记录fontStyle + */ + convertRichText2Text: function (html) { + var content = "", + line = "", + htmlFragments = []; + + new HTMLParser().parse(html, { + startTag: function (tagName, attrs) { + // 只关心br、img + switch (tagName) { + case "br": + line += "\n"; + htmlFragments.push(tagName); + break; + case "img": + BI.each(attrs, function (idx, obj) { + if (obj.name === "alt") { + line += "${" + obj.value + "}"; + } + }); + break; + default: + break; + } + }, + endTag: function (tagName) { + if (tagName === "div") { + //

这样的情况下应该只代表一个回车符 + htmlFragments[htmlFragments.length - 1] !== "br" && (line += "\n"); + htmlFragments = []; + } + + content += line; + line = ""; + }, + text: function (text) { + htmlFragments.push(text); + line += text; + } + }); + + // 去掉最后的换行符 + content = content.replace(/\n$/, ""); + + return content; + }, + + convertImage2Text: function (html) { + if (BI.isNull(html)) { + return html; + } + return html.replaceAll("", function (imageStr) { + var matched = imageStr.match(/alt="(.*?)"/); + var startHtml = ""; + var endHtml = ""; + return startHtml + (matched ? matched[1] : imageStr) + endHtml; + }); + }, + + isRichTextEqual: function (html1, html2) { + if (BI.isNotNull(html1)) { + html1 = this.convertImage2Text(html1); + } + if (BI.isNotNull(html2)) { + html2 = this.convertImage2Text(html2); + } + + return html1 === html2; + }, + + isRichTextNotEqual: function (html1, html2) { + return !this.isRichTextEqual(html1, html2); + }, + + isBlankRichText: function (html) { + html = html || ""; + html = this.convertRichText2Text(html); + return BI.trim(html).length === 0; + }, + + // 显示整个富文本中缺失的字段 + showMissingFields: function (html, validDimensionIds) { + var self = this; + + return html.replaceAll("", function (imageStr) { + var attrs = getImageAttr(imageStr); + return attrs && BI.contains(validDimensionIds, attrs[BICst.RICH_TEXT_INFO.DATA_ID]) + ? imageStr + : self.getMissingFieldImage( + attrs[BICst.RICH_TEXT_INFO.DATA_ID], + attrs[BICst.RICH_TEXT_INFO.DATA_NAME], + attrs[BICst.RICH_TEXT_INFO.ALT] + ); + }); + }, + + // 获取缺失元素的图片 + getMissingFieldImage: function (dId, name, fullName) { + var missingText = ""; + var missingImage = BI.DOM.getImage(missingText, "#ff0000"); + var html = this.getEditorParamImage(fullName, "#ff0000"); + + // 将原来的dId、name、fullName保存起来 + html = this.appendImageAttr(html, fullName, BICst.RICH_TEXT_INFO.DATA_ORIGIN_ID, dId); + html = this.appendImageAttr(html, fullName, BICst.RICH_TEXT_INFO.DATA_ORIGIN_NAME, name); + html = this.appendImageAttr(html, fullName, BICst.RICH_TEXT_INFO.DATA_ORIGIN_FULL_NAME, fullName); + html = this.appendImageAttr(html, fullName, BICst.RICH_TEXT_INFO.SRC, missingImage.src, true); + // 标记出这个参数是一个“缺失元素” + html = this.appendImageAttr(html, fullName, BICst.RICH_TEXT_INFO.DATA_IS_MISSING_FIELD, "true", true); + html = this.appendImageAttr(html, fullName, "style", missingImage.style, true); + return html; + }, + + // 将“缺失元素”替换成原来的字段 + restoreMissingField: function (html) { + var self = this; + + return html.replaceAll("", function (imageStr) { + var attrs = getImageAttr(imageStr); + + if (attrs && attrs[BICst.RICH_TEXT_INFO.DATA_ORIGIN_ID]) { + var fullName = attrs[BICst.RICH_TEXT_INFO.DATA_ORIGIN_FULL_NAME]; + var image = self.getEditorParamImage(fullName); + + image = self.appendImageAttr(image, fullName, BICst.RICH_TEXT_INFO.DATA_ID, attrs[BICst.RICH_TEXT_INFO.DATA_ORIGIN_ID]); + image = self.appendImageAttr(image, fullName, BICst.RICH_TEXT_INFO.DATA_NAME, attrs[BICst.RICH_TEXT_INFO.DATA_ORIGIN_NAME]); + return image; + } + + if (attrs + && attrs[BICst.RICH_TEXT_INFO.DATA_IS_INSERT_PARAM] + && !attrs[BICst.RICH_TEXT_INFO.DATA_ID] + ) { + imageStr = self.appendImageAttr( + imageStr, + attrs[BICst.RICH_TEXT_INFO.ALT], + BICst.RICH_TEXT_INFO.DATA_UN_VALID, + "true", + true + ); + } + + return imageStr; + }); + }, + + // 将富文本字符串中由用户主动插入的字段参数标记出来 + markTheInsertParamImages: function (html) { + return html.replaceAll("", function (imageStr) { + var attrs = getImageAttr(imageStr); + + // "缺失元素"和普通的字段参数直接过滤(从富文本编辑器中插入的参数只有data-id属性) + if (BI.has(attrs, BICst.RICH_TEXT_INFO.DATA_NAME) + || BI.has(attrs, BICst.RICH_TEXT_INFO.DATA_ORIGIN_ID)) { + return imageStr; + } + + attrs[BICst.RICH_TEXT_INFO.DATA_IS_INSERT_PARAM] = "true"; + imageStr = "", function (imageStr) { + var attrs = self.getImageAttr(imageStr); + // 已有src + if (BI.has(attrs, BICst.RICH_TEXT_INFO.SRC) && attrs[BICst.RICH_TEXT_INFO.SRC]) { + return imageStr; + } + var alt = self.decode(attrs[BICst.RICH_TEXT_INFO.ALT]); + var image = BI.DOM.getImage(alt); + imageStr = self.appendImageAttr(imageStr, alt, BICst.RICH_TEXT_INFO.SRC, image.src, true); + imageStr = self.appendImageAttr(imageStr, alt, "style", image.style, true); + return imageStr; + }); + }, + + isEmptyRichText: function (html) { + return "" === html.replaceAll("|

|
", ""); + }, + + // BI-23091 设置显示名之后更新参数名称 + getNewParamNameRichText: function (content) { + if (!content) { + return content; + } + var self = this; + return content.replaceAll("", function (imageStr) { + var attrs = self.getImageAttr(imageStr); + // 缺失元素 + if (attrs[BICst.RICH_TEXT_INFO.DATA_IS_MISSING_FIELD]) { + return imageStr; + } + var alt = attrs[BICst.RICH_TEXT_INFO.ALT], + dId = attrs[BICst.RICH_TEXT_INFO.DATA_ID], + name = BI.Utils.getNotGeoDimensionFullName(dId); + + if (name !== alt) { + imageStr = self.appendImageAttr(imageStr, alt, BICst.RICH_TEXT_INFO.ALT, name, true); + } + return imageStr; + }); + } + }); + + BI.service("bi.service.design.chart.common.editor", Service); + +}()); diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/insertcombo/combo.insert_param.js b/designer-chart/src/main/resources/com/fr/design/editor/script/insertcombo/combo.insert_param.js new file mode 100644 index 000000000..841860fc0 --- /dev/null +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/insertcombo/combo.insert_param.js @@ -0,0 +1,114 @@ +!(function () { + var Widget = BI.inherit(BI.RichEditorParamAction, { + props: { + baseCls: "bi-design-chart-common-editor-insert-param", + dimensionIds: [], + editor: null + }, + + _store: function () { + return BI.Models.getModel("bi.model.design.chart.common.editor.insert_param"); + }, + + watch: { + isSelectedParam: function () { + var editorService = BI.Services.getService("bi.service.design.chart.common.editor"); + this.addParam(this.model.param, editorService.encode); + this.combo.hideView(); + // this._restorePosition(); + } + }, + + render: function () { + var self = this; + + var adapter = BI.createWidget({ + type: "bi.button_group", + items: this.model.items, + chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE, + behaviors: {}, + layouts: [{ + type: "bi.vertical" + }], + listeners: [{ + eventName: BI.ButtonGroup.EVENT_CHANGE, + action: function () { + self._savePosition(); + self.store.changeParam(this.getValue()[0]); + } + }] + }); + + var searchPopup = { + type: "bi.vertical", + cls: "bi-border", + hgap: 15, + tgap: 5, + bgap: 10, + items: [{ + type: "bi.searcher", + adapter: adapter, + width: 210, + height: 24, + listeners: [{ + eventName: BI.Searcher.EVENT_CHANGE, + action: function () { + self.store.changeParam(this.getValue()[0]); + } + }] + }, adapter] + }; + + return { + type: "bi.combo", + direction: "bottom,left", + isNeedAdjustWidth: false, + el: { + type: "bi.vertical_adapt", + items: [{ + type: "bi.icon_change_button", + iconCls: "editor-insert-param-inactivated-font", + iconWidth: 24, + iconHeight: 24, + ref: function (_ref) { + self.iconButtonTrigger = _ref; + } + }] + }, + popup: { + el: searchPopup + }, + ref: function (_ref) { + self.combo = _ref; + }, + listeners: [{ + eventName: BI.Combo.EVENT_AFTER_POPUPVIEW, + action: function () { + self.iconButtonTrigger.setIcon("editor-insert-param-active-font"); + } + }, { + eventName: BI.Combo.EVENT_BEFORE_HIDEVIEW, + action: function () { + self.iconButtonTrigger.setIcon("editor-insert-param-inactivated-font"); + } + }] + }; + }, + + _savePosition: function () { + var instance = this._getInstance(); + instance.saveRng(); + }, + + _restorePosition: function () { + var instance = this._getInstance(); + instance.initSelection(); + }, + + _getInstance: function () { + return this.options.editor.selectedInstance || this.options.editor.getInstance(); + } + }); + + BI.shortcut("bi.design.chart.common.editor.insert_param", Widget); +}()); \ No newline at end of file diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/insertcombo/combo.insert_param.model.js b/designer-chart/src/main/resources/com/fr/design/editor/script/insertcombo/combo.insert_param.model.js new file mode 100644 index 000000000..d0a8f084e --- /dev/null +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/insertcombo/combo.insert_param.model.js @@ -0,0 +1,40 @@ +/* + * @Maintainers: xiaofu.qin + */ +!(function () { + + var Model = BI.inherit(Fix.Model, { + context: ["dimensionIds"], + + state: function () { + return { + param: "", + isSelectedParam: false + }; + }, + + computed: { + items: function () { + return BI.map(this.model.dimensionIds, function (idx, dId) { + var key = BI.keys(dId)[0]; + + return { + type: "bi.design.chart.common.editor.search", + text: key, + value: dId[key] + }; + }); + } + }, + + actions: { + changeParam: function (param) { + this.model.isSelectedParam = !this.model.isSelectedParam; + this.model.param = param; + } + } + }); + + BI.model("bi.model.design.chart.common.editor.insert_param", Model); + +} ()); diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/insertcombo/item/item.js b/designer-chart/src/main/resources/com/fr/design/editor/script/insertcombo/item/item.js new file mode 100644 index 000000000..bfd564441 --- /dev/null +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/insertcombo/item/item.js @@ -0,0 +1,38 @@ +!(function () { + + var Widget = BI.inherit(BI.BasicButton, { + props: { + text: "", + iconCls: "", + extraCls: "bi-list-item-active" + }, + + render: function () { + var o = this.options; + return { + type: "bi.vertical_adapt", + height: 25, + items: [{ + type: "bi.center_adapt", + cls: o.iconCls, + items: [{ + type: "bi.icon", + width: 16, + height: 16 + }], + width: 16, + height: 16 + }, { + type: "bi.label", + textAlign: "left", + lgap: 5, + text: o.text, + value: o.text + }] + }; + } + }); + + BI.shortcut("bi.design.chart.common.editor.search", Widget); + +}()); \ No newline at end of file diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/toolbar/disabled_bar_wrapper.js b/designer-chart/src/main/resources/com/fr/design/editor/script/toolbar/disabled_bar_wrapper.js new file mode 100644 index 000000000..5b07ea39f --- /dev/null +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/toolbar/disabled_bar_wrapper.js @@ -0,0 +1,22 @@ +/** + * 灰化toolbar的item + */ +!(function () { + + var Widget = BI.inherit(BI.Single, { + props: { + button: null + }, + + render: function () { + return { + type: "bi.vertical_adapt", + disabled: true, + items: [this.options.button] + }; + } + }); + + BI.shortcut("bi.design.chart.common.editor.toolbar.disabled_item_wrapper", Widget); + +}()); \ No newline at end of file diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/toolbar/toolbar.js b/designer-chart/src/main/resources/com/fr/design/editor/script/toolbar/toolbar.js new file mode 100644 index 000000000..4246ec9bc --- /dev/null +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/toolbar/toolbar.js @@ -0,0 +1,124 @@ +!(function () { + var RichEditorTextToolbar = BI.inherit(BI.Widget, { + + props: { + baseCls: "bi-rich-editor-text-toolbar", + height: 25, + editor: null, + buttons: [ + {type: "bi.rich_editor_font_chooser"}, + {type: "bi.rich_editor_size_chooser"}, + {type: "bi.rich_editor_bold_button"}, + {type: "bi.rich_editor_italic_button"}, + {type: "bi.rich_editor_underline_button"}, + {type: "bi.rich_editor_color_chooser"}, + {type: "bi.rich_editor_align_left_button"}, + {type: "bi.rich_editor_align_center_button"}, + {type: "bi.rich_editor_align_right_button"}, + {type: "bi.design.chart.common.editor.insert_param"} + ] + }, + + _store: function () { + return BI.Models.getModel("bi.model.design.chart.common.editor.toolbar"); + }, + + watch: { + isAuto: function (isAuto) { + this[isAuto ? "hideCustomFontTool" : "showCustomFontTool"](); + } + }, + + render: function () { + var self = this, + o = this.options; + + this.hasInsertCombo = o.buttons[o.buttons.length - 1].type === "bi.design.chart.common.editor.insert_param"; + + this.buttons = BI.createWidgets(BI.map(o.buttons, function (i, btn) { + return BI.extend(btn, { + editor: o.editor + }); + })); + + if (this.hasInsertCombo) { + var leftItems = BI.filter(this.buttons, function (idx) { + return idx !== self.buttons.length - 1; + }); + return { + type: "bi.left_right_vertical_adapt", + lrgap: 10, + items: { + left: this._getButtons(leftItems), + right: [this.buttons[this.buttons.length - 1]] + } + }; + } + + return { + type: "bi.vertical_adapt", + rgap: 10, + items: this._getButtons(this.buttons) + }; + }, + + mounted: function () { + var self = this; + if (BI.isIE9Below()) {// IE8下必须要设置unselectable才能不blur输入框 + this.element.mousedown(function () { + self._noSelect(self.element[0]); + }); + this._noSelect(this.element[0]); + } + + this.model.isAuto && this.hideCustomFontTool(); + }, + + _noSelect: function (element) { + if (element.setAttribute && element.nodeName.toLowerCase() !== "input" && element.nodeName.toLowerCase() !== "textarea") { + element.setAttribute("unselectable", "on"); + } + for (var i = 0; i < element.childNodes.length; i++) { + this._noSelect(element.childNodes[i]); + } + }, + + hideCustomFontTool: function () { + var self = this; + BI.each(this.buttons, function (idx, button) { + if (self.hasInsertCombo) { + idx !== self.buttons.length - 1 && button.setVisible(false); + } else { + button.setVisible(false); + } + }); + }, + + showCustomFontTool: function () { + var self = this; + BI.each(this.buttons, function (idx, button) { + if (self.hasInsertCombo) { + idx !== self.buttons.length - 1 && button.setVisible(true); + } else { + button.setVisible(true); + } + }); + }, + + _getButtons: function (buttons) { + return BI.map(buttons, function (idx, button) { + if (button.options.used === false) { + return { + type: "bi.design.chart.common.editor.toolbar.disabled_item_wrapper", + button: button, + title: button.options.title + }; + } + + return button; + }); + } + }); + + BI.shortcut("bi.design.chart.common.editor.toolbar", RichEditorTextToolbar); +})(); \ No newline at end of file diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/toolbar/toolbar.model.js b/designer-chart/src/main/resources/com/fr/design/editor/script/toolbar/toolbar.model.js new file mode 100644 index 000000000..96e30eee4 --- /dev/null +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/toolbar/toolbar.model.js @@ -0,0 +1,12 @@ +/* + * @Maintainers: xiaofu.qin + */ +!(function () { + + var Model = BI.inherit(Fix.Model, { + context: ["isAuto", "wId", "dimensionIds"] + }); + + BI.model("bi.model.design.chart.common.editor.toolbar", Model); + +} ()); \ No newline at end of file From d24aee2fa946497c7e4f56f334171cd4d4963730 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Sat, 19 Sep 2020 19:46:27 +0800 Subject: [PATCH 03/64] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../box/VanChartBoxTooltipContentPane.java | 24 ++-- .../fr/van/chart/designer/PlotFactory.java | 4 +- .../VanChartRefreshTooltipContentPane.java | 32 ++--- .../component/VanChartTooltipContentPane.java | 122 ++++++++++++++++-- .../label/GaugeLabelContentPane.java | 3 +- .../label/LabelContentPaneWithCate.java | 2 +- .../label/LabelContentPaneWithCateValue.java | 4 +- .../label/LabelContentPaneWithOutCate.java | 6 +- .../label/LabelContentPaneWithPercent.java | 2 +- ...efreshTooltipContentPaneWithOutSeries.java | 28 ++-- .../TooltipContentPaneWithOutSeries.java | 12 +- .../style/VanChartFunnelLabelContentPane.java | 29 +++-- ...nChartFunnelRefreshTooltipContentPane.java | 28 ++-- .../VanChartFunnelTooltipContentPane.java | 28 ++-- .../VanChartGanttTooltipContentPane.java | 23 ++-- .../label/VanChartMapLabelContentPane.java | 16 +-- .../VanChartMapRefreshTooltipContentPane.java | 40 +++--- .../VanChartMapTooltipContentPane.java | 16 +-- .../VanChartLineMapTooltipContentPane.java | 19 ++- .../VanChartMultiPieLabelContentPane.java | 17 +-- .../VanChartMultiPieTooltipContentPane.java | 17 +-- ...ChartMutiPieRefreshTooltipContentPane.java | 32 ++--- ...ChartScatterRefreshTooltipContentPane.java | 22 ++-- .../VanChartScatterTooltipContentPane.java | 8 +- .../VanChartStructureLabelContentPane.java | 24 ++-- ...artStructureRefreshTooltipContentPane.java | 44 ++++--- .../VanChartStructureTooltipContentPane.java | 42 +++--- ...artWordCloudRefreshTooltipContentPane.java | 79 ++++++++++++ ...hartWordCloudRefreshTootipContentPane.java | 73 ----------- .../VanChartWordCloudTooltipContentPane.java | 26 ++-- 30 files changed, 480 insertions(+), 342 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudRefreshTooltipContentPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudRefreshTootipContentPane.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java index 98dbbbb6e..d0dd67529 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java @@ -36,8 +36,8 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { } protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) { - categoryNameFormatPane = new CategoryNameFormatPaneWithCheckBox(parent, showOnPane); - seriesNameFormatPane = new SeriesNameFormatPaneWithCheckBox(parent, showOnPane); + setCategoryNameFormatPane(new CategoryNameFormatPaneWithCheckBox(parent, showOnPane)); + setSeriesNameFormatPane(new SeriesNameFormatPaneWithCheckBox(parent, showOnPane)); number = new VanChartFormatPaneWithCheckBox(parent, showOnPane) { protected String getCheckBoxText() { @@ -98,8 +98,8 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { double[] rowSize = {p, p}; Component[][] cateAndSeries = new Component[][]{ - new Component[]{categoryNameFormatPane, null}, - new Component[]{seriesNameFormatPane, null} + new Component[]{getCategoryNameFormatPane(), null}, + new Component[]{getSeriesNameFormatPane(), null} }; return TableLayoutHelper.createTableLayoutPane(cateAndSeries, rowSize, columnSize); @@ -152,8 +152,8 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { } public boolean isDirty() { - return categoryNameFormatPane.isDirty() - || seriesNameFormatPane.isDirty() + return getCategoryNameFormatPane().isDirty() + || getSeriesNameFormatPane().isDirty() || number.isDirty() || max.isDirty() || q3.isDirty() @@ -164,8 +164,8 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { } public void setDirty(boolean isDirty) { - categoryNameFormatPane.setDirty(isDirty); - seriesNameFormatPane.setDirty(isDirty); + getCategoryNameFormatPane().setDirty(isDirty); + getSeriesNameFormatPane().setDirty(isDirty); number.setDirty(isDirty); max.setDirty(isDirty); q3.setDirty(isDirty); @@ -180,8 +180,8 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { } protected void populateFormatPane(AttrTooltipContent attrTooltipContent) { - categoryNameFormatPane.populate(attrTooltipContent.getCategoryFormat()); - seriesNameFormatPane.populate(attrTooltipContent.getSeriesFormat()); + getCategoryNameFormatPane().populate(attrTooltipContent.getCategoryFormat()); + getSeriesNameFormatPane().populate(attrTooltipContent.getSeriesFormat()); if (attrTooltipContent instanceof AttrBoxTooltipContent) { AttrBoxTooltipContent boxTooltipContent = (AttrBoxTooltipContent) attrTooltipContent; @@ -199,8 +199,8 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { } protected void updateFormatPane(AttrTooltipContent attrTooltipContent) { - categoryNameFormatPane.update(attrTooltipContent.getCategoryFormat()); - seriesNameFormatPane.update(attrTooltipContent.getSeriesFormat()); + getCategoryNameFormatPane().update(attrTooltipContent.getCategoryFormat()); + getSeriesNameFormatPane().update(attrTooltipContent.getSeriesFormat()); if (attrTooltipContent instanceof AttrBoxTooltipContent) { AttrBoxTooltipContent boxTooltipContent = (AttrBoxTooltipContent) attrTooltipContent; diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java b/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java index d3e1adbb9..3bddc1aed 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java @@ -56,7 +56,7 @@ import com.fr.van.chart.scatter.component.label.VanChartScatterPlotLabelPane; import com.fr.van.chart.structure.desinger.style.VanChartStructureLabelContentPane; import com.fr.van.chart.structure.desinger.style.VanChartStructureRefreshTooltipContentPane; import com.fr.van.chart.structure.desinger.style.VanChartStructureTooltipContentPane; -import com.fr.van.chart.wordcloud.designer.style.VanChartWordCloudRefreshTootipContentPane; +import com.fr.van.chart.wordcloud.designer.style.VanChartWordCloudRefreshTooltipContentPane; import com.fr.van.chart.wordcloud.designer.style.VanChartWordCloudTooltipContentPane; import javax.swing.BorderFactory; @@ -182,7 +182,7 @@ public class PlotFactory { refreshTooltipContentMap.put(VanChartMultiPiePlot.class, VanChartMutiPieRefreshTooltipContentPane.class); refreshTooltipContentMap.put(VanChartTreeMapPlot.class, VanChartMutiPieRefreshTooltipContentPane.class); refreshTooltipContentMap.put(VanChartFunnelPlot.class, VanChartFunnelRefreshTooltipContentPane.class); - refreshTooltipContentMap.put(VanChartWordCloudPlot.class, VanChartWordCloudRefreshTootipContentPane.class); + refreshTooltipContentMap.put(VanChartWordCloudPlot.class, VanChartWordCloudRefreshTooltipContentPane.class); refreshTooltipContentMap.put(VanChartStructurePlot.class, VanChartStructureRefreshTooltipContentPane.class); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRefreshTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRefreshTooltipContentPane.java index 18f50e143..09e208cc1 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRefreshTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRefreshTooltipContentPane.java @@ -26,37 +26,37 @@ public class VanChartRefreshTooltipContentPane extends VanChartTooltipContentPan protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) { super.initFormatPane(parent, showOnPane); - changedValueFormatPane = new ChangedValueFormatPaneWithCheckBox(parent, showOnPane); - changedPercentFormatPane = new ChangedPercentFormatPaneWithCheckBox(parent, showOnPane); + setChangedValueFormatPane(new ChangedValueFormatPaneWithCheckBox(parent, showOnPane)); + setChangedPercentFormatPane(new ChangedPercentFormatPaneWithCheckBox(parent, showOnPane)); } @Override protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { super.initRichTextFormatPane(parent, showOnPane); - richTextChangedValueFormatPane = new ChangedValueFormatPaneWithoutCheckBox(parent, showOnPane); - richTextChangedPercentFormatPane = new ChangedPercentFormatPaneWithoutCheckBox(parent, showOnPane); + setRichTextChangedValueFormatPane(new ChangedValueFormatPaneWithoutCheckBox(parent, showOnPane)); + setRichTextChangedPercentFormatPane(new ChangedPercentFormatPaneWithoutCheckBox(parent, showOnPane)); } protected Component[][] getPaneComponents(){ return new Component[][]{ - new Component[]{categoryNameFormatPane,null}, - new Component[]{seriesNameFormatPane,null}, - new Component[]{valueFormatPane,null}, - new Component[]{changedValueFormatPane,null}, - new Component[]{percentFormatPane,null}, - new Component[]{changedPercentFormatPane,null}, + new Component[]{getCategoryNameFormatPane(), null}, + new Component[]{getSeriesNameFormatPane(), null}, + new Component[]{getValueFormatPane(), null}, + new Component[]{getChangedValueFormatPane(), null}, + new Component[]{getPercentFormatPane(), null}, + new Component[]{getChangedPercentFormatPane(), null}, }; } protected Component[][] getRichTextComponents() { return new Component[][]{ - new Component[]{richTextCategoryNameFormatPane, null}, - new Component[]{richTextSeriesNameFormatPane, null}, - new Component[]{richTextValueFormatPane, null}, - new Component[]{richTextChangedValueFormatPane, null}, - new Component[]{richTextPercentFormatPane, null}, - new Component[]{richTextChangedPercentFormatPane, null} + new Component[]{getRichTextCategoryNameFormatPane(), null}, + new Component[]{getRichTextSeriesNameFormatPane(), null}, + new Component[]{getRichTextValueFormatPane(), null}, + new Component[]{getRichTextChangedValueFormatPane(), null}, + new Component[]{getRichTextPercentFormatPane(), null}, + new Component[]{getRichTextChangedPercentFormatPane(), null} }; } 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 e8825f246..9889ee64a 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 @@ -51,23 +51,23 @@ public class VanChartTooltipContentPane extends BasicBeanPane content; + private UIButtonGroup content; - protected CategoryNameFormatPaneWithCheckBox categoryNameFormatPane; - protected SeriesNameFormatPaneWithCheckBox seriesNameFormatPane; - protected ValueFormatPaneWithCheckBox valueFormatPane; - protected PercentFormatPaneWithCheckBox percentFormatPane; + private CategoryNameFormatPaneWithCheckBox categoryNameFormatPane; + private SeriesNameFormatPaneWithCheckBox seriesNameFormatPane; + private ValueFormatPaneWithCheckBox valueFormatPane; + private PercentFormatPaneWithCheckBox percentFormatPane; //监控刷新时,自动数据点提示使用 - protected ChangedValueFormatPaneWithCheckBox changedValueFormatPane; - protected ChangedPercentFormatPaneWithCheckBox changedPercentFormatPane; + private ChangedValueFormatPaneWithCheckBox changedValueFormatPane; + private ChangedPercentFormatPaneWithCheckBox changedPercentFormatPane; - protected CategoryNameFormatPaneWithoutCheckBox richTextCategoryNameFormatPane; - protected SeriesNameFormatPaneWithoutCheckBox richTextSeriesNameFormatPane; - protected ValueFormatPaneWithoutCheckBox richTextValueFormatPane; - protected PercentFormatPaneWithoutCheckBox richTextPercentFormatPane; - protected ChangedValueFormatPaneWithoutCheckBox richTextChangedValueFormatPane; - protected ChangedPercentFormatPaneWithoutCheckBox richTextChangedPercentFormatPane; + private CategoryNameFormatPaneWithoutCheckBox richTextCategoryNameFormatPane; + private SeriesNameFormatPaneWithoutCheckBox richTextSeriesNameFormatPane; + private ValueFormatPaneWithoutCheckBox richTextValueFormatPane; + private PercentFormatPaneWithoutCheckBox richTextPercentFormatPane; + private ChangedValueFormatPaneWithoutCheckBox richTextChangedValueFormatPane; + private ChangedPercentFormatPaneWithoutCheckBox richTextChangedPercentFormatPane; private JPanel centerPanel; private JPanel commonPanel; @@ -82,6 +82,102 @@ public class VanChartTooltipContentPane extends BasicBeanPane Date: Sun, 20 Sep 2020 23:31:33 +0800 Subject: [PATCH 04/64] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/van/chart/designer/PlotFactory.java | 8 +- ...nChartLabelContentPaneWithoutRichText.java | 295 ++++++++++++++++++ .../component/VanChartTooltipContentPane.java | 24 +- .../label/GaugeLabelContentPane.java | 4 +- ...hartGaugeCateOrPercentLabelDetailPane.java | 4 +- .../label/VanChartGaugeLabelDetailPane.java | 8 +- .../label/VanChartGaugePlotLabelPane.java | 14 +- .../VanChartGaugeValueLabelDetailPane.java | 6 +- .../label/VanChartPlotLabelDetailPane.java | 24 +- .../label/VanChartPlotLabelNoCheckPane.java | 6 +- .../style/label/VanChartPlotLabelPane.java | 41 ++- .../style/VanChartGanttLabelContentPane.java | 20 -- .../label/VanChartGanttLabelContentPane.java | 121 +++++++ .../VanChartGanttPlotLabelDetailPane.java | 16 + .../label/VanChartGanttPlotLabelPane.java | 20 ++ .../VanChartDateFormatPaneWithCheckBox.java | 18 ++ ...VanChartDateFormatPaneWithoutCheckBox.java | 18 ++ .../VanChartFormatComBoxWithCheckBox.java | 100 ++++++ .../VanChartFormatComBoxWithoutCheckBox.java | 8 + .../VanChartGanttTooltipContentPane.java | 131 +++----- .../VanChartScatterPlotLabelDetailPane.java | 2 +- .../VanChartScatterPlotLabelNoCheckPane.java | 6 +- .../label/VanChartScatterPlotLabelPane.java | 5 +- .../VanChartStructureLabelContentPane.java | 4 +- .../VanChartStructurePlotLabelDetailPane.java | 16 + .../style/VanChartStructurePlotLabelPane.java | 20 ++ 26 files changed, 775 insertions(+), 164 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPaneWithoutRichText.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/VanChartGanttLabelContentPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttLabelContentPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttPlotLabelDetailPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttPlotLabelPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/tooltip/VanChartDateFormatPaneWithCheckBox.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/tooltip/VanChartDateFormatPaneWithoutCheckBox.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/tooltip/VanChartFormatComBoxWithCheckBox.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/tooltip/VanChartFormatComBoxWithoutCheckBox.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructurePlotLabelDetailPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructurePlotLabelPane.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java b/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java index 3bddc1aed..aeaefa5b3 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java @@ -38,7 +38,7 @@ import com.fr.van.chart.designer.style.tooltip.VanChartPlotTooltipPane; import com.fr.van.chart.funnel.designer.style.VanChartFunnelLabelContentPane; import com.fr.van.chart.funnel.designer.style.VanChartFunnelRefreshTooltipContentPane; import com.fr.van.chart.funnel.designer.style.VanChartFunnelTooltipContentPane; -import com.fr.van.chart.gantt.designer.style.VanChartGanttLabelContentPane; +import com.fr.van.chart.gantt.designer.style.label.VanChartGanttPlotLabelPane; import com.fr.van.chart.gantt.designer.style.tooltip.VanChartGanttPlotTooltipPane; import com.fr.van.chart.gantt.designer.style.tooltip.VanChartGanttTooltipContentPane; import com.fr.van.chart.gauge.VanChartGaugePlotRefreshTooltipPane; @@ -53,7 +53,7 @@ import com.fr.van.chart.multilayer.style.VanChartMutiPieRefreshTooltipContentPan import com.fr.van.chart.scatter.VanChartScatterPlotTooltipPane; import com.fr.van.chart.scatter.VanChartScatterRefreshTooltipContentPane; import com.fr.van.chart.scatter.component.label.VanChartScatterPlotLabelPane; -import com.fr.van.chart.structure.desinger.style.VanChartStructureLabelContentPane; +import com.fr.van.chart.structure.desinger.style.VanChartStructurePlotLabelPane; import com.fr.van.chart.structure.desinger.style.VanChartStructureRefreshTooltipContentPane; import com.fr.van.chart.structure.desinger.style.VanChartStructureTooltipContentPane; import com.fr.van.chart.wordcloud.designer.style.VanChartWordCloudRefreshTooltipContentPane; @@ -98,6 +98,8 @@ public class PlotFactory { labelMap.put(VanChartGaugePlot.class, VanChartGaugePlotLabelPane.class); labelMap.put(VanChartScatterPlot.class, VanChartScatterPlotLabelPane.class); labelMap.put(VanChartBubblePlot.class, VanChartScatterPlotLabelPane.class); + labelMap.put(VanChartGanttPlot.class, VanChartGanttPlotLabelPane.class); + labelMap.put(VanChartStructurePlot.class, VanChartStructurePlotLabelPane.class); } /** @@ -139,8 +141,6 @@ public class PlotFactory { labelContentMap.put(VanChartTreeMapPlot.class, VanChartMultiPieLabelContentPane.class); labelContentMap.put(VanChartFunnelPlot.class, VanChartFunnelLabelContentPane.class); labelContentMap.put(VanChartHeatMapPlot.class, VanChartMapLabelContentPane.class); - labelContentMap.put(VanChartGanttPlot.class, VanChartGanttLabelContentPane.class); - labelContentMap.put(VanChartStructurePlot.class, VanChartStructureLabelContentPane.class); } private static Map, Class> tooltipContentMap = new HashMap, Class>(); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPaneWithoutRichText.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPaneWithoutRichText.java new file mode 100644 index 000000000..4c1935eef --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPaneWithoutRichText.java @@ -0,0 +1,295 @@ +package com.fr.van.chart.designer.component; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.gui.ibutton.UIButtonGroup; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.plugin.chart.base.AttrTooltipContent; +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; +import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithCheckBox; +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.style.VanChartStylePane; + +import javax.swing.JPanel; +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; + +public class VanChartLabelContentPaneWithoutRichText extends BasicBeanPane { + + private UIButtonGroup content; + + private ValueFormatPaneWithCheckBox valueFormatPane; + private PercentFormatPaneWithCheckBox percentFormatPane; + private CategoryNameFormatPaneWithCheckBox categoryNameFormatPane; + private SeriesNameFormatPaneWithCheckBox seriesNameFormatPane; + + //监控刷新时,自动数据点提示使用 + private ChangedValueFormatPaneWithCheckBox changedValueFormatPane; + private ChangedPercentFormatPaneWithCheckBox changedPercentFormatPane; + + private JPanel centerPane; + private JPanel commonPanel; + private VanChartHtmlLabelPane htmlLabelPane; + + private VanChartStylePane parent; + private JPanel showOnPane; + + public VanChartLabelContentPaneWithoutRichText(VanChartStylePane parent, JPanel showOnPane) { + this.parent = parent; + this.showOnPane = showOnPane; + + this.setLayout(new BorderLayout()); + this.add(createLabelContentPane(), BorderLayout.CENTER); + } + + public ValueFormatPaneWithCheckBox getValueFormatPane() { + return valueFormatPane; + } + + public void setValueFormatPane(ValueFormatPaneWithCheckBox valueFormatPane) { + this.valueFormatPane = valueFormatPane; + } + + public PercentFormatPaneWithCheckBox getPercentFormatPane() { + return percentFormatPane; + } + + public void setPercentFormatPane(PercentFormatPaneWithCheckBox percentFormatPane) { + this.percentFormatPane = percentFormatPane; + } + + public CategoryNameFormatPaneWithCheckBox getCategoryNameFormatPane() { + return categoryNameFormatPane; + } + + public void setCategoryNameFormatPane(CategoryNameFormatPaneWithCheckBox categoryNameFormatPane) { + this.categoryNameFormatPane = categoryNameFormatPane; + } + + public SeriesNameFormatPaneWithCheckBox getSeriesNameFormatPane() { + return seriesNameFormatPane; + } + + public void setSeriesNameFormatPane(SeriesNameFormatPaneWithCheckBox seriesNameFormatPane) { + this.seriesNameFormatPane = seriesNameFormatPane; + } + + private JPanel createLabelContentPane() { + content = new UIButtonGroup(new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Common"), + Toolkit.i18nText("Fine-Design_Chart_Custom") + }); + + initFormatPane(parent, showOnPane); + + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; + + commonPanel = createCommonPanel(); + htmlLabelPane = createHtmlLabelPane(); + htmlLabelPane.setParent(parent); + + centerPane = new JPanel(new CardLayout()) { + @Override + public Dimension getPreferredSize() { + if (content.getSelectedIndex() == 0) { + return commonPanel.getPreferredSize(); + } else { + return new Dimension(commonPanel.getPreferredSize().width, htmlLabelPane.getPreferredSize().height); + } + } + }; + centerPane.add(htmlLabelPane, Toolkit.i18nText("Fine-Design_Chart_Custom")); + centerPane.add(commonPanel, Toolkit.i18nText("Fine-Design_Chart_Common")); + + double[] column = {f, e}; + double[] row = {p, p, p}; + Component[][] components = new Component[][]{ + new Component[]{null, null}, + new Component[]{new UILabel(getLabelContentTitle()), content}, + new Component[]{null, centerPane}, + }; + initContentListener(); + JPanel contentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, column); + return getLabelContentPane(contentPane); + } + + protected String getLabelContentTitle() { + return Toolkit.i18nText("Fine-Design_Report_Text"); + } + + protected JPanel getLabelContentPane(JPanel contentPane) { + return createTableLayoutPaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Content"), contentPane); + } + + protected VanChartHtmlLabelPane createHtmlLabelPane() { + return new VanChartHtmlLabelPane(); + } + + protected JPanel createCommonPanel() { + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + + double[] columnSize = {f, p}; + double[] rowSize = getRowSize(p); + + return TableLayoutHelper.createTableLayoutPane(getPaneComponents(), rowSize, columnSize); + } + + protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) { + categoryNameFormatPane = new CategoryNameFormatPaneWithCheckBox(parent, showOnPane); + seriesNameFormatPane = new SeriesNameFormatPaneWithCheckBox(parent, showOnPane); + valueFormatPane = new ValueFormatPaneWithCheckBox(parent, showOnPane); + percentFormatPane = new PercentFormatPaneWithCheckBox(parent, showOnPane); + } + + protected JPanel createTableLayoutPaneWithTitle(String title, JPanel panel) { + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(title, panel); + } + + protected double[] getRowSize(double p) { + return new double[]{p, p, p, p}; + } + + protected Component[][] getPaneComponents() { + return new Component[][]{ + new Component[]{categoryNameFormatPane, null}, + new Component[]{seriesNameFormatPane, null}, + new Component[]{valueFormatPane, null}, + new Component[]{percentFormatPane, null}, + }; + } + + private void initContentListener() { + content.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + checkCardPane(); + } + }); + } + + + private void checkCardPane() { + CardLayout cardLayout = (CardLayout) centerPane.getLayout(); + if (content.getSelectedIndex() == 1) { + cardLayout.show(centerPane, Toolkit.i18nText("Fine-Design_Chart_Custom")); + if (isDirty()) { + setCustomFormatterText(); + setDirty(false); + } + } else { + cardLayout.show(centerPane, Toolkit.i18nText("Fine-Design_Chart_Common")); + } + } + + protected void setCustomFormatterText() { + htmlLabelPane.setCustomFormatterText(updateBean().getFormatterTextFromCommon()); + } + + public boolean isDirty() { + return categoryNameFormatPane.isDirty() || seriesNameFormatPane.isDirty() || valueFormatPane.isDirty() || percentFormatPane.isDirty() + || (changedValueFormatPane != null && changedValueFormatPane.isDirty()) || (changedValueFormatPane != null && changedPercentFormatPane.isDirty()); + } + + public void setDirty(boolean isDirty) { + categoryNameFormatPane.setDirty(isDirty); + seriesNameFormatPane.setDirty(isDirty); + valueFormatPane.setDirty(isDirty); + percentFormatPane.setDirty(isDirty); + + if (changedValueFormatPane != null) { + changedValueFormatPane.setDirty(isDirty); + } + if (changedPercentFormatPane != null) { + changedPercentFormatPane.setDirty(isDirty); + } + } + + @Override + protected String title4PopupWindow() { + return ""; + } + + + @Override + public void populateBean(AttrTooltipContent attrTooltipContent) { + if (attrTooltipContent == null) { + return; + } + + content.setSelectedIndex(attrTooltipContent.isCommon() ? 0 : 1); + + populateFormatPane(attrTooltipContent); + + htmlLabelPane.populate(attrTooltipContent.getHtmlLabel()); + if (!attrTooltipContent.isCommon()) { + setDirty(false); + } + checkCardPane(); + } + + protected void populateFormatPane(AttrTooltipContent attrTooltipContent) { + categoryNameFormatPane.populate(attrTooltipContent.getCategoryFormat()); + seriesNameFormatPane.populate(attrTooltipContent.getSeriesFormat()); + valueFormatPane.populate(attrTooltipContent.getValueFormat()); + percentFormatPane.populate(attrTooltipContent.getPercentFormat()); + + if (changedValueFormatPane != null) { + changedValueFormatPane.populate(attrTooltipContent.getChangedValueFormat()); + } + if (changedPercentFormatPane != null) { + changedPercentFormatPane.populate(attrTooltipContent.getChangedPercentFormat()); + } + } + + public AttrTooltipContent updateBean() { + AttrTooltipContent attrTooltipContent = createAttrTooltip(); + + attrTooltipContent.setCommon(content.getSelectedIndex() == 0); + + updateFormatPane(attrTooltipContent); + + updateFormatsWithPaneWidth(attrTooltipContent); + + htmlLabelPane.update(attrTooltipContent.getHtmlLabel()); + + return attrTooltipContent; + } + + protected AttrTooltipContent createAttrTooltip() { + return new AttrTooltipContent(); + } + + protected void updateFormatPane(AttrTooltipContent attrTooltipContent) { + categoryNameFormatPane.update(attrTooltipContent.getCategoryFormat()); + seriesNameFormatPane.update(attrTooltipContent.getSeriesFormat()); + valueFormatPane.update(attrTooltipContent.getValueFormat()); + percentFormatPane.update(attrTooltipContent.getPercentFormat()); + + if (changedValueFormatPane != null) { + changedValueFormatPane.update(attrTooltipContent.getChangedValueFormat()); + } + if (changedPercentFormatPane != null) { + changedPercentFormatPane.update(attrTooltipContent.getChangedPercentFormat()); + } + } + + private void updateFormatsWithPaneWidth(AttrTooltipContent attrTooltipContent) { + int paneWidth = seriesNameFormatPane.getWidth(); + if (paneWidth == 0) { + attrTooltipContent.getSeriesFormat().setEnable(false); + } + } +} 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 9889ee64a..76148e649 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 @@ -82,6 +82,18 @@ public class VanChartTooltipContentPane extends BasicBeanPane dataLabelContentPane; + private BasicBeanPane dataLabelContentPane; - protected UIButtonGroup position; - protected UIButtonGroup autoAdjust; - protected UIToggleButton tractionLine; + private UIButtonGroup position; + private UIButtonGroup autoAdjust; + private UIToggleButton tractionLine; - protected ColorSelectBox backgroundColor; + private ColorSelectBox backgroundColor; private JPanel tractionLinePane; private JPanel positionPane; private Integer[] oldPositionValues; - protected VanChartStylePane parent; + private VanChartStylePane parent; private Plot plot; public VanChartPlotLabelDetailPane(Plot plot, VanChartStylePane parent) { @@ -59,6 +59,18 @@ public class VanChartPlotLabelDetailPane extends BasicPane { initLabelDetailPane(plot); } + public BasicBeanPane getDataLabelContentPane() { + return dataLabelContentPane; + } + + public void setDataLabelContentPane(BasicBeanPane dataLabelContentPane) { + this.dataLabelContentPane = dataLabelContentPane; + } + + public VanChartStylePane getParentPane() { + return parent; + } + protected void initLabelDetailPane (Plot plot) { this.setLayout(new BorderLayout()); initToolTipContentPane(plot); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelNoCheckPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelNoCheckPane.java index 95eb30204..beb89e5d7 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelNoCheckPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelNoCheckPane.java @@ -19,12 +19,12 @@ public class VanChartPlotLabelNoCheckPane extends VanChartPlotLabelPane { protected void addComponents() { this.setLayout(new BorderLayout()); - this.add(labelPane,BorderLayout.CENTER); + this.add(getLabelPane(),BorderLayout.CENTER); } public void populate(AttrLabel attr) { super.populate(attr); - isLabelShow.setSelected(true); - labelPane.setVisible(true); + getLabelShowCheckBox().setSelected(true); + getLabelPane().setVisible(true); } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelPane.java index e0a007dd2..f1fa6f0f1 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelPane.java @@ -3,6 +3,7 @@ package com.fr.van.chart.designer.style.label; import com.fr.chart.chartattr.Plot; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -19,24 +20,52 @@ import java.awt.event.ActionListener; public class VanChartPlotLabelPane extends BasicPane { private static final long serialVersionUID = -1701936672446232396L; - protected UICheckBox isLabelShow; + private UICheckBox isLabelShow; - protected VanChartPlotLabelDetailPane labelDetailPane; + private VanChartPlotLabelDetailPane labelDetailPane; - protected VanChartStylePane parent; - protected Plot plot; + private VanChartStylePane parent; + private Plot plot; - protected JPanel labelPane; + private JPanel labelPane; public VanChartPlotLabelPane(Plot plot, VanChartStylePane parent) { this.parent = parent; this.plot = plot; - isLabelShow = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Label")); + isLabelShow = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Use_Label")); labelPane = new JPanel(new BorderLayout(0, 4)); createLabelPane(); addComponents(); } + public UICheckBox getLabelShowCheckBox() { + return isLabelShow; + } + + public VanChartPlotLabelDetailPane getLabelDetailPane() { + return labelDetailPane; + } + + public void setLabelDetailPane(VanChartPlotLabelDetailPane labelDetailPane) { + this.labelDetailPane = labelDetailPane; + } + + public VanChartStylePane getParentPane() { + return parent; + } + + public Plot getPlot() { + return plot; + } + + public JPanel getLabelPane() { + return labelPane; + } + + public void setLabelPane(JPanel labelPane) { + this.labelPane = labelPane; + } + protected void createLabelPane() { labelDetailPane = new VanChartPlotLabelDetailPane(this.plot, this.parent); labelPane.add(labelDetailPane, BorderLayout.CENTER); diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/VanChartGanttLabelContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/VanChartGanttLabelContentPane.java deleted file mode 100644 index fe4b2e80a..000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/VanChartGanttLabelContentPane.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.fr.van.chart.gantt.designer.style; - -import com.fr.van.chart.designer.component.VanChartHtmlLabelPane; -import com.fr.van.chart.designer.style.VanChartStylePane; -import com.fr.van.chart.gantt.designer.style.tooltip.VanChartGanttTooltipContentPane; - -import javax.swing.JPanel; - -/** - * Created by hufan on 2017/1/13. - */ -public class VanChartGanttLabelContentPane extends VanChartGanttTooltipContentPane { - public VanChartGanttLabelContentPane(VanChartStylePane parent, JPanel showOnPane) { - super(parent, showOnPane); - } - - protected VanChartHtmlLabelPane createHtmlLabelPane() { - return new VanChartHtmlLabelPane(); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttLabelContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttLabelContentPane.java new file mode 100644 index 000000000..54ab3fd1f --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttLabelContentPane.java @@ -0,0 +1,121 @@ +package com.fr.van.chart.gantt.designer.style.label; + +import com.fr.design.i18n.Toolkit; +import com.fr.plugin.chart.base.AttrTooltipContent; +import com.fr.plugin.chart.gantt.attr.AttrGanttTooltipContent; +import com.fr.van.chart.designer.component.VanChartLabelContentPaneWithoutRichText; +import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithCheckBox; +import com.fr.van.chart.designer.style.VanChartStylePane; +import com.fr.van.chart.gantt.designer.style.tooltip.VanChartDateFormatPaneWithCheckBox; +import com.fr.van.chart.gantt.designer.style.tooltip.VanChartFormatComBoxWithCheckBox; + +import javax.swing.JPanel; +import java.awt.Component; + +/** + * Created by hufan on 2017/1/13. + */ +public class VanChartGanttLabelContentPane extends VanChartLabelContentPaneWithoutRichText { + + private VanChartFormatPaneWithCheckBox processesFormatPane; + private VanChartDateFormatPaneWithCheckBox startTimeFormatPane; + private VanChartDateFormatPaneWithCheckBox endTimeFormatPane; + private VanChartFormatComBoxWithCheckBox durationFormatPane; + private VanChartFormatPaneWithCheckBox progressFormatPane; + + public VanChartGanttLabelContentPane(VanChartStylePane parent, JPanel showOnPane) { + super(parent, showOnPane); + } + + protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) { + processesFormatPane = new VanChartFormatPaneWithCheckBox(parent, showOnPane) { + @Override + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_Project_Name"); + } + }; + setSeriesNameFormatPane(new SeriesNameFormatPaneWithCheckBox(parent, showOnPane)); + startTimeFormatPane = new VanChartDateFormatPaneWithCheckBox(parent, showOnPane) { + @Override + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_Start_Time"); + } + }; + endTimeFormatPane = new VanChartDateFormatPaneWithCheckBox(parent, showOnPane) { + @Override + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_End_Time"); + } + }; + durationFormatPane = new VanChartFormatComBoxWithCheckBox(); + progressFormatPane = new VanChartFormatPaneWithCheckBox(parent, showOnPane) { + @Override + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_Process"); + } + }; + } + + protected Component[][] getPaneComponents() { + return new Component[][]{ + new Component[]{processesFormatPane, null}, + new Component[]{getSeriesNameFormatPane(), null}, + new Component[]{startTimeFormatPane, null}, + new Component[]{endTimeFormatPane, null}, + new Component[]{durationFormatPane, null}, + new Component[]{progressFormatPane, null} + }; + } + + protected double[] getRowSize(double p) { + return new double[]{p, p, p, p, p, p}; + } + + @Override + protected void populateFormatPane(AttrTooltipContent attrTooltipContent) { + if (attrTooltipContent instanceof AttrGanttTooltipContent) { + AttrGanttTooltipContent ganttTooltipContent = (AttrGanttTooltipContent) attrTooltipContent; + processesFormatPane.populate(ganttTooltipContent.getProcessesFormat()); + getSeriesNameFormatPane().populate(ganttTooltipContent.getSeriesFormat()); + startTimeFormatPane.populate(ganttTooltipContent.getStartTimeFormat()); + endTimeFormatPane.populate(ganttTooltipContent.getEndTimeFormat()); + durationFormatPane.populate(ganttTooltipContent.getDurationFormat()); + progressFormatPane.populate(ganttTooltipContent.getProgressFormat()); + } + } + + protected void updateFormatPane(AttrTooltipContent attrTooltipContent) { + if (attrTooltipContent instanceof AttrGanttTooltipContent) { + AttrGanttTooltipContent ganttTooltipContent = (AttrGanttTooltipContent) attrTooltipContent; + processesFormatPane.update(ganttTooltipContent.getProcessesFormat()); + getSeriesNameFormatPane().update(ganttTooltipContent.getSeriesFormat()); + startTimeFormatPane.update(ganttTooltipContent.getStartTimeFormat()); + endTimeFormatPane.update(ganttTooltipContent.getEndTimeFormat()); + durationFormatPane.update(ganttTooltipContent.getDurationFormat()); + progressFormatPane.update(ganttTooltipContent.getProgressFormat()); + } + } + + public boolean isDirty() { + return processesFormatPane.isDirty() + || getSeriesNameFormatPane().isDirty() + || startTimeFormatPane.isDirty() + || endTimeFormatPane.isDirty() + || durationFormatPane.isDirty() + || progressFormatPane.isDirty(); + } + + public void setDirty(boolean isDirty) { + processesFormatPane.setDirty(isDirty); + getSeriesNameFormatPane().setDirty(isDirty); + startTimeFormatPane.setDirty(isDirty); + endTimeFormatPane.setDirty(isDirty); + durationFormatPane.setDirty(isDirty); + progressFormatPane.setDirty(isDirty); + } + + protected AttrTooltipContent createAttrTooltip() { + return new AttrGanttTooltipContent(); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttPlotLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttPlotLabelDetailPane.java new file mode 100644 index 000000000..e00e0afd4 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttPlotLabelDetailPane.java @@ -0,0 +1,16 @@ +package com.fr.van.chart.gantt.designer.style.label; + +import com.fr.chart.chartattr.Plot; +import com.fr.van.chart.designer.style.VanChartStylePane; +import com.fr.van.chart.designer.style.label.VanChartPlotLabelDetailPane; + +public class VanChartGanttPlotLabelDetailPane extends VanChartPlotLabelDetailPane { + + public VanChartGanttPlotLabelDetailPane(Plot plot, VanChartStylePane parent) { + super(plot, parent); + } + + protected void initToolTipContentPane(Plot plot) { + setDataLabelContentPane(new VanChartGanttLabelContentPane(getParentPane(), VanChartGanttPlotLabelDetailPane.this)); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttPlotLabelPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttPlotLabelPane.java new file mode 100644 index 000000000..546f772dd --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttPlotLabelPane.java @@ -0,0 +1,20 @@ +package com.fr.van.chart.gantt.designer.style.label; + +import com.fr.chart.chartattr.Plot; +import com.fr.van.chart.designer.style.VanChartStylePane; +import com.fr.van.chart.designer.style.label.VanChartPlotLabelPane; + +import java.awt.BorderLayout; + +public class VanChartGanttPlotLabelPane extends VanChartPlotLabelPane { + + public VanChartGanttPlotLabelPane(Plot plot, VanChartStylePane parent) { + super(plot, parent); + } + + protected void createLabelPane() { + VanChartGanttPlotLabelDetailPane labelDetailPane = new VanChartGanttPlotLabelDetailPane(getPlot(), getParentPane()); + setLabelDetailPane(labelDetailPane); + getLabelPane().add(labelDetailPane, BorderLayout.CENTER); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/tooltip/VanChartDateFormatPaneWithCheckBox.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/tooltip/VanChartDateFormatPaneWithCheckBox.java new file mode 100644 index 000000000..7ed6e93bc --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/tooltip/VanChartDateFormatPaneWithCheckBox.java @@ -0,0 +1,18 @@ +package com.fr.van.chart.gantt.designer.style.tooltip; + +import com.fr.design.gui.style.FormatPane; +import com.fr.van.chart.designer.PlotFactory; +import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithCheckBox; +import com.fr.van.chart.designer.style.VanChartStylePane; + +import javax.swing.JPanel; + +public abstract class VanChartDateFormatPaneWithCheckBox extends VanChartFormatPaneWithCheckBox { + public VanChartDateFormatPaneWithCheckBox(VanChartStylePane parent, JPanel showOnPane) { + super(parent, showOnPane); + } + + protected FormatPane createFormatPane(){ + return PlotFactory.createAutoFormatPane(); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/tooltip/VanChartDateFormatPaneWithoutCheckBox.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/tooltip/VanChartDateFormatPaneWithoutCheckBox.java new file mode 100644 index 000000000..ee395284a --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/tooltip/VanChartDateFormatPaneWithoutCheckBox.java @@ -0,0 +1,18 @@ +package com.fr.van.chart.gantt.designer.style.tooltip; + +import com.fr.design.gui.style.FormatPane; +import com.fr.van.chart.designer.PlotFactory; +import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithoutCheckBox; +import com.fr.van.chart.designer.style.VanChartStylePane; + +import javax.swing.JPanel; + +public abstract class VanChartDateFormatPaneWithoutCheckBox extends VanChartFormatPaneWithoutCheckBox { + public VanChartDateFormatPaneWithoutCheckBox(VanChartStylePane parent, JPanel showOnPane) { + super(parent, showOnPane); + } + + protected FormatPane createFormatPane() { + return PlotFactory.createAutoFormatPane(); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/tooltip/VanChartFormatComBoxWithCheckBox.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/tooltip/VanChartFormatComBoxWithCheckBox.java new file mode 100644 index 000000000..95da8ea98 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/tooltip/VanChartFormatComBoxWithCheckBox.java @@ -0,0 +1,100 @@ +package com.fr.van.chart.gantt.designer.style.tooltip; + +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.plugin.chart.base.format.AttrTooltipDurationFormat; +import com.fr.plugin.chart.base.format.AttrTooltipFormat; +import com.fr.plugin.chart.base.format.IntervalTimeFormat; + +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.util.Map; + +public class VanChartFormatComBoxWithCheckBox extends JPanel { + private static final String LABEL_TEXT = Toolkit.i18nText("Fine-Design_Chart_Duration_Time"); + + private UICheckBox isSelectedBox; + private UIComboBox formatComBox; + + private boolean isDirty; + + public VanChartFormatComBoxWithCheckBox() { + this.setLayout(new BorderLayout()); + isSelectedBox = new UICheckBox(LABEL_TEXT); + formatComBox = new UIComboBox(IntervalTimeFormat.getFormats()); + isSelectedBox.addMouseListener(new MouseListener() { + @Override + public void mouseClicked(MouseEvent e) { + isDirty = true; + } + + @Override + public void mousePressed(MouseEvent e) { + + } + + @Override + public void mouseReleased(MouseEvent e) { + + } + + @Override + public void mouseEntered(MouseEvent e) { + + } + + @Override + public void mouseExited(MouseEvent e) { + + } + }); + formatComBox.setPreferredSize(new Dimension(40, 20)); + + if (showSelectBox()) { + this.add(isSelectedBox, BorderLayout.CENTER); + } else { + this.add(new UILabel(LABEL_TEXT), BorderLayout.CENTER); + } + + this.add(formatComBox, BorderLayout.EAST); + } + + protected boolean showSelectBox() { + return true; + } + + public boolean isDirty() { + return isDirty; + } + + public void setDirty(boolean isDirty) { + this.isDirty = isDirty; + } + + public void populate(AttrTooltipFormat tooltipFormat) { + if (tooltipFormat instanceof AttrTooltipDurationFormat) { + this.isSelectedBox.setSelected(tooltipFormat.isEnable()); + formatComBox.setSelectedItem(((AttrTooltipDurationFormat) tooltipFormat).getIntervalTimeFormat()); + } + } + + public void update(AttrTooltipFormat tooltipFormat) { + if (tooltipFormat instanceof AttrTooltipDurationFormat) { + tooltipFormat.setEnable(isSelectedBox.isSelected()); + ((AttrTooltipDurationFormat) tooltipFormat).setIntervalTimeFormat((IntervalTimeFormat) formatComBox.getSelectedItem()); + } + } + + public void updateFormatParams(Map paramMap, String value) { + String key = LABEL_TEXT; + + if (paramMap != null && !paramMap.containsKey(key)) { + paramMap.put(key, value); + } + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/tooltip/VanChartFormatComBoxWithoutCheckBox.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/tooltip/VanChartFormatComBoxWithoutCheckBox.java new file mode 100644 index 000000000..20a74e376 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/tooltip/VanChartFormatComBoxWithoutCheckBox.java @@ -0,0 +1,8 @@ +package com.fr.van.chart.gantt.designer.style.tooltip; + +public class VanChartFormatComBoxWithoutCheckBox extends VanChartFormatComBoxWithCheckBox { + + protected boolean showSelectBox() { + return false; + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/tooltip/VanChartGanttTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/tooltip/VanChartGanttTooltipContentPane.java index 2a35b5f4a..71b57cde8 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/tooltip/VanChartGanttTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/tooltip/VanChartGanttTooltipContentPane.java @@ -1,27 +1,17 @@ package com.fr.van.chart.gantt.designer.style.tooltip; -import com.fr.design.gui.icheckbox.UICheckBox; -import com.fr.design.gui.icombobox.UIComboBox; -import com.fr.design.gui.style.FormatPane; - import com.fr.design.i18n.Toolkit; import com.fr.plugin.chart.base.AttrTooltipContent; -import com.fr.plugin.chart.base.format.AttrTooltipDurationFormat; -import com.fr.plugin.chart.base.format.AttrTooltipFormat; -import com.fr.plugin.chart.base.format.IntervalTimeFormat; import com.fr.plugin.chart.gantt.attr.AttrGanttTooltipContent; -import com.fr.van.chart.designer.PlotFactory; import com.fr.van.chart.designer.component.VanChartTooltipContentPane; import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; -import java.awt.BorderLayout; import java.awt.Component; -import java.awt.Dimension; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; /** * Created by hufan on 2017/1/13. @@ -33,6 +23,12 @@ public class VanChartGanttTooltipContentPane extends VanChartTooltipContentPane private VanChartFormatComBoxWithCheckBox durationFormatPane; private VanChartFormatPaneWithCheckBox progressFormatPane; + private VanChartFormatPaneWithoutCheckBox richTextProcessesFormatPane; + private VanChartDateFormatPaneWithoutCheckBox richTextStartTimeFormatPane; + private VanChartDateFormatPaneWithoutCheckBox richTextEndTimeFormatPane; + private VanChartFormatComBoxWithoutCheckBox richTextDurationFormatPane; + private VanChartFormatPaneWithoutCheckBox richTextProgressFormatPane; + public VanChartGanttTooltipContentPane(VanChartStylePane parent, JPanel showOnPane) { super(parent, showOnPane); } @@ -66,6 +62,31 @@ public class VanChartGanttTooltipContentPane extends VanChartTooltipContentPane }; } + protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { + richTextProcessesFormatPane = new VanChartFormatPaneWithoutCheckBox(parent, showOnPane){ + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_Project_Name"); + } + }; + setRichTextSeriesNameFormatPane(new SeriesNameFormatPaneWithoutCheckBox(parent, showOnPane)); + richTextStartTimeFormatPane = new VanChartDateFormatPaneWithoutCheckBox(parent, showOnPane){ + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_Start_Time"); + } + }; + richTextEndTimeFormatPane = new VanChartDateFormatPaneWithoutCheckBox(parent, showOnPane){ + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_End_Time"); + } + }; + richTextDurationFormatPane = new VanChartFormatComBoxWithoutCheckBox(); + richTextProgressFormatPane = new VanChartFormatPaneWithoutCheckBox(parent, showOnPane){ + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_Process"); + } + }; + } + protected Component[][] getPaneComponents(){ return new Component[][]{ new Component[]{processesFormatPane,null}, @@ -77,6 +98,17 @@ public class VanChartGanttTooltipContentPane extends VanChartTooltipContentPane }; } + protected Component[][] getRichTextComponents() { + return new Component[][]{ + new Component[]{richTextProcessesFormatPane,null}, + new Component[]{getRichTextSeriesNameFormatPane(),null}, + new Component[]{richTextStartTimeFormatPane,null}, + new Component[]{richTextEndTimeFormatPane,null}, + new Component[]{richTextDurationFormatPane, null}, + new Component[]{richTextProgressFormatPane, null} + }; + } + protected double[] getRowSize(double p){ return new double[]{p,p,p,p,p,p}; } @@ -127,79 +159,4 @@ public class VanChartGanttTooltipContentPane extends VanChartTooltipContentPane protected AttrTooltipContent createAttrTooltip() { return new AttrGanttTooltipContent(); } - - private abstract class VanChartDateFormatPaneWithCheckBox extends VanChartFormatPaneWithCheckBox { - public VanChartDateFormatPaneWithCheckBox(VanChartStylePane parent, JPanel showOnPane) { - super(parent, showOnPane); - } - - @Override - protected FormatPane createFormatPane(){ - return PlotFactory.createAutoFormatPane(); - } - } - - private class VanChartFormatComBoxWithCheckBox extends JPanel{ - private UICheckBox isSelectedBox; - private UIComboBox formatComBox; - - private boolean isDirty; - - private VanChartFormatComBoxWithCheckBox() { - this.setLayout(new BorderLayout()); - isSelectedBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Duration_Time")); - formatComBox = new UIComboBox(IntervalTimeFormat.getFormats()); - isSelectedBox.addMouseListener(new MouseListener() { - @Override - public void mouseClicked(MouseEvent e) { - isDirty = true; - } - - @Override - public void mousePressed(MouseEvent e) { - - } - - @Override - public void mouseReleased(MouseEvent e) { - - } - - @Override - public void mouseEntered(MouseEvent e) { - - } - - @Override - public void mouseExited(MouseEvent e) { - - } - }); - formatComBox.setPreferredSize(new Dimension(40,20)); - this.add(isSelectedBox, BorderLayout.CENTER); - this.add(formatComBox, BorderLayout.EAST); - } - - private boolean isDirty() { - return isDirty; - } - - private void setDirty(boolean isDirty) { - this.isDirty = isDirty; - } - - private void populate(AttrTooltipFormat tooltipFormat) { - if(tooltipFormat instanceof AttrTooltipDurationFormat) { - this.isSelectedBox.setSelected(tooltipFormat.isEnable()); - formatComBox.setSelectedItem(((AttrTooltipDurationFormat) tooltipFormat).getIntervalTimeFormat()); - } - } - - private void update(AttrTooltipFormat tooltipFormat) { - if(tooltipFormat instanceof AttrTooltipDurationFormat) { - tooltipFormat.setEnable(isSelectedBox.isSelected()); - ((AttrTooltipDurationFormat) tooltipFormat).setIntervalTimeFormat((IntervalTimeFormat) formatComBox.getSelectedItem()); - } - } - } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/component/label/VanChartScatterPlotLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/component/label/VanChartScatterPlotLabelDetailPane.java index d507934e6..a78261f65 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/scatter/component/label/VanChartScatterPlotLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/scatter/component/label/VanChartScatterPlotLabelDetailPane.java @@ -19,6 +19,6 @@ public class VanChartScatterPlotLabelDetailPane extends VanChartPlotLabelDetailP @Override protected void initToolTipContentPane(Plot plot) { - dataLabelContentPane = new VanChartScatterLabelContentPane(parent,VanChartScatterPlotLabelDetailPane.this); + setDataLabelContentPane(new VanChartScatterLabelContentPane(getParentPane(),VanChartScatterPlotLabelDetailPane.this)); } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/component/label/VanChartScatterPlotLabelNoCheckPane.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/component/label/VanChartScatterPlotLabelNoCheckPane.java index 71e783b06..a40918073 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/scatter/component/label/VanChartScatterPlotLabelNoCheckPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/scatter/component/label/VanChartScatterPlotLabelNoCheckPane.java @@ -19,12 +19,12 @@ public class VanChartScatterPlotLabelNoCheckPane extends VanChartScatterPlotLabe protected void addComponents() { this.setLayout(new BorderLayout()); - this.add(labelPane,BorderLayout.CENTER); + this.add(getLabelPane(), BorderLayout.CENTER); } public void populate(AttrLabel attr) { super.populate(attr); - isLabelShow.setSelected(true); - labelPane.setVisible(true); + getLabelShowCheckBox().setSelected(true); + getLabelPane().setVisible(true); } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/component/label/VanChartScatterPlotLabelPane.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/component/label/VanChartScatterPlotLabelPane.java index 632ce7f6f..fb8be9016 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/scatter/component/label/VanChartScatterPlotLabelPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/scatter/component/label/VanChartScatterPlotLabelPane.java @@ -18,7 +18,8 @@ public class VanChartScatterPlotLabelPane extends VanChartPlotLabelPane { @Override protected void createLabelPane() { - labelDetailPane = new VanChartScatterPlotLabelDetailPane(this.plot, this.parent); - labelPane.add(labelDetailPane, BorderLayout.CENTER); + VanChartScatterPlotLabelDetailPane labelDetailPane = new VanChartScatterPlotLabelDetailPane(getPlot(), getParentPane()); + setLabelDetailPane(labelDetailPane); + getLabelPane().add(labelDetailPane, BorderLayout.CENTER); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureLabelContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureLabelContentPane.java index e5f1287b2..f380c8267 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureLabelContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureLabelContentPane.java @@ -4,7 +4,7 @@ package com.fr.van.chart.structure.desinger.style; import com.fr.design.i18n.Toolkit; import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.multilayer.style.AttrTooltipMultiLevelNameFormat; -import com.fr.van.chart.designer.component.VanChartLabelContentPane; +import com.fr.van.chart.designer.component.VanChartLabelContentPaneWithoutRichText; import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.format.PercentFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckBox; @@ -17,7 +17,7 @@ import java.awt.Component; /** * Created by shine on 2017/2/15. */ -public class VanChartStructureLabelContentPane extends VanChartLabelContentPane { +public class VanChartStructureLabelContentPane extends VanChartLabelContentPaneWithoutRichText { public VanChartStructureLabelContentPane(VanChartStylePane parent, JPanel showOnPane) { super(parent, showOnPane); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructurePlotLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructurePlotLabelDetailPane.java new file mode 100644 index 000000000..20e784c52 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructurePlotLabelDetailPane.java @@ -0,0 +1,16 @@ +package com.fr.van.chart.structure.desinger.style; + +import com.fr.chart.chartattr.Plot; +import com.fr.van.chart.designer.style.VanChartStylePane; +import com.fr.van.chart.designer.style.label.VanChartPlotLabelDetailPane; + +public class VanChartStructurePlotLabelDetailPane extends VanChartPlotLabelDetailPane { + + public VanChartStructurePlotLabelDetailPane(Plot plot, VanChartStylePane parent) { + super(plot, parent); + } + + protected void initToolTipContentPane(Plot plot) { + setDataLabelContentPane(new VanChartStructureLabelContentPane(getParentPane(), VanChartStructurePlotLabelDetailPane.this)); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructurePlotLabelPane.java b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructurePlotLabelPane.java new file mode 100644 index 000000000..e4cdc99e1 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructurePlotLabelPane.java @@ -0,0 +1,20 @@ +package com.fr.van.chart.structure.desinger.style; + +import com.fr.chart.chartattr.Plot; +import com.fr.van.chart.designer.style.VanChartStylePane; +import com.fr.van.chart.designer.style.label.VanChartPlotLabelPane; + +import java.awt.BorderLayout; + +public class VanChartStructurePlotLabelPane extends VanChartPlotLabelPane { + + public VanChartStructurePlotLabelPane(Plot plot, VanChartStylePane parent) { + super(plot, parent); + } + + protected void createLabelPane() { + VanChartStructurePlotLabelDetailPane labelDetailPane = new VanChartStructurePlotLabelDetailPane(getPlot(), getParentPane()); + setLabelDetailPane(labelDetailPane); + getLabelPane().add(labelDetailPane, BorderLayout.CENTER); + } +} From dd32c9f7113090ba576499cf673f49885441e181 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 21 Sep 2020 10:26:33 +0800 Subject: [PATCH 05/64] =?UTF-8?q?=E5=AE=8C=E5=96=84=E7=94=98=E7=89=B9?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E7=AD=BE=E5=92=8C=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/VanChartTooltipContentPane.java | 42 +++++++++++---- .../VanChartGanttTooltipContentPane.java | 54 +++++++++++++++++++ 2 files changed, 85 insertions(+), 11 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 76148e649..bf7b51794 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 @@ -190,6 +190,10 @@ public class VanChartTooltipContentPane extends BasicBeanPane params = getRichTextAttr().getParams(); + + AttrTooltipProcessesFormat processesFormat = ganttTooltipContent.getRichTextProcessesFormat(); + richTextProcessesFormatPane.populate(processesFormat); + richTextProcessesFormatPane.updateFormatParams(params, processesFormat.getJs()); + + AttrTooltipSeriesFormat seriesFormat = ganttTooltipContent.getRichTextSeriesFormat(); + getRichTextSeriesNameFormatPane().populate(seriesFormat); + getRichTextSeriesNameFormatPane().updateFormatParams(params, seriesFormat.getJs()); + + AttrTooltipStartTimeFormat startTimeFormat = ganttTooltipContent.getRichTextStartTimeFormat(); + richTextStartTimeFormatPane.populate(startTimeFormat); + richTextStartTimeFormatPane.updateFormatParams(params, startTimeFormat.getJs()); + + AttrTooltipEndTimeFormat endTimeFormat = ganttTooltipContent.getRichTextEndTimeFormat(); + richTextEndTimeFormatPane.populate(endTimeFormat); + richTextEndTimeFormatPane.updateFormatParams(params, endTimeFormat.getJs()); + + AttrTooltipDurationFormat durationFormat = ganttTooltipContent.getRichTextDurationFormat(); + richTextDurationFormatPane.populate(durationFormat); + richTextDurationFormatPane.updateFormatParams(params, durationFormat.getJs()); + + AttrTooltipProgressFormat progressFormat = ganttTooltipContent.getRichTextProgressFormat(); + richTextProgressFormatPane.populate(progressFormat); + richTextProgressFormatPane.updateFormatParams(params, progressFormat.getJs()); + + populateRichText(attrTooltipContent.getRichTextAttr()); + } + } + protected void updateFormatPane(AttrTooltipContent attrTooltipContent) { if (attrTooltipContent instanceof AttrGanttTooltipContent){ AttrGanttTooltipContent ganttTooltipContent = (AttrGanttTooltipContent) attrTooltipContent; @@ -138,6 +179,19 @@ public class VanChartGanttTooltipContentPane extends VanChartTooltipContentPane } } + protected void updateRichEditor(AttrTooltipContent attrTooltipContent) { + if(attrTooltipContent instanceof AttrGanttTooltipContent) { + AttrGanttTooltipContent ganttTooltipContent = (AttrGanttTooltipContent) attrTooltipContent; + + richTextProcessesFormatPane.update(ganttTooltipContent.getRichTextProcessesFormat()); + getRichTextSeriesNameFormatPane().update(ganttTooltipContent.getRichTextSeriesFormat()); + richTextStartTimeFormatPane.update(ganttTooltipContent.getRichTextStartTimeFormat()); + richTextEndTimeFormatPane.update(ganttTooltipContent.getRichTextEndTimeFormat()); + richTextDurationFormatPane.update(ganttTooltipContent.getRichTextDurationFormat()); + richTextProgressFormatPane.update(ganttTooltipContent.getRichTextProgressFormat()); + } + } + public boolean isDirty() { return processesFormatPane.isDirty() || getSeriesNameFormatPane().isDirty() From f66826f607fd8a1e63a57361f9302df1cde1c900 Mon Sep 17 00:00:00 2001 From: Yyming Date: Mon, 21 Sep 2020 11:45:36 +0800 Subject: [PATCH 06/64] =?UTF-8?q?REPORT-39965=20=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E8=81=9A=E5=90=88=E6=8A=A5=E8=A1=A8=E4=B8=8B=E6=96=B9=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E6=B7=BB=E5=8A=A0=E6=99=AE=E9=80=9A=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E7=9A=84=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/JWorkBook.java | 14 ++++---------- .../fr/design/mainframe/PolySheetNameTabPane.java | 13 +------------ 2 files changed, 5 insertions(+), 22 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java index 80c8b2d0b..a139a5428 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java @@ -208,13 +208,7 @@ public class JWorkBook extends JTemplate { } }; - reportComposite.addTargetModifiedListener(new TargetModifiedListener() { - - @Override - public void targetModified(TargetModifiedEvent e) { - JWorkBook.this.fireTargetModified(); - } - }); + reportComposite.addTargetModifiedListener(e -> JWorkBook.this.fireTargetModified()); reportComposite.setParentContainer(centerPane); return centerPane; @@ -241,11 +235,11 @@ public class JWorkBook extends JTemplate { /** * 判断sheet权限 * - * @param rolsName 角色 + * @param rolesName 角色 */ @Override - public void judgeSheetAuthority(String rolsName) { - boolean isCovered = reportComposite.getEditingTemplateReport().getWorkSheetPrivilegeControl().checkInvisible(rolsName); + public void judgeSheetAuthority(String rolesName) { + boolean isCovered = reportComposite.getEditingTemplateReport().getWorkSheetPrivilegeControl().checkInvisible(rolesName); centerPane.setSheeetCovered(isCovered); centerPane.refreshContainer(); } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/PolySheetNameTabPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/PolySheetNameTabPane.java index cd61df1b4..73f63826b 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/PolySheetNameTabPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/PolySheetNameTabPane.java @@ -11,6 +11,7 @@ import com.fr.design.menu.MenuDef; * @date 2015-2-5-上午10:19:17 * */ +@Deprecated public class PolySheetNameTabPane extends SheetNameTabPane{ /** @@ -19,17 +20,5 @@ public class PolySheetNameTabPane extends SheetNameTabPane{ public PolySheetNameTabPane(ReportComponentComposite reportCompositeX) { super(reportCompositeX); } - - protected void paintAddButton(Graphics2D g2d){ - ADD_POLY_SHEET.paintIcon(this, g2d, iconLocation, 3); - } - - - protected void firstInsertActionPerformed(){ - new PolyReportInsertAction().actionPerformed(null); - } - - protected void addInsertGridShortCut(MenuDef def){ - } } \ No newline at end of file From d99b7c3c0e5d4fd001a724b1309885e583541e32 Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 21 Sep 2020 13:45:15 +0800 Subject: [PATCH 07/64] =?UTF-8?q?REPORT-40154=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=85=B1=E4=BA=AB=E6=95=B0=E6=8D=AE=E9=9B=86=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E5=88=B0=E7=A3=81=E7=9B=98=E8=AE=B0=E5=BD=95=E6=95=B0?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E6=A1=86=E5=A4=AA=E7=9F=AD=201.=20bug?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=EF=BC=9A=E4=B9=8B=E5=89=8D=E7=9A=84UISpinner?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E6=95=B0=E5=AD=97=E6=A1=86=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E7=9A=84columns=E5=8F=AA=E6=9C=892=EF=BC=8C=E6=89=80=E4=BB=A5?= =?UTF-8?q?=E5=BD=93=E8=BE=93=E5=85=A5=E6=95=B0=E5=AD=97=E8=B6=85=E8=BF=87?= =?UTF-8?q?=E4=B8=89=E4=BD=8D=E6=95=B0=E6=97=B6=EF=BC=8C=E4=BC=9A=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=B8=8D=E5=85=A8=202.=20=E4=BF=AE=E6=94=B9=E6=96=B9?= =?UTF-8?q?=E6=A1=88=EF=BC=9A=E4=B8=8E=E4=BA=A7=E5=93=81=E5=8F=8A=E4=BA=A4?= =?UTF-8?q?=E4=BA=92=E7=A1=AE=E8=AE=A4=E5=90=8E=EF=BC=8C=E4=B8=BAUISpinner?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=80=E7=A7=8D=E6=9E=84=E9=80=A0=E6=96=B9?= =?UTF-8?q?=E6=B3=95=EF=BC=8C=E5=8F=AF=E4=BB=A5=E6=8C=87=E5=AE=9A=E5=85=B6?= =?UTF-8?q?=E6=95=B0=E5=AD=97=E6=A1=86=E7=9A=84columns=EF=BC=8C=E5=B0=86Ma?= =?UTF-8?q?xMemRowCountPanel=E4=B8=AD=E7=9A=84UISpinner=E7=9A=84columns?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=B8=BA4=EF=BC=8C=E5=8D=B3=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E6=9C=80=E5=A4=9A=E5=B1=95=E7=A4=BA5=E4=BD=8D?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tabledatapane/MaxMemRowCountPanel.java | 2 +- .../com/fr/design/gui/ispinner/UISpinner.java | 26 ++++++++++++++----- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java index d43e6bdee..2df6cda02 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java @@ -72,7 +72,7 @@ public class MaxMemRowCountPanel extends UIToolbar { this.setBackground(UIConstants.NORMAL_BACKGROUND); switchCache = new UIComboBox(CACHE_LIST); switchCache.addActionListener(switchStateL); - numberSpinner = new UISpinner(0, Integer.MAX_VALUE, 1); + numberSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 4); } private void showAllPanel() { diff --git a/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java b/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java index fb6752ac1..a418a2b37 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java +++ b/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java @@ -30,6 +30,7 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver private static final int LEN = 13; private static final int WIDTH = 13; private static final int HEIGHT = 10; + private static final int DEFAULT_NUMBERFIELD_COLUMNS = 2; private UINumberField textField; private UIButton preButton; private UIButton nextButton; @@ -40,9 +41,26 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver private UIObserverListener uiObserverListener; private GlobalNameListener globalNameListener = null; private boolean lessMinValue = false; + /** + * Spinner内的数字文本框长度 + */ + private int numberFieldColumns; public UISpinner(double minValue, double maxValue, double dierta) { + init(minValue, maxValue, dierta); + } + + public UISpinner(double minValue, double maxValue, double dierta, double defaultValue) { + init(minValue, maxValue, dierta); + textField.setValue(defaultValue); + } + + public UISpinner(double minValue, double maxValue, double dierta, int numberFieldColumns) { + this.numberFieldColumns = numberFieldColumns; + init(minValue, maxValue, dierta); + } + private void init(double minValue, double maxValue, double dierta) { this.minValue = minValue; this.maxValue = maxValue; this.dierta = dierta; @@ -50,11 +68,6 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver iniListener(); } - public UISpinner(double minValue, double maxValue, double dierta, double defaultValue) { - this(minValue, maxValue, dierta); - textField.setValue(defaultValue); - } - private void iniListener() { if (shouldResponseChangeListener()) { this.addChangeListener(new ChangeListener() { @@ -308,7 +321,8 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver } protected UINumberField initNumberField() { - return new UINumberField(2) { + int columns = this.numberFieldColumns == 0 ? DEFAULT_NUMBERFIELD_COLUMNS : this.numberFieldColumns; + return new UINumberField(columns) { public boolean shouldResponseChangeListener() { return false; } From b306fea3705407c7cf5bde824be3c43540aa5c5e Mon Sep 17 00:00:00 2001 From: Yyming Date: Mon, 21 Sep 2020 14:55:41 +0800 Subject: [PATCH 08/64] =?UTF-8?q?REPORT-39884=20=E6=8D=A2=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E6=94=B9=E5=8A=A8=E6=96=B9=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/JPolyWorkBook.java | 12 ++----- .../mainframe/PolySheetNameTabPane.java | 36 +++++++++++++------ 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/JPolyWorkBook.java b/designer-realize/src/main/java/com/fr/design/mainframe/JPolyWorkBook.java index 48ddb6a05..ec9a2ce9d 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/JPolyWorkBook.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/JPolyWorkBook.java @@ -1,6 +1,4 @@ -/** - * - */ + package com.fr.design.mainframe; import com.fr.design.mainframe.template.info.JPolyWorkBookProcessInfo; @@ -13,7 +11,6 @@ import com.fr.report.poly.PolyWorkSheet; * 聚合报表Book, 跟WorkBook区别在于不能放入WorkSheet. * * @author neil - * * @date: 2015-2-5-上午8:58:39 */ public class JPolyWorkBook extends JWorkBook { @@ -32,15 +29,12 @@ public class JPolyWorkBook extends JWorkBook { * 创建sheet名称tab面板 * * @param reportCompositeX 当前组件对象 - * * @return sheet名称tab面板 - * * @date 2015-2-5-上午11:42:12 - * */ @Override - public SheetNameTabPane createSheetNameTabPane(ReportComponentComposite reportCompositeX){ - return new PolySheetNameTabPane(reportCompositeX); + public SheetNameTabPane createSheetNameTabPane(ReportComponentComposite reportCompositeX) { + return new SheetNameTabPane(reportCompositeX); } @Override diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/PolySheetNameTabPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/PolySheetNameTabPane.java index 73f63826b..8969661bf 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/PolySheetNameTabPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/PolySheetNameTabPane.java @@ -1,24 +1,38 @@ package com.fr.design.mainframe; -import java.awt.Graphics2D; import com.fr.design.menu.MenuDef; +import java.awt.Graphics2D; + /** * 获取 - * + * * @date 2015-2-5-上午10:19:17 - * + * @deprecated 让聚合报表也可以新建普通报表sheet, 逻辑和普通报表保持一致, 弃用此个性化设置 */ @Deprecated -public class PolySheetNameTabPane extends SheetNameTabPane{ - - /** - * 构造函数 - */ - public PolySheetNameTabPane(ReportComponentComposite reportCompositeX) { - super(reportCompositeX); - } +public class PolySheetNameTabPane extends SheetNameTabPane { + + /** + * 构造函数 + */ + public PolySheetNameTabPane(ReportComponentComposite reportCompositeX) { + super(reportCompositeX); + } + + protected void paintAddButton(Graphics2D g2d) { + ADD_POLY_SHEET.paintIcon(this, g2d, iconLocation, 3); + } + + + protected void firstInsertActionPerformed() { + new PolyReportInsertAction().actionPerformed(null); + } + + + protected void addInsertGridShortCut(MenuDef def) { + } } \ No newline at end of file From 6a5b573cac13d05844a4907b0ce9c339a6111404 Mon Sep 17 00:00:00 2001 From: kerry Date: Mon, 21 Sep 2020 14:56:14 +0800 Subject: [PATCH 09/64] =?UTF-8?q?REPORT-39601=20=E5=9C=A8=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=A0=BC=E4=B8=AD=E6=8F=92=E5=85=A5=20=E5=AF=8C?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E3=80=82=20=E5=AD=97=E4=BD=93=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=B8=BA14=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E7=BB=99=E6=88=91=E5=8F=98=E6=88=9013?= =?UTF-8?q?=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/cell/editor/RichTextToolBar.java | 5 +- .../cell/editor/RichTextToolBarTest.java | 69 +++++++++++++++++++ 2 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 designer-realize/src/test/java/com/fr/design/cell/editor/RichTextToolBarTest.java diff --git a/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java b/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java index a8f4b2ac1..fb904e219 100644 --- a/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java +++ b/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java @@ -502,14 +502,15 @@ public class RichTextToolBar extends BasicPane{ //pt转为px =*4/3 private int scaleUp(int fontSize) { - return (int) FontTransformUtil.pt2px(fontSize); + return roundUp(FontTransformUtil.pt2px(fontSize)); } //px转pt = *3/4 private int scaleDown(int fontSize) { - return (int) FontTransformUtil.px2pt(fontSize); + return roundUp(FontTransformUtil.px2pt(fontSize)); } + private DocumentListener inputListener = new DocumentListener() { @Override diff --git a/designer-realize/src/test/java/com/fr/design/cell/editor/RichTextToolBarTest.java b/designer-realize/src/test/java/com/fr/design/cell/editor/RichTextToolBarTest.java new file mode 100644 index 000000000..7cae136d7 --- /dev/null +++ b/designer-realize/src/test/java/com/fr/design/cell/editor/RichTextToolBarTest.java @@ -0,0 +1,69 @@ +package com.fr.design.cell.editor; + +import com.fr.invoke.Reflect; +import org.easymock.EasyMock; +import org.junit.Assert; +import org.junit.Test; + +/** + * Created by kerry on 2020-09-21 + */ +public class RichTextToolBarTest { + @Test + public void testScaleUpAndDown() { + RichTextToolBar textToolBar = EasyMock.mock(RichTextToolBar.class); + + int result = Reflect.on(textToolBar).call("scaleUp", 10).get(); + Assert.assertEquals(13, result); + result = Reflect.on(textToolBar).call("scaleDown", 13).get(); + Assert.assertEquals(10, result); + + result = Reflect.on(textToolBar).call("scaleUp", 11).get(); + Assert.assertEquals(15, result); + result = Reflect.on(textToolBar).call("scaleDown", 15).get(); + Assert.assertEquals(11, result); + + result = Reflect.on(textToolBar).call("scaleUp", 12).get(); + Assert.assertEquals(16, result); + result = Reflect.on(textToolBar).call("scaleDown", 16).get(); + Assert.assertEquals(12, result); + + + result = Reflect.on(textToolBar).call("scaleUp", 13).get(); + Assert.assertEquals(17, result); + result = Reflect.on(textToolBar).call("scaleDown", 17).get(); + Assert.assertEquals(13, result); + + result = Reflect.on(textToolBar).call("scaleUp", 14).get(); + Assert.assertEquals(19, result); + result = Reflect.on(textToolBar).call("scaleDown", 19).get(); + Assert.assertEquals(14, result); + + result = Reflect.on(textToolBar).call("scaleUp", 16).get(); + Assert.assertEquals(21, result); + result = Reflect.on(textToolBar).call("scaleDown", 21).get(); + Assert.assertEquals(16, result); + + + result = Reflect.on(textToolBar).call("scaleUp", 17).get(); + Assert.assertEquals(23, result); + result = Reflect.on(textToolBar).call("scaleDown", 23).get(); + Assert.assertEquals(17, result); + + result = Reflect.on(textToolBar).call("scaleUp", 17).get(); + Assert.assertEquals(23, result); + result = Reflect.on(textToolBar).call("scaleDown", 23).get(); + Assert.assertEquals(17, result); + + result = Reflect.on(textToolBar).call("scaleUp", 19).get(); + Assert.assertEquals(25, result); + result = Reflect.on(textToolBar).call("scaleDown", 25).get(); + Assert.assertEquals(19, result); + + result = Reflect.on(textToolBar).call("scaleUp", 20).get(); + Assert.assertEquals(27, result); + result = Reflect.on(textToolBar).call("scaleDown", 27).get(); + Assert.assertEquals(20, result); + } + +} From 2bac14ada6b3eaf947adfb4b78489fd18c1cf2e6 Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 21 Sep 2020 15:05:04 +0800 Subject: [PATCH 10/64] =?UTF-8?q?REPORT-40094=20=E3=80=90=E5=9B=9E?= =?UTF-8?q?=E5=BD=92=E3=80=91=E8=BF=9C=E7=A8=8B=E5=88=87=E6=8D=A2=E5=9B=9E?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0=EF=BC=8C=E7=BD=91=E9=A1=B5=E6=A1=86=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E4=B8=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/EastRegionContainerPane.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java index a273828d8..c7c587563 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java @@ -511,7 +511,10 @@ public class EastRegionContainerPane extends UIEastResizableContainer { UIUtil.invokeLaterIfNeeded(new Runnable() { @Override public void run() { - propertyItemMap.get(key).replaceContentPane(pane); + PropertyItem item = propertyItemMap.get(key); + if (item != null) { + item.replaceContentPane(pane); + } } }); } From 41eee70b3495fdbe7b65958cda479275a19cbbc9 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 21 Sep 2020 15:15:53 +0800 Subject: [PATCH 11/64] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=95=A3=E7=82=B9?= =?UTF-8?q?=E5=9B=BE=E3=80=81=E7=AE=B1=E5=9E=8B=E5=9B=BE=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=82=B9=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../box/VanChartBoxTooltipContentPane.java | 142 ++++++++++++++++-- .../component/VanChartTooltipContentPane.java | 63 ++++---- ...ChartScatterRefreshTooltipContentPane.java | 33 ++++ .../VanChartScatterTooltipContentPane.java | 34 +++++ 4 files changed, 224 insertions(+), 48 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java index d0dd67529..0ad1ee3aa 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java @@ -1,14 +1,20 @@ package com.fr.van.chart.box; +import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.plugin.chart.base.AttrTooltipContent; +import com.fr.plugin.chart.base.format.AttrTooltipFormat; import com.fr.plugin.chart.box.attr.AttrBoxTooltipContent; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.VanChartTooltipContentPane; import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -27,6 +33,14 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { private VanChartFormatPaneWithCheckBox min; private VanChartFormatPaneWithCheckBox outlier; + private VanChartFormatPaneWithoutCheckBox richTextNumber; + private VanChartFormatPaneWithoutCheckBox richTextMax; + private VanChartFormatPaneWithoutCheckBox richTextQ3; + private VanChartFormatPaneWithoutCheckBox richTextMedian; + private VanChartFormatPaneWithoutCheckBox richTextQ1; + private VanChartFormatPaneWithoutCheckBox richTextMin; + private VanChartFormatPaneWithoutCheckBox richTextOutlier; + private JPanel dataNumberPane; private JPanel dataOutlierPane; @@ -76,6 +90,47 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { }; } + protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { + setRichTextCategoryNameFormatPane(new CategoryNameFormatPaneWithoutCheckBox(parent, showOnPane)); + setRichTextSeriesNameFormatPane(new SeriesNameFormatPaneWithoutCheckBox(parent, showOnPane)); + + richTextNumber = new VanChartFormatPaneWithoutCheckBox(parent, showOnPane) { + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_Data_Number"); + } + }; + richTextMax = new VanChartFormatPaneWithoutCheckBox(parent, showOnPane) { + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_Max_Value"); + } + }; + richTextQ3 = new VanChartFormatPaneWithoutCheckBox(parent, showOnPane) { + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_Data_Q3"); + } + }; + richTextMedian = new VanChartFormatPaneWithoutCheckBox(parent, showOnPane) { + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_Data_Median"); + } + }; + richTextQ1 = new VanChartFormatPaneWithoutCheckBox(parent, showOnPane) { + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_Data_Q1"); + } + }; + richTextMin = new VanChartFormatPaneWithoutCheckBox(parent, showOnPane) { + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_Min_Value"); + } + }; + richTextOutlier = new VanChartFormatPaneWithoutCheckBox(parent, showOnPane) { + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_Outlier_Value"); + } + }; + } + protected JPanel createCommonFormatPanel() { JPanel commonPanel = new JPanel(new BorderLayout()); @@ -86,6 +141,20 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { return commonPanel; } + protected Component[][] getRichTextComponents() { + return new Component[][]{ + new Component[]{getRichTextCategoryNameFormatPane(), null}, + new Component[]{getRichTextSeriesNameFormatPane(), null}, + new Component[]{richTextNumber, null}, + new Component[]{richTextMax, null}, + new Component[]{richTextQ3, null}, + new Component[]{richTextMedian, null}, + new Component[]{richTextQ1, null}, + new Component[]{richTextMin, null}, + new Component[]{richTextOutlier, null} + }; + } + protected double[] getRowSize(double p) { return new double[]{p, p, p, p, p, p, p, p, p, p, p, p}; } @@ -93,13 +162,15 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { private JPanel createCateAndSeriesPane() { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; + double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] columnSize = {f, p}; - double[] rowSize = {p, p}; + double[] columnSize = {f, e}; + double[] rowSize = {p, p, p}; Component[][] cateAndSeries = new Component[][]{ - new Component[]{getCategoryNameFormatPane(), null}, - new Component[]{getSeriesNameFormatPane(), null} + new Component[]{null, null}, + new Component[]{null, getCategoryNameFormatPane()}, + new Component[]{null, getSeriesNameFormatPane()} }; return TableLayoutHelper.createTableLayoutPane(cateAndSeries, rowSize, columnSize); @@ -108,13 +179,14 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { private JPanel createDataNumberPane() { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; + double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] columnSize = {f, p}; + double[] columnSize = {f, e}; double[] rowSize = {p, p}; Component[][] dataNumber = new Component[][]{ new Component[]{null, null}, - new Component[]{number, null}, + new Component[]{null, number}, }; dataNumberPane = TableLayoutHelper.createTableLayoutPane(dataNumber, rowSize, columnSize); @@ -125,22 +197,24 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { private JPanel createDataDetailPane() { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; - double[] columnSize = {f, p}; + double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; + + double[] columnSize = {f, e}; JPanel detailPane = new JPanel(new BorderLayout()); Component[][] dataDetail = new Component[][]{ new Component[]{null, null}, - new Component[]{max, null}, - new Component[]{q3, null}, - new Component[]{median, null}, - new Component[]{q1, null}, - new Component[]{min, null} + new Component[]{null, max}, + new Component[]{new UILabel(getLabelContentTitle()), q3}, + new Component[]{null, median}, + new Component[]{null, q1}, + new Component[]{null, min} }; Component[][] dataOutlier = new Component[][]{ new Component[]{null, null}, - new Component[]{outlier, null}, + new Component[]{null, outlier}, }; dataOutlierPane = TableLayoutHelper.createTableLayoutPane(dataOutlier, new double[]{p, p}, columnSize); @@ -198,6 +272,31 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { } } + protected void populateRichEditor(AttrTooltipContent attrTooltipContent) { + + if (attrTooltipContent instanceof AttrBoxTooltipContent) { + AttrBoxTooltipContent boxTooltipContent = (AttrBoxTooltipContent) attrTooltipContent; + + VanChartFormatPaneWithoutCheckBox[] formatPaneGroup = new VanChartFormatPaneWithoutCheckBox[]{ + richTextNumber, richTextMax, richTextQ3, richTextMedian, + richTextQ1, richTextMin, richTextOutlier + }; + + AttrTooltipFormat[] formatGroup = new AttrTooltipFormat[]{ + boxTooltipContent.getRichTextNumber(), + boxTooltipContent.getRichTextMax(), + boxTooltipContent.getRichTextQ3(), + boxTooltipContent.getRichTextMedian(), + boxTooltipContent.getRichTextQ1(), + boxTooltipContent.getRichTextMin(), + boxTooltipContent.getRichTextOutlier() + }; + + populateRichTextFormat(formatPaneGroup, formatGroup); + populateRichText(attrTooltipContent.getRichTextAttr()); + } + } + protected void updateFormatPane(AttrTooltipContent attrTooltipContent) { getCategoryNameFormatPane().update(attrTooltipContent.getCategoryFormat()); getSeriesNameFormatPane().update(attrTooltipContent.getSeriesFormat()); @@ -217,6 +316,23 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { } } + protected void updateRichEditor(AttrTooltipContent attrTooltipContent) { + getRichTextCategoryNameFormatPane().update(attrTooltipContent.getRichTextCategoryFormat()); + getRichTextSeriesNameFormatPane().update(attrTooltipContent.getRichTextSeriesFormat()); + + if (attrTooltipContent instanceof AttrBoxTooltipContent) { + AttrBoxTooltipContent boxTooltipContent = (AttrBoxTooltipContent) attrTooltipContent; + + richTextNumber.update(boxTooltipContent.getRichTextNumber()); + richTextMax.update(boxTooltipContent.getRichTextMax()); + richTextQ3.update(boxTooltipContent.getRichTextQ3()); + richTextMedian.update(boxTooltipContent.getRichTextMedian()); + richTextQ1.update(boxTooltipContent.getRichTextQ1()); + richTextMin.update(boxTooltipContent.getRichTextMin()); + richTextOutlier.update(boxTooltipContent.getRichTextOutlier()); + } + } + public void checkFormatVisible(boolean detailed) { this.detailed = detailed; 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 bf7b51794..608ee2e16 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 @@ -232,7 +232,7 @@ public class VanChartTooltipContentPane extends BasicBeanPane Date: Mon, 21 Sep 2020 15:50:45 +0800 Subject: [PATCH 12/64] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/style/label/VanChartGaugeLabelDetailPane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java index 943aa2746..f06e7c1c7 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java @@ -37,8 +37,8 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { private UIButtonGroup align; private JPanel alignPane; private Integer[] oldAlignValues; - protected UIButtonGroup style; - protected ChartTextAttrPane textFontPane; + private UIButtonGroup style; + private ChartTextAttrPane textFontPane; public VanChartGaugeLabelDetailPane(Plot plot, VanChartStylePane parent) { super(plot, parent); From ab4a0c756718d0e609fc4b91d11bb069632fd8ad Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 21 Sep 2020 16:04:15 +0800 Subject: [PATCH 13/64] =?UTF-8?q?=E8=A1=A5=E5=85=85=E9=81=97=E6=BC=8F?= =?UTF-8?q?=E7=9A=84=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../van/chart/box/VanChartBoxTooltipContentPane.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java index 0ad1ee3aa..4659faaa8 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java @@ -5,7 +5,9 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.plugin.chart.base.AttrTooltipContent; +import com.fr.plugin.chart.base.format.AttrTooltipCategoryFormat; import com.fr.plugin.chart.base.format.AttrTooltipFormat; +import com.fr.plugin.chart.base.format.AttrTooltipSeriesFormat; import com.fr.plugin.chart.box.attr.AttrBoxTooltipContent; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.VanChartTooltipContentPane; @@ -20,6 +22,7 @@ import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Component; +import java.util.Map; public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { @@ -273,6 +276,15 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { } protected void populateRichEditor(AttrTooltipContent attrTooltipContent) { + Map params = getRichTextAttr().getParams(); + + AttrTooltipCategoryFormat categoryFormat = attrTooltipContent.getRichTextCategoryFormat(); + getRichTextCategoryNameFormatPane().populate(categoryFormat); + getRichTextCategoryNameFormatPane().updateFormatParams(params, categoryFormat.getJs()); + + AttrTooltipSeriesFormat seriesFormat = attrTooltipContent.getRichTextSeriesFormat(); + getRichTextSeriesNameFormatPane().populate(seriesFormat); + getRichTextSeriesNameFormatPane().updateFormatParams(params, seriesFormat.getJs()); if (attrTooltipContent instanceof AttrBoxTooltipContent) { AttrBoxTooltipContent boxTooltipContent = (AttrBoxTooltipContent) attrTooltipContent; From 4baa76c6ff536a1aef6abf54b0fdcb7373cc1f24 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 21 Sep 2020 16:34:48 +0800 Subject: [PATCH 14/64] =?UTF-8?q?=E5=A4=87=E6=B3=A8=E5=BE=85=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E7=9A=84=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/designer/style/tooltip/VanChartPlotTooltipPane.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartPlotTooltipPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartPlotTooltipPane.java index bb5b46b63..aa86fb9a7 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartPlotTooltipPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartPlotTooltipPane.java @@ -26,6 +26,7 @@ import java.awt.event.ActionListener; public class VanChartPlotTooltipPane extends BasicPane { private static final long serialVersionUID = 6087381131907589370L; + // todo 使用private protected UICheckBox isTooltipShow; protected VanChartTooltipContentPane tooltipContentPane; From 50b2fcfde5e90b817e860a8d535ae56ed1333bbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Mon, 21 Sep 2020 16:36:16 +0800 Subject: [PATCH 15/64] =?UTF-8?q?CHART-15518=20=E8=BD=B4=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E5=88=B020=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/chart/ChartDesignerActivator.java | 2 - ...nChartCustomStackAndAxisConditionPane.java | 8 +- .../component/VanChartAxisButtonPane.java | 75 ++++++++++--------- 3 files changed, 46 insertions(+), 39 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java b/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java index 8a5e0e7d8..0cd81f783 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java +++ b/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java @@ -15,7 +15,6 @@ import com.fr.locale.LocaleScope; import com.fr.module.Activator; import com.fr.module.extension.Prepare; import com.fr.plugin.chart.vanchart.export.ImagePainter; -import com.fr.plugin.chart.vanchart.export.PainterDispatcher; import com.fr.stable.bridge.StableFactory; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import com.fr.van.chart.DownloadOnlineSourcesHelper; @@ -47,7 +46,6 @@ public class ChartDesignerActivator extends Activator implements Prepare { ImagePainter.registerDownloadSourcesEvent(new DownloadOnlineSourcesHelper()); ImagePainter.registerDefaultCallbackEvent(HistoryTemplateListCache.getInstance()); - PainterDispatcher.getInstance().distributeDesignPainter(); ChartTypeInterfaceManager.addPluginChangedListener(); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartCustomStackAndAxisConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartCustomStackAndAxisConditionPane.java index ceb9bf480..86766676b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartCustomStackAndAxisConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartCustomStackAndAxisConditionPane.java @@ -6,18 +6,19 @@ import com.fr.data.condition.ListCondition; import com.fr.design.beans.BasicBeanPane; import com.fr.design.condition.LiteConditionPane; 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.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.utils.gui.GUICoreUtils; - import com.fr.plugin.chart.base.AttrSeriesStackAndAxis; import com.fr.van.chart.designer.style.series.VanChartSeriesConditionPane; import javax.swing.BorderFactory; import javax.swing.BoxLayout; import javax.swing.JPanel; +import javax.swing.ScrollPaneConstants; import java.awt.Component; import java.awt.Dimension; import java.awt.event.ActionEvent; @@ -46,10 +47,13 @@ public class VanChartCustomStackAndAxisConditionPane extends BasicBeanPane { private static final int B_W = 56; private static final int B_H = 21; private static final int COL_COUNT = 3; + private static final int MAX_COUNT = 20; private UIButton addButton; private UIPopupMenu popupMenu; + private UIMenuItem itemX; + private UIMenuItem itemY; private List indexList_X = new ArrayList(); private List indexList_Y = new ArrayList(); @@ -51,7 +53,7 @@ public class VanChartAxisButtonPane extends BasicBeanPane { private VanChartAxisPane parent; - public VanChartAxisButtonPane(VanChartAxisPane vanChartAxisPane){ + public VanChartAxisButtonPane(VanChartAxisPane vanChartAxisPane) { this.parent = vanChartAxisPane; this.setLayout(new BorderLayout()); @@ -66,6 +68,20 @@ public class VanChartAxisButtonPane extends BasicBeanPane { buttonPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 10, 0)); this.add(buttonPane, BorderLayout.CENTER); + itemX = new UIMenuItem(VanChartAttrHelper.X_AXIS_PREFIX); + itemX.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + addXAxis(); + } + }); + itemY = new UIMenuItem(VanChartAttrHelper.Y_AXIS_PREFIX); + itemY.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + addYAxis(); + } + }); addButton.addActionListener(addListener); } @@ -92,12 +108,12 @@ public class VanChartAxisButtonPane extends BasicBeanPane { pane = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); buttonPane.add(pane); } - if(pane != null) { + if (pane != null) { pane.add(indexList_Y.get(i)); } } - if(popupMenu != null){ + if (popupMenu != null) { popupMenu.setVisible(false); } @@ -114,19 +130,19 @@ public class VanChartAxisButtonPane extends BasicBeanPane { indexList_X.clear(); indexList_Y.clear(); List xList = plot.getXAxisList(); - for(VanChartAxis axis : xList){ + for (VanChartAxis axis : xList) { ChartAxisButton x = new ChartAxisButton(plot.getXAxisName(axis)); x.setToolTipText(plot.getXAxisName(axis)); indexList_X.add(x); } List yList = plot.getYAxisList(); - for(VanChartAxis axis : yList){ + for (VanChartAxis axis : yList) { ChartAxisButton y = new ChartAxisButton(plot.getYAxisName(axis)); y.setToolTipText(plot.getYAxisName(axis)); indexList_Y.add(y); } - if(indexList_X.isEmpty()){ + if (indexList_X.isEmpty()) { this.removeAll(); } else { indexList_X.get(0).setSelected(true); @@ -143,7 +159,7 @@ public class VanChartAxisButtonPane extends BasicBeanPane { return null; } - public String getNewChartName(List existList, String prefix){ + public String getNewChartName(List existList, String prefix) { int count = existList.size() + 1; while (true) { String name_test = prefix + count; @@ -165,31 +181,19 @@ public class VanChartAxisButtonPane extends BasicBeanPane { ActionListener addListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - if(popupMenu == null){ - popupMenu = new UIPopupMenu(); - UIMenuItem item_x = new UIMenuItem(VanChartAttrHelper.X_AXIS_PREFIX); - item_x.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - addXAxis(); - } - }); - UIMenuItem item_y = new UIMenuItem(VanChartAttrHelper.Y_AXIS_PREFIX); - item_y.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - addYAxis(); - } - }); - popupMenu.add(item_x); - popupMenu.add(item_y); + popupMenu = new UIPopupMenu(); + if (indexList_X.size() < MAX_COUNT) { + popupMenu.add(itemX); + } + if (indexList_Y.size() < MAX_COUNT) { + popupMenu.add(itemY); } popupMenu.setVisible(true); GUICoreUtils.showPopupMenu(popupMenu, addButton, addButton.getWidth() - popupMenu.getPreferredSize().width, addButton.getY() - 1 + addButton.getHeight()); } }; - private void addXAxis(){ + private void addXAxis() { String name = getNewChartName(indexList_X, VanChartAttrHelper.X_AXIS_PREFIX); ChartAxisButton button = new ChartAxisButton(name); @@ -199,7 +203,7 @@ public class VanChartAxisButtonPane extends BasicBeanPane { layoutPane(); } - private void addYAxis(){ + private void addYAxis() { String name = getNewChartName(indexList_Y, VanChartAttrHelper.Y_AXIS_PREFIX); ChartAxisButton button = new ChartAxisButton(name); @@ -216,9 +220,10 @@ public class VanChartAxisButtonPane extends BasicBeanPane { private class AddButton extends UIButton { - public AddButton(Icon icon){ + public AddButton(Icon icon) { super(icon); } + /** * 组件是否需要响应添加的观察者事件 * @@ -277,19 +282,19 @@ public class VanChartAxisButtonPane extends BasicBeanPane { } private void noSelected() { - for(ChartAxisButton button : indexList_X){ + for (ChartAxisButton button : indexList_X) { button.setSelected(false); } - for(ChartAxisButton button : indexList_Y){ + for (ChartAxisButton button : indexList_Y) { button.setSelected(false); } } private void checkMoveOn(boolean moveOn) { - for(ChartAxisButton button : indexList_X){ + for (ChartAxisButton button : indexList_X) { button.isMoveOn = false; } - for(ChartAxisButton button : indexList_Y){ + for (ChartAxisButton button : indexList_Y) { button.isMoveOn = false; } From c147fec30298c1c7bc0673af4bdfcdc5b16bb812 Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Tue, 22 Sep 2020 09:22:10 +0800 Subject: [PATCH 16/64] =?UTF-8?q?REPORT-40025=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=9C=A8=E5=B7=B2=E9=80=89=E6=8B=A9=E7=BB=84=E4=BB=B6=E4=B8=AD?= =?UTF-8?q?=E6=8C=89=E5=9D=90=E6=A0=87=E8=8E=B7=E5=8F=96=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/creator/XCreatorUtils.java | 7 +-- .../com/fr/design/mainframe/FormDesigner.java | 57 +++++++++++++++---- 2 files changed, 48 insertions(+), 16 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java index 0c4ea6313..260318023 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java @@ -345,17 +345,16 @@ public class XCreatorUtils { } /** - * 获取组件的最顶层XMainBorderLayout,没有则返回null + * 获取组件的上一层的XMainBorderLayout,没有则返回null * */ @Nullable public static XWCardMainBorderLayout getTopXMainBorderLayout(Container creator) { - XWCardMainBorderLayout result = null; while (creator != null) { if (creator instanceof XWCardMainBorderLayout) { - result = (XWCardMainBorderLayout) creator; + return (XWCardMainBorderLayout) creator; } creator = creator.getParent(); } - return result; + return null; } } \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java index 55c2106b0..ef7760cdb 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java @@ -842,26 +842,59 @@ public class FormDesigner extends TargetComponent
implements TreeSelection if (shouldContinue) { continue; } - //如果组件为XWCardMainBorderLayout的子组件,直接从XWCardMainBorderLayout中去找 - XWCardMainBorderLayout borderLayout = XCreatorUtils.getTopXMainBorderLayout(creator); - if (borderLayout != null) { - return xCreatorAt(x, y, borderLayout, null); + //获取当前组件父组件相对于rootComponent或者paraComponent的距离 + int relativeParentX = getRelativeParentX(creator.getParent()); + int relativeParentY = getRelativeParentY(creator.getParent()); + + //如果不是布局容器,直接进行对比 + if (!(creator instanceof XLayoutContainer)) { + x -= relativeParentX + creator.getX(); + y -= relativeParentY + creator.getY(); + Rectangle rect = ComponentUtils.computeVisibleRect(creator); + // 判断是否处于交叉区域 + if (isIntersectArea(x, y, rect)) { + return creator; + } } + + //如果是布局容器,从布局容器向下找 if (creator instanceof XLayoutContainer) { - return xCreatorAt(x, y, creator, null); + XCreator result = xCreatorAt(x - relativeParentX, y - relativeParentY, creator, null); + if (result != null) return result; } - x -= creator.getX(); - y -= creator.getY(); - Rectangle rect = ComponentUtils.computeVisibleRect(creator); - // 判断是否处于交叉区域 - if (!isIntersectArea(x, y, rect)) { - continue; + + //最后,如果组件为Tab容器中的子组件,再从Tab容器中去找 + XWCardMainBorderLayout borderLayout = XCreatorUtils.getTopXMainBorderLayout(creator); + if (borderLayout != null) { + relativeParentX = getRelativeParentX(borderLayout.getParent()); + relativeParentY = getRelativeParentY(borderLayout.getParent()); + return xCreatorAt(x - relativeParentX, y - relativeParentY, borderLayout, null); } - return creator; } return null; } + /** + * 获取当前组件相对于rootComponent或者paraComponent的横向距离 + */ + private int getRelativeParentX(Container container) { + return returnZero(container) ? 0 : container.getX() + getRelativeParentX(container.getParent()); + } + + /** + * 获取当前组件相对于rootComponent或者paraComponent的纵向距离 + */ + private int getRelativeParentY(Container container) { + return returnZero(container) ? 0 : container.getY() + getRelativeParentY(container.getParent()); + } + + private boolean returnZero(Container container) { + return !(container instanceof XLayoutContainer) + || container == rootComponent + || (paraComponent != null && container == paraComponent); + } + + /** * 刷新顶层组件 * */ From 28cde5e899b3a9151f191d315a82006ca53eed89 Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Tue, 22 Sep 2020 09:44:47 +0800 Subject: [PATCH 17/64] =?UTF-8?q?REPORT-40025=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=9C=A8=E5=B7=B2=E9=80=89=E6=8B=A9=E7=BB=84=E4=BB=B6=E4=B8=AD?= =?UTF-8?q?=E6=8C=89=E5=9D=90=E6=A0=87=E8=8E=B7=E5=8F=96=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/FormDesigner.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java index ef7760cdb..c4fa2df8a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java @@ -848,11 +848,11 @@ public class FormDesigner extends TargetComponent implements TreeSelection //如果不是布局容器,直接进行对比 if (!(creator instanceof XLayoutContainer)) { - x -= relativeParentX + creator.getX(); - y -= relativeParentY + creator.getY(); + int newX = x - relativeParentX - creator.getX(); + int newY = y - relativeParentY - creator.getY(); Rectangle rect = ComponentUtils.computeVisibleRect(creator); // 判断是否处于交叉区域 - if (isIntersectArea(x, y, rect)) { + if (isIntersectArea(newX, newY, rect)) { return creator; } } @@ -860,7 +860,9 @@ public class FormDesigner extends TargetComponent implements TreeSelection //如果是布局容器,从布局容器向下找 if (creator instanceof XLayoutContainer) { XCreator result = xCreatorAt(x - relativeParentX, y - relativeParentY, creator, null); - if (result != null) return result; + if (result != null) { + return result; + } } //最后,如果组件为Tab容器中的子组件,再从Tab容器中去找 From c221d03f544acb635c8a76d8d750aa935d5a1c79 Mon Sep 17 00:00:00 2001 From: Yvan Date: Tue, 22 Sep 2020 10:43:27 +0800 Subject: [PATCH 18/64] =?UTF-8?q?REPORT-38516=20=E3=80=90=E5=9B=9E?= =?UTF-8?q?=E5=BD=92=E3=80=91=E6=A8=A1=E6=9D=BF=E9=87=8D=E5=91=BD=E5=90=8D?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=EF=BC=8C=E8=BE=93=E5=85=A5=E6=A1=86=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=B8=8D=E5=85=A8=201.=20bug=E5=8E=9F=E5=9B=A0?= =?UTF-8?q?=EF=BC=9A=E5=AD=97=E4=BD=93=E5=BC=82=E5=B8=B8=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E4=B9=8B=E5=89=8D=E8=83=BD=E6=94=BE=E4=B8=8B=E7=9A=84=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E6=A1=86=E8=A2=AB=E6=8C=A4=E4=B8=8B=E5=8E=BB=E4=BA=86?= =?UTF-8?q?=202.=20=E4=BF=AE=E6=94=B9=E6=96=B9=E6=A1=88=EF=BC=9A=E5=B0=86?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E9=87=8D=E5=91=BD=E5=90=8D=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E7=9A=84=E5=AE=BD=E5=BA=A6=E5=A2=9E=E5=A4=A7=EF=BC=8C=E4=B8=8E?= =?UTF-8?q?hades=E6=94=B9=E7=9A=84=E6=96=87=E4=BB=B6=E5=A4=B9=E9=87=8D?= =?UTF-8?q?=E5=91=BD=E5=90=8D=E5=BC=B9=E7=AA=97=E4=BF=9D=E6=8C=81=E4=B8=80?= =?UTF-8?q?=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/DesignerFrameFileDealerPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java index a9d9281e9..86f73982f 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java @@ -649,7 +649,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt BorderLayout.CENTER); - this.setSize(340, 180); + this.setSize(380, 180); this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Rename")); this.setResizable(false); this.setAlwaysOnTop(true); From 83c85c6a09845757eb703be29420237881863057 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Tue, 22 Sep 2020 11:47:38 +0800 Subject: [PATCH 19/64] =?UTF-8?q?=E6=A0=87=E7=AD=BE=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E6=96=B9=E5=90=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VanChartColumnPlotLabelDetailPane.java | 17 ++++++ .../column/VanChartColumnPlotLabelPane.java | 20 +++++++ .../fr/van/chart/designer/PlotFactory.java | 2 + .../label/VanChartGaugeLabelDetailPane.java | 5 +- .../label/VanChartGaugePlotLabelPane.java | 57 +++++++++++++++++-- .../label/VanChartPlotLabelDetailPane.java | 42 ++++++++++---- 6 files changed, 126 insertions(+), 17 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelDetailPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelPane.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelDetailPane.java new file mode 100644 index 000000000..3243bad71 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelDetailPane.java @@ -0,0 +1,17 @@ +package com.fr.van.chart.column; + +import com.fr.chart.chartattr.Plot; +import com.fr.plugin.chart.column.VanChartColumnPlot; +import com.fr.van.chart.designer.style.VanChartStylePane; +import com.fr.van.chart.designer.style.label.VanChartPlotLabelDetailPane; + +public class VanChartColumnPlotLabelDetailPane extends VanChartPlotLabelDetailPane { + + public VanChartColumnPlotLabelDetailPane(Plot plot, VanChartStylePane parent) { + super(plot, parent); + } + + protected boolean hasLabelOrientationPane() { + return !((VanChartColumnPlot) this.getPlot()).isBar(); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelPane.java b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelPane.java new file mode 100644 index 000000000..e80f6310d --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelPane.java @@ -0,0 +1,20 @@ +package com.fr.van.chart.column; + +import com.fr.chart.chartattr.Plot; +import com.fr.van.chart.designer.style.VanChartStylePane; +import com.fr.van.chart.designer.style.label.VanChartPlotLabelPane; + +import java.awt.BorderLayout; + +public class VanChartColumnPlotLabelPane extends VanChartPlotLabelPane { + + public VanChartColumnPlotLabelPane(Plot plot, VanChartStylePane parent) { + super(plot, parent); + } + + protected void createLabelPane() { + VanChartColumnPlotLabelDetailPane labelDetailPane = new VanChartColumnPlotLabelDetailPane(getPlot(), getParentPane()); + setLabelDetailPane(labelDetailPane); + getLabelPane().add(labelDetailPane, BorderLayout.CENTER); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java b/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java index aeaefa5b3..b518b1ec8 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java @@ -23,6 +23,7 @@ import com.fr.plugin.chart.structure.VanChartStructurePlot; import com.fr.plugin.chart.treemap.VanChartTreeMapPlot; import com.fr.plugin.chart.wordcloud.VanChartWordCloudPlot; import com.fr.van.chart.bubble.force.VanChartBubbleRefreshTooltipPane; +import com.fr.van.chart.column.VanChartColumnPlotLabelPane; import com.fr.van.chart.designer.component.VanChartLabelContentPane; import com.fr.van.chart.designer.component.VanChartRefreshTooltipContentPane; import com.fr.van.chart.designer.component.VanChartTooltipContentPane; @@ -95,6 +96,7 @@ public class PlotFactory { private static Map, Class> labelMap = new HashMap, Class>(); static { + labelMap.put(VanChartColumnPlot.class, VanChartColumnPlotLabelPane.class); labelMap.put(VanChartGaugePlot.class, VanChartGaugePlotLabelPane.class); labelMap.put(VanChartScatterPlot.class, VanChartScatterPlotLabelPane.class); labelMap.put(VanChartBubblePlot.class, VanChartScatterPlotLabelPane.class); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java index f06e7c1c7..e1febb26b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java @@ -114,8 +114,9 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { }; } - protected JPanel getLabelPositionPane(Component[][] comps, double[] row, double[] col) { - return TableLayoutHelper.createTableLayoutPane(comps, row, col); + // 仪表盘标签内无布局tab + protected JPanel getLabelLayoutPane(JPanel panel, String title) { + return panel; } protected JPanel createTableLayoutPaneWithTitle(String title, JPanel panel) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugePlotLabelPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugePlotLabelPane.java index bd1b9a175..9bc21a044 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugePlotLabelPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugePlotLabelPane.java @@ -1,13 +1,15 @@ package com.fr.van.chart.designer.style.label; import com.fr.chart.chartattr.Plot; - +import com.fr.design.gui.ibutton.UIButtonGroup; +import com.fr.design.i18n.Toolkit; +import com.fr.plugin.chart.attr.GaugeDetailStyle; import com.fr.plugin.chart.base.AttrLabel; +import com.fr.plugin.chart.base.AttrLabelDetail; import com.fr.plugin.chart.gauge.VanChartGaugePlot; import com.fr.plugin.chart.type.GaugeStyle; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.style.VanChartStylePane; -import com.fr.design.i18n.Toolkit; import javax.swing.JPanel; import java.awt.BorderLayout; @@ -18,6 +20,9 @@ import java.awt.BorderLayout; public class VanChartGaugePlotLabelPane extends VanChartPlotLabelPane { private static final long serialVersionUID = -322148616244458359L; + private UIButtonGroup orientation; + private JPanel layoutPane; + private VanChartPlotLabelDetailPane gaugeValueLabelPane; public VanChartGaugePlotLabelPane(Plot plot, VanChartStylePane parent) { @@ -41,23 +46,65 @@ public class VanChartGaugePlotLabelPane extends VanChartPlotLabelPane { } JPanel cateOrPercentPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(cateTitle, getLabelDetailPane()); JPanel valuePane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(valueTitle, gaugeValueLabelPane); + + layoutPane = createGaugeLabelLayoutPane(); + getLabelPane().add(cateOrPercentPane, BorderLayout.NORTH); - getLabelPane().add(valuePane, BorderLayout.SOUTH); + getLabelPane().add(valuePane, BorderLayout.CENTER); + getLabelPane().add(layoutPane, BorderLayout.SOUTH); + + checkLayoutPaneVisible(); + } + + private void checkLayoutPaneVisible() { + layoutPane.setVisible(showLayoutPane()); + } + + private boolean showLayoutPane() { + VanChartGaugePlot plot = (VanChartGaugePlot) this.getPlot(); + GaugeDetailStyle gaugeDetailStyle = plot.getGaugeDetailStyle(); + + return plot.getGaugeStyle() == GaugeStyle.THERMOMETER && gaugeDetailStyle != null && gaugeDetailStyle.isHorizontalLayout(); + } + + // 试管仪表盘横行布局时,正常标签外增加布局tab,同时控制百分比和值标签的文本方向 + private JPanel createGaugeLabelLayoutPane() { + orientation = new UIButtonGroup<>(new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Direction_Horizontal"), + Toolkit.i18nText("Fine-Design_Chart_Direction_Vertical"), + }); + + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Text_Orientation"), orientation); + + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Form_Attr_Layout"), panel); } public void populate(AttrLabel attr) { super.populate(attr); if(gaugeValueLabelPane != null && attr != null){ - gaugeValueLabelPane.populate(attr.getGaugeValueLabelDetail()); + AttrLabelDetail labelDetail = attr.getGaugeValueLabelDetail(); + gaugeValueLabelPane.populate(labelDetail); + orientation.setSelectedIndex(labelDetail.isHorizontal() ? 0 : 1); + + checkLayoutPaneVisible(); } } public AttrLabel update() { AttrLabel attrLabel = super.update(); + if(gaugeValueLabelPane != null && attrLabel != null){ - gaugeValueLabelPane.update(attrLabel.getGaugeValueLabelDetail()); + AttrLabelDetail defaultLabelDetail = attrLabel.getAttrLabelDetail(); + AttrLabelDetail valueLabelDetail = attrLabel.getGaugeValueLabelDetail(); + + gaugeValueLabelPane.update(valueLabelDetail); + + boolean horizontal = orientation.getSelectedIndex() == 0; + defaultLabelDetail.setHorizontal(horizontal); + valueLabelDetail.setHorizontal(horizontal); } + return attrLabel; } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java index 576d0211c..253a6f832 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java @@ -28,9 +28,6 @@ import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.BorderLayout; import java.awt.Component; -import java.awt.Dimension; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; /** * Created by Mitisky on 15/12/7. @@ -42,6 +39,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { private UIButtonGroup position; private UIButtonGroup autoAdjust; + private UIButtonGroup orientation; private UIToggleButton tractionLine; private ColorSelectBox backgroundColor; @@ -157,8 +155,11 @@ public class VanChartPlotLabelDetailPane extends BasicPane { positionPane = new JPanel(); checkPositionPane(title); - panel.add(positionPane, BorderLayout.CENTER); + panel.add(positionPane, BorderLayout.NORTH); + if (hasLabelOrientationPane()) { + panel.add(createLabelOrientationPane(), BorderLayout.CENTER); + } if (plot.isSupportLeadLine()) { tractionLine = new UIToggleButton(Toolkit.i18nText("Fine-Design_Chart_Show_Guideline")); @@ -168,7 +169,25 @@ public class VanChartPlotLabelDetailPane extends BasicPane { } else if (PlotFactory.plotAutoAdjustLabelPosition(plot)) { panel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Auto_Adjust"), autoAdjust), BorderLayout.SOUTH); } - return panel; + + return getLabelLayoutPane(panel, Toolkit.i18nText("Fine-Design_Form_Attr_Layout")); + } + + protected JPanel getLabelLayoutPane(JPanel panel, String title) { + return createTableLayoutPaneWithTitle(title, panel); + } + + protected boolean hasLabelOrientationPane() { + return false; + } + + private JPanel createLabelOrientationPane() { + orientation = new UIButtonGroup<>(new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Direction_Horizontal"), + Toolkit.i18nText("Fine-Design_Chart_Direction_Vertical"), + }); + + return TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Text_Orientation"), orientation); } protected void checkPositionPane(String title) { @@ -205,13 +224,10 @@ public class VanChartPlotLabelDetailPane extends BasicPane { } } - protected JPanel getLabelPositionPane (Component[][] comps, double[] row, double[] col){ - JPanel panel = TableLayoutHelper.createTableLayoutPane(comps,row,col); - return createTableLayoutPaneWithTitle(Toolkit.i18nText("Fine-Design_Form_Attr_Layout"), panel); + return TableLayoutHelper.createTableLayoutPane(comps, row, col); } - protected void initPositionListener() { position.addChangeListener(new ChangeListener() { @Override @@ -267,11 +283,14 @@ public class VanChartPlotLabelDetailPane extends BasicPane { if(position != null){ position.setSelectedItem(detail.getPosition()); } + if(orientation != null){ + orientation.setSelectedIndex(detail.isHorizontal() ? 0 : 1); + } if(tractionLine != null){ tractionLine.setSelected(detail.isShowGuidLine()); } if(autoAdjust != null){ - autoAdjust.setSelectedIndex(detail.isAutoAdjust() == true ? 0 : 1); + autoAdjust.setSelectedIndex(detail.isAutoAdjust() ? 0 : 1); } if(backgroundColor != null){ @@ -294,6 +313,9 @@ public class VanChartPlotLabelDetailPane extends BasicPane { detail.setAutoAdjust(autoAdjust != null && autoAdjust.getSelectedItem()); + if(orientation != null){ + detail.setHorizontal(orientation.getSelectedIndex() == 0); + } if(tractionLine != null){ detail.setShowGuidLine(tractionLine.isSelected() && detail.getPosition() == Constants.OUTSIDE); } From 5b952eb12466b5ce65a4be0118a9c3a5d713fce4 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Tue, 22 Sep 2020 15:22:52 +0800 Subject: [PATCH 20/64] =?UTF-8?q?=E6=A0=87=E7=AD=BE=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E8=BE=B9=E6=A1=86=E5=92=8C=E8=83=8C=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/van/chart/designer/PlotFactory.java | 18 +++++- .../label/VanChartPlotLabelDetailPane.java | 61 +++++++++++++++++-- 2 files changed, 73 insertions(+), 6 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java b/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java index b518b1ec8..9ea26a5c5 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java @@ -7,6 +7,7 @@ import com.fr.design.gui.icombobox.UIComboBoxRenderer; import com.fr.design.gui.style.FormatPane; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; +import com.fr.plugin.chart.PiePlot4VanChart; import com.fr.plugin.chart.area.VanChartAreaPlot; import com.fr.plugin.chart.bubble.VanChartBubblePlot; import com.fr.plugin.chart.column.VanChartColumnPlot; @@ -77,7 +78,7 @@ import java.util.Set; */ public class PlotFactory { - private static Set> autoAdjustLabelPlots = new HashSet>(); + private static Set> autoAdjustLabelPlots = new HashSet<>(); static { autoAdjustLabelPlots.add(VanChartColumnPlot.class); @@ -90,10 +91,23 @@ public class PlotFactory { return autoAdjustLabelPlots.contains(plot.getClass()); } + private static Set> borderAndBackgroundLabelPlots = new HashSet<>(); + + static { + borderAndBackgroundLabelPlots.add(PiePlot4VanChart.class); + borderAndBackgroundLabelPlots.add(VanChartColumnPlot.class); + borderAndBackgroundLabelPlots.add(VanChartLinePlot.class); + borderAndBackgroundLabelPlots.add(VanChartAreaPlot.class); + } + + public static boolean hasBorderAndBackgroundPlotLabel(Plot plot) { + return borderAndBackgroundLabelPlots.contains(plot.getClass()); + } + /** * 标签Map */ - private static Map, Class> labelMap = new HashMap, Class>(); + private static Map, Class> labelMap = new HashMap<>(); static { labelMap.put(VanChartColumnPlot.class, VanChartColumnPlotLabelPane.class); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java index 253a6f832..b159af755 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java @@ -20,6 +20,8 @@ import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.stable.Constants; import com.fr.van.chart.designer.PlotFactory; import com.fr.van.chart.designer.TableLayout4VanChartHelper; +import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutImagePane; +import com.fr.van.chart.designer.component.border.VanChartBorderWithRadiusPane; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -43,6 +45,8 @@ public class VanChartPlotLabelDetailPane extends BasicPane { private UIToggleButton tractionLine; private ColorSelectBox backgroundColor; + private VanChartBorderWithRadiusPane borderPane; + private VanChartBackgroundWithOutImagePane backgroundPane; private JPanel tractionLinePane; private JPanel positionPane; @@ -98,15 +102,48 @@ public class VanChartPlotLabelDetailPane extends BasicPane { protected Component[][] getLabelPaneComponents(Plot plot, double p, double[] columnSize) { if(hasLabelPosition(plot)){ + + // 仅饼图、柱形图、条形图、折线图、面积图含有边框和背景 + if (hasBorderAndBackground(plot)) { + return new Component[][]{ + new Component[]{dataLabelContentPane,null}, + new Component[]{createLabelPositionPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Position"), plot), null}, + new Component[]{createLabelBorderPane(), null}, + new Component[]{createLabelBackgroundPane(), null} + }; + } + return new Component[][]{ new Component[]{dataLabelContentPane,null}, new Component[]{createLabelPositionPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Position"), plot), null} }; - } else { - return new Component[][]{ - new Component[]{dataLabelContentPane,null} - }; } + + return new Component[][]{ + new Component[]{dataLabelContentPane,null} + }; + } + + private JPanel createLabelBorderPane() { + borderPane = new VanChartBorderWithRadiusPane(); + + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane); + } + + private JPanel createLabelBackgroundPane() { + backgroundPane = new VanChartBackgroundWithOutImagePane(){ + + protected Component[][] getPaneComponents() { + return new Component[][]{ + new Component[]{null, null}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Fill")), typeComboBox}, + new Component[]{null, centerPane}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Alpha")), transparent}, + }; + } + }; + + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane); } protected double[] getLabelStyleRowSize(double p) { @@ -121,6 +158,10 @@ public class VanChartPlotLabelDetailPane extends BasicPane { return plot instanceof VanChartLabelPositionPlot; } + private boolean hasBorderAndBackground(Plot plot) { + return PlotFactory.hasBorderAndBackgroundPlotLabel(plot); + } + protected JPanel createTableLayoutPaneWithTitle(String title, JPanel panel) { return TableLayout4VanChartHelper.createExpandablePaneWithTitle(title, panel); } @@ -296,6 +337,12 @@ public class VanChartPlotLabelDetailPane extends BasicPane { if(backgroundColor != null){ backgroundColor.setSelectObject(detail.getBackgroundColor()); } + if(borderPane != null){ + borderPane.populate(detail.getGeneralInfo()); + } + if(backgroundPane != null){ + backgroundPane.populate(detail.getGeneralInfo()); + } checkAllUse(); } @@ -322,6 +369,12 @@ public class VanChartPlotLabelDetailPane extends BasicPane { if(backgroundColor != null){ detail.setBackgroundColor(backgroundColor.getSelectObject()); } + if(borderPane != null){ + borderPane.update(detail.getGeneralInfo()); + } + if(backgroundPane != null){ + backgroundPane.update(detail.getGeneralInfo()); + } } } From 41c033b948b7a09d1d0e5cafad27615f8b2ed43f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 22 Sep 2020 16:06:38 +0800 Subject: [PATCH 21/64] =?UTF-8?q?CHART-15704=20=E8=AF=95=E7=AE=A1=E5=9E=8B?= =?UTF-8?q?=E4=BB=AA=E8=A1=A8=E7=9B=98=E6=A0=87=E7=AD=BE=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E7=9A=84=E5=88=9D=E5=A7=8B=E5=8C=96=E6=97=B6=E5=80=99=EF=BC=8C?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E6=8A=8A=E6=89=80=E6=9C=89=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E9=83=BD=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../label/VanChartGaugeCateOrPercentLabelDetailPane.java | 2 +- .../designer/style/label/VanChartGaugeLabelDetailPane.java | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java index 292dcbfa4..9a5c45382 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java @@ -22,7 +22,7 @@ public class VanChartGaugeCateOrPercentLabelDetailPane extends VanChartGaugeLabe } protected double[] getLabelPaneRowSize(Plot plot, double p) { - if (hasLabelAlign(plot)) { + if (hasLabelAlignPane()) { return new double[]{p, p, p, p}; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java index f06e7c1c7..0921b6d62 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java @@ -123,7 +123,7 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { } protected Component[][] getLabelPaneComponents(Plot plot, double p, double[] columnSize) { - if (hasLabelAlign(plot)) { + if (hasLabelAlignPane()) { return new Component[][]{ new Component[]{getDataLabelContentPane(), null}, @@ -222,6 +222,10 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { return getGaugeStyle() == GaugeStyle.THERMOMETER && !((VanChartGaugePlot) plot).getGaugeDetailStyle().isHorizontalLayout(); } + protected boolean hasLabelAlignPane() { + return getGaugeStyle() == GaugeStyle.THERMOMETER; + } + public void populate(AttrLabelDetail detail) { super.populate(detail); From 17534e63dc2efb7d965c8686e984f8667d3aad16 Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 22 Sep 2020 16:55:31 +0800 Subject: [PATCH 22/64] =?UTF-8?q?REPORT-39601=20=E5=9C=A8=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=A0=BC=E4=B8=AD=E6=8F=92=E5=85=A5=20=E5=AF=8C?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E3=80=82=20=E5=AD=97=E4=BD=93=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=B8=BA14=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E7=BB=99=E6=88=91=E5=8F=98=E6=88=9013?= =?UTF-8?q?=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/cell/editor/RichTextToolBar.java | 5 +- .../cell/editor/RichTextToolBarTest.java | 69 +++++++++++++++++++ 2 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 designer-realize/src/test/java/com/fr/design/cell/editor/RichTextToolBarTest.java diff --git a/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java b/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java index a8f4b2ac1..fb904e219 100644 --- a/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java +++ b/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java @@ -502,14 +502,15 @@ public class RichTextToolBar extends BasicPane{ //pt转为px =*4/3 private int scaleUp(int fontSize) { - return (int) FontTransformUtil.pt2px(fontSize); + return roundUp(FontTransformUtil.pt2px(fontSize)); } //px转pt = *3/4 private int scaleDown(int fontSize) { - return (int) FontTransformUtil.px2pt(fontSize); + return roundUp(FontTransformUtil.px2pt(fontSize)); } + private DocumentListener inputListener = new DocumentListener() { @Override diff --git a/designer-realize/src/test/java/com/fr/design/cell/editor/RichTextToolBarTest.java b/designer-realize/src/test/java/com/fr/design/cell/editor/RichTextToolBarTest.java new file mode 100644 index 000000000..7cae136d7 --- /dev/null +++ b/designer-realize/src/test/java/com/fr/design/cell/editor/RichTextToolBarTest.java @@ -0,0 +1,69 @@ +package com.fr.design.cell.editor; + +import com.fr.invoke.Reflect; +import org.easymock.EasyMock; +import org.junit.Assert; +import org.junit.Test; + +/** + * Created by kerry on 2020-09-21 + */ +public class RichTextToolBarTest { + @Test + public void testScaleUpAndDown() { + RichTextToolBar textToolBar = EasyMock.mock(RichTextToolBar.class); + + int result = Reflect.on(textToolBar).call("scaleUp", 10).get(); + Assert.assertEquals(13, result); + result = Reflect.on(textToolBar).call("scaleDown", 13).get(); + Assert.assertEquals(10, result); + + result = Reflect.on(textToolBar).call("scaleUp", 11).get(); + Assert.assertEquals(15, result); + result = Reflect.on(textToolBar).call("scaleDown", 15).get(); + Assert.assertEquals(11, result); + + result = Reflect.on(textToolBar).call("scaleUp", 12).get(); + Assert.assertEquals(16, result); + result = Reflect.on(textToolBar).call("scaleDown", 16).get(); + Assert.assertEquals(12, result); + + + result = Reflect.on(textToolBar).call("scaleUp", 13).get(); + Assert.assertEquals(17, result); + result = Reflect.on(textToolBar).call("scaleDown", 17).get(); + Assert.assertEquals(13, result); + + result = Reflect.on(textToolBar).call("scaleUp", 14).get(); + Assert.assertEquals(19, result); + result = Reflect.on(textToolBar).call("scaleDown", 19).get(); + Assert.assertEquals(14, result); + + result = Reflect.on(textToolBar).call("scaleUp", 16).get(); + Assert.assertEquals(21, result); + result = Reflect.on(textToolBar).call("scaleDown", 21).get(); + Assert.assertEquals(16, result); + + + result = Reflect.on(textToolBar).call("scaleUp", 17).get(); + Assert.assertEquals(23, result); + result = Reflect.on(textToolBar).call("scaleDown", 23).get(); + Assert.assertEquals(17, result); + + result = Reflect.on(textToolBar).call("scaleUp", 17).get(); + Assert.assertEquals(23, result); + result = Reflect.on(textToolBar).call("scaleDown", 23).get(); + Assert.assertEquals(17, result); + + result = Reflect.on(textToolBar).call("scaleUp", 19).get(); + Assert.assertEquals(25, result); + result = Reflect.on(textToolBar).call("scaleDown", 25).get(); + Assert.assertEquals(19, result); + + result = Reflect.on(textToolBar).call("scaleUp", 20).get(); + Assert.assertEquals(27, result); + result = Reflect.on(textToolBar).call("scaleDown", 27).get(); + Assert.assertEquals(20, result); + } + +} From 820b3b9edcb6144c77809e0e9ecc7e6b9eba3f3c Mon Sep 17 00:00:00 2001 From: vito Date: Tue, 22 Sep 2020 17:48:18 +0800 Subject: [PATCH 23/64] =?UTF-8?q?REPORT-38376=20JDK11=E4=B8=8BLabel?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E6=96=87=E5=AD=97=E6=98=BE=E7=A4=BA=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/utils/DesignUtils.java | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java index 2bf64642f..f443a10ec 100644 --- a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java @@ -19,10 +19,10 @@ import com.fr.stable.ArrayUtils; import com.fr.stable.CommonCodeUtils; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; +import com.fr.stable.os.OperatingSystem; import com.fr.start.ServerStarter; import com.fr.workspace.WorkContext; -import javax.swing.JOptionPane; import javax.swing.SwingUtilities; import javax.swing.UIManager; import java.awt.Desktop; @@ -31,7 +31,6 @@ import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.IOException; -import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; @@ -83,6 +82,7 @@ public class DesignUtils { /** * 判断设计器端口是否被其他程序占用 * 尝试去通信,无回应就是其他程序占用端口,否则需要继续判断是否为设计器进程未关闭 + * * @return */ public static boolean isPortOccupied() { @@ -153,7 +153,7 @@ public class DesignUtils { return; } try (Socket socket = new Socket("localhost", port)) { - clientSend(lines, socket); + clientSend(lines, socket); } catch (Exception ignore) { } @@ -189,10 +189,10 @@ public class DesignUtils { DesignerEnvManager.getEnvManager().setCurrentEnv2Default(); ServerStarter.browserDemoURL(); } else if ("check".equals(line)) { - clientSend(new String[] {"response"}, socket); + clientSend(new String[]{"response"}, socket); } else if ("end".equals(line)) { - DesignerExiter.getInstance().execute(); } - else if (StringUtils.isNotEmpty(line)) { + DesignerExiter.getInstance().execute(); + } else if (StringUtils.isNotEmpty(line)) { File f = new File(line); String path = f.getAbsolutePath(); @@ -219,7 +219,7 @@ public class DesignUtils { } - public static void responseToClient(Socket socket) { + public static void responseToClient(Socket socket) { try (OutputStream outputStream = socket.getOutputStream()) { outputStream.write("reponse".getBytes(StandardCharsets.UTF_8)); outputStream.flush(); @@ -285,13 +285,20 @@ public class DesignUtils { return key.startsWith("TextField.") || key.startsWith("PasswordField."); } + /** + * 获取当前系统语言下设计器用的默认字体 + * + * @return 默认字体 + */ private static FRFont getCurrentLocaleFont() { FRFont guiFRFont; Locale defaultLocale = Locale.getDefault(); - - if (isDisplaySimSun(defaultLocale)) { + // JDK9 之后宋体在计算label中字母的空间上出现问题,暂时先用雅黑兼容,以后再统一字体 + if (StableUtils.getMajorJavaVersion() >= 9 && OperatingSystem.isWindows()) { + guiFRFont = getNamedFont("Microsoft YaHei"); + } else if (isDisplaySimSun(defaultLocale)) { guiFRFont = getNamedFont("SimSun"); - } else { + } else { guiFRFont = getNamedFont("Dialog"); } From 22ad83f2e74a1b2061d2e07884dd598cb5ccbd26 Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 23 Sep 2020 09:36:58 +0800 Subject: [PATCH 24/64] =?UTF-8?q?REPORT-39338=20=E3=80=90=E5=9B=9E?= =?UTF-8?q?=E5=BD=92=E3=80=91=E5=86=85=E7=BD=AE=E6=9C=8D=E5=8A=A1=E5=99=A8?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E8=BF=9B=E5=BA=A6=E6=9D=A1=E4=BC=9A=E5=85=88?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E4=B8=8A=E6=AC=A1=E7=9A=84=E8=BF=9B=E5=BA=A6?= =?UTF-8?q?=E5=86=8D=E5=88=9D=E5=A7=8B=E5=8C=96=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=B9=E6=A1=88=EF=BC=9A=E4=B8=8D=E6=94=B9?= =?UTF-8?q?=E5=8F=98=E5=BC=B9=E7=AA=97=E5=A4=A7=E5=B0=8F=EF=BC=8C=E5=B0=86?= =?UTF-8?q?=E5=8E=9F=E6=9C=AC=E6=96=87=E5=AD=97=E6=A0=87=E7=AD=BEsetPrefer?= =?UTF-8?q?redSize=E6=B3=A8=E9=87=8A=E6=8E=89=EF=BC=8C=E5=9C=A8FlowLayout?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E4=B8=8B=EF=BC=8C=E6=A0=87=E7=AD=BE=E5=A4=A7?= =?UTF-8?q?=E5=B0=8F=E4=BC=9A=E8=87=AA=E9=80=82=E5=BA=94=EF=BC=8C=E5=8F=A6?= =?UTF-8?q?=E5=A4=96=E6=B5=8B=E8=AF=95=E7=9A=84=E6=97=B6=E5=80=99=E5=8F=91?= =?UTF-8?q?=E7=8E=B0=E5=9C=A8=E6=97=A5=E8=AF=AD=E5=92=8C=E9=9F=A9=E8=AF=AD?= =?UTF-8?q?=E4=B8=8B=E6=96=87=E5=AD=97=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=85=A8?= =?UTF-8?q?=EF=BC=8C=E8=BF=99=E6=98=AF=E4=B8=AA=E4=BB=A5=E5=89=8D=E5=B0=B1?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=8C=E4=B8=8E?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=92=8C=E5=9B=BD=E9=99=85=E5=8C=96=E5=90=8C?= =?UTF-8?q?=E5=AD=A6=E6=B2=9F=E9=80=9A=E4=BA=86=EF=BC=8C=E7=B2=BE=E7=AE=80?= =?UTF-8?q?=E7=BF=BB=E8=AF=91=EF=BC=8C=E8=BF=99=E6=AC=A1=E9=A1=BA=E4=BE=BF?= =?UTF-8?q?=E4=B8=80=E8=B5=B7=E6=94=B9=E4=BA=86=20CHART-15905=20=E6=9C=80?= =?UTF-8?q?=E6=96=B0=E7=9A=84release=E6=8F=92=E4=BB=B6=EF=BC=8C=E6=89=93?= =?UTF-8?q?=E5=BC=80cpt=E7=A9=BA=E7=99=BD=EF=BC=8C=E6=89=93=E5=BC=80frm?= =?UTF-8?q?=E7=9A=84=EF=BC=8C=E5=8F=B3=E4=BE=A7=E9=9D=A2=E6=9D=BF=E6=89=93?= =?UTF-8?q?=E4=B8=8D=E5=BC=80=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F?= =?UTF-8?q?=E5=9B=A0=E3=80=91=E4=B9=8B=E5=89=8D=E6=94=B9=E5=8A=A8=E7=9A=84?= =?UTF-8?q?UISpinner=EF=BC=8C=E6=B7=BB=E5=8A=A0=E4=BA=86=E4=B8=80=E7=A7=8D?= =?UTF-8?q?=E4=BC=A0=E5=8F=82=E4=B8=BAdouble=E3=80=81double=E3=80=81double?= =?UTF-8?q?=E3=80=81int=E7=9A=84=E6=9E=84=E9=80=A0=E6=96=B9=E6=B3=95?= =?UTF-8?q?=EF=BC=8C=E4=B8=8E=E5=8F=A6=E4=B8=80=E4=B8=AA=E5=8E=9F=E6=9C=89?= =?UTF-8?q?=E7=9A=84double=E3=80=81double=E3=80=81double=E3=80=81double?= =?UTF-8?q?=E5=86=B2=E7=AA=81=E4=BA=86=EF=BC=8C=E5=9B=A0=E4=B8=BA=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E5=86=85=E5=BE=88=E5=A4=9A=E5=9C=B0=E6=96=B9=E9=83=BD?= =?UTF-8?q?=E6=98=AF=E4=BC=A0=E4=BA=86=E5=9B=9B=E4=B8=AAint=E5=80=BC?= =?UTF-8?q?=E8=BF=9B=E6=9D=A5=EF=BC=8C=E7=84=B6=E5=90=8E=E8=A2=AB=E7=BB=91?= =?UTF-8?q?=E5=AE=9A=E4=BA=86=E6=96=B0=E6=B7=BB=E5=8A=A0=E7=9A=84=E9=82=A3?= =?UTF-8?q?=E7=A7=8D=E6=9E=84=E9=80=A0=E6=96=B9=E6=B3=95=20=E3=80=90?= =?UTF-8?q?=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E5=B0=86=E6=96=B0?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=9A=84=E6=9E=84=E9=80=A0=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E4=BC=A0=E5=8F=82=E4=BF=AE=E6=94=B9=E4=B8=BAdouble=E3=80=81dou?= =?UTF-8?q?ble=E3=80=81double=E3=80=81double=E3=80=81int=EF=BC=8C=E5=AF=B9?= =?UTF-8?q?=E7=AC=AC=E5=9B=9B=E4=B8=AAdouble=E5=80=BC=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E5=88=A4=E6=96=AD=EF=BC=8C=E5=A6=82=E6=9E=9C=E7=AD=89=E4=BA=8E?= =?UTF-8?q?Double.MIN=5FVALUE=EF=BC=8C=E5=B0=B1=E4=B8=8D=E5=81=9A=E5=A4=84?= =?UTF-8?q?=E7=90=86=EF=BC=8C=E5=90=A6=E5=88=99=E6=AD=A3=E5=B8=B8=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=B8=BAdefaultValue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/gui/ispinner/UISpinner.java | 13 ++++++++++++- .../mainframe/DesignerFrameFileDealerPane.java | 4 ++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java b/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java index a418a2b37..0d7c11ac4 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java +++ b/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java @@ -56,9 +56,20 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver textField.setValue(defaultValue); } - public UISpinner(double minValue, double maxValue, double dierta, int numberFieldColumns) { + /** + * 为了避免跟上面的构造方法冲突,这边构造器接收五个参数,当传入defaultValue为Double.MIN_VALUE时,不设置默认值 + * @param minValue + * @param maxValue + * @param dierta + * @param defaultValue + * @param numberFieldColumns + */ + public UISpinner(double minValue, double maxValue, double dierta, double defaultValue, int numberFieldColumns) { this.numberFieldColumns = numberFieldColumns; init(minValue, maxValue, dierta); + if (defaultValue != Double.MIN_VALUE) { + textField.setValue(defaultValue); + } } private void init(double minValue, double maxValue, double dierta) { this.minValue = minValue; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java index 86f73982f..870853a45 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java @@ -556,7 +556,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt ); newNameLabel.setHorizontalAlignment(SwingConstants.RIGHT); newNameLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10)); - newNameLabel.setPreferredSize(new Dimension(118, 15)); + //newNameLabel.setPreferredSize(new Dimension(118, 15)); // 重命名输入框 nameField = new UITextField(oldName); @@ -649,7 +649,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt BorderLayout.CENTER); - this.setSize(380, 180); + this.setSize(340, 180); this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Rename")); this.setResizable(false); this.setAlwaysOnTop(true); From 2815e81223bbcaf3f391749876cc184341ebcd71 Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 23 Sep 2020 10:04:40 +0800 Subject: [PATCH 25/64] =?UTF-8?q?CHART-15905=20=E6=9B=B4=E6=96=B0=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=96=B9=E6=A1=88=EF=BC=9A=E4=B9=8B=E5=89=8D=E4=BB=A5?= =?UTF-8?q?=E4=B8=BA=E5=88=9D=E5=A7=8B=E5=8C=96=E4=BA=86UINumberField?= =?UTF-8?q?=E4=B9=8B=E5=90=8E=EF=BC=8C=E4=B8=8D=E8=83=BD=E5=86=8D=E6=94=B9?= =?UTF-8?q?=E5=8F=98=E5=88=97=E6=95=B0=E4=BA=86=EF=BC=8C=E5=88=9A=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E4=BA=86=E4=B8=80=E4=B8=8B=E5=8F=91=E7=8E=B0=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E7=9A=84=EF=BC=8C=E6=89=80=E4=BB=A5=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E6=B7=BB=E5=8A=A0=E4=BA=86=E4=B8=80=E4=B8=AAset?= =?UTF-8?q?=E6=96=B9=E6=B3=95=EF=BC=8C=E5=8F=AF=E4=BB=A5=E4=BF=AE=E6=94=B9?= =?UTF-8?q?Spinner=E5=86=85=E7=9A=84UINumberField=E7=9A=84=E5=88=97?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tabledatapane/MaxMemRowCountPanel.java | 3 ++- .../com/fr/design/gui/ispinner/UISpinner.java | 22 ++++++------------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java index 2df6cda02..13fd60a60 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java @@ -72,7 +72,8 @@ public class MaxMemRowCountPanel extends UIToolbar { this.setBackground(UIConstants.NORMAL_BACKGROUND); switchCache = new UIComboBox(CACHE_LIST); switchCache.addActionListener(switchStateL); - numberSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 4); + numberSpinner = new UISpinner(0, Integer.MAX_VALUE, 1); + numberSpinner.setNumberFieldColumns(4); } private void showAllPanel() { diff --git a/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java b/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java index 0d7c11ac4..c60ae2760 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java +++ b/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java @@ -56,21 +56,6 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver textField.setValue(defaultValue); } - /** - * 为了避免跟上面的构造方法冲突,这边构造器接收五个参数,当传入defaultValue为Double.MIN_VALUE时,不设置默认值 - * @param minValue - * @param maxValue - * @param dierta - * @param defaultValue - * @param numberFieldColumns - */ - public UISpinner(double minValue, double maxValue, double dierta, double defaultValue, int numberFieldColumns) { - this.numberFieldColumns = numberFieldColumns; - init(minValue, maxValue, dierta); - if (defaultValue != Double.MIN_VALUE) { - textField.setValue(defaultValue); - } - } private void init(double minValue, double maxValue, double dierta) { this.minValue = minValue; this.maxValue = maxValue; @@ -180,6 +165,13 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver fireStateChanged(); } + /** + * 设置Spinner内的数字输入框列数 + * @param numberFieldColumns 输入框列数 + */ + public void setNumberFieldColumns(int numberFieldColumns) { + textField.setColumns(numberFieldColumns); + } public void setEnabled(boolean flag) { super.setEnabled(flag); From 4f8a3ef91f831f67b44398c61f3cbca27f09d897 Mon Sep 17 00:00:00 2001 From: "Jimmy.Zheng" Date: Wed, 23 Sep 2020 10:55:50 +0800 Subject: [PATCH 26/64] REPORT-38762 --- .../data/datapane/TreeTableDataComboBox.java | 11 ++++++++- .../design/gui/frpane/JTreeAutoBuildPane.java | 23 ++++++++++++++++--- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataComboBox.java b/designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataComboBox.java index 8b5c62657..8964ff8de 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataComboBox.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataComboBox.java @@ -69,7 +69,16 @@ public class TreeTableDataComboBox extends UIComboBox { } } } - + + /** + * 带参刷新方法 + * @param source 数据源数据集 + */ + public void refresh(TableDataSource source) { + this.source = source; + refresh(); + } + public void setSelectedTableDataByName(String name) { TableDataWrapper tableDataWrapper; if (res_map.get(name) != null) { diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/JTreeAutoBuildPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/JTreeAutoBuildPane.java index 46cdae35b..6103e6800 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/JTreeAutoBuildPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/JTreeAutoBuildPane.java @@ -26,14 +26,14 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; - import com.fr.stable.StringUtils; - -import javax.swing.*; import java.awt.*; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.util.List; +import javax.swing.*; +import javax.swing.event.PopupMenuEvent; +import javax.swing.event.PopupMenuListener; public class JTreeAutoBuildPane extends BasicPane implements PreviewLabel.Previewable, EditOrNewLabel.Editable { private TreeTableDataComboBox treeTableDataComboBox; @@ -61,6 +61,23 @@ public class JTreeAutoBuildPane extends BasicPane implements PreviewLabel.Previe tdChange(); } }); + // REPORT-38762 加一个展开监听事件,下拉框展开时刷新一下数据集 + treeTableDataComboBox.addPopupMenuListener(new PopupMenuListener() { + @Override + public void popupMenuWillBecomeVisible(PopupMenuEvent e) { + treeTableDataComboBox.refresh(DesignTableDataManager.getEditingTableDataSource()); + } + + @Override + public void popupMenuWillBecomeInvisible(PopupMenuEvent e) { + + } + + @Override + public void popupMenuCanceled(PopupMenuEvent e) { + + } + }); selectTreeDataPanel.add(treeTableDataComboBox); treeTableDataComboBox.setPreferredSize(new Dimension(200, 25)); treeTableDataComboBox.setSelectedIndex(-1); From 0336b6a964314730a6405cf0843d2af268b21c50 Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 23 Sep 2020 11:29:22 +0800 Subject: [PATCH 27/64] =?UTF-8?q?REPORT-40458=20=E3=80=90=E5=9B=9E?= =?UTF-8?q?=E5=BD=92=E3=80=91=E8=AE=BE=E8=AE=A1=E5=99=A8=E9=87=8D=E5=90=AF?= =?UTF-8?q?=E4=BB=A5=E5=90=8E=E4=BC=9A=E5=8D=A1=E4=BD=8F=EF=BC=8C=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E9=99=A4=E4=BA=86=E8=8F=9C=E5=8D=95=E6=A0=8F=E5=85=B6?= =?UTF-8?q?=E4=BB=96=E9=83=BD=E5=8A=A8=E4=B8=8D=E4=BA=86=20=E3=80=90?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91editingTemplate?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=88=A4=E7=A9=BA=EF=BC=8C=E5=BD=93=E6=97=B6?= =?UTF-8?q?=E8=87=AA=E5=B7=B1=E6=B5=8B=E8=AF=95=E5=8F=91=E7=8E=B0=E6=98=AF?= =?UTF-8?q?=E4=B8=8D=E4=BC=9A=E5=87=BA=E7=8E=B0null=E6=83=85=E5=86=B5?= =?UTF-8?q?=E7=9A=84=EF=BC=8C=E8=BF=99=E4=B8=AA=E9=97=AE=E9=A2=98=E6=98=AF?= =?UTF-8?q?=E5=9B=A0=E4=B8=BA=E5=AE=89=E8=A3=85=E4=BA=86=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E6=96=B0=E5=BC=95=E6=93=8E=E6=8F=92=E4=BB=B6=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E9=82=A3=E8=BE=B9=E6=9F=90=E4=B8=AA=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E5=8F=AF=E8=83=BD=E4=BC=9A=E5=9C=A8setCurrentEditingT?= =?UTF-8?q?emplate=E4=B9=8B=E5=89=8D=EF=BC=8C=E8=B0=83=E7=94=A8checkCombin?= =?UTF-8?q?eUp=E6=96=B9=E6=B3=95=EF=BC=8C=E6=AD=A4=E6=97=B6getCurrentEditi?= =?UTF-8?q?ngTemplate=E4=BC=9A=E6=8B=BF=E5=88=B0null=E5=80=BC=EF=BC=8C?= =?UTF-8?q?=E7=84=B6=E5=90=8E=E5=87=BA=E7=8E=B0npe=20=E3=80=90=E6=94=B9?= =?UTF-8?q?=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E5=A2=9E=E5=8A=A0=E5=88=A4?= =?UTF-8?q?=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/data/datapane/connect/JDBCDefPane.java | 1 + .../ipasswordfield/UIPasswordFieldWithFixedLength.java | 2 +- .../main/java/com/fr/design/mainframe/DesignerFrame.java | 8 +++++--- .../main/java/com/fr/design/mainframe/TopXCreators.java | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java index 683b38e01..8f26ec8c3 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java @@ -8,6 +8,7 @@ import com.fr.design.border.UITitledBorder; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.ipasswordfield.UIPassWordField; import com.fr.design.gui.ipasswordfield.UIPasswordFieldWithFixedLength; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.ilable.ActionLabel; diff --git a/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPasswordFieldWithFixedLength.java b/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPasswordFieldWithFixedLength.java index c1cb98ca3..6fdace66a 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPasswordFieldWithFixedLength.java +++ b/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPasswordFieldWithFixedLength.java @@ -77,7 +77,7 @@ public class UIPasswordFieldWithFixedLength extends UIPassWordField { if (clearPassword) { UIPasswordFieldWithFixedLength.this.setText(StringUtils.EMPTY); UIPasswordFieldWithFixedLength.this.clearPassword = false; - UIPasswordFieldWithFixedLength.this.updateUI(); + //UIPasswordFieldWithFixedLength.this.updateUI(); } } }); 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 fe0276b38..92d06d0b5 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 @@ -746,10 +746,12 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta */ public void checkCombineUp(boolean flag, ArrayList al) { //Yvan: 检查当前是否为WORK_SHEET状态,因为只有WORK_SHEET中含有格式刷组件,此时是不需要进行checkComponentsByNames的 - if (HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getMenuState() == DesignState.WORK_SHEET) { - return; + JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + if (jTemplate != null) { + if (jTemplate.getMenuState() != DesignState.WORK_SHEET) { + combineUp.checkComponentsByNames(flag, al); + } } - combineUp.checkComponentsByNames(flag, al); } /** diff --git a/designer-form/src/main/java/com/fr/design/mainframe/TopXCreators.java b/designer-form/src/main/java/com/fr/design/mainframe/TopXCreators.java index 89b261bb9..eef16f80b 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/TopXCreators.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/TopXCreators.java @@ -78,5 +78,6 @@ public class TopXCreators extends JComponent { TopXCreator topXCreator = (TopXCreator) getComponent(i); topXCreator.resizeTopXCreator(); } + //repaint(); } } From f3c2c203a860e1d06f748fdf5c9415e497bce178 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Wed, 23 Sep 2020 11:34:46 +0800 Subject: [PATCH 28/64] =?UTF-8?q?=E6=A0=87=E7=AD=BE=E8=BE=B9=E6=A1=86?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BD=A2=E7=8A=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/border/VanChartBorderPane.java | 14 +++-- .../border/VanChartBorderWithRadiusPane.java | 12 ++-- .../border/VanChartBorderWithShapePane.java | 58 +++++++++++++++++++ .../label/VanChartPlotLabelDetailPane.java | 17 +++--- 4 files changed, 83 insertions(+), 18 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderPane.java index 478929662..4514e39b9 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderPane.java @@ -6,6 +6,7 @@ import com.fr.chart.chartglyph.GeneralInfo; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.icombobox.LineComboBox; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.style.color.ColorSelectBox; import com.fr.design.utils.gui.UIComponentUtils; @@ -30,20 +31,18 @@ public class VanChartBorderPane extends BasicPane { protected void initComponents() { currentLineCombo = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART); currentLineColorPane = new ColorSelectBox(100); - double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; double[] columnSize = {f, e}; - double[] rowSize = {p, p, p, p}; Component[][] components = getUseComponent(); - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, getRowSize(), columnSize); this.setLayout(new BorderLayout()); this.add(panel,BorderLayout.CENTER); } protected Component[][] getUseComponent() { - UILabel lineStyleLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Style")); - UILabel colorLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")); + UILabel lineStyleLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")); + UILabel colorLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Color")); return new Component[][]{ new Component[]{null,null}, @@ -52,6 +51,11 @@ public class VanChartBorderPane extends BasicPane { }; } + protected double[] getRowSize() { + double p = TableLayout.PREFERRED; + return new double[]{p, p, p, p}; + } + /** * 标题 * @return 标题 diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithRadiusPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithRadiusPane.java index 63eff9047..fabf1e669 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithRadiusPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithRadiusPane.java @@ -4,10 +4,10 @@ import com.fr.chart.base.AttrBorder; import com.fr.chart.chartglyph.GeneralInfo; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; +import com.fr.design.i18n.Toolkit; import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.widget.FRWidgetFactory; - import javax.swing.JSeparator; import java.awt.BorderLayout; import java.awt.Component; @@ -19,6 +19,10 @@ public class VanChartBorderWithRadiusPane extends VanChartBorderPane { private static final long serialVersionUID = -3937853702118283803L; private UISpinner radius; + public UISpinner getRadius() { + return radius; + } + @Override protected void initComponents() { radius = new UISpinner(0,1000,1,0); @@ -31,11 +35,11 @@ public class VanChartBorderWithRadiusPane extends VanChartBorderPane { return new Component[][]{ new Component[]{null,null}, new Component[]{ - FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Style")), + FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")), UIComponentUtils.wrapWithBorderLayoutPane(currentLineCombo) }, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")),currentLineColorPane}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Radius")),radius} + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")),currentLineColorPane}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Radius")),radius} } ; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java new file mode 100644 index 000000000..536149587 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java @@ -0,0 +1,58 @@ +package com.fr.van.chart.designer.component.border; + +import com.fr.chart.base.AttrBorder; +import com.fr.chart.chartglyph.Marker; +import com.fr.chart.chartglyph.MarkerFactory; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.xcombox.MarkerComboBox; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.TableLayout; +import com.fr.design.utils.gui.UIComponentUtils; +import com.fr.design.widget.FRWidgetFactory; +import com.fr.plugin.chart.base.AttrBorderWithShape; +import com.fr.plugin.chart.marker.type.MarkerType; + +import java.awt.Component; + +public class VanChartBorderWithShapePane extends VanChartBorderWithRadiusPane { + + private MarkerComboBox shapePane; + + protected void initComponents() { + shapePane = new MarkerComboBox(MarkerFactory.getLabelShapeMarkers()); + super.initComponents(); + } + + protected Component[][] getUseComponent() { + return new Component[][]{ + new Component[]{null, null}, + new Component[]{FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")), + UIComponentUtils.wrapWithBorderLayoutPane(currentLineCombo)}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), currentLineColorPane}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Shape")), + UIComponentUtils.wrapWithBorderLayoutPane(shapePane)}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Radius")), getRadius()} + }; + } + + protected double[] getRowSize() { + double p = TableLayout.PREFERRED; + return new double[]{p, p, p, p, p}; + } + + public void populate(AttrBorder border) { + super.populate(border); + + if (border instanceof AttrBorderWithShape) { + shapePane.setSelectedMarker((Marker.createMarker(((AttrBorderWithShape) border).getShape()))); + } + } + + public void update(AttrBorder border) { + super.update(border); + + if (border instanceof AttrBorderWithShape) { + ((AttrBorderWithShape) border).setShape(MarkerType.parse(shapePane.getSelectedMarkder().getMarkerType())); + } + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java index b159af755..22f8ace78 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java @@ -7,12 +7,11 @@ import com.fr.design.dialog.BasicPane; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.style.color.ColorSelectBox; -import com.fr.design.i18n.Toolkit; - import com.fr.general.ComparatorUtils; import com.fr.plugin.chart.attr.plot.VanChartLabelPositionPlot; import com.fr.plugin.chart.base.AttrLabelDetail; @@ -21,7 +20,7 @@ import com.fr.stable.Constants; import com.fr.van.chart.designer.PlotFactory; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutImagePane; -import com.fr.van.chart.designer.component.border.VanChartBorderWithRadiusPane; +import com.fr.van.chart.designer.component.border.VanChartBorderWithShapePane; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -45,7 +44,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { private UIToggleButton tractionLine; private ColorSelectBox backgroundColor; - private VanChartBorderWithRadiusPane borderPane; + private VanChartBorderWithShapePane borderPane; private VanChartBackgroundWithOutImagePane backgroundPane; private JPanel tractionLinePane; @@ -125,7 +124,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { } private JPanel createLabelBorderPane() { - borderPane = new VanChartBorderWithRadiusPane(); + borderPane = new VanChartBorderWithShapePane(); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane); } @@ -338,10 +337,10 @@ public class VanChartPlotLabelDetailPane extends BasicPane { backgroundColor.setSelectObject(detail.getBackgroundColor()); } if(borderPane != null){ - borderPane.populate(detail.getGeneralInfo()); + borderPane.populate(detail.getBorder()); } if(backgroundPane != null){ - backgroundPane.populate(detail.getGeneralInfo()); + backgroundPane.populate(detail.getBackground()); } checkAllUse(); @@ -370,10 +369,10 @@ public class VanChartPlotLabelDetailPane extends BasicPane { detail.setBackgroundColor(backgroundColor.getSelectObject()); } if(borderPane != null){ - borderPane.update(detail.getGeneralInfo()); + borderPane.update(detail.getBorder()); } if(backgroundPane != null){ - backgroundPane.update(detail.getGeneralInfo()); + backgroundPane.update(detail.getBackground()); } } From 380c24445044f36e754e0dc3e7582adc3667c753 Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 23 Sep 2020 11:41:18 +0800 Subject: [PATCH 29/64] =?UTF-8?q?REPORT-40458=20=E3=80=90=E5=9B=9E?= =?UTF-8?q?=E5=BD=92=E3=80=91=E8=AE=BE=E8=AE=A1=E5=99=A8=E9=87=8D=E5=90=AF?= =?UTF-8?q?=E4=BB=A5=E5=90=8E=E4=BC=9A=E5=8D=A1=E4=BD=8F=EF=BC=8C=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E9=99=A4=E4=BA=86=E8=8F=9C=E5=8D=95=E6=A0=8F=E5=85=B6?= =?UTF-8?q?=E4=BB=96=E9=83=BD=E5=8A=A8=E4=B8=8D=E4=BA=86=20=E3=80=90?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91editingTemplate?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=88=A4=E7=A9=BA=EF=BC=8C=E5=BD=93=E6=97=B6?= =?UTF-8?q?=E8=87=AA=E5=B7=B1=E6=B5=8B=E8=AF=95=E5=8F=91=E7=8E=B0=E6=98=AF?= =?UTF-8?q?=E4=B8=8D=E4=BC=9A=E5=87=BA=E7=8E=B0null=E6=83=85=E5=86=B5?= =?UTF-8?q?=E7=9A=84=EF=BC=8C=E8=BF=99=E4=B8=AA=E9=97=AE=E9=A2=98=E6=98=AF?= =?UTF-8?q?=E5=9B=A0=E4=B8=BA=E5=AE=89=E8=A3=85=E4=BA=86=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E6=96=B0=E5=BC=95=E6=93=8E=E6=8F=92=E4=BB=B6=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E9=82=A3=E8=BE=B9=E6=9F=90=E4=B8=AA=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E5=8F=AF=E8=83=BD=E4=BC=9A=E5=9C=A8setCurrentEditingT?= =?UTF-8?q?emplate=E4=B9=8B=E5=89=8D=EF=BC=8C=E8=B0=83=E7=94=A8checkCombin?= =?UTF-8?q?eUp=E6=96=B9=E6=B3=95=EF=BC=8C=E6=AD=A4=E6=97=B6getCurrentEditi?= =?UTF-8?q?ngTemplate=E4=BC=9A=E6=8B=BF=E5=88=B0null=E5=80=BC=EF=BC=8C?= =?UTF-8?q?=E7=84=B6=E5=90=8E=E5=87=BA=E7=8E=B0npe=20=E3=80=90=E6=94=B9?= =?UTF-8?q?=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E5=A2=9E=E5=8A=A0=E5=88=A4?= =?UTF-8?q?=E7=A9=BA"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/mainframe/DesignerFrame.java | 8 +++----- 1 file changed, 3 insertions(+), 5 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 92d06d0b5..fe0276b38 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 @@ -746,12 +746,10 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta */ public void checkCombineUp(boolean flag, ArrayList al) { //Yvan: 检查当前是否为WORK_SHEET状态,因为只有WORK_SHEET中含有格式刷组件,此时是不需要进行checkComponentsByNames的 - JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); - if (jTemplate != null) { - if (jTemplate.getMenuState() != DesignState.WORK_SHEET) { - combineUp.checkComponentsByNames(flag, al); - } + if (HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getMenuState() == DesignState.WORK_SHEET) { + return; } + combineUp.checkComponentsByNames(flag, al); } /** From e33f5214efdbcd3f2d204cd43466920b92169283 Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 23 Sep 2020 11:52:40 +0800 Subject: [PATCH 30/64] =?UTF-8?q?=E4=B9=8B=E5=89=8D=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E5=A4=9A=E4=BA=86=EF=BC=8C=E6=92=A4=E9=94=80=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/data/datapane/connect/JDBCDefPane.java | 1 - .../gui/ipasswordfield/UIPasswordFieldWithFixedLength.java | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java index 8f26ec8c3..683b38e01 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java @@ -8,7 +8,6 @@ import com.fr.design.border.UITitledBorder; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.ipasswordfield.UIPassWordField; import com.fr.design.gui.ipasswordfield.UIPasswordFieldWithFixedLength; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.ilable.ActionLabel; diff --git a/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPasswordFieldWithFixedLength.java b/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPasswordFieldWithFixedLength.java index 6fdace66a..c1cb98ca3 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPasswordFieldWithFixedLength.java +++ b/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPasswordFieldWithFixedLength.java @@ -77,7 +77,7 @@ public class UIPasswordFieldWithFixedLength extends UIPassWordField { if (clearPassword) { UIPasswordFieldWithFixedLength.this.setText(StringUtils.EMPTY); UIPasswordFieldWithFixedLength.this.clearPassword = false; - //UIPasswordFieldWithFixedLength.this.updateUI(); + UIPasswordFieldWithFixedLength.this.updateUI(); } } }); From e410f10bf07156a502ac7a763790c0dc85322183 Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 23 Sep 2020 11:53:19 +0800 Subject: [PATCH 31/64] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=A4=9A=E4=BA=86?= =?UTF-8?q?=EF=BC=8C=E6=92=A4=E9=94=80=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/TopXCreators.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/TopXCreators.java b/designer-form/src/main/java/com/fr/design/mainframe/TopXCreators.java index eef16f80b..89b261bb9 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/TopXCreators.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/TopXCreators.java @@ -78,6 +78,5 @@ public class TopXCreators extends JComponent { TopXCreator topXCreator = (TopXCreator) getComponent(i); topXCreator.resizeTopXCreator(); } - //repaint(); } } From 67d94534628c0c90aceed4badcf4b6db75c1b79e Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 23 Sep 2020 12:31:53 +0800 Subject: [PATCH 32/64] =?UTF-8?q?REPORT-40458=20=E3=80=90=E5=9B=9E?= =?UTF-8?q?=E5=BD=92=E3=80=91=E8=AE=BE=E8=AE=A1=E5=99=A8=E9=87=8D=E5=90=AF?= =?UTF-8?q?=E4=BB=A5=E5=90=8E=E4=BC=9A=E5=8D=A1=E4=BD=8F=EF=BC=8C=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E9=99=A4=E4=BA=86=E8=8F=9C=E5=8D=95=E6=A0=8F=E5=85=B6?= =?UTF-8?q?=E4=BB=96=E9=83=BD=E5=8A=A8=E4=B8=8D=E4=BA=86=20=E3=80=90?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91editingTemplate?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=88=A4=E7=A9=BA=EF=BC=8C=E5=BD=93=E6=97=B6?= =?UTF-8?q?=E8=87=AA=E5=B7=B1=E6=B5=8B=E8=AF=95=E5=8F=91=E7=8E=B0=E6=98=AF?= =?UTF-8?q?=E4=B8=8D=E4=BC=9A=E5=87=BA=E7=8E=B0null=E6=83=85=E5=86=B5?= =?UTF-8?q?=E7=9A=84=EF=BC=8C=E8=BF=99=E4=B8=AA=E9=97=AE=E9=A2=98=E6=98=AF?= =?UTF-8?q?=E5=9B=A0=E4=B8=BA=E5=AE=89=E8=A3=85=E4=BA=86=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E6=96=B0=E5=BC=95=E6=93=8E=E6=8F=92=E4=BB=B6=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E9=82=A3=E8=BE=B9=E6=9F=90=E4=B8=AA=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E5=8F=AF=E8=83=BD=E4=BC=9A=E5=9C=A8setCurrentEditingT?= =?UTF-8?q?emplate=E4=B9=8B=E5=89=8D=EF=BC=8C=E8=B0=83=E7=94=A8checkCombin?= =?UTF-8?q?eUp=E6=96=B9=E6=B3=95=EF=BC=8C=E6=AD=A4=E6=97=B6getCurrentEditi?= =?UTF-8?q?ngTemplate=E4=BC=9A=E6=8B=BF=E5=88=B0null=E5=80=BC=EF=BC=8C?= =?UTF-8?q?=E7=84=B6=E5=90=8E=E5=87=BA=E7=8E=B0npe=20=E3=80=90=E6=94=B9?= =?UTF-8?q?=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E5=A2=9E=E5=8A=A0=E5=88=A4?= =?UTF-8?q?=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/mainframe/DesignerFrame.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 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 fe0276b38..92d06d0b5 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 @@ -746,10 +746,12 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta */ public void checkCombineUp(boolean flag, ArrayList al) { //Yvan: 检查当前是否为WORK_SHEET状态,因为只有WORK_SHEET中含有格式刷组件,此时是不需要进行checkComponentsByNames的 - if (HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getMenuState() == DesignState.WORK_SHEET) { - return; + JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + if (jTemplate != null) { + if (jTemplate.getMenuState() != DesignState.WORK_SHEET) { + combineUp.checkComponentsByNames(flag, al); + } } - combineUp.checkComponentsByNames(flag, al); } /** From 12abfe93d64c1612bfc61ab26709a09bed5a5974 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Wed, 23 Sep 2020 15:40:09 +0800 Subject: [PATCH 33/64] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=AF=8C=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E7=BB=84=E4=BB=B6=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/editor/rich_editor.css | 22 +++++++++++++++++++ .../com/fr/design/editor/rich_editor.html | 1 + 2 files changed, 23 insertions(+) create mode 100644 designer-chart/src/main/resources/com/fr/design/editor/rich_editor.css diff --git a/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.css b/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.css new file mode 100644 index 000000000..27eb74d9b --- /dev/null +++ b/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.css @@ -0,0 +1,22 @@ +.editor-insert-param-inactivated-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.editor-insert-param-inactivated-font .b-font:before { + content: "\e6ea"; + color: inherit; +} +.editor-insert-param-inactivated-font.disabled .b-font:before { + content: "\e6ea"; + color: inherit; +} +.editor-insert-param-active-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.editor-insert-param-active-font .b-font:before { + content: "\e6ea"; + color: #23beef; +} +.editor-insert-param-active-font.disabled .b-font:before { + content: "\e6ea"; + color: #23beef; +} \ No newline at end of file diff --git a/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html b/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html index 3189374da..1f50c2ddf 100644 --- a/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html +++ b/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html @@ -4,6 +4,7 @@ + From e2decdc840721e838a83cd3180635f6bbe035437 Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 23 Sep 2020 16:40:42 +0800 Subject: [PATCH 34/64] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=9A=E4=B9=8B=E5=89=8D=E5=9C=A8=E6=94=B9REPORT-38534?= =?UTF-8?q?=E8=BF=99=E4=B8=AAbug=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C?= =?UTF-8?q?=E7=9C=8B=E5=88=B0DesignState=E9=87=8C=E9=9D=A2=E6=9C=89?= =?UTF-8?q?=E4=B8=AA=E5=8F=82=E6=95=B0=E9=9D=A2=E6=9D=BF=E7=8A=B6=E6=80=81?= =?UTF-8?q?=EF=BC=8C=E4=BB=A5=E4=B8=BA=E4=B8=8D=E4=BC=9A=E5=B9=B2=E6=89=B0?= =?UTF-8?q?=E5=88=A4=E6=96=AD=EF=BC=8C=E5=88=9A=E6=89=8D=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E5=8F=A6=E4=B8=80=E4=B8=AAbug=E5=8F=91=E7=8E=B0=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E9=9D=A2=E6=9D=BF=E8=BF=99=E8=BE=B9=EF=BC=8C=E5=89=AA?= =?UTF-8?q?=E5=88=87=E5=A4=8D=E5=88=B6=E6=8C=89=E9=92=AE=E4=B9=9F=E6=98=AF?= =?UTF-8?q?=E4=BF=9D=E6=8C=81=E4=B8=80=E7=9B=B4=E5=8F=AF=E7=94=A8=E7=9A=84?= =?UTF-8?q?=EF=BC=8C=E6=89=80=E4=BB=A5=E8=A6=81=E5=A2=9E=E5=8A=A0=E4=B8=80?= =?UTF-8?q?=E5=B1=82=E5=88=A4=E6=96=AD=EF=BC=8C=E5=A6=82=E6=9E=9C=E6=AD=A4?= =?UTF-8?q?=E6=97=B6=E6=98=AFWORK=5FSHEET=E7=8A=B6=E6=80=81=EF=BC=8C?= =?UTF-8?q?=E8=BF=98=E9=9C=80=E8=A6=81=E5=88=A4=E6=96=AD=E6=98=AF=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E6=8A=A5=E8=A1=A8=E5=9D=97=E8=BF=98=E6=98=AF=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=8F=82=E6=95=B0=E9=9D=A2=E6=9D=BF=EF=BC=8C=E4=BB=85?= =?UTF-8?q?=E5=BD=93=E7=BC=96=E8=BE=91=E6=8A=A5=E8=A1=A8=E5=9D=97=E6=97=B6?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E4=B8=8D=E8=83=BD=E7=BD=AE=E7=81=B0?= 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 92d06d0b5..2f65fca0a 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 //Yvan: 检查当前是否为WORK_SHEET状态,因为只有WORK_SHEET中含有格式刷组件,此时是不需要进行checkComponentsByNames的 JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); if (jTemplate != null) { - if (jTemplate.getMenuState() != DesignState.WORK_SHEET) { - combineUp.checkComponentsByNames(flag, al); + // 第一个条件满足后还需要添加一重判断,判断是编辑报表块还是参数面板,编辑报表块时则直接return + if (jTemplate.getMenuState() == DesignState.WORK_SHEET && !jTemplate.isUpMode()) { + return; } + combineUp.checkComponentsByNames(flag, al); } } From 38c8fa79a8eff43e559b257964ce2e5a316084b4 Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 23 Sep 2020 17:07:31 +0800 Subject: [PATCH 35/64] =?UTF-8?q?REPORT-40525=20=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E6=8B=96=E6=8B=BD=E7=BB=84=E4=BB=B6=EF=BC=8C?= =?UTF-8?q?=E6=9D=A5=E5=9B=9E=E5=88=87=E6=8D=A2=E6=A8=A1=E6=9D=BF=EF=BC=8C?= =?UTF-8?q?=E5=86=8D=E6=8B=96=E6=8B=BD=EF=BC=8C=E6=98=BE=E7=A4=BA=E5=BE=88?= =?UTF-8?q?=E6=9C=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/EditingMouseListener.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java index 2f2d8eb5b..0e66964b4 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java @@ -177,8 +177,8 @@ public class EditingMouseListener extends MouseInputAdapter { if (designer.isDrawLineMode()) { designer.updateDrawLineMode(e); } else { - int relativeX = Math.max(0, designer.getRelativeX(e.getX())); - int relativeY = Math.max(0, designer.getRelativeY(e.getY())); + int relativeX = Math.max(0, e.getX()); + int relativeY = Math.max(0, e.getY()); if (selectionModel.hasSelectionComponent() && selectionModel.getSelection().getRelativeBounds().contains( From df84b426b0e143c4184726a82066b75c6e69fcad Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Wed, 23 Sep 2020 19:21:52 +0800 Subject: [PATCH 36/64] =?UTF-8?q?=E9=80=9A=E7=94=A8=E5=92=8C=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E4=B8=AD=E9=83=BD=E6=94=AF=E6=8C=81=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/VanChartTooltipContentPane.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 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 608ee2e16..51ad13af1 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 @@ -73,6 +73,7 @@ public class VanChartTooltipContentPane extends BasicBeanPane styleButton; private ChartTextAttrPane textAttrPane; private VanChartHtmlLabelPane htmlLabelPane; @@ -202,6 +203,7 @@ public class VanChartTooltipContentPane extends BasicBeanPane Date: Wed, 23 Sep 2020 20:44:15 +0800 Subject: [PATCH 37/64] =?UTF-8?q?=E7=94=98=E7=89=B9=E5=9B=BE=E5=92=8C?= =?UTF-8?q?=E6=A1=86=E6=9E=B6=E5=9B=BE=E6=A0=87=E7=AD=BE=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nChartLabelContentPaneWithoutRichText.java | 74 ++++++++++++++++++- .../label/GaugeLabelContentPane.java | 3 + 2 files changed, 73 insertions(+), 4 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPaneWithoutRichText.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPaneWithoutRichText.java index 4c1935eef..dafaef060 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPaneWithoutRichText.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPaneWithoutRichText.java @@ -6,6 +6,7 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithCheckBox; @@ -36,9 +37,11 @@ public class VanChartLabelContentPaneWithoutRichText extends BasicBeanPane styleButton; + private ChartTextAttrPane textAttrPane; private JPanel centerPane; private JPanel commonPanel; + private JPanel stylePanel; private VanChartHtmlLabelPane htmlLabelPane; private VanChartStylePane parent; @@ -85,7 +88,7 @@ public class VanChartLabelContentPaneWithoutRichText extends BasicBeanPane(new String[]{ + content = new UIButtonGroup<>(new String[]{ Toolkit.i18nText("Fine-Design_Chart_Common"), Toolkit.i18nText("Fine-Design_Chart_Custom") }); @@ -99,7 +102,7 @@ public class VanChartLabelContentPaneWithoutRichText extends BasicBeanPane(new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Automatic"), + Toolkit.i18nText("Fine-Design_Chart_Custom") + }); + + textAttrPane = new ChartTextAttrPane() { + protected Component[][] getComponents(JPanel buttonPane) { + return new Component[][]{ + new Component[]{null, null}, + new Component[]{null, getFontNameComboBox()}, + new Component[]{null, buttonPane} + }; + } + }; + + JPanel buttonPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), styleButton); + + JPanel stylePanel = new JPanel(new BorderLayout()); + stylePanel.add(buttonPane, BorderLayout.CENTER); + stylePanel.add(textAttrPane, BorderLayout.SOUTH); + + initStyleButtonListener(); + + return stylePanel; + } + + private void initStyleButtonListener() { + styleButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + checkStylePane(); + } + }); + } + + private void checkStylePane() { + if (hasTextStylePane()) { + stylePanel.setVisible(true); + textAttrPane.setVisible(styleButton.getSelectedIndex() == 1); + } else { + stylePanel.setVisible(false); + } + } + protected String getLabelContentTitle() { return Toolkit.i18nText("Fine-Design_Report_Text"); } @@ -237,7 +293,12 @@ public class VanChartLabelContentPaneWithoutRichText extends BasicBeanPane Date: Wed, 23 Sep 2020 20:51:07 +0800 Subject: [PATCH 38/64] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E7=9A=84setDirty?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../van/chart/designer/component/VanChartTooltipContentPane.java | 1 - 1 file changed, 1 deletion(-) 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 51ad13af1..ca9616511 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 @@ -604,7 +604,6 @@ public class VanChartTooltipContentPane extends BasicBeanPane Date: Thu, 24 Sep 2020 09:41:40 +0800 Subject: [PATCH 39/64] =?UTF-8?q?REPORT-38376=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E7=9B=AE=E5=BD=95=E6=A0=91=E7=AD=89=E6=A0=91=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6JDK11=E4=B8=8B=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/data/datapane/TableDataTree.java | 21 ++--- .../gui/itree/filetree/EnvFileTree.java | 12 +-- .../designer/data/comp/MapDataTree.java | 48 +++++----- .../treeview/ComponentTreeCellRenderer.java | 89 +++++++++---------- 4 files changed, 71 insertions(+), 99 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTree.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTree.java index 8f49b6e50..94efc5faa 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTree.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTree.java @@ -1,21 +1,22 @@ package com.fr.design.data.datapane; import com.fr.base.BaseUtils; -import com.fr.general.NameObject; import com.fr.design.constants.UIConstants; import com.fr.design.data.tabledata.wrapper.TableDataWrapper; -import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.gui.itree.refreshabletree.UserObjectRefreshJTree; import com.fr.design.icon.IconPathConstants; import com.fr.general.ComparatorUtils; +import com.fr.general.NameObject; -import javax.swing.*; +import javax.swing.BorderFactory; +import javax.swing.JTree; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.TreePath; -import java.awt.*; +import java.awt.Color; +import java.awt.Component; /** * TableData Tree @@ -31,6 +32,7 @@ public class TableDataTree extends UserObjectRefreshJTree { this.setCellRenderer(tableDataTreeCellRenderer); this.setEditable(false); } + // CellRenderer private DefaultTreeCellRenderer tableDataTreeCellRenderer = new DefaultTreeCellRenderer() { private static final long serialVersionUID = 1L; @@ -66,14 +68,7 @@ public class TableDataTree extends UserObjectRefreshJTree { this.setIcon(null); this.setText(PENDING.toString()); } - // 这里新建一个Label作为render是因为JTree在动态刷新的时候,节点上render画布的的宽度不会变,会使得一部分比较长的数据显示为"..." - UILabel label = new UILabel(); - label.setText(getText()); - label.setIcon(getIcon()); - Dimension dim = label.getPreferredSize(); - dim.height += 2; - this.setSize(dim); - this.setPreferredSize(dim); + this.setBorder(BorderFactory.createEmptyBorder(1, 0, 1, 0)); this.setBackgroundNonSelectionColor(UIConstants.TREE_BACKGROUND); this.setTextSelectionColor(Color.WHITE); this.setBackgroundSelectionColor(UIConstants.FLESH_BLUE); @@ -152,7 +147,7 @@ public class TableDataTree extends UserObjectRefreshJTree { /* * p:获得选中的NameObject = name + tabledata. - */ + */ public NameObject getSelectedNameObject() { TreePath selectedTreePath = this.getSelectionPath(); if (selectedTreePath == null) { diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/EnvFileTree.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/EnvFileTree.java index d5a9044d5..435d5a465 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/EnvFileTree.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/EnvFileTree.java @@ -2,7 +2,6 @@ package com.fr.design.gui.itree.filetree; import com.fr.base.FRContext; import com.fr.design.constants.UIConstants; -import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.gui.itree.refreshabletree.RefreshableJTree; import com.fr.design.i18n.Toolkit; @@ -14,13 +13,13 @@ import com.fr.stable.CoreConstants; import com.fr.stable.StableUtils; import com.fr.workspace.WorkContext; +import javax.swing.BorderFactory; import javax.swing.JTree; import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.TreePath; import java.awt.Color; import java.awt.Component; -import java.awt.Dimension; import java.io.File; import java.util.ArrayList; import java.util.Arrays; @@ -79,14 +78,7 @@ public class EnvFileTree extends RefreshableJTree { this.setIcon(null); this.setText(PENDING.toString()); } - // 这里新建一个Label作为render是因为JTree在动态刷新的时候,节点上render画布的的宽度不会变,会使得一部分比较长的数据显示为"..." - UILabel label = new UILabel(); - label.setText(getText()); - label.setIcon(getIcon()); - this.setSize(label.getPreferredSize()); - Dimension dim = label.getPreferredSize(); - dim.height += 2; - this.setPreferredSize(dim); + this.setBorder(BorderFactory.createEmptyBorder(1, 0, 1, 0)); this.setBackgroundNonSelectionColor(UIConstants.TREE_BACKGROUND); this.setTextSelectionColor(Color.WHITE); this.setBackgroundSelectionColor(UIConstants.FLESH_BLUE); diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/MapDataTree.java b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/MapDataTree.java index 5a223cbf0..034c621d5 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/MapDataTree.java +++ b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/MapDataTree.java @@ -1,13 +1,13 @@ package com.fr.van.chart.drillmap.designer.data.comp; import com.fr.design.constants.UIConstants; -import com.fr.design.gui.ilable.UILabel; import com.fr.general.ComparatorUtils; import com.fr.plugin.chart.map.designer.type.GEOJSONTreeHelper; import com.fr.plugin.chart.map.server.ChartGEOJSONHelper; import com.fr.plugin.chart.map.server.CompatibleGEOJSONHelper; import com.fr.stable.StringUtils; +import javax.swing.BorderFactory; import javax.swing.JTree; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeCellRenderer; @@ -15,7 +15,6 @@ import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.TreeNode; import javax.swing.tree.TreePath; import java.awt.Component; -import java.awt.Dimension; import java.util.Enumeration; /** @@ -23,7 +22,7 @@ import java.util.Enumeration; */ public class MapDataTree extends JTree { - public MapDataTree(TreeNode root){ + public MapDataTree(TreeNode root) { super(); this.setModel(model); model.setRoot(root); @@ -49,54 +48,54 @@ public class MapDataTree extends JTree { if (children.hasMoreElements()) { DefaultMutableTreeNode child = (DefaultMutableTreeNode) children.nextElement(); - if(GEOJSONTreeHelper.getInstance().isSelectableTreeNode(child)){ + if (GEOJSONTreeHelper.isSelectableTreeNode(child)) { selectTreeNode(child, m_model); - }else{ + } else { setFirstChildTreeNode(child, m_model); } } } - private void setFirstChildTreeNode(DefaultMutableTreeNode parent, DefaultTreeModel m_model){ + private void setFirstChildTreeNode(DefaultMutableTreeNode parent, DefaultTreeModel m_model) { Enumeration children = parent.children(); - if (children.hasMoreElements()){ + if (children.hasMoreElements()) { DefaultMutableTreeNode node = (DefaultMutableTreeNode) children.nextElement(); selectTreeNode(node, m_model); } } - public void changeRootNode(TreeNode node){ + public void changeRootNode(TreeNode node) { DefaultTreeModel m_model = (DefaultTreeModel) this.getModel(); m_model.setRoot(node); } public String getSelectNodeJSONPath() { - if(this.getLastSelectedPathComponent() == null){ + if (this.getLastSelectedPathComponent() == null) { return StringUtils.EMPTY; } - DefaultMutableTreeNode currentSel = (DefaultMutableTreeNode)this.getLastSelectedPathComponent(); + DefaultMutableTreeNode currentSel = (DefaultMutableTreeNode) this.getLastSelectedPathComponent(); return CompatibleGEOJSONHelper.getJsonUrlByPathIncludeParam(currentSel.getUserObject().toString()); } //根据路径精确查找 public DefaultMutableTreeNode setSelectNodePath(String jsonUrl) { - if(StringUtils.isEmpty(jsonUrl) || CompatibleGEOJSONHelper.isDeprecated(jsonUrl)){ + if (StringUtils.isEmpty(jsonUrl) || CompatibleGEOJSONHelper.isDeprecated(jsonUrl)) { return null; } DefaultTreeModel m_model = (DefaultTreeModel) this.getModel(); DefaultMutableTreeNode root = (DefaultMutableTreeNode) m_model.getRoot(); Enumeration els = root.postorderEnumeration(); - while(els.hasMoreElements()){ + while (els.hasMoreElements()) { DefaultMutableTreeNode el = (DefaultMutableTreeNode) els.nextElement(); - if(el == null || el.getUserObject() == null){ + if (el == null || el.getUserObject() == null) { return null; } String dirPath = el.getUserObject().toString(); - String url = CompatibleGEOJSONHelper.getJsonUrlByPathIncludeParam(dirPath); + String url = CompatibleGEOJSONHelper.getJsonUrlByPathIncludeParam(dirPath); //先equals再valid原因:valid 远程下实时去服务器看有没有json文件 if (ComparatorUtils.equals(jsonUrl, url) && GEOJSONTreeHelper.isValidDirPath(dirPath)) { selectTreeNode(el, m_model); @@ -115,14 +114,7 @@ public class MapDataTree extends JTree { DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) value; String name = getPresentName(treeNode); this.setText(name); - - UILabel label = new UILabel(); - label.setText(getText()); - label.setIcon(getIcon()); - this.setSize(label.getPreferredSize()); - Dimension dim = label.getPreferredSize(); - dim.height += 2; - this.setPreferredSize(dim); + this.setBorder(BorderFactory.createEmptyBorder(1, 0, 1, 0)); this.setBackgroundNonSelectionColor(UIConstants.NORMAL_BACKGROUND); this.setForeground(UIConstants.FONT_COLOR); this.setBackgroundSelectionColor(UIConstants.FLESH_BLUE); @@ -131,25 +123,25 @@ public class MapDataTree extends JTree { }; protected String getPresentName(DefaultMutableTreeNode treeNode) { - if(treeNode == null || treeNode.getUserObject() == null){ + if (treeNode == null || treeNode.getUserObject() == null) { return StringUtils.EMPTY; } return ChartGEOJSONHelper.getPresentNameWithPath(treeNode.getUserObject().toString()); } //模糊搜索 深度优先. - public void search(String text){ - if(StringUtils.isEmpty(text)){ + public void search(String text) { + if (StringUtils.isEmpty(text)) { return; } DefaultTreeModel m_model = (DefaultTreeModel) this.getModel(); DefaultMutableTreeNode root = (DefaultMutableTreeNode) m_model.getRoot(); Enumeration els = root.postorderEnumeration(); - while(els.hasMoreElements()){ + while (els.hasMoreElements()) { DefaultMutableTreeNode el = (DefaultMutableTreeNode) els.nextElement(); - String path = el.getUserObject().toString(); + String path = el.getUserObject().toString(); String fileName = ChartGEOJSONHelper.getPresentNameWithPath(path); if (StringUtils.contains(fileName, text) && GEOJSONTreeHelper.isValidDirPath(path)) { selectTreeNode(el, m_model); @@ -158,7 +150,7 @@ public class MapDataTree extends JTree { } } - public void selectTreeNode(DefaultMutableTreeNode node, DefaultTreeModel m_model){ + public void selectTreeNode(DefaultMutableTreeNode node, DefaultTreeModel m_model) { TreeNode[] nodes = m_model.getPathToRoot(node); TreePath treePath = new TreePath(nodes); setSelectionPath(treePath); diff --git a/designer-form/src/main/java/com/fr/design/designer/treeview/ComponentTreeCellRenderer.java b/designer-form/src/main/java/com/fr/design/designer/treeview/ComponentTreeCellRenderer.java index 78b606a7f..48938dcee 100644 --- a/designer-form/src/main/java/com/fr/design/designer/treeview/ComponentTreeCellRenderer.java +++ b/designer-form/src/main/java/com/fr/design/designer/treeview/ComponentTreeCellRenderer.java @@ -3,60 +3,53 @@ package com.fr.design.designer.treeview; import com.fr.design.constants.UIConstants; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreatorUtils; -import com.fr.design.gui.ilable.UILabel; import com.fr.log.FineLoggerFactory; +import javax.swing.BorderFactory; import javax.swing.Icon; import javax.swing.JTree; import javax.swing.tree.DefaultTreeCellRenderer; import java.awt.Component; -import java.awt.Dimension; public class ComponentTreeCellRenderer extends DefaultTreeCellRenderer { - public ComponentTreeCellRenderer() { - } - - @Override - public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, - boolean leaf, int row, boolean hasFocus) { - super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus); - if (value instanceof XCreator) { - String name = ((XCreator) value).toData().getWidgetName(); - setText(name); - Icon icon = null; - try { - icon = XCreatorUtils.getCreatorIcon((XCreator) value); - } catch (Exception e) { - FineLoggerFactory.getLogger().info("{} has not icon or has been deleted", name); - } - if (icon != null) { - setIcon(icon); - } - } - UILabel label = new UILabel(); - label.setText(getText()); - label.setIcon(getIcon()); - Dimension dim = label.getPreferredSize(); - dim.height += 2; - this.setSize(dim); - this.setPreferredSize(dim); - this.setBackgroundNonSelectionColor(UIConstants.TREE_BACKGROUND); - return this; - } - - @Override - public Icon getClosedIcon() { - return getIcon(); - } - - @Override - public Icon getLeafIcon() { - return getIcon(); - } - - @Override - public Icon getOpenIcon() { - return getIcon(); - } -} \ No newline at end of file + public ComponentTreeCellRenderer() { + } + + @Override + public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, + boolean leaf, int row, boolean hasFocus) { + super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus); + if (value instanceof XCreator) { + String name = ((XCreator) value).toData().getWidgetName(); + setText(name); + Icon icon = null; + try { + icon = XCreatorUtils.getCreatorIcon((XCreator) value); + } catch (Exception e) { + FineLoggerFactory.getLogger().info("{} has not icon or has been deleted", name); + } + if (icon != null) { + setIcon(icon); + } + } + this.setBorder(BorderFactory.createEmptyBorder(1, 0, 1, 0)); + this.setBackgroundNonSelectionColor(UIConstants.TREE_BACKGROUND); + return this; + } + + @Override + public Icon getClosedIcon() { + return getIcon(); + } + + @Override + public Icon getLeafIcon() { + return getIcon(); + } + + @Override + public Icon getOpenIcon() { + return getIcon(); + } +} From 9af539cbbd2bd7b73258fe12489325991b09079a Mon Sep 17 00:00:00 2001 From: vito Date: Thu, 24 Sep 2020 12:04:07 +0800 Subject: [PATCH 40/64] =?UTF-8?q?REPORT-39308=20=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E9=9D=A2=E6=9D=BF=E5=8F=82=E6=95=B0=E5=90=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=AE=8C=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/parameter/ParameterInputPane.java | 252 +++++++++--------- 1 file changed, 132 insertions(+), 120 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/parameter/ParameterInputPane.java b/designer-base/src/main/java/com/fr/design/parameter/ParameterInputPane.java index b16e6b279..7c8f675b1 100644 --- a/designer-base/src/main/java/com/fr/design/parameter/ParameterInputPane.java +++ b/designer-base/src/main/java/com/fr/design/parameter/ParameterInputPane.java @@ -20,14 +20,18 @@ import com.fr.design.editor.editor.TextEditor; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; - import com.fr.stable.ParameterProvider; import com.fr.stable.StringUtils; -import javax.swing.*; +import javax.swing.BorderFactory; +import javax.swing.JComponent; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.SwingConstants; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.Dimension; import java.util.ArrayList; import java.util.Date; import java.util.Iterator; @@ -37,31 +41,34 @@ import java.util.Map.Entry; /** * The dialog used to input parameter. + * * @editor zhou * @since 2012-3-26上午11:09:45 */ public class ParameterInputPane extends BasicPane { - /** - * - */ - private static final long serialVersionUID = 1L; + /** + * + */ + private static final long serialVersionUID = 1L; + + // alex:保存编辑器对应的参数的名字 + private java.util.Map editorNameMap; // Map + + private boolean allowBlank = true; - // alex:保存编辑器对应的参数的名字 - private java.util.Map editorNameMap; // Map + private FlowTableLayoutHelper flowTableLayoutHelper; - private boolean allowBlank = true; - - /** + /** * Constructor. */ public ParameterInputPane(ParameterProvider[] parameters) { this.initComponents(parameters); } - public ParameterInputPane(ParameterProvider[] parameters, boolean allowBlank) { - this.allowBlank = allowBlank; - this.initComponents(parameters); - } + public ParameterInputPane(ParameterProvider[] parameters, boolean allowBlank) { + this.allowBlank = allowBlank; + this.initComponents(parameters); + } private void initComponents(ParameterProvider[] parameters) { this.setLayout(new BorderLayout(0, 4)); @@ -71,24 +78,24 @@ public class ParameterInputPane extends BasicPane { this.add(new JScrollPane(contentPane), BorderLayout.CENTER); contentPane.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameters") + ":")); - FlowTableLayoutHelper flowTableLayoutHelper = new FlowTableLayoutHelper(); + flowTableLayoutHelper = new FlowTableLayoutHelper(); + + editorNameMap = new java.util.HashMap(); - editorNameMap = new java.util.HashMap(); - //Parameter list. java.util.List nameAddedList = new java.util.ArrayList(); // alex:已经加到界面中去的参数名 if (parameters != null && parameters.length > 0) { for (int i = 0; i < parameters.length; i++) { ParameterProvider parameter = parameters[i]; - + // alex:已经在界面中的参数,不加了 if (nameAddedList.contains(parameter.getName())) { - continue; - } - if(parameter instanceof StoreProcedureParameter - && ((StoreProcedureParameter) parameter).getSchema() == StoreProcedureConstants.OUT) { - continue; - } + continue; + } + if (parameter instanceof StoreProcedureParameter + && ((StoreProcedureParameter) parameter).getSchema() == StoreProcedureConstants.OUT) { + continue; + } final Object pv = parameter.getValue(); Editor[] editors = makeEditorByValue(pv); @@ -100,135 +107,140 @@ public class ParameterInputPane extends BasicPane { editPane.setPreferredSize(new Dimension(180, editPane.getPreferredSize().height)); String parameterDisplayName = parameter.getName(); - if(StringUtils.isNotBlank(parameter.getName())) { - parameterDisplayName = parameter.getName(); + if (StringUtils.isNotBlank(parameter.getName())) { + parameterDisplayName = parameter.getName(); } contentPane.add(flowTableLayoutHelper.createLabelFlowPane(parameterDisplayName + ":", editPane)); //add editor to parameter hashtable. - initTextListener(textF); + initTextListener(textF); this.editorNameMap.put(textF, parameter.getName()); nameAddedList.add(parameter.getName()); } } + } + @Override + public void addNotify() { + super.addNotify(); + // windows 高DPI下,使用getPreferredSize必须在添加到容器之后,否则得到的数值不准确,因此先放到这调整大小 flowTableLayoutHelper.adjustLabelWidth(); } protected void initTextListener(ValueEditorPane textF) { - textF.getCurrentEditor().addChangeListener(new ChangeListener() { - @Override - public void stateChanged(ChangeEvent e) { - HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified(); - } - }); - } - - private Editor[] makeEditorByValue(Object pv) { - Editor[] editors = {null}; - if (pv instanceof Integer) { - editors[0] = new IntegerEditor(); - } else if (pv instanceof Double || pv instanceof Float) { - editors[0] = new DoubleEditor(); - } else if (pv instanceof Float) { - editors[0] = new FloatEditor(); - } else if (pv instanceof Date) { - editors[0] = new DateEditor(true, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Date")); - } else if (pv instanceof Boolean) { - editors[0] = new BooleanEditor(); - } else if (pv instanceof BaseFormula) { - editors = ValueEditorPaneFactory.basicEditors(); - } else { - editors[0] = new TextEditor(); - } - return editors; - } - + textF.getCurrentEditor().addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified(); + } + }); + } + + private Editor[] makeEditorByValue(Object pv) { + Editor[] editors = {null}; + if (pv instanceof Integer) { + editors[0] = new IntegerEditor(); + } else if (pv instanceof Double || pv instanceof Float) { + editors[0] = new DoubleEditor(); + } else if (pv instanceof Float) { + editors[0] = new FloatEditor(); + } else if (pv instanceof Date) { + editors[0] = new DateEditor(true, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Date")); + } else if (pv instanceof Boolean) { + editors[0] = new BooleanEditor(); + } else if (pv instanceof BaseFormula) { + editors = ValueEditorPaneFactory.basicEditors(); + } else { + editors[0] = new TextEditor(); + } + return editors; + } + @Override protected String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameters"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameters"); } /** * Update */ - public Map update() { - - java.util.Map nameValueMap = new java.util.HashMap(); - - Iterator> entryIt = this.editorNameMap.entrySet().iterator(); - while(entryIt.hasNext()) { - java.util.Map.Entry entry = entryIt.next(); - ValueEditorPane editor = entry.getKey(); - String parameterName = entry.getValue(); - - Object editorStringValue = editor.update(); - nameValueMap.put(parameterName, editorStringValue); - } - - return nameValueMap; + public Map update() { + + java.util.Map nameValueMap = new java.util.HashMap(); + + Iterator> entryIt = this.editorNameMap.entrySet().iterator(); + while (entryIt.hasNext()) { + java.util.Map.Entry entry = entryIt.next(); + ValueEditorPane editor = entry.getKey(); + String parameterName = entry.getValue(); + + Object editorStringValue = editor.update(); + nameValueMap.put(parameterName, editorStringValue); + } + + return nameValueMap; + } + + public void checkValid() throws Exception { + if (!allowBlank) { + boolean valid = true; + String error = ""; + Iterator> entryIt = this.editorNameMap.entrySet().iterator(); + while (entryIt.hasNext()) { + java.util.Map.Entry entry = entryIt.next(); + ValueEditorPane editor = entry.getKey(); + String parameterName = entry.getValue(); + Object editorStringValue = editor.update(); + if (editorStringValue == null || StringUtils.isEmpty(Utils.objectToString(editorStringValue))) { + valid = false; + error += parameterName + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Not_Null_Des") + "\n"; + } + } + if (!valid) { + throw new Exception(error); + } + } } - public void checkValid() throws Exception { - if (!allowBlank) { - boolean valid = true; - String error = ""; - Iterator> entryIt = this.editorNameMap.entrySet().iterator(); - while (entryIt.hasNext()) { - java.util.Map.Entry entry = entryIt.next(); - ValueEditorPane editor = entry.getKey(); - String parameterName = entry.getValue(); - Object editorStringValue = editor.update(); - if (editorStringValue == null || StringUtils.isEmpty(Utils.objectToString(editorStringValue))) { - valid = false; - error += parameterName + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Not_Null_Des") + "\n"; - } - } - if (!valid) { - throw new Exception(error); - } - } - } - /** * The class help to flowlayout components */ private static class FlowTableLayoutHelper { - private List labelList = new ArrayList(); + private List labelList = new ArrayList(); - public FlowTableLayoutHelper() { - } + public FlowTableLayoutHelper() { + } - public JPanel createLabelFlowPane(String text, JComponent comp) { - JPanel centerPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + public JPanel createLabelFlowPane(String text, JComponent comp) { + JPanel centerPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); - UILabel textLabel = new UILabel(text); - centerPane.add(textLabel); - textLabel.setHorizontalAlignment(SwingConstants.LEFT); + UILabel textLabel = new UILabel(text); + centerPane.add(textLabel); + textLabel.setHorizontalAlignment(SwingConstants.LEFT); - this.labelList.add(textLabel); - centerPane.add(comp); + this.labelList.add(textLabel); + centerPane.add(comp); - return centerPane; - } + return centerPane; + } - public void adjustLabelWidth() { - int maxWidth = 0; + public void adjustLabelWidth() { + int maxWidth = 0; - for (int i = 0; i < labelList.size(); i++) { - maxWidth = Math.max(maxWidth, labelList.get(i).getPreferredSize().width); - } + for (int i = 0; i < labelList.size(); i++) { + maxWidth = Math.max(maxWidth, labelList.get(i).getPreferredSize().width); + } - for (int i = 0; i < labelList.size(); i++) { - UILabel label = labelList.get(i); + for (int i = 0; i < labelList.size(); i++) { + UILabel label = labelList.get(i); - Dimension labelDim = new Dimension(maxWidth, label.getPreferredSize().height); + Dimension labelDim = new Dimension(maxWidth, label.getPreferredSize().height); - label.setPreferredSize(labelDim); - label.setSize(labelDim); - label.setMinimumSize(labelDim); - } - } + label.setPreferredSize(labelDim); + label.setSize(labelDim); + label.setMinimumSize(labelDim); + } + } } -} \ No newline at end of file +} From d1108bf94a19d982729f93246acee799facda438 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 24 Sep 2020 14:03:32 +0800 Subject: [PATCH 41/64] =?UTF-8?q?MOBILE-29490=20=E3=80=90H5=E3=80=9110.4.8?= =?UTF-8?q?0=E5=8D=87=E7=BA=A7=E5=88=B010.4.90=E5=90=8E=EF=BC=8C=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E4=B8=AD=E6=9C=89=E4=BA=9B=E5=86=85=E5=AE=B9=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=B8=8D=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/form/util/FormDesignerUtils.java | 21 +++++++++++++++++++ .../mobile/ChartEditorDefinePane.java | 14 ++++++++++++- .../mobile/ElementCaseDefinePane.java | 12 ++++++++++- 3 files changed, 45 insertions(+), 2 deletions(-) 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 352aa80e5..3e248f3ba 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,8 @@ package com.fr.design.form.util; +import com.fr.design.designer.creator.XCreator; +import com.fr.design.designer.creator.XWAbsoluteBodyLayout; +import com.fr.design.designer.creator.XWAbsoluteLayout; import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.mainframe.FormDesigner; @@ -8,6 +11,7 @@ import com.fr.design.mainframe.template.info.ComponentCreateOperate; import com.fr.design.mainframe.template.info.ComponentDeleteOperate; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WFitLayout; +import java.awt.Container; public class FormDesignerUtils { @@ -46,4 +50,21 @@ public class FormDesignerUtils { jTemplate.getProcessInfo().updateTemplateOperationInfo(new ComponentDeleteOperate(widget)); } + /** + * 判断当前UI组件是否在绝对画布块中 + * + * @param xCreator + * @return + */ + public static boolean isInAbsoluteLayout(XCreator xCreator) { + Container parent = xCreator.getParent(); + while (parent != null) { + if (parent instanceof XWAbsoluteLayout && !(parent instanceof XWAbsoluteBodyLayout)) { + return true; + } + parent = parent.getParent(); + } + return false; + } + } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java index 7427a0281..8a9c3b4d4 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java @@ -24,6 +24,7 @@ import com.fr.design.mainframe.mobile.ui.MobileCollapsedStylePane; import com.fr.design.mainframe.mobile.ui.MobileComboBoxDialogEditor; import com.fr.form.ui.BaseChartEditor; import com.fr.form.ui.ChartEditor; +import com.fr.form.ui.ElementCaseEditor; import com.fr.form.ui.mobile.MobileCollapsedStyle; import javax.swing.BorderFactory; @@ -202,8 +203,19 @@ public class ChartEditorDefinePane extends MobileWidgetDefinePane { MobileCollapsedStyle style = ((ChartEditor) xCreator.toData()).getMobileCollapsedStyle(); this.mobileCollapsedStyleEditor.setStyle(style); this.mobileCollapsedStyleEditor.setSelected(style.isCollapsedWork()); + fix(style); } + /** + * 根据组件当前位置修正下属性 + * + * @param style + */ + private void fix(MobileCollapsedStyle style) { + style.setCollapsedWork(!FormDesignerUtils.isInAbsoluteLayout(xCreator)); + } + + @Override public void update() { ChartMobileAttrProvider mobileAttr = ((BaseChartEditor)xCreator.toData()).getMobileAttr(); @@ -219,7 +231,7 @@ public class ChartEditorDefinePane extends MobileWidgetDefinePane { MobileCollapsedStyle style = this.mobileCollapsedStyleEditor.getStyle(); if (style != null) { ((ChartEditor) xCreator.toData()).setMobileCollapsedStyle(style); - style.setCollapsedWork(this.mobileCollapsedStyleEditor.isSelectedCustom()); + style.setCollapsedWork(this.mobileCollapsedStyleEditor.isSelectedCustom() && !FormDesignerUtils.isInAbsoluteLayout(xCreator)); } DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); // 触发设计器保存按钮亮起来 } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java index 723616280..596f04682 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java @@ -177,6 +177,16 @@ public class ElementCaseDefinePane extends MobileWidgetDefinePane { this.functionalWhenUnactivatedCheckBox.setSelected(!elementCaseEditor.isFunctionalWhenUnactivated()); this.mobileCollapsedStyleEditor.setStyle(elementCaseEditor.getMobileCollapsedStyle()); this.mobileCollapsedStyleEditor.setSelected(elementCaseEditor.getMobileCollapsedStyle().isCollapsedWork()); + fix(elementCaseEditor.getMobileCollapsedStyle()); + } + + /** + * 根据组件当前位置修正下属性 + * + * @param style + */ + private void fix(MobileCollapsedStyle style) { + style.setCollapsedWork(!FormDesignerUtils.isInAbsoluteLayout(xCreator)); } @Override @@ -207,7 +217,7 @@ public class ElementCaseDefinePane extends MobileWidgetDefinePane { } MobileCollapsedStyle style = this.mobileCollapsedStyleEditor.getStyle(); if (style != null) { - style.setCollapsedWork(this.mobileCollapsedStyleEditor.isSelectedCustom()); + style.setCollapsedWork(this.mobileCollapsedStyleEditor.isSelectedCustom() && !FormDesignerUtils.isInAbsoluteLayout(xCreator)); ((ElementCaseEditor) xCreator.toData()).setMobileCollapsedStyle(style); } } From 85fcea5fba367eb83b0da25c71dde38a7a43023d Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 24 Sep 2020 14:20:23 +0800 Subject: [PATCH 42/64] =?UTF-8?q?MOBILE-29490=20=E3=80=90H5=E3=80=9110.4.8?= =?UTF-8?q?0=E5=8D=87=E7=BA=A7=E5=88=B010.4.90=E5=90=8E=EF=BC=8C=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E4=B8=AD=E6=9C=89=E4=BA=9B=E5=86=85=E5=AE=B9=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=B8=8D=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../widget/ui/designer/mobile/ChartEditorDefinePane.java | 4 ++-- .../widget/ui/designer/mobile/ElementCaseDefinePane.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java index 8a9c3b4d4..69e438401 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java @@ -202,8 +202,8 @@ public class ChartEditorDefinePane extends MobileWidgetDefinePane { MobileCollapsedStyle style = ((ChartEditor) xCreator.toData()).getMobileCollapsedStyle(); this.mobileCollapsedStyleEditor.setStyle(style); - this.mobileCollapsedStyleEditor.setSelected(style.isCollapsedWork()); fix(style); + this.mobileCollapsedStyleEditor.setSelected(style.isCollapsedWork()); } /** @@ -212,7 +212,7 @@ public class ChartEditorDefinePane extends MobileWidgetDefinePane { * @param style */ private void fix(MobileCollapsedStyle style) { - style.setCollapsedWork(!FormDesignerUtils.isInAbsoluteLayout(xCreator)); + style.setCollapsedWork(style.isCollapsedWork() && !FormDesignerUtils.isInAbsoluteLayout(xCreator)); } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java index 596f04682..bdd5b7d35 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java @@ -176,8 +176,8 @@ public class ElementCaseDefinePane extends MobileWidgetDefinePane { this.allowFullCheckBox.setSelected(elementCaseEditor.isAllowFullScreen()); this.functionalWhenUnactivatedCheckBox.setSelected(!elementCaseEditor.isFunctionalWhenUnactivated()); this.mobileCollapsedStyleEditor.setStyle(elementCaseEditor.getMobileCollapsedStyle()); - this.mobileCollapsedStyleEditor.setSelected(elementCaseEditor.getMobileCollapsedStyle().isCollapsedWork()); fix(elementCaseEditor.getMobileCollapsedStyle()); + this.mobileCollapsedStyleEditor.setSelected(elementCaseEditor.getMobileCollapsedStyle().isCollapsedWork()); } /** @@ -186,7 +186,7 @@ public class ElementCaseDefinePane extends MobileWidgetDefinePane { * @param style */ private void fix(MobileCollapsedStyle style) { - style.setCollapsedWork(!FormDesignerUtils.isInAbsoluteLayout(xCreator)); + style.setCollapsedWork(style.isCollapsedWork() && !FormDesignerUtils.isInAbsoluteLayout(xCreator)); } @Override From a3c061ffdfc01d122e82414d5ce0e4ccb8952d7e Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 24 Sep 2020 14:43:11 +0800 Subject: [PATCH 43/64] =?UTF-8?q?REPORT-40459=20=E3=80=90=E5=9B=9E?= =?UTF-8?q?=E5=BD=92=E3=80=91=E5=8F=B3=E4=BE=A7=E5=B1=9E=E6=80=A7=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E5=AF=8C=E6=96=87=E6=9C=AC=E7=BC=96=E8=BE=91=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E5=8F=98=E7=9F=AD=20=E3=80=90=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=E3=80=91=E5=AE=9E=E9=99=85=E4=B8=8A=E4=B8=8D?= =?UTF-8?q?=E6=98=AF=E7=BC=96=E8=BE=91=E6=8C=89=E9=92=AE=E5=8F=98=E7=9F=AD?= =?UTF-8?q?=E4=BA=86=EF=BC=8C=E8=80=8C=E6=98=AF=E4=B8=8A=E9=9D=A2=E7=9A=84?= =?UTF-8?q?=E4=B8=A4=E4=B8=AALabel=E5=8F=98=E7=9F=AD=E4=BA=86=EF=BC=8C?= =?UTF-8?q?=E5=9C=A8=E4=BD=BF=E7=94=A8TableLayout.FILL=E7=9A=84=E6=83=85?= =?UTF-8?q?=E5=86=B5=E4=B8=8B=EF=BC=8C=E5=90=8E=E9=9D=A2=E8=B7=9F=E7=9D=80?= =?UTF-8?q?=E7=9A=84=E8=BE=93=E5=85=A5=E6=A1=86=E8=BF=98=E6=9C=89UICombox?= =?UTF-8?q?=E5=8F=98=E9=95=BF=E4=BA=86=EF=BC=8C=E8=80=8C=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E5=89=8D=E9=9D=A2=E7=9A=84=E5=8D=A0=E4=BD=8D?= =?UTF-8?q?=E7=A9=BA=E7=99=BDLabel=E6=98=AF=E5=86=99=E6=AD=BBsize=E7=9A=84?= =?UTF-8?q?=EF=BC=8C=E6=B2=A1=E6=9C=89=E4=BF=9D=E6=8C=81=E4=B8=80=E8=87=B4?= =?UTF-8?q?=EF=BC=8C=E6=89=80=E4=BB=A5=E7=A9=BA=E7=99=BDLabel=E4=B8=8D?= =?UTF-8?q?=E5=8F=98=E7=9A=84=E6=83=85=E5=86=B5=E4=B8=8B=EF=BC=8C=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E6=8C=89=E9=92=AE=E6=98=BE=E5=BE=97=E7=9F=AD=E4=BA=86?= =?UTF-8?q?=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=96=B9=E6=A1=88=E3=80=91?= =?UTF-8?q?=E5=B0=86=E5=8D=A0=E4=BD=8DLabel=E7=9A=84=E5=AE=BD=E5=BA=A6?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BA=E4=B8=8E=E5=89=8D=E9=9D=A2=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E8=AE=A1=E7=AE=97=E5=AE=BD=E5=BA=A6=E7=9A=84=E4=B8=A4?= =?UTF-8?q?=E4=B8=AALabel=E4=B8=80=E8=87=B4=EF=BC=8C=E8=BF=99=E6=A0=B7?= =?UTF-8?q?=E5=90=8E=E9=9D=A2=E8=B7=9F=E7=9A=84=E4=B8=9C=E8=A5=BF=E5=AE=BD?= =?UTF-8?q?=E5=BA=A6=E5=B0=B1=E9=83=BD=E6=98=AF=E4=B8=80=E8=87=B4=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/quickeditor/CellQuickEditor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java index 019b4cdee..d24193dae 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java @@ -48,7 +48,7 @@ import java.util.ArrayList; */ public abstract class CellQuickEditor extends QuickEditor { - protected static final Dimension LABEL_DIMENSION = new Dimension(60, 20); + protected static final Dimension LABEL_DIMENSION = new Dimension(GraphHelper.getWidth(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element")), 20); protected static final int VGAP = 10, HGAP = 8, VGAP_INNER = 3; /** From 31f74c939267b32f710b70f200b075b77ffd9e68 Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 24 Sep 2020 14:44:42 +0800 Subject: [PATCH 44/64] =?UTF-8?q?REPORT-38618=20=E3=80=90=E5=9B=9E?= =?UTF-8?q?=E5=BD=92=E3=80=91=E8=A1=A8=E5=8D=95-=E4=B8=8B=E6=96=B9?= =?UTF-8?q?=E7=BC=A9=E6=94=BE=E7=BC=A9=E5=B0=8F=E4=B9=8B=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E6=8B=96=E5=85=A5tab=E5=9D=97=EF=BC=8C=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=E5=8F=B3=E4=BE=A7=E8=BE=B9=E6=A1=86=E7=BA=BF=E6=B6=88=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/FormDesignerUI.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java index b75fbcf3c..233ee2a96 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java @@ -22,10 +22,12 @@ import com.fr.form.main.parameter.FormParameterUI; import com.fr.page.WatermarkPainter; import com.fr.report.core.ReportUtils; import com.fr.stable.ArrayUtils; +import com.fr.stable.Constants; import javax.swing.*; import javax.swing.plaf.ComponentUI; import java.awt.AlphaComposite; +import java.awt.Color; import java.awt.Component; import java.awt.Graphics; import java.awt.Graphics2D; @@ -41,6 +43,8 @@ import java.util.ArrayList; */ public class FormDesignerUI extends ComponentUI { + private static final Color DESIGNER_BORDER_COLOR = new Color(198, 198, 198); + // 当前的设计器 private FormDesigner designer; private SelectionModel selectionModel; @@ -90,7 +94,7 @@ public class FormDesignerUI extends ComponentUI { designer.getDrawLineHelper().drawAuxiliaryLine(g); return; } - + paintBorder(g); paintSelection(g); if (DesignerMode.isAuthorityEditing()) { @@ -275,6 +279,19 @@ public class FormDesignerUI extends ComponentUI { clipg.dispose(); } + public void paintBorder(Graphics g) { + Rectangle bounds = designer.getTopContainer().getBounds(); + bounds.x = -designer.getHorizontalScaleValue(); + bounds.y = -designer.getVerticalScaleValue(); + Graphics clipg = g.create(); + clipg.clipRect(bounds.x, bounds.y, bounds.width, bounds.height); + Color oldColor = g.getColor(); + g.setColor(DESIGNER_BORDER_COLOR); + GraphHelper.draw(g, bounds, Constants.LINE_THIN); + clipg.dispose(); + g.setColor(oldColor); + } + /** * 画出当前选择、拖拽状态框 * From 465dafee980b07c8835f24816302329fc9b9812c Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 24 Sep 2020 14:50:22 +0800 Subject: [PATCH 45/64] =?UTF-8?q?=E6=8F=90=E5=88=B0final?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/EditingMouseListener.java | 42 +++++++++++++------ 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java index 01de4a1da..0e66964b4 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java @@ -177,8 +177,8 @@ public class EditingMouseListener extends MouseInputAdapter { if (designer.isDrawLineMode()) { designer.updateDrawLineMode(e); } else { - int relativeX = Math.max(0, designer.getRelativeX(e.getX())); - int relativeY = Math.max(0, designer.getRelativeY(e.getY())); + int relativeX = Math.max(0, e.getX()); + int relativeY = Math.max(0, e.getY()); if (selectionModel.hasSelectionComponent() && selectionModel.getSelection().getRelativeBounds().contains( @@ -363,7 +363,7 @@ public class EditingMouseListener extends MouseInputAdapter { designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } // component.getParent() 是报表块所在的XWTitleLayout int minX = button.getX() + getParentPositionX(component, 0) - designer.getHorizontalScaleValue(); - int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue(); + int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue() + xElementCase.getY(); if (e.getX() + GAP - xElementCase.getInsets().left > minX && e.getX() - GAP - xElementCase.getInsets().left < minX + button.getWidth()) { if (e.getY() + GAP - xElementCase.getInsets().top > minY && e.getY() - GAP - xElementCase.getInsets().top < minY + button.getHeight()) { designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); @@ -405,16 +405,7 @@ public class EditingMouseListener extends MouseInputAdapter { } private void setCoverPaneNotDisplay(XCreator component, MouseEvent e, boolean isLinkedHelpDialog) { - if (xElementCase != null) { - int x = getParentPositionX(xElementCase, 0) - designer.getArea().getHorizontalValue(); - int y = getParentPositionY(xElementCase, 0) - designer.getArea().getVerticalValue(); - Rectangle rect = new Rectangle(x, y, xElementCase.getWidth(), xElementCase.getHeight()); - if (rect.contains(e.getPoint())) { - return; - } - xElementCase.displayCoverPane(false); - } if (xChartEditor != null) { xChartEditor.displayCoverPane(false); } @@ -425,6 +416,15 @@ public class EditingMouseListener extends MouseInputAdapter { if (xTopLayoutContainer != null) { xTopLayoutContainer.setMouseEnter(false); } + //不知道为什么要对XElementCase进行判断,但是直接return会有bug,所以把他放在最后 + if (xElementCase != null) { + int x = getParentPositionX(xElementCase, 0) - designer.getArea().getHorizontalValue(); + int y = getParentPositionY(xElementCase, 0) - designer.getArea().getVerticalValue(); + Rectangle rect = new Rectangle(x, y, xElementCase.getWidth(), xElementCase.getHeight()); + if (!rect.contains(e.getPoint())) { + xElementCase.displayCoverPane(false); + } + } designer.repaint(); } @@ -462,7 +462,7 @@ public class EditingMouseListener extends MouseInputAdapter { designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } int minX = button.getX() + getParentPositionX(component, 0) - designer.getHorizontalScaleValue(); - int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue(); + int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue() + xChartEditor.getY(); if (e.getX() + GAP > minX && e.getX() - GAP < minX + button.getWidth()) { if (e.getY() + GAP > minY && e.getY() - GAP < minY + button.getHeight()) { designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); @@ -700,6 +700,7 @@ public class EditingMouseListener extends MouseInputAdapter { currentXCreator.stopEditing(); currentXCreator = null; currentEditor = null; + refreshTopXCreator(); return true; } return true; @@ -727,4 +728,19 @@ public class EditingMouseListener extends MouseInputAdapter { } currentEditor.getEditorTarget().setBounds(bounds); } + + /** + * 刷新顶层组件 + * */ + public void refreshTopXCreator(boolean isEditing){ + designer.refreshTopXCreator(isEditing); + } + + /** + * 刷新顶层组件 + * */ + public void refreshTopXCreator(){ + refreshTopXCreator(false); + } + } From a66a183f2fdb0738860a81fdba4d0156c68b6bab Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 24 Sep 2020 14:55:34 +0800 Subject: [PATCH 46/64] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/EditingMouseListener.java | 38 ++++++------------- 1 file changed, 11 insertions(+), 27 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java index 0e66964b4..f482f7c97 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java @@ -363,7 +363,7 @@ public class EditingMouseListener extends MouseInputAdapter { designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } // component.getParent() 是报表块所在的XWTitleLayout int minX = button.getX() + getParentPositionX(component, 0) - designer.getHorizontalScaleValue(); - int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue() + xElementCase.getY(); + int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue(); if (e.getX() + GAP - xElementCase.getInsets().left > minX && e.getX() - GAP - xElementCase.getInsets().left < minX + button.getWidth()) { if (e.getY() + GAP - xElementCase.getInsets().top > minY && e.getY() - GAP - xElementCase.getInsets().top < minY + button.getHeight()) { designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); @@ -405,7 +405,16 @@ public class EditingMouseListener extends MouseInputAdapter { } private void setCoverPaneNotDisplay(XCreator component, MouseEvent e, boolean isLinkedHelpDialog) { + if (xElementCase != null) { + int x = getParentPositionX(xElementCase, 0) - designer.getArea().getHorizontalValue(); + int y = getParentPositionY(xElementCase, 0) - designer.getArea().getVerticalValue(); + Rectangle rect = new Rectangle(x, y, xElementCase.getWidth(), xElementCase.getHeight()); + if (rect.contains(e.getPoint())) { + return; + } + xElementCase.displayCoverPane(false); + } if (xChartEditor != null) { xChartEditor.displayCoverPane(false); } @@ -416,15 +425,6 @@ public class EditingMouseListener extends MouseInputAdapter { if (xTopLayoutContainer != null) { xTopLayoutContainer.setMouseEnter(false); } - //不知道为什么要对XElementCase进行判断,但是直接return会有bug,所以把他放在最后 - if (xElementCase != null) { - int x = getParentPositionX(xElementCase, 0) - designer.getArea().getHorizontalValue(); - int y = getParentPositionY(xElementCase, 0) - designer.getArea().getVerticalValue(); - Rectangle rect = new Rectangle(x, y, xElementCase.getWidth(), xElementCase.getHeight()); - if (!rect.contains(e.getPoint())) { - xElementCase.displayCoverPane(false); - } - } designer.repaint(); } @@ -462,7 +462,7 @@ public class EditingMouseListener extends MouseInputAdapter { designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } int minX = button.getX() + getParentPositionX(component, 0) - designer.getHorizontalScaleValue(); - int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue() + xChartEditor.getY(); + int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue(); if (e.getX() + GAP > minX && e.getX() - GAP < minX + button.getWidth()) { if (e.getY() + GAP > minY && e.getY() - GAP < minY + button.getHeight()) { designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); @@ -700,7 +700,6 @@ public class EditingMouseListener extends MouseInputAdapter { currentXCreator.stopEditing(); currentXCreator = null; currentEditor = null; - refreshTopXCreator(); return true; } return true; @@ -728,19 +727,4 @@ public class EditingMouseListener extends MouseInputAdapter { } currentEditor.getEditorTarget().setBounds(bounds); } - - /** - * 刷新顶层组件 - * */ - public void refreshTopXCreator(boolean isEditing){ - designer.refreshTopXCreator(isEditing); - } - - /** - * 刷新顶层组件 - * */ - public void refreshTopXCreator(){ - refreshTopXCreator(false); - } - } From b0cb486d8cbdb3e2157af082814eefc89eb8aa5f Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 24 Sep 2020 15:46:18 +0800 Subject: [PATCH 47/64] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=B8=8BToolK?= =?UTF-8?q?it=E7=9A=84=E5=AF=BC=E5=8C=85=E9=97=AE=E9=A2=98=E5=92=8CHistory?= =?UTF-8?q?TemplateListPane=E7=9A=84=E8=BF=87=E6=97=B6=E6=96=B9=E6=B3=95?= =?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/quickeditor/CellQuickEditor.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java index d24193dae..6c177d133 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java @@ -3,11 +3,12 @@ package com.fr.quickeditor; import com.fr.base.GraphHelper; import com.fr.design.actions.UpdateAction; import com.fr.design.actions.core.ActionFactory; -import com.fr.design.file.HistoryTemplateListPane; +import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.iscrollbar.UIScrollBar; import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.CellElementPropertyPane; @@ -48,7 +49,7 @@ import java.util.ArrayList; */ public abstract class CellQuickEditor extends QuickEditor { - protected static final Dimension LABEL_DIMENSION = new Dimension(GraphHelper.getWidth(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element")), 20); + protected static final Dimension LABEL_DIMENSION = new Dimension(GraphHelper.getWidth(Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element")), 20); protected static final int VGAP = 10, HGAP = 8, VGAP_INNER = 3; /** @@ -165,7 +166,7 @@ public abstract class CellQuickEditor extends QuickEditor { columnRowTextField.setText(columnRow.toString()); cellElement = tc.getEditingElementCase().getTemplateCellElement(cs.getColumn(), cs.getRow()); - JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); + JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); if (jTemplate != null) { comboBox.removeActionListener(comboBoxActionListener); comboBox.removeAllItems(); @@ -208,10 +209,10 @@ public abstract class CellQuickEditor extends QuickEditor { private JPanel initTopContent() { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; - double[] columnSize = {GraphHelper.getWidth(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element")), f}; + double[] columnSize = {GraphHelper.getWidth(Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element")), f}; double[] rowSize = {p, p}; - UILabel cellLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cell")); - UILabel insertContentLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element")); + UILabel cellLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Cell")); + UILabel insertContentLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element")); initCellElementEditComboBox(); Component[][] components = new Component[][]{ new Component[]{cellLabel, columnRowTextField = initColumnRowTextField()}, @@ -263,7 +264,7 @@ public abstract class CellQuickEditor extends QuickEditor { * 初始化添加按钮 */ private void initCellElementEditComboBox() { - JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); + JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); if (jTemplate == null) { comboBox = new UIComboBox(); return; @@ -304,8 +305,8 @@ public abstract class CellQuickEditor extends QuickEditor { ColumnRow columnRowEdit = ColumnRow.valueOf(columnRowTextField.getText()); // barry:检查输入是否正确 if (!ColumnRow.validate(columnRowEdit)) { - Object[] options = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_OK")}; - JOptionPane.showOptionDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Please_Input_Letters+Numbers(A1,AA1,A11....)"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Warning"), + Object[] options = {Toolkit.i18nText("Fine-Design_Report_OK")}; + JOptionPane.showOptionDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Please_Input_Letters+Numbers(A1,AA1,A11....)"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Warning"), JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE, null, options, options[0]); // 重新选中当前的selection,把columnRowTextField tc.setSelection(tc.getSelection()); From e1011109d10d8cc9b6241353f27fd2970ee3d0cc Mon Sep 17 00:00:00 2001 From: vito Date: Thu, 24 Sep 2020 16:44:24 +0800 Subject: [PATCH 48/64] =?UTF-8?q?REPORT-38537=20=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/constants/UIConstants.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/constants/UIConstants.java b/designer-base/src/main/java/com/fr/design/constants/UIConstants.java index 15a7c87c0..93dc57a8f 100644 --- a/designer-base/src/main/java/com/fr/design/constants/UIConstants.java +++ b/designer-base/src/main/java/com/fr/design/constants/UIConstants.java @@ -37,7 +37,7 @@ public interface UIConstants { public static final Image APPFIT_H3 = IOUtils.readImage("/com/fr/design/images/dialog/appfit/H3.png"); public static final Image APPFIT_H4 = IOUtils.readImage("/com/fr/design/images/dialog/appfit/H4.png"); - public static final Border CELL_ATTR_ZEROBORDER = BorderFactory.createEmptyBorder(0, 0, 0, 0); + public static final Border CELL_ATTR_ZEROBORDER = BorderFactory.createEmptyBorder(0, 1, 0, 0); public static final Border CELL_ATTR_EMPTYBORDER = BorderFactory.createEmptyBorder(0, 10, 0, 0); public static final Border CELL_ATTR_PRESENTBORDER = BorderFactory.createEmptyBorder(0, 5, 0, 0); public static final Border CELL_ATTR_NORMALBORDER = BorderFactory.createEmptyBorder(0, 10, 0, 15); From 5e4ad9b890d2211a35bb6ef3957658f33446ce0b Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 24 Sep 2020 17:10:51 +0800 Subject: [PATCH 49/64] =?UTF-8?q?REPORT-40613=20=E3=80=90=E4=BA=8C?= =?UTF-8?q?=E8=BD=AE=E5=9B=9E=E5=BD=92=E3=80=91=E6=95=B0=E6=8D=AE=E5=88=97?= =?UTF-8?q?=E5=8F=B3=E4=BE=A7=E5=B1=9E=E6=80=A7=E9=9D=A2=E6=9D=BF=E7=9A=84?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E6=9D=A1=E4=BB=B6=E7=BC=96=E8=BE=91=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E8=BE=83=E9=95=BF=20=E3=80=90=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=E3=80=91=E7=BC=96=E8=BE=91=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E6=AF=94=E8=BE=83=E9=95=BF=E6=98=AF=E5=9B=A0=E4=B8=BA=E5=89=8D?= =?UTF-8?q?=E9=9D=A2=E7=9A=84=E8=BF=87=E6=BB=A4=E6=9D=A1=E4=BB=B6=E8=BF=99?= =?UTF-8?q?=E4=B8=AALabel=E7=9A=84=E5=AE=BD=E5=BA=A6=E6=98=AFTableLayout.P?= =?UTF-8?q?REFERRED=EF=BC=8C=E8=80=8C=E4=B8=8A=E9=9D=A2=E9=82=A3=E4=BA=9BL?= =?UTF-8?q?abel=E7=9A=84=E5=AE=BD=E5=BA=A6=E6=98=AF=E5=AE=9A=E5=80=BC60?= =?UTF-8?q?=EF=BC=8C=E6=89=80=E4=BB=A5=E6=98=BE=E7=A4=BA=E8=B5=B7=E6=9D=A5?= =?UTF-8?q?=E5=8F=B3=E8=BE=B9=E7=9A=84=E7=BC=96=E8=BE=91=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E5=AE=BD=E5=BA=A6=E6=B2=A1=E6=9C=89=E4=B8=8E=E4=B8=8A=E9=9D=A2?= =?UTF-8?q?=E7=9A=84=E4=BF=9D=E6=8C=81=E4=B8=80=E8=87=B4=20=E3=80=90?= =?UTF-8?q?=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E5=B0=86=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E6=8C=89=E9=92=AE=E5=B7=A6=E4=BE=A7=E7=9A=84=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E6=9D=A1=E4=BB=B6Label=E7=9A=84=E5=AE=BD=E5=BA=A6?= =?UTF-8?q?=E4=B9=9F=E4=BF=AE=E6=94=B9=E4=B8=BA=E5=AE=9A=E5=80=BC60?= =?UTF-8?q?=EF=BC=8C=E5=8F=A6=E5=A4=96=E4=BF=AE=E6=94=B9=E4=BA=86=E4=B8=80?= =?UTF-8?q?=E4=BA=9BToolKit=E7=9A=84=E5=AF=BC=E5=8C=85=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cellquick/CellDSColumnEditor.java | 53 ++++++++++--------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java index fb80e8891..cfc0e9adb 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java @@ -22,6 +22,7 @@ import com.fr.design.gui.ilable.MultilineLabel; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -251,15 +252,15 @@ public class CellDSColumnEditor extends CellQuickEditor { dataPane.setListener(dataListener); groupPane.setListener(groupListener); - double[] rowSize = {P}, columnSize = {P, F}; - UILabel uiLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Filter_Conditions")); + double[] rowSize = {P}, columnSize = {60, F}; + UILabel uiLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Report_Filter_Conditions")); condition = new DSColumnConditionAction(); if (tc != null) { condition.setEditingComponent(tc); } //丢掉icon,修改按钮名称为编辑 condition.setSmallIcon(null); - condition.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit")); + condition.setName(Toolkit.i18nText("Fine-Design_Basic_Edit")); conditionUIButton = new UIButton(condition); Component[][] components = new Component[][]{ new Component[]{uiLabel, UIComponentUtils.wrapWithBorderLayoutPane(conditionUIButton)} @@ -273,12 +274,12 @@ public class CellDSColumnEditor extends CellQuickEditor { @Override public String getIconPath() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Basic"); + return Toolkit.i18nText("Fine-Design_Report_Basic"); } @Override public String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Basic"); + return Toolkit.i18nText("FR-Designer_Basic"); } @@ -441,12 +442,12 @@ public class CellDSColumnEditor extends CellQuickEditor { @Override public String getIconPath() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"); + return Toolkit.i18nText("Fine-Design_Report_Advanced"); } @Override public String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"); + return Toolkit.i18nText("Fine-Design_Report_Advanced"); } @@ -570,19 +571,19 @@ public class CellDSColumnEditor extends CellQuickEditor { //可扩展性 JPanel extendableDirectionPane = FRGUIPaneFactory.createYBoxEmptyBorderPane(); - extendableDirectionPane.add(heCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Horizontal_Extendable"))); - extendableDirectionPane.add(veCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Vertical_Extendable"))); + extendableDirectionPane.add(heCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_ExpandD_Horizontal_Extendable"))); + extendableDirectionPane.add(veCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_ExpandD_Vertical_Extendable"))); //补充空白数据 JPanel multiNumPane = FRGUIPaneFactory.createYBoxEmptyBorderPane(); - useMultiNumCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Fill_Blank_Data")); + useMultiNumCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Fill_Blank_Data")); JPanel checkBoxPane = new JPanel(new BorderLayout()); checkBoxPane.add(useMultiNumCheckBox, BorderLayout.WEST); multiNumPane.add(checkBoxPane); multiNumSpinner = new UISpinner(1, 10000, 1, 1); //数据倍数 - UILabel multipleLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column_Multiple")); + UILabel multipleLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Column_Multiple")); multiPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ new Component[]{ multipleLabel, multiNumSpinner @@ -659,17 +660,17 @@ public class CellDSColumnEditor extends CellQuickEditor { IOUtils.readIcon("/com/fr/design/images/expand/asc.png"), IOUtils.readIcon("/com/fr/design/images/expand/des.png") }; - String[] nameArray = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Sort_Original"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Sort_Ascending"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Sort_Descending")}; + String[] nameArray = {Toolkit.i18nText("Fine-Design_Report_Sort_Original"), Toolkit.i18nText("Fine-Design_Report_Sort_Ascending"), Toolkit.i18nText("Fine-Design_Report_Sort_Descending")}; sortTypePane = new UIButtonGroup(iconArray); sortTypePane.setAllToolTips(nameArray); - sortTypePane.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ExpandD_Sort_After_Expand")); + sortTypePane.setGlobalName(Toolkit.i18nText("Fine-Design_Basic_ExpandD_Sort_After_Expand")); cardLayout = new CardLayout(); centerPane = new JPanel(cardLayout); formulaField = new JFormulaField(DEFAULT_VALUE); centerPane.add(new JPanel(), "none"); centerPane.add(formulaField, "content"); - UILabel sortLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Sort_Sort_Order")); + UILabel sortLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Sort_Sort_Order")); sortLabel.setPreferredSize(LABEL_DIMENSION); sortTypePane.addChangeListener(new ChangeListener() { @Override @@ -849,15 +850,15 @@ public class CellDSColumnEditor extends CellQuickEditor { public ResultSetFilterConfigPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - UILabel filterLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_Results_Filter")); + UILabel filterLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Bind_Column_Results_Filter")); //结果集筛选下拉框 rsComboBox = new UIComboBox(new String[]{ - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Undefined"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_Top_N"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_Bottom_N"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Odd"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Even"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Specify") + Toolkit.i18nText("Fine-Design_Report_Undefined"), + Toolkit.i18nText("Fine-Design_Report_Bind_Column_Top_N"), + Toolkit.i18nText("Fine-Design_Report_Bind_Column_Bottom_N"), + Toolkit.i18nText("Fine-Design_Report_Odd"), + Toolkit.i18nText("Fine-Design_Report_Even"), + Toolkit.i18nText("Fine-Design_Report_Specify") }); rsComboBox.addActionListener(actionListener); //配置展示CardLayout @@ -881,20 +882,20 @@ public class CellDSColumnEditor extends CellQuickEditor { //奇数 UILabel 占一行作为提示信息 setCardPane.add(new JPanel(), ODD.name()); - MultilineLabel oddTip = new MultilineLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_DS_Filter_Odd_Tip")); + MultilineLabel oddTip = new MultilineLabel(Toolkit.i18nText("Fine-Design_Report_DS_Filter_Odd_Tip")); oddTip.setForeground(TIP_FONT_COLOR); tipCardPane.add(oddTip, ODD.name()); //偶数 UILabel 占一行作为提示信息 setCardPane.add(new JPanel(), EVEN.name()); - MultilineLabel evenTip = new MultilineLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_DS_Filter_Even_Tip")); + MultilineLabel evenTip = new MultilineLabel(Toolkit.i18nText("Fine-Design_Report_DS_Filter_Even_Tip")); evenTip.setForeground(TIP_FONT_COLOR); tipCardPane.add(evenTip, EVEN.name()); //输入框占用右半边,提示信息占一行 serialTextField = new UITextField(16); setCardPane.add(serialTextField, SPECIFY.name()); - MultilineLabel specifyTip = new MultilineLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_DS_Filter_Specify_Tip")); + MultilineLabel specifyTip = new MultilineLabel(Toolkit.i18nText("Fine-Design_Report_DS_Filter_Specify_Tip")); specifyTip.setForeground(TIP_FONT_COLOR); tipCardPane.add(specifyTip, SPECIFY.name()); contentPane = TableLayoutHelper.createDiffVGapTableLayoutPane(new Component[][]{ @@ -1072,7 +1073,7 @@ public class CellDSColumnEditor extends CellQuickEditor { textFieldPane.add(formulaTextField, BorderLayout.CENTER); textFieldPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5)); UIButton formulaButton = new UIButton(IOUtils.readIcon("/com/fr/design/images/m_insert/formula.png")); - formulaButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Formula") + "..."); + formulaButton.setToolTipText(Toolkit.i18nText("Fine-Design_Report_Formula") + "..."); formulaButton.setPreferredSize(new Dimension(20, formulaTextField.getPreferredSize().height)); formulaButton.addActionListener(formulaButtonActionListener); @@ -1157,7 +1158,7 @@ public class CellDSColumnEditor extends CellQuickEditor { public CustomValuePane() { this.setLayout(new BorderLayout()); - UILabel customValueLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Display_Value")); + UILabel customValueLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Display_Value")); customValueLabel.setPreferredSize(LABEL_DIMENSION); formulaField = new JFormulaField(DEFAULT_VALUE); this.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ From 1c9ead2a778f0149076c8cce25dd8bbc74b7dad5 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Thu, 24 Sep 2020 17:17:36 +0800 Subject: [PATCH 50/64] =?UTF-8?q?CHART-15947=20=E4=BF=AE=E6=94=B9=E5=AF=8C?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E7=BC=96=E8=BE=91=E5=99=A8=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/editor/script/editor.js | 14 ++++++++++++++ .../script/insertcombo/combo.insert_param.model.js | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js index 216243069..d0e49dd5f 100644 --- a/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js @@ -107,6 +107,16 @@ _cleanHtml: function (value) { var editorService = BI.Services.getService("bi.service.design.chart.common.editor"); + var dimensionIds = this.options.dimensionIds; + var dataIdMap = {}; + + for (var i = 0, len = dimensionIds.length; i < len; i++) { + var dimensionId = dimensionIds[i]; + var key = BI.keys(dimensionId)[0]; + + dataIdMap[key] = dimensionId[key]; + } + var result = BI.replaceAll(value, "

", ""); // 去掉image的src属性,因为数据太大了 result = value.replaceAll("", function (imageStr) { @@ -117,6 +127,10 @@ return; } str += " " + key + "=\"" + value + "\""; + + if (key === "alt" && dataIdMap[value]) { + str += " " + "data-id" + "=\"" + dataIdMap[value] + "\""; + } }); return str + " />"; diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/insertcombo/combo.insert_param.model.js b/designer-chart/src/main/resources/com/fr/design/editor/script/insertcombo/combo.insert_param.model.js index d0a8f084e..10db72cd0 100644 --- a/designer-chart/src/main/resources/com/fr/design/editor/script/insertcombo/combo.insert_param.model.js +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/insertcombo/combo.insert_param.model.js @@ -21,7 +21,7 @@ return { type: "bi.design.chart.common.editor.search", text: key, - value: dId[key] + value: key }; }); } From 1957dabe8ec4a9370c468e28f15aed0afb5cf5f8 Mon Sep 17 00:00:00 2001 From: pengda Date: Thu, 24 Sep 2020 18:27:38 +0800 Subject: [PATCH 51/64] =?UTF-8?q?REPORT-40147=20=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E5=8F=8C=E5=87=BBtab=E6=A0=87=E7=AD=BE=E4=BC=9A=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E4=B8=8D=E5=BA=94=E8=AF=A5=E6=9C=89=E7=9A=84=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/designer/beans/models/SelectionModel.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java index b3215ede1..0f673e30a 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java @@ -15,6 +15,7 @@ import com.fr.design.designer.creator.XWAbsoluteBodyLayout; import com.fr.design.designer.creator.XWAbsoluteLayout; import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.designer.creator.XWParameterLayout; +import com.fr.design.designer.creator.cardlayout.XCardSwitchButton; import com.fr.design.designer.creator.cardlayout.XWCardLayout; import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout; import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; @@ -111,7 +112,7 @@ public class SelectionModel { if (comp != designer.getRootComponent() && comp != designer.getParaComponent()) { XCreator parentContainer = (XCreator) comp.getParent(); if (parentContainer != null) { - comp = parentContainer.isDedicateContainer() ? parentContainer : comp; + comp = parentContainer.isDedicateContainer() || comp instanceof XCardSwitchButton ? parentContainer : comp; } } if (selection.removeSelectedCreator(comp) || selection.addSelectedCreator(comp)) { From cc2fa9218f2e7d57efc68bed04be779729b19b35 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 24 Sep 2020 20:47:32 +0800 Subject: [PATCH 52/64] =?UTF-8?q?REPORT-34955=20linux=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E9=80=89=E4=B8=AD=E6=9F=90=E4=B8=AA=E5=AD=97=E4=BD=93?= =?UTF-8?q?=E5=90=8E=20=E5=88=87=E6=8D=A2=E5=8D=95=E5=85=83=E6=A0=BC?= =?UTF-8?q?=E5=90=8E=E5=AD=97=E4=BD=93=E6=9C=AA=E9=87=8D=E6=96=B0=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E6=9C=AA=E9=BB=98=E8=AE=A4=E5=AD=97=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/cell/style/ReportFontNameAction.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/actions/cell/style/ReportFontNameAction.java b/designer-realize/src/main/java/com/fr/design/actions/cell/style/ReportFontNameAction.java index 1acf4a404..5023e6f4f 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/cell/style/ReportFontNameAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/cell/style/ReportFontNameAction.java @@ -3,6 +3,7 @@ */ package com.fr.design.actions.cell.style; +import com.fr.stable.os.OperatingSystem; import java.awt.Dimension; import javax.swing.ComboBoxModel; @@ -49,6 +50,7 @@ public class ReportFontNameAction extends AbstractStyleAction { public void setFontName(String fontName) { Object object = this.getValue(UIComboBox.class.getName()); + boolean find = false; if (object != null && object instanceof UIComboBox) { UIComboBox comboBox = (UIComboBox) object; ComboBoxModel comboBoxModel = comboBox.getModel(); @@ -60,9 +62,17 @@ public class ReportFontNameAction extends AbstractStyleAction { comboBox.removeActionListener(this); comboBox.setSelectedIndex(i); comboBox.addActionListener(this); + find = true; break; } } + // linux设计器下面 找不到默认就是第一个字体 + boolean access = OperatingSystem.isLinux() && !find && comboBoxModel.getSize() > 0; + if (access) { + comboBox.removeActionListener(this); + comboBox.setSelectedIndex(0); + comboBox.addActionListener(this); + } } } From cc2e281c11466372c12e570ff73ba0943cc69f6c Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 18 Sep 2020 17:59:49 +0800 Subject: [PATCH 53/64] =?UTF-8?q?MOBILE-29339=20=E4=B8=A4=E4=B8=AA?= =?UTF-8?q?=E6=A8=AA=E5=90=91=E5=B8=83=E5=B1=80=E5=9D=97=E4=B8=AD=E9=97=B4?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E6=8F=92=E5=85=A5=E6=96=B0=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../adapters/layout/FRFitLayoutAdapter.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java index dfb4d9409..24c3a19db 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java @@ -3,6 +3,7 @@ */ package com.fr.design.designer.beans.adapters.layout; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.beans.GroupModel; import com.fr.design.designer.beans.ConstraintsGroupModel; import com.fr.design.designer.beans.HoverPainter; @@ -18,6 +19,7 @@ import com.fr.design.designer.creator.cardlayout.XWCardTitleLayout; import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; import com.fr.design.designer.properties.FRFitLayoutConstraints; import com.fr.design.designer.properties.FRFitLayoutPropertiesGroupModel; +import com.fr.design.fun.FormWidgetOptionProvider; import com.fr.design.utils.ComponentUtils; import com.fr.form.ui.LayoutBorderStyle; import com.fr.form.ui.container.WAbsoluteLayout; @@ -32,6 +34,7 @@ import java.awt.Dimension; import java.awt.Rectangle; import java.util.ArrayList; import java.util.List; +import java.util.Set; /** * 自适应布局的容器适配器 @@ -161,7 +164,8 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { //布局控件要先判断是不是可编辑 XLayoutContainer topLayout = XCreatorUtils.getHotspotContainer((XCreator) comp).getTopLayout(); - if (topLayout != null && !isMatchEdge && !topLayout.isEditable() && !topLayout.acceptType(XWAbsoluteLayout.class)) { + boolean access = topLayout != null && !isMatchEdge && !topLayout.isEditable() && !topLayout.acceptType(XWAbsoluteLayout.class) && !isExtraContainer(comp); + if (access) { return false; } @@ -178,6 +182,18 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { return y > upHeight && y < downHeight ? horizonValid : verticalValid; } + private boolean isExtraContainer(Component comp) { + if (container != null) { + Set set = ExtraDesignClassManager.getInstance().getArray(FormWidgetOptionProvider.XML_TAG); + for (FormWidgetOptionProvider provider : set) { + if (provider.isContainer() && ComparatorUtils.equals(provider.appearanceForWidget(), comp.getClass())) { + return true; + } + } + } + return false; + } + // 间隔区域 private boolean checkInterval(Component comp) { return container.getComponentCount() > 0 && comp == container; From 163c5a1a2d03803bd35ac2222adeb6e8f5d83271 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 25 Sep 2020 11:27:26 +0800 Subject: [PATCH 54/64] =?UTF-8?q?REPORT-40259=E3=80=90=E5=9B=9E=E5=BD=92?= =?UTF-8?q?=E3=80=91Tomcat=20=E4=B8=8B=E9=80=9A=E8=BF=87=20IP=20=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E8=AE=BF=E9=97=AE=E6=95=B0=E6=8D=AE=E5=86=B3=E7=AD=96?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=EF=BC=8C=E5=88=87=E6=8D=A2=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E4=B9=8B=E5=90=8E=E9=85=8D=E7=BD=AE=E9=A1=B5=E9=9D=A2url?= =?UTF-8?q?=E5=8F=98=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/env/RemoteEnvPane.java | 34 ------------------- 1 file changed, 34 deletions(-) diff --git a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java index 54cfddc8d..515ce3690 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java +++ b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java @@ -1,7 +1,5 @@ package com.fr.env; -import com.fr.base.FRContext; -import com.fr.base.ServerConfig; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; import com.fr.design.beans.BasicBeanPane; @@ -444,38 +442,6 @@ public class RemoteEnvPane extends BasicBeanPane { new double[]{FILL} )); - setDefaultAppAndServlet(); - } - - /** - * 设置 app 和 servlet 默认值 - */ - private void setDefaultAppAndServlet() { - setWrap(webAppNameInput, () -> FRContext.getCommonOperator().getAppName(), RemoteWorkspaceURL.DEFAULT_WEB_APP_NAME); - setWrap(servletNameInput, () -> ServerConfig.getInstance().getServletName(), RemoteWorkspaceURL.DEFAULT_SERVLET_NAME); - } - - private void setWrap(final UITextField textField, final Supplier supplier, final String defaultName) { - new SwingWorker() { - - @Override - protected String doInBackground() throws Exception { - return supplier.get(); - } - - @Override - protected void done() { - String name = defaultName; - try { - name = get(); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage() , e); - } - if (StringUtils.isEmpty(textField.getText())) { - textField.setText(name); - } - } - }.execute(); } From a1b92c6eb83cf3134ec50a6a23f9e2c80ea87ddd Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 25 Sep 2020 11:50:22 +0800 Subject: [PATCH 55/64] =?UTF-8?q?REPORT-40495=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF-=E5=A4=9Asheet-windows=E4=B8=8B=E9=9F=A9?= =?UTF-8?q?=E6=96=87=E5=90=8D=E7=A7=B0=E7=9A=84sheet=E4=B8=8D=E8=A2=AB?= =?UTF-8?q?=E9=80=89=E4=B8=AD=E6=97=B6=E4=B8=8D=E6=98=BE=E7=A4=BA=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0?= =?UTF-8?q?=E3=80=91=E4=B9=8B=E5=89=8D=E7=94=A8=E7=9A=84Graphics2D?= =?UTF-8?q?=E7=9A=84drawString=E6=96=B9=E6=B3=95=EF=BC=8C=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E7=94=BB=E5=87=BA=E9=9F=A9=E6=96=87=E7=9A=84sheetName?= =?UTF-8?q?=EF=BC=8Cdebug=E5=8F=91=E7=8E=B0=E8=B5=B0=E5=88=B0=E9=87=8C?= =?UTF-8?q?=E9=9D=A2=EF=BC=8CfontInfo=E4=B8=AD=E7=9A=84font=3Dnull?= =?UTF-8?q?=EF=BC=8C=E8=80=8CGraphHelper=E7=9A=84drawString=E6=96=B9?= =?UTF-8?q?=E6=B3=95=EF=BC=8C=E8=BF=99=E4=B8=AA=E6=96=B9=E6=B3=95debug?= =?UTF-8?q?=E8=B5=B0=E5=88=B0=E9=87=8C=E9=9D=A2=E5=8F=91=E7=8E=B0font?= =?UTF-8?q?=E4=B8=80=E7=9B=B4=E6=98=AF=E6=AD=A3=E5=B8=B8=E7=9A=84=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E4=B8=94=E4=B8=A4=E4=B8=AA=E6=96=B9=E6=B3=95=E9=87=8C?= =?UTF-8?q?=E9=9D=A2=E7=9A=84Graphics2D=E4=B9=9F=E9=83=BD=E6=98=AFSunGraph?= =?UTF-8?q?ics2D=EF=BC=8C=E5=B0=B1=E5=BE=88=E5=A5=87=E6=80=AA=EF=BC=8C?= =?UTF-8?q?=E6=B2=A1=E6=90=9E=E6=87=82=E4=B8=BA=E5=95=A5=20=E3=80=90?= =?UTF-8?q?=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E5=B0=86=E8=B0=83?= =?UTF-8?q?=E7=94=A8Graphics2D=E7=9A=84drawString=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E4=B8=BA=E8=B0=83=E7=94=A8GraphHelper?= =?UTF-8?q?=E7=9A=84drawString=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/SheetNameTabPane.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java index 52f1fe1f0..0c7c359f0 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java @@ -134,7 +134,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse * 编辑的对象实例 */ private ReportComponentComposite reportComposite; - + private int selectedIndex = -1; private JPanel buttonPane; @@ -332,7 +332,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse leftButton.setEnabled(buttonEnabled); rightButton.setEnabled(buttonEnabled); } - + /** * 抽出来方便OEM * @return @@ -417,10 +417,10 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse // 画两个添加sheet图标 iconLocation = isOvertakeWidth ? (int) (maxWidth) : addIconlocation + GRAP; - + paintAddButton(g2d); } - + protected void paintAddButton(Graphics2D g2d){ getAddWorkSheet().paintIcon(this, g2d, iconLocation, 3); ADD_POLY_SHEET.paintIcon(this, g2d, iconLocation + getAddWorkSheet().getIconWidth() + ICON_SEP_DISTANCE, 3); @@ -496,7 +496,8 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse sheetIcon.paintIcon(this, g2d, (int) textX + charWidth, 2); g2d.setPaint(getForeground()); - g2d.drawString(sheetName, (int) textX + charWidth + 14, textAscent); + // REPORT-40495 之前的g2d.drawString()无法画出韩文sheetName,修改成GraphHelper的drawString + GraphHelper.drawString(g2d, sheetName, (int) textX + charWidth + 14, textAscent); } /** @@ -626,7 +627,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse processRightMouseButton(evtX, evtY); } } - + private void processRightMouseButton(int evtX, int evtY){ MenuDef def = new MenuDef(); addInsertGridShortCut(def); @@ -636,14 +637,14 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse def.updateMenu(); GUICoreUtils.showPopupMenu(tabPop, this, evtX - 1, evtY - 1); } - + private void processLeftMouseButton(int evtX){ if (evtX > iconLocation && evtX < iconLocation + GRID_TOSHEET_RIGHT) { firstInsertActionPerformed(); } else if (evtX > iconLocation + POLY_TOSHEET_LEFT && evtX < iconLocation + POLY_TOSHEET_RIGHT) { new PolyReportInsertAction().actionPerformed(null); } - + } protected void addInsertGridShortCut(MenuDef def){ @@ -847,7 +848,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse } protected class GridReportInsertAction extends SheetInsertAction { - + @Override protected TemplateReport newTemplateReport() { return new WorkSheet(); From b6085f1a3e24e28e4c11bb759c04abdab8f16c89 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 25 Sep 2020 12:28:27 +0800 Subject: [PATCH 56/64] =?UTF-8?q?REPORT-38557=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E3=80=90JDK11=E3=80=91=E6=B7=BB=E5=8A=A0=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E7=9A=84=E9=9D=A2=E6=9D=BF=E9=87=8C=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E6=A1=86=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/web/CustomIconPane.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/web/CustomIconPane.java b/designer-base/src/main/java/com/fr/design/web/CustomIconPane.java index 12c72c5cd..54f1755b9 100644 --- a/designer-base/src/main/java/com/fr/design/web/CustomIconPane.java +++ b/designer-base/src/main/java/com/fr/design/web/CustomIconPane.java @@ -4,6 +4,7 @@ import com.fr.base.BaseUtils; import com.fr.base.GraphHelper; import com.fr.base.Icon; import com.fr.base.IconManager; +import com.fr.design.designer.IntervalConstants; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.FineJOptionPane; @@ -401,9 +402,9 @@ public class CustomIconPane extends BasicPane { private void init() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); double p = TableLayout.PREFERRED; - double rowSize[] = {p, p}; - double columnSize[] = {p, p, p}; - + double[] rowSize = {p, p}; + double[] columnSize = {p, p}; + int[][] rowCount = {{1, 1}, {1, 1}}; UIButton browseButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom_Icon_SelectIcon")); browseButton.setPreferredSize(new Dimension(80, 25)); browseButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Click_this_button")); @@ -442,7 +443,7 @@ public class CustomIconPane extends BasicPane { imagePane.add(browseButton); Component[][] components = {{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name") + ":"), nameTextField}, {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Icon") + ":"), imagePane}}; - JPanel centerPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + JPanel centerPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W0, IntervalConstants.INTERVAL_L1); this.add(centerPane, BorderLayout.CENTER); } From 2cb92e14d1fa0564fe262200b08d3997adbbe4a2 Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 25 Sep 2020 14:28:18 +0800 Subject: [PATCH 57/64] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=EF=BC=8C=E6=98=8E=E7=A1=AEbug=E5=8E=9F=E5=9B=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/SheetNameTabPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java index 0c7c359f0..ead1cf2f1 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java @@ -496,7 +496,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse sheetIcon.paintIcon(this, g2d, (int) textX + charWidth, 2); g2d.setPaint(getForeground()); - // REPORT-40495 之前的g2d.drawString()无法画出韩文sheetName,修改成GraphHelper的drawString + // REPORT-40495 之前的g2d.drawString(),在windows下默认宋体时,无法绘制韩文字符,而GraphHelper的drawString中对韩文做了额外处理,可以绘制韩文字符 GraphHelper.drawString(g2d, sheetName, (int) textX + charWidth + 14, textAscent); } From 78473a8c3483c7c28bf165b165eaf1b3cb0c8337 Mon Sep 17 00:00:00 2001 From: Lanlan Date: Fri, 25 Sep 2020 16:17:42 +0800 Subject: [PATCH 58/64] =?UTF-8?q?REPORT-40496=20=E3=80=9010.0.10=E5=9B=9E?= =?UTF-8?q?=E5=BD=92=E3=80=91=E8=AE=BE=E8=AE=A1=E5=99=A8=E9=87=8C=E7=9A=84?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=8D=87=E7=BA=A7=E4=B8=8E=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E7=9A=84=E6=9B=B4=E6=96=B0=E5=8D=87=E7=BA=A7=E4=B8=8D=E4=B8=80?= =?UTF-8?q?=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/update/ui/dialog/UpdateMainDialog.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java b/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java index 3992be6a9..05608c62e 100644 --- a/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java +++ b/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java @@ -544,7 +544,7 @@ public class UpdateMainDialog extends UIDialog { private void showDownLoadInfo() { //形如 Build#release-2018.07.31.03.03.52.80 String buildNO = downloadFileConfig.optString("buildNO"); - Date jarDate = (new SimpleDateFormat("yyyy.MM.dd")).parse(buildNO, new ParsePosition(buildNO.indexOf("-") + 1)); + Date jarDate = (new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss")).parse(buildNO, new ParsePosition(buildNO.indexOf("-") + 1)); String serverVersionNO = downloadFileConfig.optString("versionNO"); String currentVersionNO = ProductConstants.RELEASE_VERSION; String[] serverVersionSplitStr = serverVersionNO.split("\\."); @@ -556,8 +556,8 @@ public class UpdateMainDialog extends UIDialog { //形如 Build#release-2018.07.31.03.03.52.80 String currentNO = GeneralUtils.readBuildNO(); if (!".".equals(StableUtils.getInstallHome())) { - Date currentDate = (new SimpleDateFormat("yyyy.MM.dd")).parse(currentNO, new ParsePosition(currentNO.indexOf("-") + 1)); - if (DateUtils.subtractDate(jarDate, currentDate, DateUtils.DAY) > 0) { + Date currentDate = (new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss")).parse(currentNO, new ParsePosition(currentNO.indexOf("-") + 1)); + if (DateUtils.subtractDate(jarDate, currentDate, DateUtils.SECOND) > 0) { updateButton.setEnabled(true); updateLabel.setVisible(true); loadingLabel.stopLoading(buildNO.contains("-") ? buildNO.substring(buildNO.lastIndexOf("-") + 1) : buildNO); From e324f2ea84d0ff8613adfebdb2ec4a1571bb46cd Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 25 Sep 2020 16:59:16 +0800 Subject: [PATCH 59/64] =?UTF-8?q?REPORT-40553=20=E5=86=B3=E7=AD=96?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8-=E8=BF=9E=E7=BB=AD=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E7=A9=BA=E7=99=BD=E8=AE=BE=E8=AE=A1=E9=9D=A2=E6=9D=BF=EF=BC=8C?= =?UTF-8?q?body=E6=B2=A1=E6=9C=89=E5=A4=84=E4=BA=8E=E6=9C=AA=E9=80=89?= =?UTF-8?q?=E4=B8=AD=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/EditingMouseListener.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java index 0e66964b4..f275fa312 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java @@ -166,7 +166,7 @@ public class EditingMouseListener extends MouseInputAdapter { // 获取焦点,以便获取热键 designer.requestFocus(); } - if (e.getButton() == MouseEvent.BUTTON1) { + if (e.getButton() == MouseEvent.BUTTON1 && e.getX() > 0 && e.getY() > 0) { Direction dir = selectionModel.getDirectionAt(e); if (!DesignerMode.isAuthorityEditing()) { @@ -177,13 +177,10 @@ public class EditingMouseListener extends MouseInputAdapter { if (designer.isDrawLineMode()) { designer.updateDrawLineMode(e); } else { - int relativeX = Math.max(0, e.getX()); - int relativeY = Math.max(0, e.getY()); - if (selectionModel.hasSelectionComponent() && selectionModel.getSelection().getRelativeBounds().contains( - designer.getHorizontalScaleValue() + relativeX, - designer.getVerticalScaleValue() + relativeY)) { + designer.getHorizontalScaleValue() + e.getX(), + designer.getVerticalScaleValue() + e.getY())) { lastPressEvent = e; lastXCreator = selectionModel.getSelection().getSelectedCreator(); } else { From 4eacb923fb87040cd3550ecab69911124569a3f1 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 25 Sep 2020 17:07:07 +0800 Subject: [PATCH 60/64] =?UTF-8?q?REPORT-40553=20=E5=86=B3=E7=AD=96?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8-=E8=BF=9E=E7=BB=AD=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E7=A9=BA=E7=99=BD=E8=AE=BE=E8=AE=A1=E9=9D=A2=E6=9D=BF=EF=BC=8C?= =?UTF-8?q?body=E6=B2=A1=E6=9C=89=E5=A4=84=E4=BA=8E=E6=9C=AA=E9=80=89?= =?UTF-8?q?=E4=B8=AD=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/EditingMouseListener.java | 47 ++++++++++++------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java index f482f7c97..f275fa312 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java @@ -166,7 +166,7 @@ public class EditingMouseListener extends MouseInputAdapter { // 获取焦点,以便获取热键 designer.requestFocus(); } - if (e.getButton() == MouseEvent.BUTTON1) { + if (e.getButton() == MouseEvent.BUTTON1 && e.getX() > 0 && e.getY() > 0) { Direction dir = selectionModel.getDirectionAt(e); if (!DesignerMode.isAuthorityEditing()) { @@ -177,13 +177,10 @@ public class EditingMouseListener extends MouseInputAdapter { if (designer.isDrawLineMode()) { designer.updateDrawLineMode(e); } else { - int relativeX = Math.max(0, e.getX()); - int relativeY = Math.max(0, e.getY()); - if (selectionModel.hasSelectionComponent() && selectionModel.getSelection().getRelativeBounds().contains( - designer.getHorizontalScaleValue() + relativeX, - designer.getVerticalScaleValue() + relativeY)) { + designer.getHorizontalScaleValue() + e.getX(), + designer.getVerticalScaleValue() + e.getY())) { lastPressEvent = e; lastXCreator = selectionModel.getSelection().getSelectedCreator(); } else { @@ -363,7 +360,7 @@ public class EditingMouseListener extends MouseInputAdapter { designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } // component.getParent() 是报表块所在的XWTitleLayout int minX = button.getX() + getParentPositionX(component, 0) - designer.getHorizontalScaleValue(); - int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue(); + int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue() + xElementCase.getY(); if (e.getX() + GAP - xElementCase.getInsets().left > minX && e.getX() - GAP - xElementCase.getInsets().left < minX + button.getWidth()) { if (e.getY() + GAP - xElementCase.getInsets().top > minY && e.getY() - GAP - xElementCase.getInsets().top < minY + button.getHeight()) { designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); @@ -405,16 +402,7 @@ public class EditingMouseListener extends MouseInputAdapter { } private void setCoverPaneNotDisplay(XCreator component, MouseEvent e, boolean isLinkedHelpDialog) { - if (xElementCase != null) { - int x = getParentPositionX(xElementCase, 0) - designer.getArea().getHorizontalValue(); - int y = getParentPositionY(xElementCase, 0) - designer.getArea().getVerticalValue(); - Rectangle rect = new Rectangle(x, y, xElementCase.getWidth(), xElementCase.getHeight()); - if (rect.contains(e.getPoint())) { - return; - } - xElementCase.displayCoverPane(false); - } if (xChartEditor != null) { xChartEditor.displayCoverPane(false); } @@ -425,6 +413,15 @@ public class EditingMouseListener extends MouseInputAdapter { if (xTopLayoutContainer != null) { xTopLayoutContainer.setMouseEnter(false); } + //不知道为什么要对XElementCase进行判断,但是直接return会有bug,所以把他放在最后 + if (xElementCase != null) { + int x = getParentPositionX(xElementCase, 0) - designer.getArea().getHorizontalValue(); + int y = getParentPositionY(xElementCase, 0) - designer.getArea().getVerticalValue(); + Rectangle rect = new Rectangle(x, y, xElementCase.getWidth(), xElementCase.getHeight()); + if (!rect.contains(e.getPoint())) { + xElementCase.displayCoverPane(false); + } + } designer.repaint(); } @@ -462,7 +459,7 @@ public class EditingMouseListener extends MouseInputAdapter { designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } int minX = button.getX() + getParentPositionX(component, 0) - designer.getHorizontalScaleValue(); - int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue(); + int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue() + xChartEditor.getY(); if (e.getX() + GAP > minX && e.getX() - GAP < minX + button.getWidth()) { if (e.getY() + GAP > minY && e.getY() - GAP < minY + button.getHeight()) { designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); @@ -700,6 +697,7 @@ public class EditingMouseListener extends MouseInputAdapter { currentXCreator.stopEditing(); currentXCreator = null; currentEditor = null; + refreshTopXCreator(); return true; } return true; @@ -727,4 +725,19 @@ public class EditingMouseListener extends MouseInputAdapter { } currentEditor.getEditorTarget().setBounds(bounds); } + + /** + * 刷新顶层组件 + * */ + public void refreshTopXCreator(boolean isEditing){ + designer.refreshTopXCreator(isEditing); + } + + /** + * 刷新顶层组件 + * */ + public void refreshTopXCreator(){ + refreshTopXCreator(false); + } + } From 367c8f23ea295d6fe653e221538be566662e4d42 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 25 Sep 2020 17:17:27 +0800 Subject: [PATCH 61/64] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/EditingMouseListener.java | 39 ++++++------------- 1 file changed, 12 insertions(+), 27 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java index f275fa312..2d9df7126 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java @@ -177,6 +177,7 @@ public class EditingMouseListener extends MouseInputAdapter { if (designer.isDrawLineMode()) { designer.updateDrawLineMode(e); } else { + if (selectionModel.hasSelectionComponent() && selectionModel.getSelection().getRelativeBounds().contains( designer.getHorizontalScaleValue() + e.getX(), @@ -360,7 +361,7 @@ public class EditingMouseListener extends MouseInputAdapter { designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } // component.getParent() 是报表块所在的XWTitleLayout int minX = button.getX() + getParentPositionX(component, 0) - designer.getHorizontalScaleValue(); - int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue() + xElementCase.getY(); + int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue(); if (e.getX() + GAP - xElementCase.getInsets().left > minX && e.getX() - GAP - xElementCase.getInsets().left < minX + button.getWidth()) { if (e.getY() + GAP - xElementCase.getInsets().top > minY && e.getY() - GAP - xElementCase.getInsets().top < minY + button.getHeight()) { designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); @@ -402,7 +403,16 @@ public class EditingMouseListener extends MouseInputAdapter { } private void setCoverPaneNotDisplay(XCreator component, MouseEvent e, boolean isLinkedHelpDialog) { + if (xElementCase != null) { + int x = getParentPositionX(xElementCase, 0) - designer.getArea().getHorizontalValue(); + int y = getParentPositionY(xElementCase, 0) - designer.getArea().getVerticalValue(); + Rectangle rect = new Rectangle(x, y, xElementCase.getWidth(), xElementCase.getHeight()); + if (rect.contains(e.getPoint())) { + return; + } + xElementCase.displayCoverPane(false); + } if (xChartEditor != null) { xChartEditor.displayCoverPane(false); } @@ -413,15 +423,6 @@ public class EditingMouseListener extends MouseInputAdapter { if (xTopLayoutContainer != null) { xTopLayoutContainer.setMouseEnter(false); } - //不知道为什么要对XElementCase进行判断,但是直接return会有bug,所以把他放在最后 - if (xElementCase != null) { - int x = getParentPositionX(xElementCase, 0) - designer.getArea().getHorizontalValue(); - int y = getParentPositionY(xElementCase, 0) - designer.getArea().getVerticalValue(); - Rectangle rect = new Rectangle(x, y, xElementCase.getWidth(), xElementCase.getHeight()); - if (!rect.contains(e.getPoint())) { - xElementCase.displayCoverPane(false); - } - } designer.repaint(); } @@ -459,7 +460,7 @@ public class EditingMouseListener extends MouseInputAdapter { designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } int minX = button.getX() + getParentPositionX(component, 0) - designer.getHorizontalScaleValue(); - int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue() + xChartEditor.getY(); + int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue(); if (e.getX() + GAP > minX && e.getX() - GAP < minX + button.getWidth()) { if (e.getY() + GAP > minY && e.getY() - GAP < minY + button.getHeight()) { designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); @@ -697,7 +698,6 @@ public class EditingMouseListener extends MouseInputAdapter { currentXCreator.stopEditing(); currentXCreator = null; currentEditor = null; - refreshTopXCreator(); return true; } return true; @@ -725,19 +725,4 @@ public class EditingMouseListener extends MouseInputAdapter { } currentEditor.getEditorTarget().setBounds(bounds); } - - /** - * 刷新顶层组件 - * */ - public void refreshTopXCreator(boolean isEditing){ - designer.refreshTopXCreator(isEditing); - } - - /** - * 刷新顶层组件 - * */ - public void refreshTopXCreator(){ - refreshTopXCreator(false); - } - } From 44273fdf06543a4cb2e3c17a3757eec9e3781868 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 25 Sep 2020 17:47:46 +0800 Subject: [PATCH 62/64] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/EditingMouseListener.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java index 2d9df7126..7d2ba0cc9 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java @@ -166,7 +166,7 @@ public class EditingMouseListener extends MouseInputAdapter { // 获取焦点,以便获取热键 designer.requestFocus(); } - if (e.getButton() == MouseEvent.BUTTON1 && e.getX() > 0 && e.getY() > 0) { + if (e.getButton() == MouseEvent.BUTTON1 && !beyondValidArea(e)) { Direction dir = selectionModel.getDirectionAt(e); if (!DesignerMode.isAuthorityEditing()) { @@ -195,6 +195,16 @@ public class EditingMouseListener extends MouseInputAdapter { e.translatePoint(oldX - e.getX(), oldY - e.getY()); } + private boolean beyondValidArea(MouseEvent e) { + if (e.getX() < 0 || e.getY() < 0 || + e.getX() > designer.getRootComponent().getWidth() || + e.getY() > (designer.getRootComponent().getHeight() + designer.getParaHeight())) { + return true; + } + return false; + } + + private void offsetEventPoint(MouseEvent e){ int x = designer.getRelativeX(e.getX()); int y = designer.getRelativeY(e.getY()); From ae699c5dd8b456b46cd7b7eb393fbf871fb398ec Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 25 Sep 2020 17:48:14 +0800 Subject: [PATCH 63/64] =?UTF-8?q?REPORT-40553=20=E5=86=B3=E7=AD=96?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8-=E8=BF=9E=E7=BB=AD=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E7=A9=BA=E7=99=BD=E8=AE=BE=E8=AE=A1=E9=9D=A2=E6=9D=BF=EF=BC=8C?= =?UTF-8?q?body=E6=B2=A1=E6=9C=89=E5=A4=84=E4=BA=8E=E6=9C=AA=E9=80=89?= =?UTF-8?q?=E4=B8=AD=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/EditingMouseListener.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java index f275fa312..e17959015 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java @@ -166,7 +166,7 @@ public class EditingMouseListener extends MouseInputAdapter { // 获取焦点,以便获取热键 designer.requestFocus(); } - if (e.getButton() == MouseEvent.BUTTON1 && e.getX() > 0 && e.getY() > 0) { + if (e.getButton() == MouseEvent.BUTTON1 && !beyondValidArea(e)) { Direction dir = selectionModel.getDirectionAt(e); if (!DesignerMode.isAuthorityEditing()) { @@ -194,6 +194,15 @@ public class EditingMouseListener extends MouseInputAdapter { e.translatePoint(oldX - e.getX(), oldY - e.getY()); } + private boolean beyondValidArea(MouseEvent e) { + if (e.getX() < 0 || e.getY() < 0 || + e.getX() > designer.getRootComponent().getWidth() || + e.getY() > (designer.getRootComponent().getHeight() + designer.getParaHeight())) { + return true; + } + return false; + } + private void offsetEventPoint(MouseEvent e){ int x = designer.getRelativeX(e.getX()); int y = designer.getRelativeY(e.getY()); From 3ffcc30a994c972701035e2bb13426d6b983b418 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 25 Sep 2020 18:11:01 +0800 Subject: [PATCH 64/64] =?UTF-8?q?REPORT-39769=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8-=E8=81=9A=E5=90=88=E6=8A=A5=E8=A1=A8-=E6=8F=92?= =?UTF-8?q?=E5=85=A5=E6=82=AC=E6=B5=AE=E5=85=83=E7=B4=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/poly/creator/ECBlockPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/poly/creator/ECBlockPane.java b/designer-realize/src/main/java/com/fr/poly/creator/ECBlockPane.java index 4940ede73..28b09fef7 100644 --- a/designer-realize/src/main/java/com/fr/poly/creator/ECBlockPane.java +++ b/designer-realize/src/main/java/com/fr/poly/creator/ECBlockPane.java @@ -135,7 +135,7 @@ public class ECBlockPane extends PolyElementCasePane { private void addInsertFloatMenuDef(MenuDef menuDef) { // 悬浮元素菜单 - MenuDef subMenuDef = new MenuDef(KeySetUtils.INSERT_FLOAT.getMenuKeySetName()); + MenuDef subMenuDef = new MenuDef(KeySetUtils.INSERT_FLOAT.getMenuName()); subMenuDef.setIconPath("/com/fr/design/images/m_insert/float.png"); menuDef.addShortCut(subMenuDef); UpdateAction[] actions = ActionFactory.createFloatInsertAction(ElementCasePane.class, this);