Browse Source

Merge pull request #93 in BA/design from ~XIAOHU/design:dev to dev

* commit '909b4b1a0bd7fd2d357f6b4fded0681ff041a8c8':
  數據配置界面
master
superman 9 years ago
parent
commit
dd40164246
  1. 36
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/MeterPlotTableDataContentPane.java

36
designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/MeterPlotTableDataContentPane.java

@ -49,14 +49,7 @@ public class MeterPlotTableDataContentPane extends AbstractTableDataContentPane
double[] columnSize = { p,f};
double[] rowSize = { p, p,p,p,p,p,p,p, p};
Component[][] components = new Component[][]{
new Component[]{new BoldFontTextLabel(METER_NAME, SwingConstants.RIGHT), nameBox},
new Component[]{new BoldFontTextLabel(METER_VALUE, SwingConstants.RIGHT), valueBox},
new Component[]{new JSeparator(), null},
new Component[]{new BoldFontTextLabel(Inter.getLocText("Chart-Data_Filter"))},
new Component[]{filterPane, null}
} ;
Component[][] components = createComponents();
JPanel panel = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize);
this.add(panel,BorderLayout.CENTER);
@ -65,6 +58,16 @@ public class MeterPlotTableDataContentPane extends AbstractTableDataContentPane
valueBox.addItemListener(tooltipListener);
}
private Component[][] createComponents() {
return new Component[][]{
new Component[]{new BoldFontTextLabel(METER_NAME, SwingConstants.RIGHT), getNameComponent()},
new Component[]{new BoldFontTextLabel(METER_VALUE, SwingConstants.RIGHT), valueBox},
new Component[]{new JSeparator(), null},
new Component[]{new BoldFontTextLabel(Inter.getLocText("Chart-Data_Filter"))},
new Component[]{filterPane, null}
};
}
protected void refreshBoxListWithSelectTableData(List list) {
refreshBoxItems(nameBox, list);
refreshBoxItems(valueBox, list);
@ -85,12 +88,17 @@ public class MeterPlotTableDataContentPane extends AbstractTableDataContentPane
if(ob != null && ob.getSelectedChart().getFilterDefinition() instanceof MeterTableDefinition) {
MeterTableDefinition meter = (MeterTableDefinition)ob.getSelectedChart().getFilterDefinition();
nameBox.setSelectedItem(meter.getName());
populateNameComponent(meter.getName());
valueBox.setSelectedItem(meter.getValue());
filterPane.populateBean(ob);
}
}
protected void populateNameComponent(String name) {
nameBox.setSelectedItem(name);
}
/**
* 保存界面属性.
*/
@ -99,12 +107,17 @@ public class MeterPlotTableDataContentPane extends AbstractTableDataContentPane
MeterTableDefinition meter = new MeterTableDefinition();
ob.getSelectedChart().setFilterDefinition(meter);
meter.setName(Utils.objectToString(nameBox.getSelectedItem()));
updateNameComponent(meter);
meter.setValue(Utils.objectToString(valueBox.getSelectedItem()));
filterPane.updateBean(ob);
}
}
protected void updateNameComponent(MeterTableDefinition meter) {
meter.setName(Utils.objectToString(nameBox.getSelectedItem()));
}
/**
* 重新布局整个面板
*/
@ -113,4 +126,7 @@ public class MeterPlotTableDataContentPane extends AbstractTableDataContentPane
}
protected Component getNameComponent() {
return nameBox;
}
}
Loading…
Cancel
Save