From 69e42060fef146ecf7f1278ee01362baea4c3c56 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Sun, 20 Sep 2020 23:31:33 +0800 Subject: [PATCH] =?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); + } +}