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 0698a3291f..f2c5662307 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 @@ -115,8 +115,9 @@ public class VanChartTooltipContentPane extends BasicBeanPane richEditorPane) { return new VanChartRichTextPane(richEditorPane) { @@ -73,7 +69,7 @@ public class VanChartScatterTooltipContentPane extends VanChartTooltipContentPa } protected AttrTooltipContent getInitialTooltipContent() { - return new ScatterAttrTooltipContent(); + return createAttrTooltip(); } }; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudRichTextFieldListPane.java b/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudRichTextFieldListPane.java new file mode 100644 index 0000000000..3394e6f05b --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudRichTextFieldListPane.java @@ -0,0 +1,41 @@ +package com.fr.van.chart.wordcloud.designer.style; + +import com.fr.design.i18n.Toolkit; +import com.fr.design.ui.ModernUIPane; +import com.fr.plugin.chart.base.format.AttrTooltipCategoryFormat; +import com.fr.plugin.chart.base.format.AttrTooltipNameFormat; +import com.fr.plugin.chart.base.format.AttrTooltipPercentFormat; +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 VanChartWordCloudRichTextFieldListPane extends VanChartFieldListPane { + + public VanChartWordCloudRichTextFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane richEditorPane) { + super(fieldAttrPane, richEditorPane); + } + + protected void initDefaultFieldButton() { + VanChartFieldListener fieldListener = getFieldListener(); + + VanChartFieldButton categoryNameButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_MultiPie_Series_Name"), + new AttrTooltipCategoryFormat(), false, fieldListener); + + VanChartFieldButton seriesNameButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Word_Name"), + new AttrTooltipNameFormat(), false, fieldListener); + + VanChartFieldButton valueButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Word_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/wordcloud/designer/style/VanChartWordCloudTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudTooltipContentPane.java index c0e9ac6c37..99b437861d 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 @@ -2,17 +2,18 @@ package com.fr.van.chart.wordcloud.designer.style; import com.fr.design.i18n.Toolkit; +import com.fr.design.ui.ModernUIPane; 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.component.richText.VanChartFieldAttrPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldListPane; +import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel; +import com.fr.van.chart.designer.component.richText.VanChartRichTextPane; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -53,31 +54,19 @@ public class VanChartWordCloudTooltipContentPane extends VanChartTooltipContentP setPercentFormatPane(percentFormatPane); } - protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { - CategoryNameFormatPaneWithoutCheckBox richTextCategoryNameFormatPane = new CategoryNameFormatPaneWithoutCheckBox(parent, showOnPane) { - protected String getCheckBoxText() { - return Toolkit.i18nText("Fine-Design_Chart_MultiPie_Series_Name"); - } - }; - SeriesNameFormatPaneWithoutCheckBox richTextSeriesNameFormatPane = new SeriesNameFormatPaneWithoutCheckBox(parent, showOnPane) { - protected String getCheckBoxText() { - return Toolkit.i18nText("Fine-Design_Chart_Word_Name"); + protected VanChartRichTextPane createRichTextPane(ModernUIPane richEditorPane) { + return new VanChartRichTextPane(richEditorPane) { + + protected VanChartFieldListPane createFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane richEditor) { + return new VanChartWordCloudRichTextFieldListPane(fieldAttrPane, richEditor); } - }; - ValueFormatPaneWithoutCheckBox richTextValueFormatPane = new ValueFormatPaneWithoutCheckBox(parent, showOnPane) { - protected String getCheckBoxText() { - return Toolkit.i18nText("Fine-Design_Chart_Word_Value"); + + protected AttrTooltipContent getInitialTooltipContent() { + return createAttrTooltip(); } }; - PercentFormatPaneWithoutCheckBox richTextPercentFormatPane = new PercentFormatPaneWithoutCheckBox(parent, showOnPane); - - setRichTextCategoryNameFormatPane(richTextCategoryNameFormatPane); - setRichTextSeriesNameFormatPane(richTextSeriesNameFormatPane); - setRichTextValueFormatPane(richTextValueFormatPane); - setRichTextPercentFormatPane(richTextPercentFormatPane); } - @Override protected AttrTooltipContent createAttrTooltip() { AttrTooltipContent attrTooltipContent = new AttrTooltipContent(); attrTooltipContent.setSeriesFormat(new AttrTooltipNameFormat());