From 97517d0b073588207e3c7da4170a34c0ac86836a Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 4 Jan 2021 16:33:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E5=AF=8C=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VanChartMapRichTextFieldListPane.java | 41 +++++++++++++++++++ .../label/VanChartMapLabelContentPane.java | 32 ++++++++++----- .../VanChartMapTooltipContentPane.java | 31 +++++++++----- 3 files changed, 84 insertions(+), 20 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/style/VanChartMapRichTextFieldListPane.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/VanChartMapRichTextFieldListPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/VanChartMapRichTextFieldListPane.java new file mode 100644 index 000000000..91e1817ef --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/VanChartMapRichTextFieldListPane.java @@ -0,0 +1,41 @@ +package com.fr.van.chart.map.designer.style; + +import com.fr.design.i18n.Toolkit; +import com.fr.design.ui.ModernUIPane; +import com.fr.plugin.chart.base.format.AttrTooltipAreaNameFormat; +import com.fr.plugin.chart.base.format.AttrTooltipPercentFormat; +import com.fr.plugin.chart.base.format.AttrTooltipSeriesFormat; +import com.fr.plugin.chart.base.format.AttrTooltipValueFormat; +import com.fr.van.chart.designer.component.richText.VanChartFieldAttrPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldButton; +import com.fr.van.chart.designer.component.richText.VanChartFieldListPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldListener; +import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel; + +public class VanChartMapRichTextFieldListPane extends VanChartFieldListPane { + + public VanChartMapRichTextFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane richEditorPane) { + super(fieldAttrPane, richEditorPane); + } + + protected void initDefaultFieldButton() { + VanChartFieldListener fieldListener = getFieldListener(); + + VanChartFieldButton categoryNameButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Area_Name"), + new AttrTooltipAreaNameFormat(), false, fieldListener); + + VanChartFieldButton seriesNameButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Series_Name"), + new AttrTooltipSeriesFormat(), false, fieldListener); + + VanChartFieldButton valueButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Use_Value"), + new AttrTooltipValueFormat(), false, fieldListener); + + VanChartFieldButton percentButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Use_Percent"), + new AttrTooltipPercentFormat(), false, fieldListener); + + setCategoryNameButton(categoryNameButton); + setSeriesNameButton(seriesNameButton); + setValueButton(valueButton); + setPercentButton(percentButton); + } +} 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 084953c99..baec70ca9 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 @@ -1,18 +1,19 @@ package com.fr.van.chart.map.designer.style.label; +import com.fr.design.i18n.Toolkit; import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.base.format.AttrTooltipAreaNameFormat; +import com.fr.plugin.chart.base.format.AttrTooltipFormat; import com.fr.plugin.chart.base.format.AttrTooltipMapValueFormat; +import com.fr.plugin.chart.base.format.AttrTooltipPercentFormat; +import com.fr.plugin.chart.base.format.AttrTooltipSeriesFormat; +import com.fr.plugin.chart.base.format.AttrTooltipValueFormat; import com.fr.plugin.chart.type.TextAlign; 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; @@ -21,6 +22,7 @@ import javax.swing.JPanel; * Created by Mitisky on 16/5/20. */ public class VanChartMapLabelContentPane extends VanChartLabelContentPane { + public VanChartMapLabelContentPane(VanChartStylePane parent, JPanel showOnPane, boolean inCondition) { super(parent, showOnPane, inCondition); } @@ -33,12 +35,22 @@ public class VanChartMapLabelContentPane extends VanChartLabelContentPane { setPercentFormatPane(new PercentFormatPaneWithCheckBox(parent, showOnPane)); } - @Override - protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { - setRichTextCategoryNameFormatPane(new MapAreaNameFormatPaneWithoutCheckBox(parent, showOnPane)); - setRichTextSeriesNameFormatPane(new SeriesNameFormatPaneWithoutCheckBox(parent, showOnPane)); - setRichTextValueFormatPane(new ValueFormatPaneWithoutCheckBox(parent, showOnPane)); - setRichTextPercentFormatPane(new PercentFormatPaneWithoutCheckBox(parent, showOnPane)); + protected String[] getRichTextFieldNames() { + return new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Area_Name"), + Toolkit.i18nText("Fine-Design_Chart_Series_Name"), + Toolkit.i18nText("Fine-Design_Chart_Use_Value"), + Toolkit.i18nText("Fine-Design_Chart_Use_Percent") + }; + } + + protected AttrTooltipFormat[] getRichTextFieldFormats() { + return new AttrTooltipFormat[]{ + new AttrTooltipAreaNameFormat(), + new AttrTooltipSeriesFormat(), + new AttrTooltipValueFormat(), + new AttrTooltipPercentFormat() + }; } @Override 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 12948b14d..03f720bf7 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 @@ -1,17 +1,18 @@ package com.fr.van.chart.map.designer.style.tooltip; +import com.fr.design.i18n.Toolkit; import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.base.format.AttrTooltipAreaNameFormat; +import com.fr.plugin.chart.base.format.AttrTooltipFormat; import com.fr.plugin.chart.base.format.AttrTooltipMapValueFormat; +import com.fr.plugin.chart.base.format.AttrTooltipPercentFormat; +import com.fr.plugin.chart.base.format.AttrTooltipSeriesFormat; +import com.fr.plugin.chart.base.format.AttrTooltipValueFormat; 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; @@ -32,12 +33,22 @@ public class VanChartMapTooltipContentPane extends VanChartTooltipContentPane { setPercentFormatPane(new PercentFormatPaneWithCheckBox(parent, showOnPane)); } - @Override - protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { - setRichTextCategoryNameFormatPane(new MapAreaNameFormatPaneWithoutCheckBox(parent, showOnPane)); - setRichTextSeriesNameFormatPane(new SeriesNameFormatPaneWithoutCheckBox(parent, showOnPane)); - setRichTextValueFormatPane(new ValueFormatPaneWithoutCheckBox(parent, showOnPane)); - setRichTextPercentFormatPane(new PercentFormatPaneWithoutCheckBox(parent, showOnPane)); + protected String[] getRichTextFieldNames() { + return new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Area_Name"), + Toolkit.i18nText("Fine-Design_Chart_Series_Name"), + Toolkit.i18nText("Fine-Design_Chart_Use_Value"), + Toolkit.i18nText("Fine-Design_Chart_Use_Percent") + }; + } + + protected AttrTooltipFormat[] getRichTextFieldFormats() { + return new AttrTooltipFormat[]{ + new AttrTooltipAreaNameFormat(), + new AttrTooltipSeriesFormat(), + new AttrTooltipValueFormat(), + new AttrTooltipPercentFormat() + }; } @Override