diff --git a/ch.psi.fda.core/src/main/java/ch/psi/fda/vdescriptor/LinePlot.java b/ch.psi.fda.core/src/main/java/ch/psi/fda/vdescriptor/LinePlot.java index 05ae0c9..82d2d32 100644 --- a/ch.psi.fda.core/src/main/java/ch/psi/fda/vdescriptor/LinePlot.java +++ b/ch.psi.fda.core/src/main/java/ch/psi/fda/vdescriptor/LinePlot.java @@ -1,14 +1,26 @@ package ch.psi.fda.vdescriptor; +import java.util.ArrayList; import java.util.List; +import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement(name="lineplot") public class LinePlot extends Plot { - private List data; + private List data = new ArrayList<>(); + + private Number minX; + private Number maxX; + public LinePlot(){ + } + + public LinePlot(String title){ + setTitle(title); + } + @XmlElement public List getData() { return data; @@ -16,4 +28,18 @@ public class LinePlot extends Plot { public void setData(List data) { this.data = data; } + @XmlAttribute + public Number getMinX() { + return minX; + } + public void setMinX(Number minX) { + this.minX = minX; + } + @XmlAttribute + public Number getMaxX() { + return maxX; + } + public void setMaxX(Number maxX) { + this.maxX = maxX; + } } diff --git a/ch.psi.fda.core/src/main/java/ch/psi/fda/vdescriptor/MatrixPlot.java b/ch.psi.fda.core/src/main/java/ch/psi/fda/vdescriptor/MatrixPlot.java index 3f64b25..d026194 100644 --- a/ch.psi.fda.core/src/main/java/ch/psi/fda/vdescriptor/MatrixPlot.java +++ b/ch.psi.fda.core/src/main/java/ch/psi/fda/vdescriptor/MatrixPlot.java @@ -1,13 +1,29 @@ package ch.psi.fda.vdescriptor; +import java.util.ArrayList; import java.util.List; +import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement(name="matrixplot") public class MatrixPlot extends Plot { - private List data; + private List data = new ArrayList<>(); + private Number minX; + private Number maxX; + private Number nX; + + private Number minY; + private Number maxY; + private Number nY; + + public MatrixPlot(){ + } + + public MatrixPlot(String title){ + setTitle(title); + } public List getData() { return data; @@ -15,4 +31,46 @@ public class MatrixPlot extends Plot { public void setData(List data) { this.data = data; } + @XmlAttribute + public Number getMinX() { + return minX; + } + public void setMinX(Number minX) { + this.minX = minX; + } + @XmlAttribute + public Number getMaxX() { + return maxX; + } + public void setMaxX(Number maxX) { + this.maxX = maxX; + } + @XmlAttribute + public Number getnX() { + return nX; + } + public void setnX(Number nX) { + this.nX = nX; + } + @XmlAttribute + public Number getMinY() { + return minY; + } + public void setMinY(Number minY) { + this.minY = minY; + } + @XmlAttribute + public Number getMaxY() { + return maxY; + } + public void setMaxY(Number maxY) { + this.maxY = maxY; + } + @XmlAttribute + public Number getnY() { + return nY; + } + public void setnY(Number nY) { + this.nY = nY; + } } diff --git a/ch.psi.fda.core/src/main/java/ch/psi/fda/vdescriptor/Plot.java b/ch.psi.fda.core/src/main/java/ch/psi/fda/vdescriptor/Plot.java index fdaa270..4ebb53a 100644 --- a/ch.psi.fda.core/src/main/java/ch/psi/fda/vdescriptor/Plot.java +++ b/ch.psi.fda.core/src/main/java/ch/psi/fda/vdescriptor/Plot.java @@ -7,4 +7,14 @@ import javax.xml.bind.annotation.XmlTransient; @XmlSeeAlso({LinePlot.class, MatrixPlot.class}) @XmlTransient public abstract class Plot { + + private String title; + + public String getTitle() { + return title; + } + public void setTitle(String title) { + this.title = title; + } + } diff --git a/ch.psi.fda.core/src/main/java/ch/psi/fda/vdescriptor/Series.java b/ch.psi.fda.core/src/main/java/ch/psi/fda/vdescriptor/Series.java index 8ac9a25..9d1263e 100644 --- a/ch.psi.fda.core/src/main/java/ch/psi/fda/vdescriptor/Series.java +++ b/ch.psi.fda.core/src/main/java/ch/psi/fda/vdescriptor/Series.java @@ -1,32 +1,12 @@ package ch.psi.fda.vdescriptor; -import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlTransient; -public class Series { + +@XmlSeeAlso({XYSeries.class, XYZSeries.class}) +@XmlTransient +public abstract class Series { - private String x = null; - private String y = null; - private String z = null; - @XmlAttribute - public String getX() { - return x; - } - public void setX(String x) { - this.x = x; - } - @XmlAttribute - public String getY() { - return y; - } - public void setY(String y) { - this.y = y; - } - @XmlAttribute - public String getZ() { - return z; - } - public void setZ(String z) { - this.z = z; - } } diff --git a/ch.psi.fda.core/src/main/java/ch/psi/fda/vdescriptor/XYSeries.java b/ch.psi.fda.core/src/main/java/ch/psi/fda/vdescriptor/XYSeries.java new file mode 100644 index 0000000..3816a56 --- /dev/null +++ b/ch.psi.fda.core/src/main/java/ch/psi/fda/vdescriptor/XYSeries.java @@ -0,0 +1,32 @@ +package ch.psi.fda.vdescriptor; + +import javax.xml.bind.annotation.XmlAttribute; + +public class XYSeries extends Series { + + private String x = null; + private String y = null; + + public XYSeries(){ + } + + public XYSeries(String x, String y){ + this.x = x; + this.y = y; + } + + @XmlAttribute + public String getX() { + return x; + } + public void setX(String x) { + this.x = x; + } + @XmlAttribute + public String getY() { + return y; + } + public void setY(String y) { + this.y = y; + } +} diff --git a/ch.psi.fda.core/src/main/java/ch/psi/fda/vdescriptor/XYZSeries.java b/ch.psi.fda.core/src/main/java/ch/psi/fda/vdescriptor/XYZSeries.java new file mode 100644 index 0000000..bb3b547 --- /dev/null +++ b/ch.psi.fda.core/src/main/java/ch/psi/fda/vdescriptor/XYZSeries.java @@ -0,0 +1,46 @@ +package ch.psi.fda.vdescriptor; + +import javax.xml.bind.annotation.XmlAttribute; + +public class XYZSeries extends Series { + + private String x = null; + private String y = null; + private String z = null; + + public XYZSeries(){ + } + + public XYZSeries(String x, String y){ + this.x = x; + this.y = y; + } + + public XYZSeries(String x, String y, String z){ + this.x = x; + this.y = y; + this.z = z; + } + + @XmlAttribute + public String getX() { + return x; + } + public void setX(String x) { + this.x = x; + } + @XmlAttribute + public String getY() { + return y; + } + public void setY(String y) { + this.y = y; + } + @XmlAttribute + public String getZ() { + return z; + } + public void setZ(String z) { + this.z = z; + } +} diff --git a/ch.psi.fda.core/src/main/java/ch/psi/fda/vdescriptor/YSeries.java b/ch.psi.fda.core/src/main/java/ch/psi/fda/vdescriptor/YSeries.java new file mode 100644 index 0000000..6905236 --- /dev/null +++ b/ch.psi.fda.core/src/main/java/ch/psi/fda/vdescriptor/YSeries.java @@ -0,0 +1,26 @@ +package ch.psi.fda.vdescriptor; + +import javax.xml.bind.annotation.XmlAttribute; + +/** + * In a YSeries the Y components hold an data array in which the index i the x and the value the y value. + */ +public class YSeries extends Series { + + private String y = null; + + public YSeries(){ + } + + public YSeries(String y){ + this.y = y; + } + + @XmlAttribute + public String getY() { + return y; + } + public void setY(String y) { + this.y = y; + } +} diff --git a/ch.psi.fda.core/src/main/java/ch/psi/fda/vdescriptor/YZSeries.java b/ch.psi.fda.core/src/main/java/ch/psi/fda/vdescriptor/YZSeries.java new file mode 100644 index 0000000..8b555fe --- /dev/null +++ b/ch.psi.fda.core/src/main/java/ch/psi/fda/vdescriptor/YZSeries.java @@ -0,0 +1,36 @@ +package ch.psi.fda.vdescriptor; + +import javax.xml.bind.annotation.XmlAttribute; + + +/** + * In a YZSeries the Y components hold an data array in which the index i the x and the value the y value. + */ +public class YZSeries extends Series { + + private String y = null; + private String z = null; + + public YZSeries(){ + } + + public YZSeries(String y, String z){ + this.y = y; + this.z = z; + } + + @XmlAttribute + public String getY() { + return y; + } + public void setY(String y) { + this.y = y; + } + @XmlAttribute + public String getZ() { + return z; + } + public void setZ(String z) { + this.z = z; + } +}