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