Browse Source

Merge pull request #6 in CHART/design from ~MANGO/m_design:dev to dev

* commit '8810f3c6956e3e2fc9cab3731eee052bb2b732aa':
  修改返回类型
  将Table中的返回类型ArrayList<UIComboBox>改为List<UIComboBox>。
  多分类轴整体代码,第一次提交
master
superman 7 years ago
parent
commit
baaf67bb38
  1. 23
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java
  2. 33
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotMoreCateTableDataContentPane.java

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

@ -3,6 +3,7 @@ package com.fr.design.mainframe.chart.gui.data.report;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.Utils; import com.fr.base.Utils;
import com.fr.base.chart.chartdata.TopDefinitionProvider; import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.Axis;
import com.fr.chart.chartattr.Bar2DPlot; import com.fr.chart.chartattr.Bar2DPlot;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartdata.NormalReportDataDefinition; import com.fr.chart.chartdata.NormalReportDataDefinition;
@ -21,6 +22,7 @@ import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List;
/** /**
@ -37,6 +39,10 @@ public class CategoryPlotMoreCateReportDataContentPane extends CategoryPlotRepor
private ArrayList<TinyFormulaPane> formualList = new ArrayList<TinyFormulaPane>(); private ArrayList<TinyFormulaPane> formualList = new ArrayList<TinyFormulaPane>();
private UIObserverListener uiobListener = null; private UIObserverListener uiobListener = null;
public List<TinyFormulaPane> getFormualList() {
return formualList;
}
public CategoryPlotMoreCateReportDataContentPane() { public CategoryPlotMoreCateReportDataContentPane() {
} }
@ -105,13 +111,13 @@ public class CategoryPlotMoreCateReportDataContentPane extends CategoryPlotRepor
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
boxPane.remove(newButtonPane); boxPane.remove(newButtonPane);
formualList.remove(pane); formualList.remove(pane);
checkAddButton(); checkComponent();
relayoutPane(); relayoutPane();
} }
}); });
delButton.registerChangeListener(uiobListener); delButton.registerChangeListener(uiobListener);
checkAddButton(); checkComponent();
relayoutPane(); relayoutPane();
return pane; return pane;
@ -122,6 +128,10 @@ public class CategoryPlotMoreCateReportDataContentPane extends CategoryPlotRepor
addButton.setEnabled(size < 2); addButton.setEnabled(size < 2);
} }
protected void checkComponent() {
checkAddButton();
}
private void relayoutPane() { private void relayoutPane() {
this.revalidate(); this.revalidate();
} }
@ -168,15 +178,20 @@ public class CategoryPlotMoreCateReportDataContentPane extends CategoryPlotRepor
super.updateBean(collection); super.updateBean(collection);
TopDefinitionProvider definition = collection.getSelectedChart().getFilterDefinition(); TopDefinitionProvider definition = collection.getSelectedChart().getFilterDefinition();
Axis axis = collection.getSelectedChart().getPlot().getxAxis();
if (definition instanceof NormalReportDataDefinition) { if (definition instanceof NormalReportDataDefinition) {
NormalReportDataDefinition reportDefinition = (NormalReportDataDefinition) definition; NormalReportDataDefinition reportDefinition = (NormalReportDataDefinition) definition;
reportDefinition.clearMoreCate(); reportDefinition.clearMoreCate();
updateMoreCate(reportDefinition, axis);
for(int i = 0, size = formualList.size(); i < size; i++) { }
}
protected void updateMoreCate(NormalReportDataDefinition reportDefinition, Axis axis) {
for (int i = 0, size = formualList.size(); i < size; i++) {
TinyFormulaPane pane = formualList.get(i); TinyFormulaPane pane = formualList.get(i);
reportDefinition.addMoreCate(canBeFormula(pane.updateBean())); reportDefinition.addMoreCate(canBeFormula(pane.updateBean()));
} }
} }
}
} }

33
designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotMoreCateTableDataContentPane.java

@ -4,6 +4,7 @@ import com.fr.base.BaseUtils;
import com.fr.base.chart.chartdata.TopDefinitionProvider; import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.Bar2DPlot; import com.fr.chart.chartattr.Bar2DPlot;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartdata.NormalTableDataDefinition; import com.fr.chart.chartdata.NormalTableDataDefinition;
import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
@ -42,6 +43,10 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
private UIObserverListener uiobListener = null; private UIObserverListener uiobListener = null;
public List<UIComboBox> getBoxList() {
return boxList;
}
public CategoryPlotMoreCateTableDataContentPane() { public CategoryPlotMoreCateTableDataContentPane() {
// do nothing // do nothing
} }
@ -87,7 +92,7 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
checkSeriseUse(categoryCombox.getSelectedItem() != null); checkSeriseUse(categoryCombox.getSelectedItem() != null);
makeToolTipUse(categoryCombox); makeToolTipUse(categoryCombox);
checkAddButton(); checkComponent();
} }
}); });
} }
@ -127,14 +132,14 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
boxPane.add(buttonPane); boxPane.add(buttonPane);
boxList.add(combox); boxList.add(combox);
checkAddButton(); checkComponent();
delButton.addActionListener(new ActionListener() { delButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
boxPane.remove(buttonPane); boxPane.remove(buttonPane);
boxList.remove(combox); boxList.remove(combox);
checkAddButton(); checkComponent();
relayoutPane(); relayoutPane();
} }
}); });
@ -148,6 +153,10 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
addButton.setEnabled(size < 2 && categoryCombox.getSelectedItem() != null); addButton.setEnabled(size < 2 && categoryCombox.getSelectedItem() != null);
} }
protected void checkComponent() {
checkAddButton();
}
private void relayoutPane() { private void relayoutPane() {
this.revalidate(); this.revalidate();
} }
@ -160,7 +169,7 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
public void checkBoxUse(boolean hasUse) { public void checkBoxUse(boolean hasUse) {
super.checkBoxUse(hasUse); super.checkBoxUse(hasUse);
checkAddButton(); checkComponent();
} }
protected void refreshBoxListWithSelectTableData(List list) { protected void refreshBoxListWithSelectTableData(List list) {
@ -220,15 +229,21 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
super.updateBean(collection); super.updateBean(collection);
TopDefinitionProvider top = collection.getSelectedChart().getFilterDefinition(); TopDefinitionProvider top = collection.getSelectedChart().getFilterDefinition();
if(top instanceof NormalTableDataDefinition) { Plot plot = collection.getSelectedChart().getPlot();
NormalTableDataDefinition normal = (NormalTableDataDefinition)top; if (top instanceof NormalTableDataDefinition) {
NormalTableDataDefinition normal = (NormalTableDataDefinition) top;
normal.clearMoreCate(); normal.clearMoreCate();
for(int i = 0, size = boxList.size(); i < size; i++) { updateMoreCate(normal, plot);
}
}
protected void updateMoreCate(NormalTableDataDefinition normal, Plot plot) {
for (int i = 0, size = boxList.size(); i < size; i++) {
UIComboBox box = boxList.get(i); UIComboBox box = boxList.get(i);
if(box.getSelectedItem() != null) { if (box.getSelectedItem() != null) {
normal.addMoreCate(box.getSelectedItem().toString()); normal.addMoreCate(box.getSelectedItem().toString());
} }
} }
} }
}
} }
Loading…
Cancel
Save