From 4e74f71f1103b8bc2d6a25186fb036d095111cd4 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Sun, 18 Oct 2020 14:48:59 +0800 Subject: [PATCH 1/3] =?UTF-8?q?CHART-16040=20=E7=AE=B1=E5=9E=8B=E5=9B=BE?= =?UTF-8?q?=E5=AF=8C=E6=96=87=E6=9C=AC=E5=8F=82=E6=95=B0=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../box/VanChartBoxTooltipContentPane.java | 82 +++++++++++++++++++ .../component/VanChartTooltipContentPane.java | 11 ++- 2 files changed, 90 insertions(+), 3 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 abba5f7539..18b3bb3631 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 @@ -48,6 +48,9 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { private JPanel dataNumberPane; private JPanel dataOutlierPane; + private JPanel richTextNumberPane; + private JPanel richTextOutlierPane; + public VanChartBoxTooltipContentPane(VanChartStylePane parent, JPanel showOnPane, boolean isDetailed) { super(parent, showOnPane); checkFormatVisible(isDetailed); @@ -145,6 +148,16 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { return commonPanel; } + protected JPanel createRichFormatPanel() { + JPanel richFormatPanel = new JPanel(new BorderLayout()); + + richFormatPanel.add(createRichTextCateAndSeriesPane(), BorderLayout.NORTH); + richFormatPanel.add(createRichTextDataNumberPane(), BorderLayout.CENTER); + richFormatPanel.add(createRichTextDataDetailPane(), BorderLayout.SOUTH); + + return richFormatPanel; + } + protected Component[][] getRichTextComponents() { return new Component[][]{ new Component[]{getRichTextCategoryNameFormatPane(), null}, @@ -229,6 +242,72 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { return detailPane; } + private JPanel createRichTextCateAndSeriesPane() { + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; + + double[] columnSize = {f, e}; + double[] rowSize = {p, p, p}; + + Component[][] cateAndSeries = new Component[][]{ + new Component[]{null, null}, + new Component[]{null, getRichTextCategoryNameFormatPane()}, + new Component[]{null, getRichTextSeriesNameFormatPane()} + }; + + return TableLayoutHelper.createTableLayoutPane(cateAndSeries, rowSize, columnSize); + } + + private JPanel createRichTextDataNumberPane() { + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; + + double[] columnSize = {f, e}; + double[] rowSize = {p, p}; + + Component[][] dataNumber = new Component[][]{ + new Component[]{null, null}, + new Component[]{null, richTextNumber}, + }; + + richTextNumberPane = TableLayoutHelper.createTableLayoutPane(dataNumber, rowSize, columnSize); + + return richTextNumberPane; + } + + private JPanel createRichTextDataDetailPane() { + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; + + double[] columnSize = {f, e}; + + JPanel detailPane = new JPanel(new BorderLayout()); + + Component[][] richTextDetail = new Component[][]{ + new Component[]{null, null}, + new Component[]{null, richTextMax}, + new Component[]{new UILabel(getLabelContentTitle()), richTextQ3}, + new Component[]{null, richTextMedian}, + new Component[]{null, richTextQ1}, + new Component[]{null, richTextMin} + }; + + Component[][] dataOutlier = new Component[][]{ + new Component[]{null, null}, + new Component[]{null, richTextOutlier}, + }; + + richTextOutlierPane = TableLayoutHelper.createTableLayoutPane(dataOutlier, new double[]{p, p}, columnSize); + + detailPane.add(TableLayoutHelper.createTableLayoutPane(richTextDetail, new double[]{p, p, p, p, p, p}, columnSize), BorderLayout.NORTH); + detailPane.add(richTextOutlierPane, BorderLayout.CENTER); + + return detailPane; + } + public boolean isDirty() { return getCategoryNameFormatPane().isDirty() || getSeriesNameFormatPane().isDirty() @@ -354,5 +433,8 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { dataNumberPane.setVisible(detailed); dataOutlierPane.setVisible(detailed); + + richTextNumberPane.setVisible(detailed); + richTextOutlierPane.setVisible(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 5d0a613ac3..aca0070971 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 @@ -384,17 +384,22 @@ public class VanChartTooltipContentPane extends BasicBeanPane Date: Sun, 18 Oct 2020 16:19:15 +0800 Subject: [PATCH 2/3] =?UTF-8?q?CHART-16224=20=E5=A2=9E=E5=8A=A0=E5=AF=8C?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E6=9D=A1=E4=BB=B6=E5=B1=9E=E6=80=A7=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VanChartColumnPlotLabelDetailPane.java | 26 +++++++++++++++++++ .../component/VanChartTooltipContentPane.java | 14 ++++++---- 2 files changed, 35 insertions(+), 5 deletions(-) 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 index b2035522d2..8de2097128 100644 --- 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 @@ -5,6 +5,8 @@ import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.plugin.chart.base.AttrLabelDetail; import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.column.VanChartColumnPlot; +import com.fr.van.chart.designer.component.VanChartLabelContentPane; +import com.fr.van.chart.designer.component.VanChartTooltipContentPane; import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.label.VanChartPlotLabelDetailPane; @@ -14,6 +16,30 @@ public class VanChartColumnPlotLabelDetailPane extends VanChartPlotLabelDetailPa super(plot, parent); } + protected void initToolTipContentPane(Plot plot) { + VanChartLabelContentPane dataLabelContentPane = new VanChartLabelContentPane(getParentPane(), VanChartColumnPlotLabelDetailPane.this) { + protected void checkCardPane() { + super.checkCardPane(); + checkOrientationPane(); + } + }; + + setDataLabelContentPane(dataLabelContentPane); + } + + private void checkOrientationPane() { + VanChartLabelContentPane dataLabelContentPane = (VanChartLabelContentPane) getDataLabelContentPane(); + UIButtonGroup content = dataLabelContentPane.getContent(); + UIButtonGroup orientation = getOrientation(); + + if (content.getSelectedIndex() == VanChartTooltipContentPane.RICH_EDITOR_INDEX) { + orientation.setSelectedIndex(HORIZONTAL_INDEX); + orientation.setEnabled(false); + } else { + orientation.setEnabled(true); + } + } + protected boolean hasLabelOrientationPane() { return !((VanChartColumnPlot) this.getPlot()).isBar(); } 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 aca0070971..d4ef4ac774 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 @@ -57,10 +57,10 @@ public class VanChartTooltipContentPane extends BasicBeanPane content; @@ -202,6 +202,10 @@ public class VanChartTooltipContentPane extends BasicBeanPane getContent() { + return content; + } + public AttrTooltipRichText getRichTextAttr() { return richText; } @@ -513,7 +517,7 @@ public class VanChartTooltipContentPane extends BasicBeanPane Date: Sun, 18 Oct 2020 17:06:27 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=A9=BA=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../van/chart/column/VanChartColumnPlotLabelDetailPane.java | 4 ++++ 1 file changed, 4 insertions(+) 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 index 8de2097128..a2be5f2905 100644 --- 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 @@ -32,6 +32,10 @@ public class VanChartColumnPlotLabelDetailPane extends VanChartPlotLabelDetailPa UIButtonGroup content = dataLabelContentPane.getContent(); UIButtonGroup orientation = getOrientation(); + if (content == null || orientation == null) { + return; + } + if (content.getSelectedIndex() == VanChartTooltipContentPane.RICH_EDITOR_INDEX) { orientation.setSelectedIndex(HORIZONTAL_INDEX); orientation.setEnabled(false);