Browse Source

數據配置界面

master
xiaohu 9 years ago
parent
commit
a41a51ddae
  1. 20
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/MeterPlotReportDataContentPane.java
  2. 12
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/MeterPlotTableDataContentPane.java

20
designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/MeterPlotReportDataContentPane.java

@ -46,7 +46,7 @@ public class MeterPlotReportDataContentPane extends AbstractReportDataContentPan
double[] rowSize = { p, p, p}; double[] rowSize = { p, p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(CATENAME), singCatePane = new TinyFormulaPane()}, new Component[]{new UILabel(CATENAME), getSingCatePane()},
new Component[]{new UILabel(NVALUE), singValuePane = new TinyFormulaPane()}, new Component[]{new UILabel(NVALUE), singValuePane = new TinyFormulaPane()},
new Component[]{null, null} new Component[]{null, null}
}; };
@ -73,7 +73,7 @@ public class MeterPlotReportDataContentPane extends AbstractReportDataContentPan
MeterReportDefinition meterDefinition = (MeterReportDefinition)definition; MeterReportDefinition meterDefinition = (MeterReportDefinition)definition;
if (meterDefinition.getName() != null) { if (meterDefinition.getName() != null) {
singCatePane.getUITextField().setText(meterDefinition.getName().toString()); populateSingCatePane(meterDefinition.getName().toString());
} }
if (meterDefinition.getValue() != null) { if (meterDefinition.getValue() != null) {
singValuePane.getUITextField().setText(meterDefinition.getValue().toString()); singValuePane.getUITextField().setText(meterDefinition.getValue().toString());
@ -83,12 +83,17 @@ public class MeterPlotReportDataContentPane extends AbstractReportDataContentPan
filterPane.populateBean(collection); filterPane.populateBean(collection);
} }
protected void populateSingCatePane(String name) {
singCatePane.getUITextField().setText(name);
}
public void updateBean(ChartCollection collection) { public void updateBean(ChartCollection collection) {
if (collection != null) { if (collection != null) {
MeterReportDefinition meterDefinition = new MeterReportDefinition(); MeterReportDefinition meterDefinition = new MeterReportDefinition();
meterDefinition.setName(canBeFormula(singCatePane.getUITextField().getText())); updateSingCatePane(meterDefinition);
meterDefinition.setValue(canBeFormula(singValuePane.getUITextField().getText())); meterDefinition.setValue(canBeFormula(singValuePane.getUITextField().getText()));
collection.getSelectedChart().setFilterDefinition(meterDefinition); collection.getSelectedChart().setFilterDefinition(meterDefinition);
@ -97,9 +102,18 @@ public class MeterPlotReportDataContentPane extends AbstractReportDataContentPan
} }
} }
protected void updateSingCatePane(MeterReportDefinition meterDefinition) {
meterDefinition.setName(canBeFormula(singCatePane.getUITextField().getText()));
}
@Override @Override
protected String[] columnNames() { protected String[] columnNames() {
return new String[]{"", ""}; return new String[]{"", ""};
} }
protected Component getSingCatePane() {
return singCatePane = new TinyFormulaPane();
}
} }

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

@ -88,15 +88,15 @@ public class MeterPlotTableDataContentPane extends AbstractTableDataContentPane
if(ob != null && ob.getSelectedChart().getFilterDefinition() instanceof MeterTableDefinition) { if(ob != null && ob.getSelectedChart().getFilterDefinition() instanceof MeterTableDefinition) {
MeterTableDefinition meter = (MeterTableDefinition)ob.getSelectedChart().getFilterDefinition(); MeterTableDefinition meter = (MeterTableDefinition)ob.getSelectedChart().getFilterDefinition();
populateNameComponent(meter.getName()); populateNameComponent(meter);
valueBox.setSelectedItem(meter.getValue()); valueBox.setSelectedItem(meter.getValue());
filterPane.populateBean(ob); filterPane.populateBean(ob);
} }
} }
protected void populateNameComponent(String name) { protected void populateNameComponent(MeterTableDefinition meter) {
nameBox.setSelectedItem(name); nameBox.setSelectedItem(meter.getName());
} }
/** /**
@ -104,7 +104,7 @@ public class MeterPlotTableDataContentPane extends AbstractTableDataContentPane
*/ */
public void updateBean(ChartCollection ob) { public void updateBean(ChartCollection ob) {
if(ob != null) { if(ob != null) {
MeterTableDefinition meter = new MeterTableDefinition(); MeterTableDefinition meter = getMeterTableDefinition();
ob.getSelectedChart().setFilterDefinition(meter); ob.getSelectedChart().setFilterDefinition(meter);
updateNameComponent(meter); updateNameComponent(meter);
@ -114,6 +114,10 @@ public class MeterPlotTableDataContentPane extends AbstractTableDataContentPane
} }
} }
protected MeterTableDefinition getMeterTableDefinition(){
return new MeterTableDefinition();
}
protected void updateNameComponent(MeterTableDefinition meter) { protected void updateNameComponent(MeterTableDefinition meter) {
meter.setName(Utils.objectToString(nameBox.getSelectedItem())); meter.setName(Utils.objectToString(nameBox.getSelectedItem()));
} }

Loading…
Cancel
Save