Browse Source

Merge pull request #1 in CHART/design from ~MANGO/m_design:dev to dev

* commit 'ff20b64864d8119fddbd548f911c4da5e19db760':
  删除多余类
  去掉多余代码
  去掉接口代码中instnceof,用泛型代替。
master
eason 8 years ago
parent
commit
2dc75dacfb
  1. 10
      designer_base/src/com/fr/design/module/DesignModuleFactory.java
  2. 18
      designer_chart/src/com/fr/design/mainframe/chart/ChartsConfigPane.java
  3. 2
      designer_chart/src/com/fr/design/mainframe/chart/ChartsEditPane.java

10
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() {
}

18
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 <T extends Charts> extends AbstractChartAttrPane {
public final static String CHART_STYLE_TITLE = Inter.getLocText("Chart-Style_Name");
public abstract Class<? extends Charts> 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();

2
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();
}

Loading…
Cancel
Save