|
|
|
@ -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(); |
|
|
|
|