Extended vdescriptor model

This commit is contained in:
2014-04-14 13:12:21 +02:00
parent 632e11dde2
commit a6a995e5af
8 changed files with 242 additions and 28 deletions

View File

@@ -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<Series> data;
private List<Series> data = new ArrayList<>();
private Number minX;
private Number maxX;
public LinePlot(){
}
public LinePlot(String title){
setTitle(title);
}
@XmlElement
public List<Series> getData() {
return data;
@@ -16,4 +28,18 @@ public class LinePlot extends Plot {
public void setData(List<Series> 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;
}
}

View File

@@ -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<Series> data;
private List<Series> 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<Series> getData() {
return data;
@@ -15,4 +31,46 @@ public class MatrixPlot extends Plot {
public void setData(List<Series> 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;
}
}

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View File

@@ -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;
}
}