Browse Source

第三方图表,接口添加。

master
mengao 8 years ago
parent
commit
065f3d54ed
  1. 16
      designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java
  2. 1
      designer_chart/src/com/fr/design/chart/fun/IndependentChartUIProvider.java
  3. 2
      designer_chart/src/com/fr/design/chart/fun/impl/AbstractIndependentChartUI.java
  4. 16
      designer_chart/src/com/fr/design/chart/fun/impl/AbstractIndependentChartUI4Custom.java
  5. 2
      designer_chart/src/com/fr/design/chart/fun/impl/AbstractIndependentChartUIWithAPILevel.java
  6. 2
      designer_chart/src/com/fr/design/mainframe/chart/gui/ChartDataPane.java
  7. 44
      designer_chart/src/com/fr/design/mainframe/chart/gui/CustomChartDataPane.java
  8. 157
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/CustomChartDataContentsPane.java

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

@ -11,6 +11,7 @@ import com.fr.design.chart.fun.IndependentChartUIProvider;
import com.fr.design.chart.gui.ChartWidgetOption;
import com.fr.design.chartinterface.*;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.core.WidgetOption;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
@ -409,6 +410,21 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
private AbstractTableDataContentPane getTableDataSourcePane(String priority, Plot plot, ChartDataPane parent) {
return chartTypeInterfaces.get(priority).get(plot.getPlotID()).getTableDataSourcePane(plot, parent);
}
public BasicPane getChartConfigPane(Plot plot, ChartDataPane parent) {
Iterator iterator = chartTypeInterfaces.entrySet().iterator();
while (iterator.hasNext()){
Map.Entry entry = (Map.Entry) iterator.next();
String priority = (String) entry.getKey();
if (plotInChart(plot.getPlotID(), priority)) {
return getChartConfigPane(priority, plot, parent);
}
}
return getChartConfigPane(ChartTypeManager.CHART_PRIORITY, plot, parent);
}
private BasicBeanPane getChartConfigPane(String priority, Plot plot, ChartDataPane parent) {
return chartTypeInterfaces.get(priority).get(plot.getPlotID()).getChartConfigPane(plot, parent);
}
public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) {

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

@ -89,5 +89,6 @@ public interface IndependentChartUIProvider extends Level {
*/
String getPlotTypeTitle4PopupWindow();
BasicBeanPane getChartConfigPane(Plot plot, ChartDataPane parent);
}

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

@ -53,4 +53,6 @@ public abstract class AbstractIndependentChartUI implements IndependentChartUIPr
public ConditionAttributesPane getPlotConditionPane(Plot plot){
return new DataSeriesConditionPane();
}
public BasicBeanPane getChartConfigPane(Plot plot, ChartDataPane parent){ return null;}
}

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

@ -6,13 +6,12 @@ import com.fr.design.chart.fun.IndependentChartUIProvider;
import com.fr.design.chart.series.SeriesCondition.DataSeriesConditionPane;
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.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.CustomChartDataPane;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.design.mainframe.chart.gui.data.report.PiePlotReportDataContentPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.mainframe.chart.gui.data.table.PiePlotTableDataContentPane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.general.ComparatorUtils;
/**
@ -23,6 +22,11 @@ public abstract class AbstractIndependentChartUI4Custom implements IndependentCh
int CURRENT_API_LEVEL = 3;
@Override
public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
return new CustomChartDataPane(listener);
}
@Override
public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) {
return null;
@ -50,8 +54,8 @@ public abstract class AbstractIndependentChartUI4Custom implements IndependentCh
}
@Override
public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
return new ChartDataPane(listener);
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener){
return new AbstractChartAttrPane[]{};
}
@Override
@ -62,7 +66,7 @@ public abstract class AbstractIndependentChartUI4Custom implements IndependentCh
@Override
public String getIconPath() {
return "com/fr/solution/plugin/chart/echarts/pie/images/pie.png";
return "com/fr/design/images/form/toolbar/ChartF-Column.png";
}
@Override

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

@ -65,4 +65,6 @@ public abstract class AbstractIndependentChartUIWithAPILevel implements Independ
public String getPlotTypeTitle4PopupWindow(){
return getPlotTypePane().title4PopupWindow();
}
public BasicBeanPane getChartConfigPane(Plot plot, ChartDataPane parent){ return null;}
}

2
designer_chart/src/com/fr/design/mainframe/chart/gui/ChartDataPane.java

@ -28,7 +28,7 @@ public class ChartDataPane extends AbstractChartAttrPane {
super();
this.listener = listener;
}
@Override
protected JPanel createContentPane() {
contentsPane = new NormalChartDataPane(listener, ChartDataPane.this);

44
designer_chart/src/com/fr/design/mainframe/chart/gui/CustomChartDataPane.java

@ -0,0 +1,44 @@
package com.fr.design.mainframe.chart.gui;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.gui.data.CustomChartDataContentsPane;
import javax.swing.*;
import java.awt.*;
/**
* Created by mengao on 2017/4/26.
*/
public class CustomChartDataPane extends ChartDataPane {
private boolean supportCellData = true;
public CustomChartDataPane(AttributeChangeListener listener) {
super(listener);
this.listener = listener;
}
@Override
protected JPanel createContentPane() {
contentsPane = new CustomChartDataContentsPane(listener, CustomChartDataPane.this);
return contentsPane;
}
protected void repeatLayout(ChartCollection collection) {
Plot plot =collection.getSelectedChart().getPlot();
if (contentsPane != null) {
this.remove(contentsPane);
}
this.setLayout(new BorderLayout(0, 0));
contentsPane = new CustomChartDataContentsPane(listener, CustomChartDataPane.this ,plot);
if (contentsPane != null) {
contentsPane.setSupportCellData(supportCellData);
}
}
}

157
designer_chart/src/com/fr/design/mainframe/chart/gui/data/CustomChartDataContentsPane.java

@ -0,0 +1,157 @@
package com.fr.design.mainframe.chart.gui.data;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot;
import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.gui.frpane.UIComboBoxPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import javax.swing.*;
import java.awt.*;
import java.util.ArrayList;
/**
* Created by mengao on 2017/4/26.
*/
public class CustomChartDataContentsPane extends DataContentsPane {
public UIComboBoxPane<ChartCollection> dataPane;
private TableDataPane tableDataPane;
private ReportDataPane reportDataPane;
private BasicBeanPane configPane;
private AttributeChangeListener listener;
private Plot plot;
private ChartDataPane parent;
public CustomChartDataContentsPane(AttributeChangeListener listener, ChartDataPane parent) {
this.listener = listener;
this.parent = parent;
initAll();
}
public CustomChartDataContentsPane(AttributeChangeListener listener, ChartDataPane parent, boolean supportCellData) {
this.listener = listener;
this.parent = parent;
initAll();
dataPane.justSupportOneSelect(true);
}
public CustomChartDataContentsPane(AttributeChangeListener listener, ChartDataPane parent, Plot plot) {
this.listener = listener;
this.parent = parent;
this.plot= plot;
initAll();
}
public CustomChartDataContentsPane(AttributeChangeListener listener, ChartDataPane parent, boolean supportCellData, Plot plot) {
this.listener = listener;
this.parent = parent;
this.plot= plot;
initAll();
dataPane.justSupportOneSelect(true);
}
public UIComboBoxPane<ChartCollection> getDataPane() {
return dataPane;
}
@Override
protected JPanel createContentPane() {
return new BasicScrollPane<ChartCollection>() {
@Override
protected JPanel createContentPane() {
JPanel contentPane = new JPanel(new BorderLayout());
dataPane = new UIComboBoxPane<ChartCollection>() {
protected void initLayout() {
this.setLayout(new BorderLayout(LayoutConstants.HGAP_LARGE, 6));
JPanel northPane = new JPanel(new BorderLayout(LayoutConstants.HGAP_LARGE, 0));
JButton jButton = new JButton();
if(plot!=null){
configPane = (BasicBeanPane)ChartTypeInterfaceManager.getInstance().getChartConfigPane(plot, parent);
northPane.add(configPane, BorderLayout.CENTER);
}else {
northPane.add(jButton, BorderLayout.CENTER);
}
this.add(northPane, BorderLayout.NORTH);
}
@Override
protected String title4PopupWindow() {
return null;
}
@Override
protected java.util.List<FurtherBasicBeanPane<? extends ChartCollection>> initPaneList() {
tableDataPane = getTableDataPane(parent);
reportDataPane = getReportDataPane(parent);
java.util.List<FurtherBasicBeanPane<? extends ChartCollection>> paneList = new ArrayList<FurtherBasicBeanPane<? extends ChartCollection>>();
paneList.add(tableDataPane);
paneList.add(reportDataPane);
return paneList;
}
};
contentPane.add(dataPane, BorderLayout.CENTER);
dataPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
return contentPane;
}
@Override
protected String title4PopupWindow() {
return "";
}
@Override
public void populateBean(ChartCollection ob) {
}
};
}
protected ReportDataPane getReportDataPane(ChartDataPane parent) {
return new ReportDataPane(parent);
}
protected TableDataPane getTableDataPane(ChartDataPane chartDataPane) {
return new TableDataPane(chartDataPane);
}
/**
* 更新界面 数据内容
*/
public void populate(ChartCollection collection) {
Plot plot = collection.getSelectedChart().getPlot();
dataPane.populateBean(collection);
configPane.populateBean(plot);
}
/**
* 保存 数据界面内容
*/
public void update(ChartCollection collection) {
Plot plot = collection.getSelectedChart().getPlot();
configPane.updateBean(plot);
dataPane.updateBean(collection);
configPane.updateBean();
}
/**
* 是否支持单元格数据
*/
public void setSupportCellData(boolean supportCellData) {
dataPane.justSupportOneSelect(supportCellData);
}
}
Loading…
Cancel
Save