Java class for anonymous complex type. + * + *
The following schema fragment specifies the expected content contained within this class. + * + *
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="Boats">
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="Boat" maxOccurs="unbounded">
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="GPSposition">
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="X" type="{http://www.w3.org/2001/XMLSchema}double" />
+ * <attribute name="Y" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
+ * <attribute name="Z" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </element>
+ * </sequence>
+ * <attribute name="Type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="BoatName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ * <attribute name="HullNum" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="ShortName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="ShapeID" type="{http://www.w3.org/2001/XMLSchema}int" />
+ * <attribute name="StoweName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </element>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </element>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ *
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+ "boats"
+})
+@XmlRootElement(name = "BoatConfig")
+public class BoatConfig {
+
+ @XmlElement(name = "Boats", required = true)
+ protected BoatConfig.Boats boats;
+
+ /**
+ * Gets the value of the boats property.
+ *
+ * @return
+ * possible object is
+ * {@link BoatConfig.Boats }
+ *
+ */
+ public BoatConfig.Boats getBoats() {
+ return boats;
+ }
+
+ /**
+ * Sets the value of the boats property.
+ *
+ * @param value
+ * allowed object is
+ * {@link BoatConfig.Boats }
+ *
+ */
+ public void setBoats(BoatConfig.Boats value) {
+ this.boats = value;
+ }
+
+
+ /**
+ * Java class for anonymous complex type. + * + *
The following schema fragment specifies the expected content contained within this class. + * + *
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="Boat" maxOccurs="unbounded">
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="GPSposition">
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="X" type="{http://www.w3.org/2001/XMLSchema}double" />
+ * <attribute name="Y" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
+ * <attribute name="Z" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </element>
+ * </sequence>
+ * <attribute name="Type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="BoatName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ * <attribute name="HullNum" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="ShortName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="ShapeID" type="{http://www.w3.org/2001/XMLSchema}int" />
+ * <attribute name="StoweName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </element>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ *
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "", propOrder = {
+ "boat"
+ })
+ public static class Boats {
+
+ @XmlElement(name = "Boat", required = true)
+ protected List
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a set method for the boat property.
+ *
+ *
+ * For example, to add a new item, do as follows: + *
+ * getBoat().add(newItem); + *+ * + * + *
+ * Objects of the following type(s) are allowed in the list
+ * {@link BoatConfig.Boats.Boat }
+ *
+ *
+ */
+ public List Java class for anonymous complex type.
+ *
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * Java class for anonymous complex type.
+ *
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups. Factory methods for each of these are
+ * provided in this class.
+ *
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+
+ /**
+ * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: aaa
+ *
+ */
+ public ObjectFactory() {
+ }
+
+ /**
+ * Create an instance of {@link BoatConfig }
+ *
+ */
+ public BoatConfig createBoatConfig() {
+ return new BoatConfig();
+ }
+
+ /**
+ * Create an instance of {@link BoatConfig.Boats }
+ *
+ */
+ public BoatConfig.Boats createBoatConfigBoats() {
+ return new BoatConfig.Boats();
+ }
+
+ /**
+ * Create an instance of {@link BoatConfig.Boats.Boat }
+ *
+ */
+ public BoatConfig.Boats.Boat createBoatConfigBoatsBoat() {
+ return new BoatConfig.Boats.Boat();
+ }
+
+ /**
+ * Create an instance of {@link BoatConfig.Boats.Boat.GPSposition }
+ *
+ */
+ public BoatConfig.Boats.Boat.GPSposition createBoatConfigBoatsBoatGPSposition() {
+ return new BoatConfig.Boats.Boat.GPSposition();
+ }
+
+}
diff --git a/racevisionGame/src/main/java/shared/xml/regatta/ObjectFactory.java b/racevisionGame/src/main/java/shared/xml/regatta/ObjectFactory.java
new file mode 100644
index 00000000..7fc72202
--- /dev/null
+++ b/racevisionGame/src/main/java/shared/xml/regatta/ObjectFactory.java
@@ -0,0 +1,47 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
+// See http://java.sun.com/xml/jaxb
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2017.09.01 at 10:37:23 PM NZST
+//
+
+
+package shared.xml.regatta;
+
+import javax.xml.bind.annotation.XmlRegistry;
+
+
+/**
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the aaa package.
+ * An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups. Factory methods for each of these are
+ * provided in this class.
+ *
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+
+ /**
+ * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: aaa
+ *
+ */
+ public ObjectFactory() {
+ }
+
+ /**
+ * Create an instance of {@link RegattaConfig }
+ *
+ */
+ public RegattaConfig createRegattaConfig() {
+ return new RegattaConfig();
+ }
+
+}
diff --git a/racevisionGame/src/main/java/shared/xml/regatta/RegattaConfig.java b/racevisionGame/src/main/java/shared/xml/regatta/RegattaConfig.java
new file mode 100644
index 00000000..d8cc1613
--- /dev/null
+++ b/racevisionGame/src/main/java/shared/xml/regatta/RegattaConfig.java
@@ -0,0 +1,219 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
+// See http://java.sun.com/xml/jaxb
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2017.09.01 at 10:37:23 PM NZST
+//
+
+
+package shared.xml.regatta;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * Java class for anonymous complex type.
+ *
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ *
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="GPSposition">
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="X" type="{http://www.w3.org/2001/XMLSchema}double" />
+ * <attribute name="Y" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
+ * <attribute name="Z" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </element>
+ * </sequence>
+ * <attribute name="Type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="BoatName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ * <attribute name="HullNum" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="ShortName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="ShapeID" type="{http://www.w3.org/2001/XMLSchema}int" />
+ * <attribute name="StoweName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ *
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "", propOrder = {
+ "gpSposition"
+ })
+ public static class Boat {
+
+ @XmlElement(name = "GPSposition", required = true)
+ protected BoatConfig.Boats.Boat.GPSposition gpSposition;
+ @XmlAttribute(name = "Type", required = true)
+ protected String type;
+ @XmlAttribute(name = "BoatName", required = true)
+ protected String boatName;
+ @XmlAttribute(name = "SourceID", required = true)
+ protected int sourceID;
+ @XmlAttribute(name = "HullNum")
+ protected String hullNum;
+ @XmlAttribute(name = "ShortName")
+ protected String shortName;
+ @XmlAttribute(name = "ShapeID")
+ protected Integer shapeID;
+ @XmlAttribute(name = "StoweName")
+ protected String stoweName;
+
+ /**
+ * Gets the value of the gpSposition property.
+ *
+ * @return
+ * possible object is
+ * {@link BoatConfig.Boats.Boat.GPSposition }
+ *
+ */
+ public BoatConfig.Boats.Boat.GPSposition getGPSposition() {
+ return gpSposition;
+ }
+
+ /**
+ * Sets the value of the gpSposition property.
+ *
+ * @param value
+ * allowed object is
+ * {@link BoatConfig.Boats.Boat.GPSposition }
+ *
+ */
+ public void setGPSposition(BoatConfig.Boats.Boat.GPSposition value) {
+ this.gpSposition = value;
+ }
+
+ /**
+ * Gets the value of the type property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * Sets the value of the type property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setType(String value) {
+ this.type = value;
+ }
+
+ /**
+ * Gets the value of the boatName property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getBoatName() {
+ return boatName;
+ }
+
+ /**
+ * Sets the value of the boatName property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setBoatName(String value) {
+ this.boatName = value;
+ }
+
+ /**
+ * Gets the value of the sourceID property.
+ *
+ */
+ public int getSourceID() {
+ return sourceID;
+ }
+
+ /**
+ * Sets the value of the sourceID property.
+ *
+ */
+ public void setSourceID(int value) {
+ this.sourceID = value;
+ }
+
+ /**
+ * Gets the value of the hullNum property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getHullNum() {
+ return hullNum;
+ }
+
+ /**
+ * Sets the value of the hullNum property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setHullNum(String value) {
+ this.hullNum = value;
+ }
+
+ /**
+ * Gets the value of the shortName property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getShortName() {
+ return shortName;
+ }
+
+ /**
+ * Sets the value of the shortName property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setShortName(String value) {
+ this.shortName = value;
+ }
+
+ /**
+ * Gets the value of the shapeID property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getShapeID() {
+ return shapeID;
+ }
+
+ /**
+ * Sets the value of the shapeID property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setShapeID(Integer value) {
+ this.shapeID = value;
+ }
+
+ /**
+ * Gets the value of the stoweName property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getStoweName() {
+ return stoweName;
+ }
+
+ /**
+ * Sets the value of the stoweName property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setStoweName(String value) {
+ this.stoweName = value;
+ }
+
+
+ /**
+ *
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="X" type="{http://www.w3.org/2001/XMLSchema}double" />
+ * <attribute name="Y" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
+ * <attribute name="Z" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ *
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "")
+ public static class GPSposition {
+
+ @XmlAttribute(name = "X", required = true)
+ protected Double x;
+ @XmlAttribute(name = "Y", required = true)
+ protected double y;
+ @XmlAttribute(name = "Z", required = true)
+ protected double z;
+
+ /**
+ * Gets the value of the x property.
+ *
+ * @return
+ * possible object is
+ * {@link Double }
+ *
+ */
+ public Double getX() {
+ return x;
+ }
+
+ /**
+ * Sets the value of the x property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Double }
+ *
+ */
+ public void setX(Double value) {
+ this.x = value;
+ }
+
+ /**
+ * Gets the value of the y property.
+ *
+ */
+ public double getY() {
+ return y;
+ }
+
+ /**
+ * Sets the value of the y property.
+ *
+ */
+ public void setY(double value) {
+ this.y = value;
+ }
+
+ /**
+ * Gets the value of the z property.
+ *
+ */
+ public double getZ() {
+ return z;
+ }
+
+ /**
+ * Sets the value of the z property.
+ *
+ */
+ public void setZ(double value) {
+ this.z = value;
+ }
+
+ }
+
+ }
+
+ }
+
+}
diff --git a/racevisionGame/src/main/java/shared/xml/boats/BoatDataSourceToXML.java b/racevisionGame/src/main/java/shared/xml/boats/BoatDataSourceToXML.java
new file mode 100644
index 00000000..d24bee56
--- /dev/null
+++ b/racevisionGame/src/main/java/shared/xml/boats/BoatDataSourceToXML.java
@@ -0,0 +1,86 @@
+package shared.xml.boats;
+
+import shared.dataInput.BoatDataSource;
+import shared.dataInput.RaceDataSource;
+import shared.enums.RoundingType;
+import shared.model.Boat;
+import shared.model.CompoundMark;
+import shared.model.Leg;
+import shared.model.Mark;
+import shared.xml.Race.*;
+import shared.xml.XMLUtilities;
+
+import javax.xml.bind.JAXBException;
+import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+
+/**
+ * Has functions to convert a {@link shared.dataInput.BoatDataSource} to an {@link BoatConfig} object.
+ */
+public class BoatDataSourceToXML {
+
+
+ /**
+ * Converts a boat data source to an XMLRace object.
+ * @param boatDataSource The data source to convert.
+ * @return The XMLRace file.
+ */
+ public static BoatConfig toXML(BoatDataSource boatDataSource) {
+ BoatConfig boatConfig = new BoatConfig();
+
+ boatConfig.boats = new BoatConfig.Boats();
+ boatConfig.boats.boat = new ArrayList<>();
+
+
+ for (Boat boat : boatDataSource.getBoats().values()) {
+ BoatConfig.Boats.Boat xmlBoat = new BoatConfig.Boats.Boat();
+
+ xmlBoat.setType("Yacht");
+ xmlBoat.setBoatName(boat.getName());
+ xmlBoat.setSourceID(boat.getSourceID());
+ xmlBoat.setStoweName(boat.getCountry());
+ xmlBoat.setShortName(boat.getCountry());
+
+ BoatConfig.Boats.Boat.GPSposition position = new BoatConfig.Boats.Boat.GPSposition();
+ position.setX(boat.getPosition().getLongitude());
+ position.setY(boat.getPosition().getLatitude());
+ position.setZ(0);
+ xmlBoat.setGPSposition(position);
+
+ boatConfig.boats.boat.add(xmlBoat);
+ }
+
+
+ for (Mark mark : boatDataSource.getMarkerBoats().values()) {
+ BoatConfig.Boats.Boat xmlBoat = new BoatConfig.Boats.Boat();
+
+ xmlBoat.setType("Mark");
+ xmlBoat.setBoatName(mark.getName());
+ xmlBoat.setSourceID(mark.getSourceID());
+
+ BoatConfig.Boats.Boat.GPSposition position = new BoatConfig.Boats.Boat.GPSposition();
+ position.setX(mark.getPosition().getLongitude());
+ position.setY(mark.getPosition().getLatitude());
+ position.setZ(0);
+ xmlBoat.setGPSposition(position);
+
+ boatConfig.boats.boat.add(xmlBoat);
+ }
+
+ return boatConfig;
+ }
+
+
+ /**
+ * Converts a boat data source to an xml string.
+ * @param boatDataSource Data source to convert.
+ * @return String containing xml file.
+ * @throws JAXBException Thrown if it cannot be converted.
+ */
+ public static String toString(BoatDataSource boatDataSource) throws JAXBException {
+ BoatConfig boats = toXML(boatDataSource);
+ return XMLUtilities.classToXML(boats);
+ }
+
+
+}
diff --git a/racevisionGame/src/main/java/shared/xml/boats/ObjectFactory.java b/racevisionGame/src/main/java/shared/xml/boats/ObjectFactory.java
new file mode 100644
index 00000000..0319de9a
--- /dev/null
+++ b/racevisionGame/src/main/java/shared/xml/boats/ObjectFactory.java
@@ -0,0 +1,71 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
+// See http://java.sun.com/xml/jaxb
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2017.09.01 at 11:12:43 PM NZST
+//
+
+
+package shared.xml.boats;
+
+import javax.xml.bind.annotation.XmlRegistry;
+
+
+/**
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the aaa package.
+ *
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="RegattaID" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ * <element name="RegattaName" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="CourseName" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="CentralLatitude" type="{http://www.w3.org/2001/XMLSchema}double"/>
+ * <element name="CentralLongitude" type="{http://www.w3.org/2001/XMLSchema}double"/>
+ * <element name="CentralAltitude" type="{http://www.w3.org/2001/XMLSchema}double"/>
+ * <element name="UtcOffset" type="{http://www.w3.org/2001/XMLSchema}double"/>
+ * <element name="MagneticVariation" type="{http://www.w3.org/2001/XMLSchema}double"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ *
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+ "regattaID",
+ "regattaName",
+ "courseName",
+ "centralLatitude",
+ "centralLongitude",
+ "centralAltitude",
+ "utcOffset",
+ "magneticVariation"
+})
+@XmlRootElement(name = "RegattaConfig")
+public class RegattaConfig {
+
+ @XmlElement(name = "RegattaID")
+ protected int regattaID;
+ @XmlElement(name = "RegattaName", required = true)
+ protected String regattaName;
+ @XmlElement(name = "CourseName", required = true)
+ protected String courseName;
+ @XmlElement(name = "CentralLatitude")
+ protected double centralLatitude;
+ @XmlElement(name = "CentralLongitude")
+ protected double centralLongitude;
+ @XmlElement(name = "CentralAltitude")
+ protected double centralAltitude;
+ @XmlElement(name = "UtcOffset")
+ protected double utcOffset;
+ @XmlElement(name = "MagneticVariation")
+ protected double magneticVariation;
+
+ /**
+ * Gets the value of the regattaID property.
+ *
+ */
+ public int getRegattaID() {
+ return regattaID;
+ }
+
+ /**
+ * Sets the value of the regattaID property.
+ *
+ */
+ public void setRegattaID(int value) {
+ this.regattaID = value;
+ }
+
+ /**
+ * Gets the value of the regattaName property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getRegattaName() {
+ return regattaName;
+ }
+
+ /**
+ * Sets the value of the regattaName property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setRegattaName(String value) {
+ this.regattaName = value;
+ }
+
+ /**
+ * Gets the value of the courseName property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getCourseName() {
+ return courseName;
+ }
+
+ /**
+ * Sets the value of the courseName property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setCourseName(String value) {
+ this.courseName = value;
+ }
+
+ /**
+ * Gets the value of the centralLatitude property.
+ *
+ */
+ public double getCentralLatitude() {
+ return centralLatitude;
+ }
+
+ /**
+ * Sets the value of the centralLatitude property.
+ *
+ */
+ public void setCentralLatitude(double value) {
+ this.centralLatitude = value;
+ }
+
+ /**
+ * Gets the value of the centralLongitude property.
+ *
+ */
+ public double getCentralLongitude() {
+ return centralLongitude;
+ }
+
+ /**
+ * Sets the value of the centralLongitude property.
+ *
+ */
+ public void setCentralLongitude(double value) {
+ this.centralLongitude = value;
+ }
+
+ /**
+ * Gets the value of the centralAltitude property.
+ *
+ */
+ public double getCentralAltitude() {
+ return centralAltitude;
+ }
+
+ /**
+ * Sets the value of the centralAltitude property.
+ *
+ */
+ public void setCentralAltitude(double value) {
+ this.centralAltitude = value;
+ }
+
+ /**
+ * Gets the value of the utcOffset property.
+ *
+ */
+ public double getUtcOffset() {
+ return utcOffset;
+ }
+
+ /**
+ * Sets the value of the utcOffset property.
+ *
+ */
+ public void setUtcOffset(double value) {
+ this.utcOffset = value;
+ }
+
+ /**
+ * Gets the value of the magneticVariation property.
+ *
+ */
+ public double getMagneticVariation() {
+ return magneticVariation;
+ }
+
+ /**
+ * Sets the value of the magneticVariation property.
+ *
+ */
+ public void setMagneticVariation(double value) {
+ this.magneticVariation = value;
+ }
+
+}
diff --git a/racevisionGame/src/main/java/shared/xml/regatta/RegattaDataSourceToXML.java b/racevisionGame/src/main/java/shared/xml/regatta/RegattaDataSourceToXML.java
new file mode 100644
index 00000000..bbe1dce6
--- /dev/null
+++ b/racevisionGame/src/main/java/shared/xml/regatta/RegattaDataSourceToXML.java
@@ -0,0 +1,54 @@
+package shared.xml.regatta;
+
+import shared.dataInput.RegattaDataSource;
+import shared.xml.Race.XMLRace;
+import shared.xml.XMLUtilities;
+
+import javax.xml.bind.JAXBException;
+
+/**
+ * Has functions to convert a {@link shared.dataInput.RegattaDataSource} to an {@link RegattaConfig} object.
+ */
+public class RegattaDataSourceToXML {
+
+
+ /**
+ * Converts a regatta data source to an XMLRace object.
+ * @param regattaDataSource The data source to convert.
+ * @return The XMLRace file.
+ */
+ public static RegattaConfig toXML(RegattaDataSource regattaDataSource) {
+
+ RegattaConfig regatta = new RegattaConfig();
+
+ regatta.setCentralAltitude(regattaDataSource.getCentralAltitude());
+ regatta.setCentralLatitude(regattaDataSource.getCentralLatitude());
+ regatta.setCentralLongitude(regattaDataSource.getCentralLongitude());
+
+ regatta.setCourseName(regattaDataSource.getCourseName());
+
+ regatta.setRegattaName(regattaDataSource.getRegattaName());
+
+ regatta.setMagneticVariation(regattaDataSource.getMagneticVariation());
+
+ regatta.setRegattaID(regattaDataSource.getRegattaID());
+
+ regatta.setUtcOffset(regattaDataSource.getUtcOffset());
+
+ return regatta;
+ }
+
+
+ /**
+ * Converts a regatta data source to an xml string.
+ * @param regattaDataSource Data source to convert.
+ * @return String containing xml file.
+ * @throws JAXBException Thrown if it cannot be converted.
+ */
+ public static String toString(RegattaDataSource regattaDataSource) throws JAXBException {
+ RegattaConfig regatta = toXML(regattaDataSource);
+ return XMLUtilities.classToXML(regatta);
+ }
+
+
+}
diff --git a/racevisionGame/src/main/java/visualiser/Controllers/FinishController.java b/racevisionGame/src/main/java/visualiser/Controllers/FinishController.java
index c5356495..6de6dcdf 100644
--- a/racevisionGame/src/main/java/visualiser/Controllers/FinishController.java
+++ b/racevisionGame/src/main/java/visualiser/Controllers/FinishController.java
@@ -71,8 +71,10 @@ public class FinishController extends Controller {
//Winner label.
- raceWinnerLabel.setText("Winner: "+ boatNameColumn.getCellObservableValue(0).getValue());
- raceWinnerLabel.setWrapText(true);
+ if (boats.size() > 0) {
+ raceWinnerLabel.setText("Winner: " + boatNameColumn.getCellObservableValue(0).getValue());
+ raceWinnerLabel.setWrapText(true);
+ }
}
diff --git a/racevisionGame/src/main/java/visualiser/Controllers/HostController.java b/racevisionGame/src/main/java/visualiser/Controllers/HostController.java
index 1609e700..008276ef 100644
--- a/racevisionGame/src/main/java/visualiser/Controllers/HostController.java
+++ b/racevisionGame/src/main/java/visualiser/Controllers/HostController.java
@@ -1,21 +1,29 @@
package visualiser.Controllers;
+import com.interactivemesh.jfx.importer.stl.StlMeshImporter;
+import javafx.animation.AnimationTimer;
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableList;
import javafx.fxml.FXML;
-import javafx.scene.control.TextField;
+import javafx.scene.control.Alert;
+import javafx.scene.control.ButtonType;
+import javafx.scene.control.SplitPane;
+import javafx.scene.image.ImageView;
import javafx.scene.layout.AnchorPane;
+import javafx.scene.layout.GridPane;
+import javafx.scene.shape.Box;
+import javafx.scene.shape.Mesh;
+import javafx.scene.shape.MeshView;
+import javafx.scene.shape.Shape3D;
+import javafx.scene.transform.Rotate;
import mock.app.Event;
-import org.xml.sax.SAXException;
import mock.exceptions.EventConstructionException;
-import shared.exceptions.InvalidBoatDataException;
-import shared.exceptions.InvalidRaceDataException;
-import shared.exceptions.InvalidRegattaDataException;
-import shared.exceptions.XMLReaderException;
+import visualiser.model.View3D;
-import javax.xml.bind.JAXBException;
-import javax.xml.parsers.ParserConfigurationException;
import java.io.IOException;
import java.net.Socket;
import java.net.URL;
+import java.util.Optional;
import java.util.ResourceBundle;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -26,27 +34,70 @@ import java.util.logging.Logger;
public class HostController extends Controller {
- @FXML
- TextField gameNameField;
+// @FXML
+// TextField gameNameField;
+//
+// @FXML
+// TextField hostNameField;
@FXML
- TextField hostNameField;
+ private ImageView imageView;
@FXML
AnchorPane hostWrapper;
+ @FXML
+ AnchorPane imagePane;
+
+ @FXML
+ SplitPane splitPane;
+
+ @FXML
+ AnchorPane specPane;
+
+ @FXML
+ GridPane playerContainer;
+
private Event game;
+ private View3D view3D;
@Override
public void initialize(URL location, ResourceBundle resources) {
+ ObservableList