From 24ec6fa87aad235d776daa91fcb26e69ec859bf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Fri, 6 Dec 2019 10:47:06 +0800 Subject: [PATCH 1/2] =?UTF-8?q?CHART-11899=20=E6=BC=8F=E6=B4=9E=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/van/chart/bubble/BubbleIndependentVanChartInterface.java | 2 +- .../fr/van/chart/gauge/GaugeIndependentVanChartInterface.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/bubble/BubbleIndependentVanChartInterface.java b/designer-chart/src/main/java/com/fr/van/chart/bubble/BubbleIndependentVanChartInterface.java index a00423ad7..679dfcd60 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/bubble/BubbleIndependentVanChartInterface.java +++ b/designer-chart/src/main/java/com/fr/van/chart/bubble/BubbleIndependentVanChartInterface.java @@ -128,7 +128,7 @@ public class BubbleIndependentVanChartInterface extends AbstractIndependentVanCh public ChartDataPane getChartDataPane(AttributeChangeListener listener) { return new AbstractVanSingleDataPane(listener) { - VanChartBubblePlot plot; + private VanChartBubblePlot plot; @Override public void populate(ChartCollection collection) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/gauge/GaugeIndependentVanChartInterface.java b/designer-chart/src/main/java/com/fr/van/chart/gauge/GaugeIndependentVanChartInterface.java index d19ea6a46..c8b2ac682 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gauge/GaugeIndependentVanChartInterface.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gauge/GaugeIndependentVanChartInterface.java @@ -120,7 +120,7 @@ public class GaugeIndependentVanChartInterface extends AbstractIndependentVanCha public ChartDataPane getChartDataPane(AttributeChangeListener listener) { return new AbstractVanSingleDataPane(listener) { - VanChartGaugePlot gaugePlot; + private VanChartGaugePlot gaugePlot; @Override public void populate(ChartCollection collection) { From e8fe03bdd68d350cbc19ef65a6d748f3a682ccfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Fri, 6 Dec 2019 15:29:27 +0800 Subject: [PATCH 2/2] =?UTF-8?q?CHART-11899=20=E6=BC=8F=E6=B4=9E=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BubbleIndependentVanChartInterface.java | 22 ++------- .../GaugeIndependentVanChartInterface.java | 46 +++++++------------ 2 files changed, 20 insertions(+), 48 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/bubble/BubbleIndependentVanChartInterface.java b/designer-chart/src/main/java/com/fr/van/chart/bubble/BubbleIndependentVanChartInterface.java index 679dfcd60..d1494756e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/bubble/BubbleIndependentVanChartInterface.java +++ b/designer-chart/src/main/java/com/fr/van/chart/bubble/BubbleIndependentVanChartInterface.java @@ -1,7 +1,6 @@ package com.fr.van.chart.bubble; import com.fr.chart.chartattr.Chart; -import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.Plot; import com.fr.design.beans.BasicBeanPane; import com.fr.design.chartx.AbstractVanSingleDataPane; @@ -21,7 +20,6 @@ import com.fr.design.mainframe.chart.gui.data.report.BubblePlotReportDataContent import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; import com.fr.plugin.chart.bubble.VanChartBubblePlot; -import com.fr.plugin.chart.vanchart.VanChart; import com.fr.van.chart.bubble.data.VanChartBubblePlotTableDataContentPane; import com.fr.van.chart.designer.other.VanChartInteractivePaneWithOutSort; import com.fr.van.chart.designer.other.VanChartOtherPane; @@ -127,24 +125,12 @@ public class BubbleIndependentVanChartInterface extends AbstractIndependentVanCh @Override public ChartDataPane getChartDataPane(AttributeChangeListener listener) { return new AbstractVanSingleDataPane(listener) { - - private VanChartBubblePlot plot; - - @Override - public void populate(ChartCollection collection) { - if (collection == null) { - return; - } - VanChart chart = collection.getSelectedChartProvider(VanChart.class); - if (chart == null) { - return; - } - plot = chart.getPlot(); - super.populate(collection); - } - @Override protected SingleDataPane createSingleDataPane() { + VanChartBubblePlot plot = null; + if (getVanChart() != null) { + plot = getVanChart().getPlot(); + } if (plot != null && plot.isForceBubble()) { return new SingleDataPane(new SingleCategoryDataSetFieldsPane(), new SingleCategoryCellDataFieldsPane()); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/gauge/GaugeIndependentVanChartInterface.java b/designer-chart/src/main/java/com/fr/van/chart/gauge/GaugeIndependentVanChartInterface.java index c8b2ac682..b6360c118 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gauge/GaugeIndependentVanChartInterface.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gauge/GaugeIndependentVanChartInterface.java @@ -1,6 +1,5 @@ package com.fr.van.chart.gauge; -import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.Plot; import com.fr.design.beans.BasicBeanPane; import com.fr.design.chartx.AbstractVanSingleDataPane; @@ -22,7 +21,6 @@ import com.fr.design.mainframe.chart.gui.data.table.CategoryPlotTableDataContent import com.fr.design.mainframe.chart.gui.data.table.MeterPlotTableDataContentPane; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; import com.fr.plugin.chart.gauge.VanChartGaugePlot; -import com.fr.plugin.chart.vanchart.VanChart; import com.fr.van.chart.custom.component.CategoryCustomPlotTableDataContentPane; import com.fr.van.chart.custom.component.MeterCustomPlotReportDataContentPane; import com.fr.van.chart.custom.component.MeterCustomPlotTableDataContentPane; @@ -72,10 +70,10 @@ public class GaugeIndependentVanChartInterface extends AbstractIndependentVanCha return new VanChartGaugePlotPane(); } - public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent){ - if(plot instanceof VanChartGaugePlot){ - VanChartGaugePlot gaugePlot = (VanChartGaugePlot)plot; - switch (gaugePlot.getGaugeStyle()){ + public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) { + if (plot instanceof VanChartGaugePlot) { + VanChartGaugePlot gaugePlot = (VanChartGaugePlot) plot; + switch (gaugePlot.getGaugeStyle()) { case POINTER: return gaugePlot.isInCustom() ? new CategoryCustomPlotTableDataContentPane(parent) : new CategoryPlotTableDataContentPane(parent); case POINTER_SEMI: @@ -84,13 +82,13 @@ public class GaugeIndependentVanChartInterface extends AbstractIndependentVanCha break; } } - return ((VanChartGaugePlot)plot).isInCustom() ? new MeterCustomPlotTableDataContentPane(parent) : new MeterPlotTableDataContentPane(parent); + return ((VanChartGaugePlot) plot).isInCustom() ? new MeterCustomPlotTableDataContentPane(parent) : new MeterPlotTableDataContentPane(parent); } - public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent){ - if(plot instanceof VanChartGaugePlot){ - VanChartGaugePlot gaugePlot = (VanChartGaugePlot)plot; - switch (gaugePlot.getGaugeStyle()){ + public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) { + if (plot instanceof VanChartGaugePlot) { + VanChartGaugePlot gaugePlot = (VanChartGaugePlot) plot; + switch (gaugePlot.getGaugeStyle()) { case POINTER: return new CategoryPlotReportDataContentPane(parent); case POINTER_SEMI: @@ -104,40 +102,28 @@ public class GaugeIndependentVanChartInterface extends AbstractIndependentVanCha /** * 图表的属性界面数组 + * * @return 属性界面 */ - public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener){ + public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener) { VanChartStylePane stylePane = new VanChartGaugeStylePane(listener); VanChartOtherPane otherPane = new VanChartOtherPane(); return new AbstractChartAttrPane[]{stylePane, otherPane}; } - public BasicBeanPane getPlotSeriesPane(ChartStylePane parent, Plot plot){ + public BasicBeanPane getPlotSeriesPane(ChartStylePane parent, Plot plot) { return new VanChartGaugeSeriesPane(parent, plot); } @Override public ChartDataPane getChartDataPane(AttributeChangeListener listener) { return new AbstractVanSingleDataPane(listener) { - - private VanChartGaugePlot gaugePlot; - - @Override - public void populate(ChartCollection collection) { - if (collection == null) { - return; - } - VanChart chart = collection.getSelectedChartProvider(VanChart.class); - if (chart == null) { - return; - } - gaugePlot = chart.getPlot(); - - super.populate(collection); - } - @Override protected SingleDataPane createSingleDataPane() { + VanChartGaugePlot gaugePlot = null; + if (getVanChart() != null) { + gaugePlot = getVanChart().getPlot(); + } if (gaugePlot != null && !gaugePlot.isMultiPointer()) { return new SingleDataPane(new GaugeDataSetFieldsPane(), new GaugeCellDataFieldsPane()); }