From a41a51ddaef4bf40563f2e2d655372eee68bfa48 Mon Sep 17 00:00:00 2001 From: xiaohu Date: Mon, 23 May 2016 10:23:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B8=E6=93=9A=E9=85=8D=E7=BD=AE=E7=95=8C?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MeterPlotReportDataContentPane.java | 30 ++++++++++++++----- .../table/MeterPlotTableDataContentPane.java | 12 +++++--- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/MeterPlotReportDataContentPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/MeterPlotReportDataContentPane.java index e4001079b8..b785373bc2 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/MeterPlotReportDataContentPane.java +++ b/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()); @@ -82,13 +82,18 @@ public class MeterPlotReportDataContentPane extends AbstractReportDataContentPan filterPane.populateBean(collection); } - - public void updateBean(ChartCollection 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); @@ -96,10 +101,19 @@ public class MeterPlotReportDataContentPane extends AbstractReportDataContentPan filterPane.updateBean(collection); } } - - @Override + + 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(); + } } \ No newline at end of file diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/MeterPlotTableDataContentPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/MeterPlotTableDataContentPane.java index 22deb51016..a12f4370a4 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/MeterPlotTableDataContentPane.java +++ b/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())); }