Browse Source

Merge pull request #883 in BA/design from ~MANGO/design:dev to dev

* commit 'adf904821fbd76a16a09eb6b1e82af7c1d14c2d7':
  修改图片,标题等
  添加数据配置页面
master
superman 8 years ago
parent
commit
f5dea0c560
  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. 39
      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.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane; import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.ChartEditPane; 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.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane; 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.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(); Iterator iterator = chartTypeInterfaces.entrySet().iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
Map.Entry entry = (Map.Entry) iterator.next(); Map.Entry entry = (Map.Entry) iterator.next();
@ -427,7 +444,7 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
return getChartConfigPane(ChartTypeManager.CHART_PRIORITY, plotID); 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); 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.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane; import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.ChartEditPane; 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.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane; 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.AbstractReportDataContentPane;
@ -90,6 +91,9 @@ public interface IndependentChartUIProvider extends Level {
*/ */
String getPlotTypeTitle4PopupWindow(); 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.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane; import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.ChartEditPane; 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.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
@ -57,6 +58,9 @@ public abstract class AbstractIndependentChartUI implements IndependentChartUIPr
return new DataSeriesConditionPane(); 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.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane; 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.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane; 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.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.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.AbstractChartTypePane;
import com.fr.design.mainframe.chart.gui.type.PiePlotPane; import com.fr.design.mainframe.chart.gui.type.PiePlotPane;
import com.fr.general.ComparatorUtils; 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. * 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 @Override
public AbstractChartTypePane getPlotTypePane() { public AbstractChartTypePane getPlotTypePane() {
@ -27,17 +40,17 @@ public abstract class AbstractIndependentChartUI4Custom implements IndependentCh
@Override @Override
public ChartDataPane getChartDataPane(AttributeChangeListener listener) { public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
return null; return new ChartDataPane(listener);
} }
@Override @Override
public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) { public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) {
return null; return new CategoryPlotTableDataContentPane(parent);
} }
@Override @Override
public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) { public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) {
return null; return new CategoryPlotReportDataContentPane(parent);
} }
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot){ public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot){
@ -82,4 +95,9 @@ public abstract class AbstractIndependentChartUI4Custom implements IndependentCh
return getPlotTypePane().title4PopupWindow(); 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.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane; import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.ChartEditPane; 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.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
@ -68,5 +69,7 @@ public abstract class AbstractIndependentChartUIWithAPILevel implements Independ
return getPlotTypePane().title4PopupWindow(); 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){ public void addChartEditPane(String plotID){
chartEditPane = ChartTypeInterfaceManager.getInstance().getChartConfigPane(plotID); chartEditPane = ChartTypeInterfaceManager.getInstance().getChartEditPane(plotID);
chartEditPane.setSupportCellData(true); chartEditPane.setSupportCellData(true);
this.createMainPane(); this.createMainPane();
setSureProperty(); setSureProperty();

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

@ -0,0 +1,39 @@
package com.fr.design.mainframe.chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.general.Inter;
import javax.swing.*;
/**
* Created by mengao on 2017/5/16.
*/
public class ThirdChartConfigPane extends AbstractChartAttrPane {
public final static String CHART_STYLE_TITLE = Inter.getLocText("Chart-Style_Name");
@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/chart/ChartStyle.png";
}
@Override
public String title4PopupWindow() {
return CHART_STYLE_TITLE;
}
}

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

@ -1,46 +1,57 @@
package com.fr.design.mainframe.chart; 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. * 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() { public ThirdChartEditPane() {
return paneList.get(1).title4PopupWindow(); this.setLayout(new BorderLayout());
} paneList = new ArrayList<AbstractChartAttrPane>();
public void populate(ChartCollection collection) { dataPane4SupportCell = new ChartDataPane(listener);
populateBean(collection.getSelectedChart()); dataPane4SupportCell.setSupportCellData(true);
} thirdChartConfigPane= new ThirdChartConfigPane();
protected void dealWithStyleChange(){ paneList.add(dataPane4SupportCell);
populateBean(collection.getSelectedChart()); paneList.add(thirdChartConfigPane);
}
/** createTabsPane();
* 图表设计器显示选中的面板
*/
public void populateSelectedTabPane() {
populateBean(collection.getSelectedChart());
} }
/** /**
* 数据集改变的事件监听 * 重新构造面板
* @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