From 5bb2544c1c508ecf7c643b511926f20ba22570ff Mon Sep 17 00:00:00 2001 From: zheng Date: Wed, 25 Jul 2018 14:26:10 +0800 Subject: [PATCH] CHART-2611 --- .../fr/design/ChartTypeInterfaceManager.java | 22 +++++-------------- .../chart/custom/VanChartCustomPlotPane.java | 4 ++-- .../type/AbstractVanChartTypePane.java | 6 ++++- .../designer/type/VanChartMapPlotPane.java | 2 +- 4 files changed, 14 insertions(+), 20 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java b/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java index 55f6076d81..e3fa679d6e 100644 --- a/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java @@ -93,7 +93,6 @@ import java.util.Map; import static com.fr.chart.charttypes.ChartTypeManager.CHART_PRIORITY; import static com.fr.chart.charttypes.ChartTypeManager.VAN_CHART_PRIORITY; -import static com.fr.chart.charttypes.ChartTypeManager.enabledChart; /** * Created by eason on 14/12/29. @@ -171,9 +170,6 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr private static void readVanChart() { - if (chartTypeInterfaces.containsKey(VAN_CHART_PRIORITY)) { - return; - } addChartTypeInterface(VAN_CHART_PRIORITY, PiePlot4VanChart.VAN_CHART_PIE_PLOT, new PieIndependentVanChartInterface()); addChartTypeInterface(VAN_CHART_PRIORITY, VanChartColumnPlot.VAN_CHART_COLUMN_PLOT_ID, new ColumnIndependentVanChartInterface()); addChartTypeInterface(VAN_CHART_PRIORITY, VanChartColumnPlot.VAN_CHART_BAR_PLOT_ID, new BarIndependentVanChartInterface()); @@ -197,10 +193,6 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr private static void readDefault() { - - if (chartTypeInterfaces.containsKey(CHART_PRIORITY)) { - return; - } addChartTypeInterface(CHART_PRIORITY, ChartConstants.COLUMN_CHART, new ColumnIndependentChartInterface()); addChartTypeInterface(CHART_PRIORITY, ChartConstants.LINE_CHART, new LineIndependentChartInterface()); @@ -276,16 +268,14 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr Map.Entry entry = iterator.next(); String plotID = entry.getKey(); - if (enabledChart(plotID)) { - AbstractChartTypePane pane = entry.getValue().getPlotTypePane(); - pane.setPlotID(plotID); - paneList.add(pane); + AbstractChartTypePane pane = entry.getValue().getPlotTypePane(); + pane.setPlotID(plotID); + paneList.add(pane); - if (allChartTypePane.get(priority) == null) { - allChartTypePane.put(priority, new LinkedHashMap>()); - } - allChartTypePane.get(priority).put(plotID, pane); + if (allChartTypePane.get(priority) == null) { + allChartTypePane.put(priority, new LinkedHashMap>()); } + allChartTypePane.get(priority).put(plotID, pane); } } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java index 4aa92a09e3..6239c4fafd 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java @@ -154,12 +154,12 @@ public class VanChartCustomPlotPane extends AbstractVanChartTypePane { isCustom = true; //先重置自定义组合面板,如果不重置,无法获取选择顺序 - if (lastState == customChart.length - 1 && samePlot) { + if (lastState == customChart.length - 1 && isSamePlot()) { //更新数据配置,刪除已经不在的图表数据 dealCustomDefinition(chart); customSelectPane.updateBean(chart); - } else if (samePlot) {//如果是同一个图表切换过来,则重置面板 + } else if (isSamePlot()) {//如果是同一个图表切换过来,则重置面板 customSelectPane.populateBean(chart); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java index c1ce665035..ead6be3395 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java @@ -29,7 +29,11 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane{ private static final long serialVersionUID = 7743244512351499265L; private UICheckBox largeModelCheckBox; - protected Boolean samePlot; + private Boolean samePlot; + + protected Boolean isSamePlot() { + return samePlot; + } //新图表暂时还没有平面3d,渐变高光等布局。 @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java index 2b8ea1ac86..b7b1c62951 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java @@ -113,7 +113,7 @@ public class VanChartMapPlotPane extends AbstractVanChartTypePane { Plot plot = chart.getPlot(); if(plot instanceof VanChartMapPlot) { sourceChoosePane.updateBean((VanChartMapPlot) plot); - if(!samePlot || (typeChanged && samePlot)){ + if(!isSamePlot() || (typeChanged && isSamePlot())){ resetAttr(plot); } }