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 46126d277..ab46f5526 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 @@ -35,6 +35,7 @@ import com.fr.van.chart.designer.style.VanChartRangeLegendPane; import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.VanLegendPaneWidthOutHighlight; import com.fr.van.chart.designer.style.label.VanChartGaugePlotLabelPane; +import com.fr.van.chart.designer.style.label.VanChartPiePlotLabelPane; import com.fr.van.chart.designer.style.label.VanChartPlotLabelDetailPane; import com.fr.van.chart.designer.style.label.VanChartPlotLabelPane; import com.fr.van.chart.designer.style.tooltip.VanChartPlotRefreshTooltipPane; @@ -209,6 +210,8 @@ public class PlotFactory { public static VanChartPlotLabelPane createPlotLabelPane(Plot plot, VanChartStylePane stylePane, boolean inCondition) { if (plot instanceof VanChartGaugePlot) { return new VanChartGaugePlotLabelPane(plot, stylePane); + } else if (plot instanceof PiePlot4VanChart) { + return new VanChartPiePlotLabelPane(plot, stylePane, inCondition); } return new VanChartPlotLabelPane(plot, stylePane, inCondition); } 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 index f764c9baa..f40a51f12 100644 --- 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 @@ -46,6 +46,10 @@ public class VanChartBorderWithShapePane extends BasicPane { createBorderPane(); } + public LineComboBox getLineTypeBox() { + return lineTypeBox; + } + private void initComponents() { lineTypeBox = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART); lineColorButton = new UIButtonGroup<>(new String[]{ @@ -106,7 +110,7 @@ public class VanChartBorderWithShapePane extends BasicPane { borderRadius.setEnabled(borderShape.getSelectedIndex() == RECTANGULAR_INDEX || borderShape.getSelectedIndex() == DIALOG_INDEX); } - private JPanel createLineTypePane() { + protected JPanel createLineTypePane() { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/format/SummaryValueFormatPaneWithCheckBox.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/format/SummaryValueFormatPaneWithCheckBox.java new file mode 100644 index 000000000..8d088827f --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/format/SummaryValueFormatPaneWithCheckBox.java @@ -0,0 +1,23 @@ +package com.fr.van.chart.designer.component.format; + +import com.fr.design.i18n.Toolkit; +import com.fr.van.chart.designer.style.VanChartStylePane; + +import javax.swing.JPanel; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-12-10 + */ +public class SummaryValueFormatPaneWithCheckBox extends VanChartFormatPaneWithCheckBox { + + public SummaryValueFormatPaneWithCheckBox(VanChartStylePane parent, JPanel showOnPane) { + super(parent, showOnPane); + } + + @Override + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_Use_Summary_Value"); + } +} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/format/SummaryValueFormatPaneWithoutCheckBox.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/format/SummaryValueFormatPaneWithoutCheckBox.java new file mode 100644 index 000000000..400af6b7f --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/format/SummaryValueFormatPaneWithoutCheckBox.java @@ -0,0 +1,23 @@ +package com.fr.van.chart.designer.component.format; + +import com.fr.design.i18n.Toolkit; +import com.fr.van.chart.designer.style.VanChartStylePane; + +import javax.swing.JPanel; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-12-10 + */ +public class SummaryValueFormatPaneWithoutCheckBox extends VanChartFormatPaneWithoutCheckBox { + + public SummaryValueFormatPaneWithoutCheckBox(VanChartStylePane parent, JPanel showOnPane) { + super(parent, showOnPane); + } + + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_Use_Summary_Value"); + } +} + diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieCategoryLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieCategoryLabelDetailPane.java new file mode 100644 index 000000000..bf13ca445 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieCategoryLabelDetailPane.java @@ -0,0 +1,68 @@ +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.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.stable.Constants; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; +import com.fr.van.chart.designer.style.VanChartStylePane; +import com.fr.van.chart.pie.style.VanChartPieCategoryLabelContentPane; + +import javax.swing.JPanel; +import java.awt.Component; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-12-09 + */ +public class VanChartPieCategoryLabelDetailPane extends VanChartPlotLabelDetailPane { + + public VanChartPieCategoryLabelDetailPane(Plot plot, VanChartStylePane parent, boolean inCondition) { + super(plot, parent, inCondition); + } + + protected void initToolTipContentPane(Plot plot) { + setDataLabelContentPane(new VanChartPieCategoryLabelContentPane(getParentPane(), this, isInCondition())); + } + + protected JPanel createLabelPositionPane(String title, Plot plot) { + String[] positionName = new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Axis_Bottom"), + Toolkit.i18nText("Fine-Design_Form_Center"), + Toolkit.i18nText("Fine-Design_Chart_Axis_Top") + }; + + Integer[] positionValue = new Integer[]{Constants.BOTTOM, Constants.CENTER, Constants.TOP}; + + UIButtonGroup position = new UIButtonGroup<>(positionName, positionValue); + setPosition(position); + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; + double[] row = {p, p}; + double[] col = {f, e}; + + Component[][] components = new Component[][]{ + new Component[]{null, null}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Layout_Position")), position}, + }; + + return TableLayoutHelper.createTableLayoutPane(components, row, col); + } + + protected void checkPositionPane(String title) { + + } + + protected JPanel createLabelBorderPane() { + return null; + } + + protected JPanel createLabelBackgroundPane() { + return null; + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPiePlotLabelPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPiePlotLabelPane.java new file mode 100644 index 000000000..ac24b9951 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPiePlotLabelPane.java @@ -0,0 +1,61 @@ +package com.fr.van.chart.designer.style.label; + +import com.fr.chart.chartattr.Plot; +import com.fr.design.i18n.Toolkit; +import com.fr.plugin.chart.attr.plot.VanChartPlot; +import com.fr.plugin.chart.base.AttrLabel; +import com.fr.plugin.chart.base.AttrLabelDetail; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; +import com.fr.van.chart.designer.style.VanChartStylePane; + +import javax.swing.JPanel; +import java.awt.BorderLayout; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-12-09 + */ +public class VanChartPiePlotLabelPane extends VanChartPlotLabelPane { + + private VanChartPlotLabelDetailPane pieCategoryLabelPane; + + public VanChartPiePlotLabelPane(Plot plot, VanChartStylePane parent, boolean inCondition) { + super(plot, parent, inCondition); + } + + protected void createLabelPane() { + setLabelPane(new JPanel(new BorderLayout(0, 4))); + setLabelDetailPane(new VanChartPieValueLabelDetailPane(getPlot(), getParentPane(), isInCondition())); + JPanel valuePane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Value_Label"), getLabelDetailPane()); + getLabelPane().add(valuePane, BorderLayout.NORTH); + + if (!isInCondition()) { + pieCategoryLabelPane = new VanChartPieCategoryLabelDetailPane(getPlot(), getParentPane(), isInCondition()); + JPanel categoryPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Category_Label"), pieCategoryLabelPane); + getLabelPane().add(categoryPane, BorderLayout.CENTER); + } + } + + public void populate(AttrLabel attrLabel) { + if (attrLabel == null) { + attrLabel = ((VanChartPlot) this.getPlot()).getDefaultAttrLabel(); + } + super.populate(attrLabel); + if (pieCategoryLabelPane != null) { + AttrLabelDetail labelDetail = attrLabel.getSecondLabelDetail(); + pieCategoryLabelPane.populate(labelDetail); + } + } + + public AttrLabel update() { + AttrLabel attrLabel = super.update(); + if (pieCategoryLabelPane != null) { + AttrLabelDetail labelDetail = attrLabel.getSecondLabelDetail(); + pieCategoryLabelPane.update(labelDetail); + } else { + attrLabel.setSecondLabelDetail(null); + } + return attrLabel; + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieValueLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieValueLabelDetailPane.java new file mode 100644 index 000000000..707f6f5fd --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieValueLabelDetailPane.java @@ -0,0 +1,72 @@ +package com.fr.van.chart.designer.style.label; + +import com.fr.chart.chartattr.Plot; +import com.fr.design.gui.ilable.UILabel; +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.van.chart.designer.TableLayout4VanChartHelper; +import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutImagePane; +import com.fr.van.chart.designer.component.border.VanChartBorderWithShapePane; +import com.fr.van.chart.designer.style.VanChartStylePane; +import com.fr.van.chart.pie.style.VanChartPieValueLabelContentPane; + +import javax.swing.JPanel; +import java.awt.Component; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-12-09 + */ +public class VanChartPieValueLabelDetailPane extends VanChartPlotLabelDetailPane { + + public VanChartPieValueLabelDetailPane(Plot plot, VanChartStylePane parent, boolean inCondition) { + super(plot, parent, inCondition); + } + + protected void initToolTipContentPane(Plot plot) { + setDataLabelContentPane(new VanChartPieValueLabelContentPane(getParentPane(), this, isInCondition())); + } + + protected JPanel getLabelLayoutPane(JPanel panel, String title) { + return panel; + } + + protected JPanel createLabelBorderPane() { + VanChartBorderWithShapePane borderPane = new VanChartBorderWithShapePane() { + @Override + protected JPanel createLineTypePane() { + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; + + double[] columnSize = {f, e}; + double[] rowSize = {p}; + + Component[][] components = new Component[][]{ + new Component[]{FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Border")), + UIComponentUtils.wrapWithBorderLayoutPane(getLineTypeBox())}}; + + return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); + } + }; + setBorderPane(borderPane); + return borderPane; + } + + protected JPanel createLabelBackgroundPane() { + VanChartBackgroundWithOutImagePane backgroundPane = new VanChartBackgroundWithOutImagePane() { + protected Component[][] getPaneComponents() { + return new Component[][]{ + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Utils_Background")), typeComboBox}, + new Component[]{null, centerPane}, + new Component[]{getTransparentLabel(), transparent}, + }; + } + }; + setBackgroundPane(backgroundPane); + return backgroundPane; + } +} 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 546648963..0e6071b55 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 @@ -83,6 +83,19 @@ public class VanChartPlotLabelDetailPane extends BasicPane { return parent; } + public void setPosition(UIButtonGroup position) { + this.position = position; + } + + public void setBorderPane(VanChartBorderWithShapePane borderPane) { + this.borderPane = borderPane; + } + + public void setBackgroundPane(VanChartBackgroundWithOutImagePane backgroundPane) { + this.backgroundPane = backgroundPane; + } + + protected void initLabelDetailPane(Plot plot) { this.setLayout(new BorderLayout()); initToolTipContentPane(plot); @@ -145,14 +158,14 @@ public class VanChartPlotLabelDetailPane extends BasicPane { return jPanel; } - private JPanel createLabelBorderPane() { + protected JPanel createLabelBorderPane() { borderPane = new VanChartBorderWithShapePane(); borderPaneWithTitle = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane); return borderPaneWithTitle; } - private JPanel createLabelBackgroundPane() { + protected JPanel createLabelBackgroundPane() { backgroundPane = new VanChartBackgroundWithOutImagePane() { protected Component[][] getPaneComponents() { 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 71ad599fd..4aed8c30a 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 @@ -44,6 +44,10 @@ public class VanChartPlotLabelPane extends BasicPane { addComponents(); } + public boolean isInCondition() { + return inCondition; + } + public VanChartPlotLabelDetailPane getLabelDetailPane() { return labelDetailPane; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/pie/style/VanChartPieCategoryLabelContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/pie/style/VanChartPieCategoryLabelContentPane.java new file mode 100644 index 000000000..e5b55d749 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/pie/style/VanChartPieCategoryLabelContentPane.java @@ -0,0 +1,130 @@ +package com.fr.van.chart.pie.style; + +import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; +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.plugin.chart.pie.attr.PieCategoryLabelContent; +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.SummaryValueFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.SummaryValueFormatPaneWithoutCheckBox; +import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithoutCheckBox; +import com.fr.van.chart.designer.style.VanChartStylePane; + +import javax.swing.JPanel; +import java.awt.Component; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-12-10 + */ +public class VanChartPieCategoryLabelContentPane extends VanChartLabelContentPane { + + private SummaryValueFormatPaneWithCheckBox summaryValueFormatPane; + + private SummaryValueFormatPaneWithoutCheckBox richTextSummaryValueFormatPane; + + public VanChartPieCategoryLabelContentPane(VanChartStylePane parent, JPanel showOnPane, boolean inCondition) { + super(parent, showOnPane, inCondition); + } + + @Override + protected JPanel getLabelContentPane(JPanel contentPane) { + return contentPane; + } + + @Override + protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) { + setCategoryNameFormatPane(new CategoryNameFormatPaneWithCheckBox(parent, showOnPane)); + summaryValueFormatPane = new SummaryValueFormatPaneWithCheckBox(parent, showOnPane); + } + + @Override + protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { + setRichTextCategoryNameFormatPane(new CategoryNameFormatPaneWithoutCheckBox(parent, showOnPane)); + richTextSummaryValueFormatPane = new SummaryValueFormatPaneWithoutCheckBox(parent, showOnPane); + } + + @Override + protected Component[][] getPaneComponents() { + return new Component[][]{ + new Component[]{getCategoryNameFormatPane(), null}, + new Component[]{summaryValueFormatPane, null}, + }; + } + + @Override + protected Component[][] getRichTextComponents() { + return new Component[][]{ + new Component[]{getRichTextCategoryNameFormatPane(), null}, + new Component[]{richTextSummaryValueFormatPane, null}, + }; + } + + @Override + protected double[] getRowSize(double p) { + return new double[]{p, p}; + } + + public JPanel createCommonStylePane() { + setTextAttrPane(new ChartTextAttrPane()); + return getTextAttrPane(); + } + + @Override + protected void populateFormatPane(AttrTooltipContent attrTooltipContent) { + PieCategoryLabelContent pieCategoryLabelContent = (PieCategoryLabelContent) attrTooltipContent; + super.populateFormatPane(pieCategoryLabelContent); + summaryValueFormatPane.populate(pieCategoryLabelContent.getSummaryValueFormat()); + } + + protected void populateRichEditor(AttrTooltipContent attrTooltipContent) { + PieCategoryLabelContent pieCategoryLabelContent = (PieCategoryLabelContent) attrTooltipContent; + VanChartFormatPaneWithoutCheckBox[] formatPaneGroup = new VanChartFormatPaneWithoutCheckBox[]{ + getRichTextCategoryNameFormatPane(), + richTextSummaryValueFormatPane + }; + + AttrTooltipFormat[] formatGroup = new AttrTooltipFormat[]{ + pieCategoryLabelContent.getRichTextCategoryFormat(), + pieCategoryLabelContent.getRichTextSummaryValueFormat() + }; + + setRichTextAttr(new AttrTooltipRichText()); + populateRichTextFormat(formatPaneGroup, formatGroup); + populateRichText(pieCategoryLabelContent.getRichTextAttr()); + + checkRichEditorState(pieCategoryLabelContent); + } + + @Override + protected void updateFormatPane(AttrTooltipContent attrTooltipContent) { + PieCategoryLabelContent pieCategoryLabelContent = (PieCategoryLabelContent) attrTooltipContent; + super.updateFormatPane(pieCategoryLabelContent); + summaryValueFormatPane.update(pieCategoryLabelContent.getSummaryValueFormat()); + } + + protected void updateRichEditor(AttrTooltipContent attrTooltipContent) { + PieCategoryLabelContent pieCategoryLabelContent = (PieCategoryLabelContent) attrTooltipContent; + super.updateRichEditor(pieCategoryLabelContent); + richTextSummaryValueFormatPane.update(pieCategoryLabelContent.getRichTextSummaryValueFormat()); + } + + @Override + public void setDirty(boolean isDirty) { + getCategoryNameFormatPane().setDirty(isDirty); + summaryValueFormatPane.setDirty(isDirty); + } + + @Override + public boolean isDirty() { + return getCategoryNameFormatPane().isDirty() || summaryValueFormatPane.isDirty(); + } + + protected AttrTooltipContent createAttrTooltip() { + return new PieCategoryLabelContent(); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/pie/style/VanChartPieValueLabelContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/pie/style/VanChartPieValueLabelContentPane.java new file mode 100644 index 000000000..ddc6e6631 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/pie/style/VanChartPieValueLabelContentPane.java @@ -0,0 +1,79 @@ +package com.fr.van.chart.pie.style; + +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.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; +import java.awt.Component; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-12-09 + */ +public class VanChartPieValueLabelContentPane extends VanChartLabelContentPane { + + public VanChartPieValueLabelContentPane(VanChartStylePane parent, JPanel showOnPane, boolean inCondition) { + super(parent, showOnPane, inCondition); + } + + @Override + protected JPanel getLabelContentPane(JPanel contentPane) { + return contentPane; + } + + @Override + protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) { + setSeriesNameFormatPane(new SeriesNameFormatPaneWithCheckBox(parent, showOnPane)); + setValueFormatPane(new ValueFormatPaneWithCheckBox(parent, showOnPane)); + setPercentFormatPane(new PercentFormatPaneWithCheckBox(parent, showOnPane)); + } + + @Override + protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { + setRichTextSeriesNameFormatPane(new SeriesNameFormatPaneWithoutCheckBox(parent, showOnPane)); + setRichTextValueFormatPane(new ValueFormatPaneWithoutCheckBox(parent, showOnPane)); + setRichTextPercentFormatPane(new PercentFormatPaneWithoutCheckBox(parent, showOnPane)); + } + + @Override + protected double[] getRowSize(double p) { + return new double[]{p, p, p}; + } + + @Override + protected Component[][] getPaneComponents() { + return new Component[][]{ + new Component[]{getSeriesNameFormatPane(), null}, + new Component[]{getValueFormatPane(), null}, + new Component[]{getPercentFormatPane(), null}, + }; + } + + @Override + protected Component[][] getRichTextComponents() { + return new Component[][]{ + new Component[]{getRichTextSeriesNameFormatPane(), null}, + new Component[]{getRichTextValueFormatPane(), null}, + new Component[]{getRichTextPercentFormatPane(), null} + }; + } + + @Override + public void setDirty(boolean isDirty) { + getSeriesNameFormatPane().setDirty(isDirty); + getValueFormatPane().setDirty(isDirty); + getPercentFormatPane().setDirty(isDirty); + } + + @Override + public boolean isDirty() { + return getSeriesNameFormatPane().isDirty() || getValueFormatPane().isDirty() || getPercentFormatPane().isDirty(); + } +}