From 63c78fb7e70b1d862fcda26da575c8654ba0fa14 Mon Sep 17 00:00:00 2001 From: zheng Date: Tue, 28 Aug 2018 14:11:57 +0800 Subject: [PATCH] =?UTF-8?q?CHART-2802=20=E5=9B=BE=E8=A1=A8=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=20=E5=8F=AF=E4=BB=A5=E6=B2=A1=E6=9C=89=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=85=8D=E7=BD=AE=E9=9D=A2=E6=9D=BF&&=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E9=9D=A2=E6=9D=BF=E5=8F=AF=E4=BB=A5=E5=8A=A0=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/chart/ChartEditPane.java | 9 ++++++--- .../fr/design/mainframe/chart/ChartHyperEditPane.java | 4 +++- .../com/fr/design/mainframe/chart/ChartsEditPane.java | 6 ++++-- .../java/com/fr/extended/chart/ExtendedTypePane.java | 9 +++++++++ 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java index a301af697..5fce5c366 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java @@ -21,7 +21,6 @@ import com.fr.design.mainframe.chart.gui.ChartTypePane; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; - import javax.swing.JPanel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; @@ -154,7 +153,9 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4 this.isDefaultPane = true; }else{ ChartDataPane chartDataPane = createChartDataPane(plotID); - paneList.add(chartDataPane); + if (chartDataPane != null) { + paneList.add(chartDataPane); + } AbstractChartAttrPane[] otherPaneList = ChartTypeInterfaceManager.getInstance().getAttrPaneArray(plotID, listener); for(int i = 0; i < otherPaneList.length; i++){ otherPaneList[i].addAttributeChangeListener(listener); @@ -169,7 +170,9 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4 protected ChartDataPane createChartDataPane(String plotID) { ChartDataPane chartDataPane = ChartTypeInterfaceManager.getInstance().getChartDataPane(plotID, listener); - chartDataPane.setSupportCellData(dataPane4SupportCell.isSupportCellData()); + if (chartDataPane != null) { + chartDataPane.setSupportCellData(dataPane4SupportCell.isSupportCellData()); + } return chartDataPane; } diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartHyperEditPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartHyperEditPane.java index 936304b4e..bae6e20bc 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartHyperEditPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartHyperEditPane.java @@ -42,7 +42,9 @@ public class ChartHyperEditPane extends ChartEditPane { @Override protected ChartDataPane createChartDataPane(String plotID) { ChartDataPane dataPane = ChartTypeInterfaceManager.getInstance().getChartDataPane(plotID, listener); - dataPane.setSupportCellData(false); + if (dataPane != null) { + dataPane.setSupportCellData(false); + } return dataPane; } diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartsEditPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartsEditPane.java index 3f35c585d..b9f5a2fbd 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartsEditPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartsEditPane.java @@ -4,7 +4,7 @@ import com.fr.chart.chartattr.Chart; import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.mainframe.chart.gui.ChartDataPane; -import java.awt.*; +import java.awt.BorderLayout; import java.util.ArrayList; /** @@ -43,7 +43,9 @@ public class ChartsEditPane extends ChartEditPane { dataPane4SupportCell = createChartDataPane(plotID); chartsConfigPane = ChartTypeInterfaceManager.getInstance().getChartConfigPane(plotID); - paneList.add(dataPane4SupportCell); + if (dataPane4SupportCell != null) { + paneList.add(dataPane4SupportCell); + } paneList.add(chartsConfigPane); createTabsPane(); diff --git a/designer-chart/src/main/java/com/fr/extended/chart/ExtendedTypePane.java b/designer-chart/src/main/java/com/fr/extended/chart/ExtendedTypePane.java index a1375938d..9e5ddd7b4 100644 --- a/designer-chart/src/main/java/com/fr/extended/chart/ExtendedTypePane.java +++ b/designer-chart/src/main/java/com/fr/extended/chart/ExtendedTypePane.java @@ -27,6 +27,12 @@ public class ExtendedTypePane extends AbstractChartType protected void setType(T chart, int index) { } + protected void populate(T chart) { + } + + protected void update(T chart) { + } + @Override public void populateBean(Chart chart) { if (getTypeIconPath().length > 0) { @@ -36,10 +42,13 @@ public class ExtendedTypePane extends AbstractChartType typeDemo.get(getTypeIndex((T) chart)).isPressing = true; checkDemosBackground(); } + populate((T) chart); } @Override public void updateBean(Chart chart) { + update((T) chart); + if (getTypeIconPath().length > 0) { for (int index = 0, len = typeDemo.size(); index < len; index++) { if (typeDemo.get(index).isPressing) {