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() { } 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..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 ChartsConfigPane(); paneList.add(dataPane4SupportCell); - paneList.add(chartsConfigPane); createTabsPane(); }