From ad31a8f43a01698a8f35a76104a2dad4c796a42e Mon Sep 17 00:00:00 2001 From: zheng Date: Tue, 11 Sep 2018 17:42:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9D=A2=E6=9D=BF=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=EF=BC=88=E6=95=B0=E6=8D=AE=E9=9B=86=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E4=B8=8D=E7=94=A8=E4=B8=8B=E6=8B=89=E6=A1=86&?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=A0=BC=E6=95=B0=E6=8D=AE=E4=B8=8D=E7=94=A8?= =?UTF-8?q?=E5=85=AC=E5=BC=8F=E8=BE=93=E5=85=A5=E6=A1=86=EF=BC=89=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/fr/plugin/demo/DemoChart.java | 2 ++ src/com/fr/plugin/demo/DemoDataConfig.java | 16 +++++++++++-- .../fr/plugin/demo/DemoReportDataPane.java | 23 +++++++++++++++++++ src/com/fr/plugin/demo/DemoTableDataPane.java | 23 +++++++++++++++++++ 4 files changed, 62 insertions(+), 2 deletions(-) diff --git a/src/com/fr/plugin/demo/DemoChart.java b/src/com/fr/plugin/demo/DemoChart.java index e331181..f2fa2e0 100644 --- a/src/com/fr/plugin/demo/DemoChart.java +++ b/src/com/fr/plugin/demo/DemoChart.java @@ -134,6 +134,8 @@ public class DemoChart extends AbstractChart{ List yValues = dataConfig.getY().getValues(); List zValues = dataConfig.getZ().getValues(); + jsonObject.put("targetName", dataConfig.getTargetName()); + 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 84ea99a..51c3cc6 100644 --- a/src/com/fr/plugin/demo/DemoDataConfig.java +++ b/src/com/fr/plugin/demo/DemoDataConfig.java @@ -2,7 +2,6 @@ package com.fr.plugin.demo; import com.fr.extended.chart.AbstractDataConfig; import com.fr.extended.chart.ExtendedField; -import com.fr.general.ComparatorUtils; import com.fr.stable.AssistUtils; import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLableReader; @@ -13,6 +12,7 @@ import com.fr.stable.xml.XMLableReader; public class DemoDataConfig extends AbstractDataConfig { private ExtendedField x = new ExtendedField(); + private String targetName; private ExtendedField y = new ExtendedField(); private ExtendedField z = new ExtendedField(); @@ -40,9 +40,18 @@ public class DemoDataConfig extends AbstractDataConfig { this.z = z; } + public String getTargetName() { + return targetName; + } + + public void setTargetName(String targetName) { + this.targetName = targetName; + } + @Override protected void readAttr(XMLableReader reader) { readExtendedField(x, "x", reader); + this.setTargetName(reader.getAttrAsString("targetName", "")); readExtendedField(y, "y", reader); readExtendedField(z, "z", reader); } @@ -50,6 +59,7 @@ public class DemoDataConfig extends AbstractDataConfig { @Override protected void writeAttr(XMLPrintWriter writer) { writeExtendedField(x, "x", writer); + writer.attr("targetName", this.getTargetName()); writeExtendedField(y, "y", writer); writeExtendedField(z, "z", writer); } @@ -67,6 +77,7 @@ public class DemoDataConfig extends AbstractDataConfig { public DemoDataConfig clone() throws CloneNotSupportedException { DemoDataConfig result = new DemoDataConfig(); result.setX(this.getX().clone()); + result.setTargetName(this.getTargetName()); result.setY(this.getY().clone()); result.setZ(this.getZ().clone()); return result; @@ -74,13 +85,14 @@ public class DemoDataConfig extends AbstractDataConfig { @Override public int hashCode() { - return super.hashCode() + AssistUtils.hashCode(this.getX(), this.getY(), this.getZ()); + return super.hashCode() + AssistUtils.hashCode(this.getX(), this.getY(), this.getZ(), this.getTargetName()); } @Override public boolean equals(Object obj) { return obj instanceof DemoDataConfig && AssistUtils.equals(this.getX(), ((DemoDataConfig) obj).getX()) + && AssistUtils.equals(this.getTargetName(), ((DemoDataConfig) obj).getTargetName()) && AssistUtils.equals(this.getY(), ((DemoDataConfig) obj).getY()) && AssistUtils.equals(this.getZ(), ((DemoDataConfig) obj).getZ()) ; diff --git a/src/com/fr/plugin/demo/DemoReportDataPane.java b/src/com/fr/plugin/demo/DemoReportDataPane.java index 0ddbeea..c9d44dc 100644 --- a/src/com/fr/plugin/demo/DemoReportDataPane.java +++ b/src/com/fr/plugin/demo/DemoReportDataPane.java @@ -1,14 +1,18 @@ package com.fr.plugin.demo; import com.fr.design.formula.TinyFormulaPane; +import com.fr.design.gui.itextfield.UITextField; import com.fr.extended.chart.AbstractExtendedChartReportDataPane; +import java.awt.Component; + /** * Created by shine on 2018/3/24. */ public class DemoReportDataPane extends AbstractExtendedChartReportDataPane { private TinyFormulaPane xPane; + private UITextField targetName; private TinyFormulaPane yPane; private TinyFormulaPane zPane; @@ -16,11 +20,28 @@ public class DemoReportDataPane extends AbstractExtendedChartReportDataPane{ private UIComboBox xComboBox; + private UITextField targetName; private UIComboBox yComboBox; private UIComboBox zComboBox; @@ -15,11 +19,28 @@ public class DemoTableDataPane extends AbstractExtendedChartTableDataPane