Browse Source

Merge pull request #1200 in BA/design from ~ZHENG/design:release/9.0 to release/9.0

* commit '881ede801de0084ed8ad567ab5f051ce4b6dcbf6':
  格式
  8.0-9.0合并冲突解决
master
superman 7 years ago
parent
commit
e438acf0fc
  1. 13
      designer_chart/src/com/fr/design/chart/ChartTypePane.java
  2. 489
      designer_chart/src/com/fr/design/chart/series/PlotSeries/MapGroupExtensionPane.java
  3. 155
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java

13
designer_chart/src/com/fr/design/chart/ChartTypePane.java

@ -7,7 +7,11 @@ package com.fr.design.chart;
import com.fr.base.FRContext;
import com.fr.base.FRCoreContext;
import com.fr.chart.base.ChartInternationalNameContentBean;
import com.fr.chart.chartattr.*;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.ChartIcon;
import com.fr.chart.chartattr.MapPlot;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
@ -150,7 +154,7 @@ public class ChartTypePane extends ChartCommonWizardPane {
String plotID = typeName[mainTypeList.getSelectedIndex()].getPlotID();
Chart chart = ChartTypeManager.getInstance().getChartTypes(plotID)[iconViewList.getSelectedIndex()];
if(chart.getPlot() != null){
if(chart.getPlot() instanceof MapPlot && !(VT4FR.isLicAvailable(FRCoreContext.getBytes()) && VT4FR.CHART_MAP.support())){
if(chart.getPlot() instanceof MapPlot && !supportMap()){
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Chart-Map_Not_Supported"));
throw new RegistEditionException(VT4FR.CHART_MAP);
}
@ -165,6 +169,11 @@ public class ChartTypePane extends ChartCommonWizardPane {
}
}
private boolean supportMap() {
byte[] bytes = FRCoreContext.getBytes();
return VT4FR.isLicAvailable(bytes) && VT4FR.CHART_MAP.support();
}
public void update(ChartCollection cc) {
if (cc == null) {
return;

489
designer_chart/src/com/fr/design/chart/series/PlotSeries/MapGroupExtensionPane.java

File diff suppressed because one or more lines are too long

155
designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java

@ -5,6 +5,7 @@ import com.fr.base.Utils;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.Bar2DPlot;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartdata.NormalReportDataDefinition;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
@ -21,6 +22,7 @@ import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
/**
@ -30,130 +32,138 @@ import java.util.ArrayList;
*/
public class CategoryPlotMoreCateReportDataContentPane extends CategoryPlotReportDataContentPane implements UIObserver{
private static final long serialVersionUID = -1122313353777460534L;
private JPanel boxPane;
private UIButton addButton;
private ArrayList<TinyFormulaPane> formualList = new ArrayList<TinyFormulaPane>();
private UIObserverListener uiobListener = null;
public List<TinyFormulaPane> getFormualList() {
return formualList;
}
public CategoryPlotMoreCateReportDataContentPane() {
}
public CategoryPlotMoreCateReportDataContentPane(ChartDataPane parent) {
initEveryPane();
categoryName = initCategoryBox(Inter.getLocText("FR-Chart-Category_Name"));
JPanel catePane = new JPanel();
catePane.setLayout(new BorderLayout(2, 2));
catePane.add(categoryName);
addButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/add.png"));
addButton.setPreferredSize(new Dimension(20, 20));
catePane.add(addButton, BorderLayout.EAST);
boxPane = new JPanel();
boxPane.setLayout(new BoxLayout(boxPane, BoxLayout.Y_AXIS));
boxPane.setBackground(Color.red);
catePane.add(boxPane, BorderLayout.SOUTH);
initEveryPane();
categoryName = initCategoryBox(Inter.getLocText("FR-Chart-Category_Name"));
JPanel catePane = new JPanel();
catePane.setLayout(new BorderLayout(2, 2));
catePane.add(categoryName);
addButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/add.png"));
addButton.setPreferredSize(new Dimension(20, 20));
catePane.add(addButton, BorderLayout.EAST);
boxPane = new JPanel();
boxPane.setLayout(new BoxLayout(boxPane, BoxLayout.Y_AXIS));
boxPane.setBackground(Color.red);
catePane.add(boxPane, BorderLayout.SOUTH);
catePane.setBorder(BorderFactory.createEmptyBorder(0,24,10,15));
this.add(catePane, "0,0,2,0");
this.add(catePane, "0,0,2,0");
filterPane = new ChartDataFilterPane(new Bar2DPlot(), parent);
JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),filterPane);
panel.setBorder(getSidesBorder());
filterPane.setBorder(getFilterPaneBorder());
this.add(panel, "0,6,2,4");
addButton.addActionListener(new ActionListener() {
addButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
addNewCatePane();
}
});
}
/**
* 检查box 是否应该可用状态.
*/
public void checkBoxUse() {
super.checkBoxUse();
String text = categoryName.getUITextField().getText();
addButton.setEnabled(StringUtils.isNotEmpty(text));
}
/**
* 检查box 是否应该可用状态.
*/
public void checkBoxUse() {
super.checkBoxUse();
String text = categoryName.getUITextField().getText();
addButton.setEnabled(StringUtils.isNotEmpty(text));
}
private TinyFormulaPane addNewCatePane() {
final TinyFormulaPane pane = initCategoryBox(StringUtils.EMPTY);
pane.setPreferredSize(new Dimension(106, 16));
pane.registerChangeListener(uiobListener);
formualList.add(pane);
final JPanel newButtonPane = new JPanel();
newButtonPane.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 0));
newButtonPane.add(pane);
UIButton delButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/toolbarbtn/close.png"));
newButtonPane.add(delButton);
boxPane.add(newButtonPane);
delButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
boxPane.remove(newButtonPane);
formualList.remove(pane);
checkAddButton();
checkComponent();
relayoutPane();
}
});
delButton.registerChangeListener(uiobListener);
checkAddButton();
checkComponent();
relayoutPane();
return pane;
}
private void checkAddButton() {
int size = formualList.size();
addButton.setEnabled(size < 2);
}
protected void checkComponent() {
checkAddButton();
}
private void relayoutPane() {
this.revalidate();
}
/**
* 给组件登记一个观察者监听事件
*
* @param listener 观察者监听事件
*/
/**
* 给组件登记一个观察者监听事件
*
* @param listener 观察者监听事件
*/
public void registerChangeListener(UIObserverListener listener) {
uiobListener = listener;
}
/**
* 组件是否需要响应添加的观察者事件
*
* @return 如果需要响应观察者事件则返回true否则返回false
*/
/**
* 组件是否需要响应添加的观察者事件
*
* @return 如果需要响应观察者事件则返回true否则返回false
*/
public boolean shouldResponseChangeListener() {
return true;
}
public void populateBean(ChartCollection collection) {
super.populateBean(collection);
formualList.clear();
TopDefinitionProvider definition = collection.getSelectedChart().getFilterDefinition();
if (definition instanceof NormalReportDataDefinition) {
NormalReportDataDefinition reportDefinition = (NormalReportDataDefinition) definition;
@ -165,23 +175,28 @@ public class CategoryPlotMoreCateReportDataContentPane extends CategoryPlotRepor
}
}
}
checkAddButton();
}
public void updateBean(ChartCollection collection) {
super.updateBean(collection);
TopDefinitionProvider definition = collection.getSelectedChart().getFilterDefinition();
Plot plot = collection.getSelectedChart().getPlot();
if (definition instanceof NormalReportDataDefinition) {
NormalReportDataDefinition reportDefinition = (NormalReportDataDefinition) definition;
reportDefinition.clearMoreCate();
for(int i = 0, size = formualList.size(); i < size; i++) {
TinyFormulaPane pane = formualList.get(i);
reportDefinition.addMoreCate(canBeFormula(pane.updateBean()));
}
updateMoreCate(reportDefinition, plot);
}
}
protected void updateMoreCate(NormalReportDataDefinition reportDefinition, Plot plot) {
for (int i = 0, size = formualList.size(); i < size; i++) {
TinyFormulaPane pane = formualList.get(i);
reportDefinition.addMoreCate(canBeFormula(pane.updateBean()));
}
}
}
Loading…
Cancel
Save