|
|
|
@ -37,10 +37,10 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
|
|
|
|
|
private static final int COMBOX_HEIGHT = 20; |
|
|
|
|
|
|
|
|
|
private JPanel boxPane; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private ArrayList<UIComboBox> boxList = new ArrayList<UIComboBox>(); |
|
|
|
|
private UIButton addButton; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private UIObserverListener uiobListener = null; |
|
|
|
|
|
|
|
|
|
public List<UIComboBox> getBoxList() { |
|
|
|
@ -50,31 +50,31 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
|
|
|
|
|
public CategoryPlotMoreCateTableDataContentPane() { |
|
|
|
|
// do nothing
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public CategoryPlotMoreCateTableDataContentPane(ChartDataPane parent) { |
|
|
|
|
categoryCombox = new UIComboBox(); |
|
|
|
|
categoryCombox.setPreferredSize(new Dimension(100,20)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JPanel categoryPane = new JPanel(new BorderLayout(4,0)); |
|
|
|
|
categoryPane.setBorder(BorderFactory.createMatteBorder(0, 0, 6, 1, getBackground())); |
|
|
|
|
UILabel categoryLabel = new BoldFontTextLabel(Inter.getLocText("FR-Chart-Category_Name") + ":", SwingConstants.RIGHT) ; |
|
|
|
|
categoryLabel.setPreferredSize(new Dimension(75,20)); |
|
|
|
|
|
|
|
|
|
addButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/add.png")); |
|
|
|
|
addButton.setPreferredSize(new Dimension(20, 20)); |
|
|
|
|
|
|
|
|
|
categoryPane.add(GUICoreUtils.createBorderLayoutPane(new Component[]{categoryCombox, addButton,null,categoryLabel,null})); |
|
|
|
|
|
|
|
|
|
boxPane = new JPanel(); |
|
|
|
|
boxPane.setLayout(new BoxLayout(boxPane, BoxLayout.Y_AXIS)); |
|
|
|
|
|
|
|
|
|
categoryPane.add(boxPane, BorderLayout.SOUTH); |
|
|
|
|
|
|
|
|
|
UILabel categoryLabel = new BoldFontTextLabel(Inter.getLocText("FR-Chart-Category_Name") + ":", SwingConstants.RIGHT) ; |
|
|
|
|
categoryLabel.setPreferredSize(new Dimension(75,20)); |
|
|
|
|
|
|
|
|
|
addButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/add.png")); |
|
|
|
|
addButton.setPreferredSize(new Dimension(20, 20)); |
|
|
|
|
|
|
|
|
|
categoryPane.add(GUICoreUtils.createBorderLayoutPane(new Component[]{categoryCombox, addButton,null,categoryLabel,null})); |
|
|
|
|
|
|
|
|
|
boxPane = new JPanel(); |
|
|
|
|
boxPane.setLayout(new BoxLayout(boxPane, BoxLayout.Y_AXIS)); |
|
|
|
|
|
|
|
|
|
categoryPane.add(boxPane, BorderLayout.SOUTH); |
|
|
|
|
|
|
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
|
this.add(categoryPane, BorderLayout.NORTH); |
|
|
|
|
seriesTypeComboxPane = new SeriesTypeUseComboxPane(parent, new Bar2DPlot()); |
|
|
|
|
this.add(seriesTypeComboxPane, BorderLayout.SOUTH); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addButton.addActionListener(new ActionListener() { |
|
|
|
|
@Override |
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
@ -82,11 +82,11 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
|
|
|
|
|
addNewCombox(); |
|
|
|
|
relayoutPane(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
checkSeriseUse(categoryCombox.getSelectedItem() != null); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
categoryCombox.addItemListener(new ItemListener() { |
|
|
|
|
public void itemStateChanged(ItemEvent e) { |
|
|
|
|
checkSeriseUse(categoryCombox.getSelectedItem() != null); |
|
|
|
@ -96,45 +96,45 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void checkSeriseUse(boolean hasUse) { |
|
|
|
|
super.checkSeriseUse(hasUse); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addButton.setEnabled(hasUse); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private UIComboBox addNewCombox() { |
|
|
|
|
final JPanel buttonPane = new JPanel(); |
|
|
|
|
buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 2)); |
|
|
|
|
|
|
|
|
|
final UIComboBox combox = new UIComboBox(); |
|
|
|
|
combox.setPreferredSize(new Dimension(COMBOX_WIDTH, COMBOX_HEIGHT)); |
|
|
|
|
|
|
|
|
|
int count = categoryCombox.getItemCount(); |
|
|
|
|
for(int i = 0; i < count; i++) { |
|
|
|
|
combox.addItem(categoryCombox.getItemAt(i)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
combox.registerChangeListener(uiobListener); |
|
|
|
|
combox.addItemListener(new ItemListener() { |
|
|
|
|
final JPanel buttonPane = new JPanel(); |
|
|
|
|
buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 2)); |
|
|
|
|
|
|
|
|
|
final UIComboBox combox = new UIComboBox(); |
|
|
|
|
combox.setPreferredSize(new Dimension(COMBOX_WIDTH, COMBOX_HEIGHT)); |
|
|
|
|
|
|
|
|
|
int count = categoryCombox.getItemCount(); |
|
|
|
|
for(int i = 0; i < count; i++) { |
|
|
|
|
combox.addItem(categoryCombox.getItemAt(i)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
combox.registerChangeListener(uiobListener); |
|
|
|
|
combox.addItemListener(new ItemListener() { |
|
|
|
|
@Override |
|
|
|
|
public void itemStateChanged(ItemEvent e) { |
|
|
|
|
makeToolTipUse(combox); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
combox.setSelectedItem(categoryCombox.getItemAt(0)); |
|
|
|
|
makeToolTipUse(combox); |
|
|
|
|
|
|
|
|
|
buttonPane.add(combox); |
|
|
|
|
UIButton delButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/toolbarbtn/close.png")); |
|
|
|
|
buttonPane.add(delButton); |
|
|
|
|
boxPane.add(buttonPane); |
|
|
|
|
boxList.add(combox); |
|
|
|
|
|
|
|
|
|
combox.setSelectedItem(categoryCombox.getItemAt(0)); |
|
|
|
|
makeToolTipUse(combox); |
|
|
|
|
|
|
|
|
|
buttonPane.add(combox); |
|
|
|
|
UIButton delButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/toolbarbtn/close.png")); |
|
|
|
|
buttonPane.add(delButton); |
|
|
|
|
boxPane.add(buttonPane); |
|
|
|
|
boxList.add(combox); |
|
|
|
|
|
|
|
|
|
checkComponent(); |
|
|
|
|
|
|
|
|
|
delButton.addActionListener(new ActionListener() { |
|
|
|
|
|
|
|
|
|
delButton.addActionListener(new ActionListener() { |
|
|
|
|
@Override |
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
boxPane.remove(buttonPane); |
|
|
|
@ -143,11 +143,11 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
|
|
|
|
|
relayoutPane(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
delButton.registerChangeListener(uiobListener); |
|
|
|
|
|
|
|
|
|
return combox; |
|
|
|
|
delButton.registerChangeListener(uiobListener); |
|
|
|
|
|
|
|
|
|
return combox; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void checkAddButton() { |
|
|
|
|
int size = boxList.size(); |
|
|
|
|
addButton.setEnabled(size < 2 && categoryCombox.getSelectedItem() != null); |
|
|
|
@ -156,11 +156,11 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
|
|
|
|
|
protected void checkComponent() { |
|
|
|
|
checkAddButton(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void relayoutPane() { |
|
|
|
|
this.revalidate(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
*检查 某些Box是否可用 |
|
|
|
@ -171,14 +171,14 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
|
|
|
|
|
|
|
|
|
|
checkComponent(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected void refreshBoxListWithSelectTableData(List list) { |
|
|
|
|
super.refreshBoxListWithSelectTableData(list); |
|
|
|
|
|
|
|
|
|
for(int i = 0, size = boxList.size(); i < size; i++) { |
|
|
|
|
refreshBoxItems(boxList.get(i), list); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected void refreshBoxListWithSelectTableData(List list) { |
|
|
|
|
super.refreshBoxListWithSelectTableData(list); |
|
|
|
|
|
|
|
|
|
for(int i = 0, size = boxList.size(); i < size; i++) { |
|
|
|
|
refreshBoxItems(boxList.get(i), list); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 给组件登记一个观察者监听事件 |
|
|
|
@ -204,9 +204,9 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
|
|
|
|
|
*/ |
|
|
|
|
public void populateBean(ChartCollection collection) { |
|
|
|
|
super.populateBean(collection); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boxList.clear(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TopDefinitionProvider top = collection.getSelectedChart().getFilterDefinition(); |
|
|
|
|
if(top instanceof NormalTableDataDefinition) { |
|
|
|
|
NormalTableDataDefinition normal = (NormalTableDataDefinition)top; |
|
|
|
@ -216,11 +216,11 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
|
|
|
|
|
box.setSelectedItem(normal.getMoreCateWithIndex(i)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
checkAddButton(); |
|
|
|
|
checkSeriseUse(categoryCombox.getSelectedItem() != null); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 保存多分类界面到collection |
|
|
|
|
* @param collection |
|
|
|
|