Browse Source

添加数据配置页面

master
mengao 8 years ago
parent
commit
62ac4b8bec
  1. 21
      designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java
  2. 6
      designer_chart/src/com/fr/design/chart/fun/IndependentChartUIProvider.java
  3. 6
      designer_chart/src/com/fr/design/chart/fun/impl/AbstractIndependentChartUI.java
  4. 26
      designer_chart/src/com/fr/design/chart/fun/impl/AbstractIndependentChartUI4Custom.java
  5. 5
      designer_chart/src/com/fr/design/chart/fun/impl/AbstractIndependentChartUIWithAPILevel.java
  6. 2
      designer_chart/src/com/fr/design/mainframe/MiddleChartPropertyPane.java
  7. 35
      designer_chart/src/com/fr/design/mainframe/chart/ThirdChartConfigPane.java
  8. 65
      designer_chart/src/com/fr/design/mainframe/chart/ThirdChartEditPane.java

21
designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java

@ -16,6 +16,7 @@ import com.fr.design.gui.core.WidgetOption;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.ThirdChartConfigPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
@ -415,7 +416,23 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
}
//获取指定图表的编辑面板
public ChartEditPane getChartConfigPane(String plotID) {
public ChartEditPane getChartEditPane(String plotID) {
Iterator iterator = chartTypeInterfaces.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry entry = (Map.Entry) iterator.next();
String priority = (String) entry.getKey();
if (plotInChart(plotID, priority)) {
return getChartEditPane(priority, plotID);
}
}
return getChartEditPane(ChartTypeManager.CHART_PRIORITY, plotID);
}
private ChartEditPane getChartEditPane(String priority, String plotID) {
return chartTypeInterfaces.get(priority).get(plotID).getChartEditPane(plotID);
}
public ThirdChartConfigPane getChartConfigPane(String plotID) {
Iterator iterator = chartTypeInterfaces.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry entry = (Map.Entry) iterator.next();
@ -427,7 +444,7 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
return getChartConfigPane(ChartTypeManager.CHART_PRIORITY, plotID);
}
private ChartEditPane getChartConfigPane(String priority, String plotID) {
private ThirdChartConfigPane getChartConfigPane(String priority, String plotID) {
return chartTypeInterfaces.get(priority).get(plotID).getChartConfigPane(plotID);
}

6
designer_chart/src/com/fr/design/chart/fun/IndependentChartUIProvider.java

@ -6,6 +6,7 @@ import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.ThirdChartConfigPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
@ -90,6 +91,9 @@ public interface IndependentChartUIProvider extends Level {
*/
String getPlotTypeTitle4PopupWindow();
ChartEditPane getChartConfigPane(String plotID);
ChartEditPane getChartEditPane(String plotID);
ThirdChartConfigPane getChartConfigPane(String plotID);
}

6
designer_chart/src/com/fr/design/chart/fun/impl/AbstractIndependentChartUI.java

@ -8,6 +8,7 @@ import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.ThirdChartConfigPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.general.ComparatorUtils;
@ -57,6 +58,9 @@ public abstract class AbstractIndependentChartUI implements IndependentChartUIPr
return new DataSeriesConditionPane();
}
public ChartEditPane getChartConfigPane(String plotID){ return StableUtils.construct(ChartEditPane.class);}
public ChartEditPane getChartEditPane(String plotID){ return StableUtils.construct(ChartEditPane.class);}
public ThirdChartConfigPane getChartConfigPane(String plotID){return null;}
}

26
designer_chart/src/com/fr/design/chart/fun/impl/AbstractIndependentChartUI4Custom.java

@ -6,19 +6,32 @@ import com.fr.design.chart.fun.IndependentChartUIProvider;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.ThirdChartEditPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.design.mainframe.chart.gui.data.report.CategoryPlotReportDataContentPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.mainframe.chart.gui.data.table.CategoryPlotTableDataContentPane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.design.mainframe.chart.gui.type.PiePlotPane;
import com.fr.general.ComparatorUtils;
import com.fr.stable.fun.impl.AbstractProvider;
import com.fr.stable.fun.mark.API;
/**
* Created by mengao on 2017/4/24.
* 用户使用第三方图表需要继承的面板抽象类
*/
public abstract class AbstractIndependentChartUI4Custom implements IndependentChartUIProvider {
@API(level = IndependentChartUIProvider.CURRENT_API_LEVEL)
public abstract class AbstractIndependentChartUI4Custom extends AbstractProvider implements IndependentChartUIProvider {
public String mark4Provider() {
return getClass().getName();
}
@Override
public AbstractChartTypePane getPlotTypePane() {
@ -27,17 +40,17 @@ public abstract class AbstractIndependentChartUI4Custom implements IndependentCh
@Override
public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
return null;
return new ChartDataPane(listener);
}
@Override
public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) {
return null;
return new CategoryPlotTableDataContentPane(parent);
}
@Override
public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) {
return null;
return new CategoryPlotReportDataContentPane(parent);
}
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot){
@ -82,4 +95,9 @@ public abstract class AbstractIndependentChartUI4Custom implements IndependentCh
return getPlotTypePane().title4PopupWindow();
}
@Override
public ChartEditPane getChartEditPane(String plotID) {
return new ThirdChartEditPane();
}
}

5
designer_chart/src/com/fr/design/chart/fun/impl/AbstractIndependentChartUIWithAPILevel.java

@ -8,6 +8,7 @@ import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.ThirdChartConfigPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.general.ComparatorUtils;
@ -68,5 +69,7 @@ public abstract class AbstractIndependentChartUIWithAPILevel implements Independ
return getPlotTypePane().title4PopupWindow();
}
public ChartEditPane getChartConfigPane(String plotID){ return StableUtils.construct(ChartEditPane.class);}
public ChartEditPane getChartEditPane(String plotID){ return StableUtils.construct(ChartEditPane.class);}
public ThirdChartConfigPane getChartConfigPane(String plotID){return null;}
}

2
designer_chart/src/com/fr/design/mainframe/MiddleChartPropertyPane.java

@ -39,7 +39,7 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{
}
public void addChartEditPane(String plotID){
chartEditPane = ChartTypeInterfaceManager.getInstance().getChartConfigPane(plotID);
chartEditPane = ChartTypeInterfaceManager.getInstance().getChartEditPane(plotID);
chartEditPane.setSupportCellData(true);
this.createMainPane();
setSureProperty();

35
designer_chart/src/com/fr/design/mainframe/chart/ThirdChartConfigPane.java

@ -0,0 +1,35 @@
package com.fr.design.mainframe.chart;
import com.fr.chart.chartattr.ChartCollection;
import javax.swing.*;
/**
* Created by mengao on 2017/5/16.
*/
public class ThirdChartConfigPane extends AbstractChartAttrPane {
@Override
public void populate(ChartCollection collection) {
}
@Override
public void update(ChartCollection collection) {
}
@Override
protected JPanel createContentPane() {
return new JPanel();
}
@Override
public String getIconPath() {
return "com/fr/design/images/form/toolbar/ChartF-Column.png";
}
@Override
public String title4PopupWindow() {
return "CustomChart";
}
}

65
designer_chart/src/com/fr/design/mainframe/chart/ThirdChartEditPane.java

@ -1,46 +1,57 @@
package com.fr.design.mainframe.chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Chart;
import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import java.awt.*;
import java.util.ArrayList;
/**
* Created by mengao on 2017/5/3.
*/
public abstract class ThirdChartEditPane extends ChartEditPane {
public class ThirdChartEditPane extends ChartEditPane {
protected void createTabsPane() {}
protected ThirdChartConfigPane thirdChartConfigPane;
public String getSelectedTabName() {
return paneList.get(1).title4PopupWindow();
}
public ThirdChartEditPane() {
this.setLayout(new BorderLayout());
paneList = new ArrayList<AbstractChartAttrPane>();
public void populate(ChartCollection collection) {
populateBean(collection.getSelectedChart());
}
dataPane4SupportCell = new ChartDataPane(listener);
dataPane4SupportCell.setSupportCellData(true);
thirdChartConfigPane= new ThirdChartConfigPane();
protected void dealWithStyleChange(){
populateBean(collection.getSelectedChart());
}
paneList.add(dataPane4SupportCell);
paneList.add(thirdChartConfigPane);
/**
* 图表设计器显示选中的面板
*/
public void populateSelectedTabPane() {
populateBean(collection.getSelectedChart());
createTabsPane();
}
/**
* 数据集改变的事件监听
* 重新构造面板
* @param currentChart 图表
*/
public void registerDSChangeListener() {
}
public void reLayout(Chart currentChart) {
if (currentChart != null) {
int chartIndex = getSelectedChartIndex(currentChart);
this.removeAll();
this.setLayout(new BorderLayout());
paneList = new ArrayList<AbstractChartAttrPane>();
String plotID = "";
if (currentChart.getPlot() != null) {
plotID = currentChart.getPlot().getPlotID();
}
dataPane4SupportCell = createChartDataPane(plotID);
thirdChartConfigPane= ChartTypeInterfaceManager.getInstance().getChartConfigPane(plotID);
paneList.add(dataPane4SupportCell);
paneList.add(thirdChartConfigPane);
createTabsPane();
}
@Override
protected String title4PopupWindow() {
return "CustomChart";
}
protected abstract void populateBean(Object ob);
protected abstract void updateBean(Object ob);
}

Loading…
Cancel
Save