Browse Source

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

* commit 'a41a51ddaef4bf40563f2e2d655372eee68bfa48':
  數據配置界面
master
superman 9 years ago
parent
commit
b9cadbe685
  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};
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[]{null, null}
};
@ -73,7 +73,7 @@ public class MeterPlotReportDataContentPane extends AbstractReportDataContentPan
MeterReportDefinition meterDefinition = (MeterReportDefinition)definition;
if (meterDefinition.getName() != null) {
singCatePane.getUITextField().setText(meterDefinition.getName().toString());
populateSingCatePane(meterDefinition.getName().toString());
}
if (meterDefinition.getValue() != null) {
singValuePane.getUITextField().setText(meterDefinition.getValue().toString());
@ -83,12 +83,17 @@ public class MeterPlotReportDataContentPane extends AbstractReportDataContentPan
filterPane.populateBean(collection);
}
protected void populateSingCatePane(String name) {
singCatePane.getUITextField().setText(name);
}
public void updateBean(ChartCollection collection) {
if (collection != null) {
MeterReportDefinition meterDefinition = new MeterReportDefinition();
meterDefinition.setName(canBeFormula(singCatePane.getUITextField().getText()));
updateSingCatePane(meterDefinition);
meterDefinition.setValue(canBeFormula(singValuePane.getUITextField().getText()));
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
protected String[] columnNames() {
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) {
MeterTableDefinition meter = (MeterTableDefinition)ob.getSelectedChart().getFilterDefinition();
populateNameComponent(meter.getName());
populateNameComponent(meter);
valueBox.setSelectedItem(meter.getValue());
filterPane.populateBean(ob);
}
}
protected void populateNameComponent(String name) {
nameBox.setSelectedItem(name);
protected void populateNameComponent(MeterTableDefinition meter) {
nameBox.setSelectedItem(meter.getName());
}
/**
@ -104,7 +104,7 @@ public class MeterPlotTableDataContentPane extends AbstractTableDataContentPane
*/
public void updateBean(ChartCollection ob) {
if(ob != null) {
MeterTableDefinition meter = new MeterTableDefinition();
MeterTableDefinition meter = getMeterTableDefinition();
ob.getSelectedChart().setFilterDefinition(meter);
updateNameComponent(meter);
@ -114,6 +114,10 @@ public class MeterPlotTableDataContentPane extends AbstractTableDataContentPane
}
}
protected MeterTableDefinition getMeterTableDefinition(){
return new MeterTableDefinition();
}
protected void updateNameComponent(MeterTableDefinition meter) {
meter.setName(Utils.objectToString(nameBox.getSelectedItem()));
}

Loading…
Cancel
Save