帆软报表设计器源代码。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.8 KiB

package com.fr.quickeditor;
import com.fr.base.chart.BaseChartCollection;
import com.fr.chart.chartattr.ChartCollection;
8 years ago
import com.fr.chart.chartattr.ThirdChart;
import com.fr.design.designer.TargetComponent;
import com.fr.design.gui.chart.BaseChartPropertyPane;
8 years ago
import com.fr.design.mainframe.ChartPropertyPane;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.module.DesignModuleFactory;
import com.fr.design.selection.QuickEditor;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection;
import com.fr.poly.PolyDesigner;
import com.fr.poly.creator.ChartBlockEditor;
import com.fr.report.cell.Elem;
import java.awt.*;
public class ChartQuickEditor extends QuickEditor<TargetComponent>{
// kunsnat: editingPropertyPane初始化 避开设计器启动, 在用到的时候再初始化.
//private BaseChartPropertyPane editingPropertyPane = null;
8 years ago
private static boolean lastChartType =false;
public ChartQuickEditor() {
setLayout(new BorderLayout());
setBorder(null);
}
@Override
protected void refresh() {
BaseChartPropertyPane editingPropertyPane = null;
BaseChartCollection collection = null;
if(tc instanceof PolyDesigner) {
ChartBlockEditor chartBlockEditor = (ChartBlockEditor)((PolyDesigner)tc).getSelection().getEditor();
collection = chartBlockEditor.getValue().getChartCollection();
add(editingPropertyPane = DesignModuleFactory.getChartPropertyPane(), BorderLayout.CENTER);
editingPropertyPane.setSupportCellData(false);
} else {
Selection selection = ((ElementCasePane)tc).getSelection();
Elem element = null;
if(selection instanceof CellSelection) {
CellSelection cs = (CellSelection)selection;
element = ((ElementCasePane)tc).getEditingElementCase().getCellElement(cs.getColumn(), cs.getRow());
} else if(selection instanceof FloatSelection){
FloatSelection fs = (FloatSelection)selection;
element = ((ElementCasePane)tc).getEditingElementCase().getFloatElement(fs.getSelectedFloatName());
}
collection = (BaseChartCollection) element.getValue();
8 years ago
boolean chartType = false;
if (((ChartCollection) collection).getSelectedChart() instanceof ThirdChart) {
chartType = true;
}
if (chartType != lastChartType) {
ChartPropertyPane.clear();
}
add(editingPropertyPane = DesignModuleFactory.getChartPropertyPane(), BorderLayout.CENTER);
editingPropertyPane.addChartEditPane(((ChartCollection)collection).getSelectedChart().getPlot().getPlotID());
editingPropertyPane.setSupportCellData(true);
8 years ago
if (((ChartCollection) collection).getSelectedChart() instanceof ThirdChart) {
lastChartType = true;
}
}
editingPropertyPane.populateChartPropertyPane(collection, tc);
}
}