neil 7 years ago
parent
commit
d344e92e8b
  1. 16
      designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java
  2. 68
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotMoreCateTableDataContentPane.java

16
designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java

@ -1,7 +1,7 @@
package com.fr.design.editor.editor;
import com.fr.data.SimpleDSColumn;
import com.fr.design.data.DesignTableDataManager;
import com.fr.data.SimpleDSColumn;
import com.fr.design.data.datapane.TableDataComboBox;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.gui.icombobox.UIComboBox;
@ -36,13 +36,13 @@ public class ColumnSelectedEditor extends Editor<SimpleDSColumn> {
@Override
public void itemStateChanged(ItemEvent e) {
TableDataWrapper tableDataWrapper = tableDataComboBox.getSelectedItem();
if (tableDataWrapper == null) {
return;
}
//这边需要重新初始化columnNames, 否则nameList长度和columnNames长度不同导致出錯。
List<String> nameList = tableDataWrapper.calculateColumnNameList();
columnNames = new String[nameList.size()];
TableDataWrapper tableDataWrapper = tableDataComboBox.getSelectedItem();
if (tableDataWrapper == null) {
return;
}
//这边需要重新初始化columnNames, 否则nameList长度和columnNames长度不同导致出錯。
List<String> nameList = tableDataWrapper.calculateColumnNameList();
columnNames = new String[nameList.size()];
columnNames = tableDataComboBox.getSelectedItem().calculateColumnNameList().toArray(columnNames);
columnNameComboBox.removeAllItems();
for (int i = 0; i < columnNames.length; i++) {

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

@ -57,18 +57,18 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
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));
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));
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}));
categoryPane.add(GUICoreUtils.createBorderLayoutPane(new Component[]{categoryCombox, addButton,null,categoryLabel,null}));
boxPane = new JPanel();
boxPane.setLayout(new BoxLayout(boxPane, BoxLayout.Y_AXIS));
boxPane = new JPanel();
boxPane.setLayout(new BoxLayout(boxPane, BoxLayout.Y_AXIS));
categoryPane.add(boxPane, BorderLayout.SOUTH);
categoryPane.add(boxPane, BorderLayout.SOUTH);
this.setLayout(new BorderLayout());
this.add(categoryPane, BorderLayout.NORTH);
@ -104,37 +104,37 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
}
private UIComboBox addNewCombox() {
final JPanel buttonPane = new JPanel();
buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 2));
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));
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));
}
int count = categoryCombox.getItemCount();
for(int i = 0; i < count; i++) {
combox.addItem(categoryCombox.getItemAt(i));
}
combox.registerChangeListener(uiobListener);
combox.addItemListener(new ItemListener() {
combox.registerChangeListener(uiobListener);
combox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
makeToolTipUse(combox);
}
});
combox.setSelectedItem(categoryCombox.getItemAt(0));
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);
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,9 +143,9 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
relayoutPane();
}
});
delButton.registerChangeListener(uiobListener);
delButton.registerChangeListener(uiobListener);
return combox;
return combox;
}
private void checkAddButton() {
@ -172,13 +172,13 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
checkComponent();
}
protected void refreshBoxListWithSelectTableData(List list) {
super.refreshBoxListWithSelectTableData(list);
protected void refreshBoxListWithSelectTableData(List list) {
super.refreshBoxListWithSelectTableData(list);
for(int i = 0, size = boxList.size(); i < size; i++) {
refreshBoxItems(boxList.get(i), list);
}
}
for(int i = 0, size = boxList.size(); i < size; i++) {
refreshBoxItems(boxList.get(i), list);
}
}
/**
* 给组件登记一个观察者监听事件

Loading…
Cancel
Save