|
|
@ -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; |
|
|
@ -41,7 +42,11 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD |
|
|
|
private UIButton addButton; |
|
|
|
private UIButton addButton; |
|
|
|
|
|
|
|
|
|
|
|
private UIObserverListener uiobListener = null; |
|
|
|
private UIObserverListener uiobListener = null; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ArrayList<UIComboBox> getBoxList() { |
|
|
|
|
|
|
|
return boxList; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public CategoryPlotMoreCateTableDataContentPane() { |
|
|
|
public CategoryPlotMoreCateTableDataContentPane() { |
|
|
|
// do nothing
|
|
|
|
// do nothing
|
|
|
|
} |
|
|
|
} |
|
|
@ -86,8 +91,8 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD |
|
|
|
public void itemStateChanged(ItemEvent e) { |
|
|
|
public void itemStateChanged(ItemEvent e) { |
|
|
|
checkSeriseUse(categoryCombox.getSelectedItem() != null); |
|
|
|
checkSeriseUse(categoryCombox.getSelectedItem() != null); |
|
|
|
makeToolTipUse(categoryCombox); |
|
|
|
makeToolTipUse(categoryCombox); |
|
|
|
|
|
|
|
|
|
|
|
checkAddButton(); |
|
|
|
checkComponent(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
@ -126,15 +131,15 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD |
|
|
|
buttonPane.add(delButton); |
|
|
|
buttonPane.add(delButton); |
|
|
|
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(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
@ -147,6 +152,10 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD |
|
|
|
int size = boxList.size(); |
|
|
|
int size = boxList.size(); |
|
|
|
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(); |
|
|
@ -159,8 +168,8 @@ 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) { |
|
|
@ -218,17 +227,23 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void updateBean(ChartCollection collection) { |
|
|
|
public void updateBean(ChartCollection collection) { |
|
|
|
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); |
|
|
|
UIComboBox box = boxList.get(i); |
|
|
|
} |
|
|
|
if(box.getSelectedItem() != null) { |
|
|
|
} |
|
|
|
normal.addMoreCate(box.getSelectedItem().toString()); |
|
|
|
|
|
|
|
} |
|
|
|
protected void updateMoreCate(NormalTableDataDefinition normal, Plot plot) { |
|
|
|
|
|
|
|
for (int i = 0, size = boxList.size(); i < size; i++) { |
|
|
|
|
|
|
|
UIComboBox box = boxList.get(i); |
|
|
|
|
|
|
|
if (box.getSelectedItem() != null) { |
|
|
|
|
|
|
|
normal.addMoreCate(box.getSelectedItem().toString()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |