From db283848a03e3cb4142a0e84eb5b68f8b28d4a65 Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Mon, 5 Jun 2017 10:26:15 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=B8=ADinstnceof=EF=BC=8C=E7=94=A8=E6=B3=9B?= =?UTF-8?q?=E5=9E=8B=E4=BB=A3=E6=9B=BF=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/chart/ChartsConfigPane.java | 18 +++++++++++--- .../mainframe/chart/ChartsEditPane.java | 2 +- .../chart/DefaultChartsConfigPane.java | 24 +++++++++++++++++++ 3 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 designer_chart/src/com/fr/design/mainframe/chart/DefaultChartsConfigPane.java diff --git a/designer_chart/src/com/fr/design/mainframe/chart/ChartsConfigPane.java b/designer_chart/src/com/fr/design/mainframe/chart/ChartsConfigPane.java index 76e674eb88..bebf6d2c23 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/ChartsConfigPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/ChartsConfigPane.java @@ -1,27 +1,39 @@ package com.fr.design.mainframe.chart; import com.fr.chart.chartattr.ChartCollection; +import com.fr.chart.chartattr.Charts; import com.fr.general.Inter; +import com.fr.stable.StableUtils; import javax.swing.*; /** * Created by mengao on 2017/5/16. */ -public class ChartsConfigPane extends AbstractChartAttrPane { +public abstract class ChartsConfigPane extends AbstractChartAttrPane { public final static String CHART_STYLE_TITLE = Inter.getLocText("Chart-Style_Name"); + public abstract Class accptType(); + @Override public void populate(ChartCollection collection) { - + if (StableUtils.classInstanceOf(collection.getSelectedChart().getClass(),accptType())) { + populate(collection, (T)collection.getSelectedChart()); + } } + protected abstract void populate(ChartCollection collection, T selectedChart); + @Override public void update(ChartCollection collection) { - + if (StableUtils.classInstanceOf(collection.getSelectedChart().getClass(),accptType())) { + update(collection, (T)collection.getSelectedChart()); + } } + protected abstract void update(ChartCollection collection, T selectedChart); + @Override protected JPanel createContentPane() { return new JPanel(); diff --git a/designer_chart/src/com/fr/design/mainframe/chart/ChartsEditPane.java b/designer_chart/src/com/fr/design/mainframe/chart/ChartsEditPane.java index b012e95795..7f5897a501 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/ChartsEditPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/ChartsEditPane.java @@ -20,7 +20,7 @@ public class ChartsEditPane extends ChartEditPane { dataPane4SupportCell = new ChartDataPane(listener); dataPane4SupportCell.setSupportCellData(true); - chartsConfigPane = new ChartsConfigPane(); + chartsConfigPane = new DefaultChartsConfigPane(); paneList.add(dataPane4SupportCell); paneList.add(chartsConfigPane); diff --git a/designer_chart/src/com/fr/design/mainframe/chart/DefaultChartsConfigPane.java b/designer_chart/src/com/fr/design/mainframe/chart/DefaultChartsConfigPane.java new file mode 100644 index 0000000000..fc36489465 --- /dev/null +++ b/designer_chart/src/com/fr/design/mainframe/chart/DefaultChartsConfigPane.java @@ -0,0 +1,24 @@ +package com.fr.design.mainframe.chart; + +import com.fr.chart.chartattr.ChartCollection; +import com.fr.chart.chartattr.Charts; + +/** + * Created by mengao on 2017/6/4. + */ +public class DefaultChartsConfigPane extends ChartsConfigPane { + @Override + public Class accptType() { + return null; + } + + @Override + protected void populate(ChartCollection collection, Charts selectedChart) { + + } + + @Override + protected void update(ChartCollection collection, Charts selectedChart) { + + } +} From 30bae7a43fa288b57c348c05d1687c6d52145b77 Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Mon, 5 Jun 2017 15:22:22 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/module/DesignModuleFactory.java | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/designer_base/src/com/fr/design/module/DesignModuleFactory.java b/designer_base/src/com/fr/design/module/DesignModuleFactory.java index 5b9dcb7624..1e5b4d1ed4 100644 --- a/designer_base/src/com/fr/design/module/DesignModuleFactory.java +++ b/designer_base/src/com/fr/design/module/DesignModuleFactory.java @@ -32,16 +32,6 @@ import java.util.ArrayList; public class DesignModuleFactory { private static DesignModuleFactory instance = new DesignModuleFactory(); - private static ChartCollection chartCollection; - - public static ChartCollection getChartCollection() { - return chartCollection; - } - - public static void setChartCollection(ChartCollection chartCollection) { - DesignModuleFactory.chartCollection = chartCollection; - } - private DesignModuleFactory() { } From ff20b64864d8119fddbd548f911c4da5e19db760 Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Mon, 5 Jun 2017 15:29:25 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/chart/ChartsEditPane.java | 2 -- .../chart/DefaultChartsConfigPane.java | 24 ------------------- 2 files changed, 26 deletions(-) delete mode 100644 designer_chart/src/com/fr/design/mainframe/chart/DefaultChartsConfigPane.java diff --git a/designer_chart/src/com/fr/design/mainframe/chart/ChartsEditPane.java b/designer_chart/src/com/fr/design/mainframe/chart/ChartsEditPane.java index 7f5897a501..3f35c585dc 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/ChartsEditPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/ChartsEditPane.java @@ -20,10 +20,8 @@ public class ChartsEditPane extends ChartEditPane { dataPane4SupportCell = new ChartDataPane(listener); dataPane4SupportCell.setSupportCellData(true); - chartsConfigPane = new DefaultChartsConfigPane(); paneList.add(dataPane4SupportCell); - paneList.add(chartsConfigPane); createTabsPane(); } diff --git a/designer_chart/src/com/fr/design/mainframe/chart/DefaultChartsConfigPane.java b/designer_chart/src/com/fr/design/mainframe/chart/DefaultChartsConfigPane.java deleted file mode 100644 index fc36489465..0000000000 --- a/designer_chart/src/com/fr/design/mainframe/chart/DefaultChartsConfigPane.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.fr.design.mainframe.chart; - -import com.fr.chart.chartattr.ChartCollection; -import com.fr.chart.chartattr.Charts; - -/** - * Created by mengao on 2017/6/4. - */ -public class DefaultChartsConfigPane extends ChartsConfigPane { - @Override - public Class accptType() { - return null; - } - - @Override - protected void populate(ChartCollection collection, Charts selectedChart) { - - } - - @Override - protected void update(ChartCollection collection, Charts selectedChart) { - - } -}