|
|
|
@ -4,6 +4,7 @@ import com.fr.base.BaseUtils;
|
|
|
|
|
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.NormalTableDataDefinition; |
|
|
|
|
import com.fr.design.event.UIObserver; |
|
|
|
|
import com.fr.design.event.UIObserverListener; |
|
|
|
@ -26,6 +27,7 @@ import java.util.List;
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 多分类轴 的数据集定义界面. |
|
|
|
|
* |
|
|
|
|
* @author kunsnat E-mail:kunsnat@gmail.com |
|
|
|
|
* @version 创建时间:2013-9-3 上午10:00:28 |
|
|
|
|
*/ |
|
|
|
@ -42,6 +44,10 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
|
|
|
|
|
|
|
|
|
|
private UIObserverListener uiobListener = null; |
|
|
|
|
|
|
|
|
|
public List<UIComboBox> getBoxList() { |
|
|
|
|
return boxList; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public CategoryPlotMoreCateTableDataContentPane() { |
|
|
|
|
// do nothing
|
|
|
|
|
} |
|
|
|
@ -59,8 +65,8 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
|
|
|
|
|
addButton.setPreferredSize(new Dimension(20, COMBOX_HEIGHT)); |
|
|
|
|
|
|
|
|
|
categoryPane.add(GUICoreUtils.createBorderLayoutPane(new Component[]{categoryCombox, addButton, null, categoryLabel, null})); |
|
|
|
|
categoryPane.setBorder(BorderFactory.createEmptyBorder(0,24,10,15)); |
|
|
|
|
|
|
|
|
|
categoryPane.setBorder(BorderFactory.createEmptyBorder(0,24,10,15)); |
|
|
|
|
|
|
|
|
|
boxPane = new JPanel(); |
|
|
|
|
boxPane.setLayout(new BoxLayout(boxPane, BoxLayout.Y_AXIS)); |
|
|
|
@ -90,7 +96,7 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
|
|
|
|
|
checkSeriseUse(categoryCombox.getSelectedItem() != null); |
|
|
|
|
makeToolTipUse(categoryCombox); |
|
|
|
|
|
|
|
|
|
checkAddButton(); |
|
|
|
|
checkComponent(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
@ -130,14 +136,14 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
|
|
|
|
|
boxPane.add(buttonPane); |
|
|
|
|
boxList.add(combox); |
|
|
|
|
|
|
|
|
|
checkAddButton(); |
|
|
|
|
checkComponent(); |
|
|
|
|
|
|
|
|
|
delButton.addActionListener(new ActionListener() { |
|
|
|
|
@Override |
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
boxPane.remove(buttonPane); |
|
|
|
|
boxList.remove(combox); |
|
|
|
|
checkAddButton(); |
|
|
|
|
checkComponent(); |
|
|
|
|
relayoutPane(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
@ -151,6 +157,10 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
|
|
|
|
|
addButton.setEnabled(size < 2 && categoryCombox.getSelectedItem() != null); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected void checkComponent() { |
|
|
|
|
checkAddButton(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void relayoutPane() { |
|
|
|
|
this.revalidate(); |
|
|
|
|
} |
|
|
|
@ -158,12 +168,13 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 检查 某些Box是否可用 |
|
|
|
|
* |
|
|
|
|
* @param hasUse 是否使用. |
|
|
|
|
*/ |
|
|
|
|
public void checkBoxUse(boolean hasUse) { |
|
|
|
|
super.checkBoxUse(hasUse); |
|
|
|
|
|
|
|
|
|
checkAddButton(); |
|
|
|
|
checkComponent(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected void refreshBoxListWithSelectTableData(List list) { |
|
|
|
@ -194,6 +205,7 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 更新 多分类相关界面 |
|
|
|
|
* |
|
|
|
|
* @param collection |
|
|
|
|
*/ |
|
|
|
|
public void populateBean(ChartCollection collection) { |
|
|
|
@ -217,15 +229,22 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 保存多分类界面到collection |
|
|
|
|
* |
|
|
|
|
* @param collection |
|
|
|
|
*/ |
|
|
|
|
public void updateBean(ChartCollection collection) { |
|
|
|
|
super.updateBean(collection); |
|
|
|
|
|
|
|
|
|
TopDefinitionProvider top = collection.getSelectedChart().getFilterDefinition(); |
|
|
|
|
Plot plot = collection.getSelectedChart().getPlot(); |
|
|
|
|
if (top instanceof NormalTableDataDefinition) { |
|
|
|
|
NormalTableDataDefinition normal = (NormalTableDataDefinition) top; |
|
|
|
|
normal.clearMoreCate(); |
|
|
|
|
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); |
|
|
|
|
if (box.getSelectedItem() != null) { |
|
|
|
@ -233,5 +252,5 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |