From 584a62b9a83b8b006cf3ec5969126a3395414af6 Mon Sep 17 00:00:00 2001 From: zheng Date: Fri, 14 Sep 2018 14:30:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=B7=BB=E5=8A=A0=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=20=E5=AF=B9=E6=9F=90=E4=B8=AA=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B1=87=E6=80=BB=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/fr/plugin/demo/DemoChart.java | 5 ++- src/com/fr/plugin/demo/DemoDataConfig.java | 34 ++++++++++++++++-- src/com/fr/plugin/demo/DemoTableDataPane.java | 35 +++++++++++++++++-- 3 files changed, 68 insertions(+), 6 deletions(-) diff --git a/src/com/fr/plugin/demo/DemoChart.java b/src/com/fr/plugin/demo/DemoChart.java index f2fa2e0..7be15f3 100644 --- a/src/com/fr/plugin/demo/DemoChart.java +++ b/src/com/fr/plugin/demo/DemoChart.java @@ -134,7 +134,10 @@ public class DemoChart extends AbstractChart{ List yValues = dataConfig.getY().getValues(); List zValues = dataConfig.getZ().getValues(); - jsonObject.put("targetName", dataConfig.getTargetName()); + // jsonObject.put("targetName", dataConfig.getTargetName()); + + List expectList = dataConfig.getExpect().getValues(); + List actualList = dataConfig.getActual().getValues(); for (int i = 0, len = xValues.size(); i < len; i++) { maxValue = Math.max(GeneralUtils.objectToNumber(zValues.get(i)).doubleValue(), maxValue); diff --git a/src/com/fr/plugin/demo/DemoDataConfig.java b/src/com/fr/plugin/demo/DemoDataConfig.java index 51c3cc6..530c38a 100644 --- a/src/com/fr/plugin/demo/DemoDataConfig.java +++ b/src/com/fr/plugin/demo/DemoDataConfig.java @@ -16,6 +16,9 @@ public class DemoDataConfig extends AbstractDataConfig { private ExtendedField y = new ExtendedField(); private ExtendedField z = new ExtendedField(); + private ExtendedField expect = new ExtendedField(); + private ExtendedField actual = new ExtendedField(); + public ExtendedField getX() { return x; } @@ -48,12 +51,30 @@ public class DemoDataConfig extends AbstractDataConfig { this.targetName = targetName; } + public ExtendedField getExpect() { + return expect; + } + + public void setExpect(ExtendedField expect) { + this.expect = expect; + } + + public ExtendedField getActual() { + return actual; + } + + public void setActual(ExtendedField actual) { + this.actual = actual; + } + @Override protected void readAttr(XMLableReader reader) { readExtendedField(x, "x", reader); this.setTargetName(reader.getAttrAsString("targetName", "")); readExtendedField(y, "y", reader); readExtendedField(z, "z", reader); + readExtendedField(expect, "expect", reader); + readExtendedField(actual, "actual", reader); } @Override @@ -62,6 +83,8 @@ public class DemoDataConfig extends AbstractDataConfig { writer.attr("targetName", this.getTargetName()); writeExtendedField(y, "y", writer); writeExtendedField(z, "z", writer); + writeExtendedField(expect, "expect", writer); + writeExtendedField(actual, "actual", writer); } @Override @@ -69,7 +92,9 @@ public class DemoDataConfig extends AbstractDataConfig { return new ExtendedField[]{ x, y, - z + z, + expect, + actual }; } @@ -80,12 +105,15 @@ public class DemoDataConfig extends AbstractDataConfig { result.setTargetName(this.getTargetName()); result.setY(this.getY().clone()); result.setZ(this.getZ().clone()); + result.setExpect(this.getExpect().clone()); + result.setActual(this.getActual().clone()); return result; } @Override public int hashCode() { - return super.hashCode() + AssistUtils.hashCode(this.getX(), this.getY(), this.getZ(), this.getTargetName()); + return super.hashCode() + AssistUtils.hashCode(this.getX(), this.getY(), this.getZ(), + this.getTargetName(), this.getExpect(), this.getActual()); } @Override @@ -95,6 +123,8 @@ public class DemoDataConfig extends AbstractDataConfig { && AssistUtils.equals(this.getTargetName(), ((DemoDataConfig) obj).getTargetName()) && AssistUtils.equals(this.getY(), ((DemoDataConfig) obj).getY()) && AssistUtils.equals(this.getZ(), ((DemoDataConfig) obj).getZ()) + && AssistUtils.equals(this.getExpect(), ((DemoDataConfig) obj).getExpect()) + && AssistUtils.equals(this.getActual(), ((DemoDataConfig) obj).getActual()) ; } } diff --git a/src/com/fr/plugin/demo/DemoTableDataPane.java b/src/com/fr/plugin/demo/DemoTableDataPane.java index f328957..6b84815 100644 --- a/src/com/fr/plugin/demo/DemoTableDataPane.java +++ b/src/com/fr/plugin/demo/DemoTableDataPane.java @@ -2,6 +2,7 @@ package com.fr.plugin.demo; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.mainframe.chart.gui.data.CalculateComboBox; import com.fr.extended.chart.AbstractExtendedChartTableDataPane; import java.awt.Component; @@ -15,13 +16,23 @@ public class DemoTableDataPane extends AbstractExtendedChartTableDataPane