From 4e8d4f24333ef785852ba8623b13e85aabb9b649 Mon Sep 17 00:00:00 2001 From: Fan-Wu Yang Date: Thu, 3 Aug 2017 02:42:33 +1200 Subject: [PATCH 01/28] Created Schema for Race xml's and generated classes for reading xml with xjc, made the RaceXMLReader read Corner classes in as well as making a corner class #story[1092] --- .../src/main/java/mock/app/Event.java | 105 +- .../src/main/java/mock/xml/ObjectFactory.java | 127 ++ .../src/main/java/mock/xml/Race.java | 1258 +++++++++++++++++ .../src/main/java/mock/xml/RaceFactory.java | 127 ++ .../java/shared/dataInput/RaceXMLReader.java | 15 + .../src/main/java/shared/model/Corner.java | 23 + .../resources/mock/mockXML/raceSchemaTest.xml | 52 + .../mock/mockXML/schema/raceSchema.xsd | 77 + 8 files changed, 1782 insertions(+), 2 deletions(-) create mode 100644 racevisionGame/src/main/java/mock/xml/ObjectFactory.java create mode 100644 racevisionGame/src/main/java/mock/xml/Race.java create mode 100644 racevisionGame/src/main/java/mock/xml/RaceFactory.java create mode 100644 racevisionGame/src/main/java/shared/model/Corner.java create mode 100644 racevisionGame/src/main/resources/mock/mockXML/raceSchemaTest.xml create mode 100644 racevisionGame/src/main/resources/mock/mockXML/schema/raceSchema.xsd diff --git a/racevisionGame/src/main/java/mock/app/Event.java b/racevisionGame/src/main/java/mock/app/Event.java index c94a691f..631f431d 100644 --- a/racevisionGame/src/main/java/mock/app/Event.java +++ b/racevisionGame/src/main/java/mock/app/Event.java @@ -3,6 +3,8 @@ package mock.app; import mock.dataInput.PolarParser; import mock.model.MockRace; import mock.model.Polars; +import mock.xml.Race; +import mock.xml.RaceFactory; import network.Messages.LatestMessages; import shared.dataInput.*; import shared.enums.XMLFileType; @@ -10,10 +12,15 @@ import shared.exceptions.InvalidBoatDataException; import shared.exceptions.InvalidRaceDataException; import shared.exceptions.InvalidRegattaDataException; import shared.exceptions.XMLReaderException; +import shared.model.CompoundMark; import shared.model.Constants; +import shared.model.Corner; +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Marshaller; import javax.xml.transform.TransformerException; -import java.io.IOException; +import java.io.*; import java.net.UnknownHostException; import java.nio.charset.StandardCharsets; import java.time.ZonedDateTime; @@ -42,7 +49,7 @@ public class Event { */ private Event() { try { - this.raceXML = getRaceXMLAtCurrentTime(XMLReader.readXMLFileToString("mock/mockXML/raceTest.xml", StandardCharsets.UTF_8)); + this.raceXML = getRaceXMLAtCurrentTime(alterRaceToWind("mock/mockXML/raceSchemaTest.xml", 0)); this.boatXML = XMLReader.readXMLFileToString("mock/mockXML/boatsSinglePlayer.xml", StandardCharsets.UTF_8); this.regattaXML = XMLReader.readXMLFileToString("mock/mockXML/regattaTest.xml", StandardCharsets.UTF_8); this.xmlFileType = XMLFileType.Contents; @@ -58,6 +65,10 @@ public class Event { e.printStackTrace(); } catch (TransformerException e) { e.printStackTrace(); + } catch (InvalidRaceDataException e) { + e.printStackTrace(); + } catch (JAXBException e) { + e.printStackTrace(); } } @@ -130,4 +141,94 @@ public class Event { return raceXML; } + + + private Race copyRace(RaceXMLReader reader) throws InvalidRaceDataException, XMLReaderException { + mock.xml.RaceFactory raceFactory = new RaceFactory(); + mock.xml.Race race = raceFactory.createRace(); + race.setRaceID(String.valueOf(reader.getRaceId())); + race.setRaceType(String.valueOf(reader.getRaceType())); + race.setCreationTimeDate("CREATION_TIME");//this needs to be changed later + + //Race Start Time + mock.xml.Race.RaceStartTime raceStartTime = raceFactory.createRaceRaceStartTime(); + raceStartTime.setPostpone("false"); + raceStartTime.setTime("START_TIME");//this needs to be changed later + race.setRaceStartTime(raceStartTime); + + //Participants + Race.Participants participants = raceFactory.createRaceParticipants(); + for (int i :reader.getParticipants()) { + Race.Participants.Yacht yacht = raceFactory.createRaceParticipantsYacht(); + yacht.setSourceID(String.valueOf(i)); + participants.getYacht().add(yacht); //java schema does not clone the array so this is "safe". + } + race.setParticipants(participants); + + //compound marks sequence + Race.CompoundMarkSequence cms = raceFactory.createRaceCompoundMarkSequence(); + for (Corner mark: reader.getCornersList()){ + Race.CompoundMarkSequence.Corner corner = raceFactory.createRaceCompoundMarkSequenceCorner(); + corner.setCompoundMarkID(String.valueOf(mark.getId())); + corner.setSeqID(String.valueOf(mark.getSeqID())); + cms.getCorner().add(corner); + } + race.setCompoundMarkSequence(cms); + + //Course + Race.Course course = raceFactory.createRaceCourse(); + for (CompoundMark mark: reader.getCompoundMarks()){ + Race.Course.CompoundMark cm = raceFactory.createRaceCourseCompoundMark(); + cm.setName(mark.getName()); + cm.setCompoundMarkID(String.valueOf(mark.getId())); + if (mark.getMark1() != null){ + Race.Course.CompoundMark.Mark m1 = raceFactory.createRaceCourseCompoundMarkMark(); + m1.setName(mark.getMark1().getName()); + m1.setTargetLat(String.valueOf(mark.getMark1().getPosition().getLatitude())); + m1.setTargetLng(String.valueOf(mark.getMark1().getPosition().getLongitude())); + m1.setSourceID(String.valueOf(mark.getMark1().getSourceID())); + cm.getMark().add(m1); + } + //make this not copy paste later but just need the concept working right now + if (mark.getMark2() != null){ + Race.Course.CompoundMark.Mark m2 = raceFactory.createRaceCourseCompoundMarkMark(); + m2.setName(mark.getMark1().getName()); + m2.setTargetLat(String.valueOf(mark.getMark1().getPosition().getLatitude())); + m2.setTargetLng(String.valueOf(mark.getMark1().getPosition().getLongitude())); + m2.setSourceID(String.valueOf(mark.getMark1().getSourceID())); + cm.getMark().add(m2); + } + course.getCompoundMark().add(cm); + } + race.setCourse(course); + + //Course Limit + Race.CourseLimit courseLimit = raceFactory.createRaceCourseLimit(); + for (int i = 0; i < reader.getBoundary().size(); i++){ + Race.CourseLimit.Limit limit = raceFactory.createRaceCourseLimitLimit(); + limit.setSeqID(String.valueOf(i+1)); + limit.setLat(String.valueOf(reader.getBoundary().get(i).getLatitude())); + limit.setLon(String.valueOf(reader.getBoundary().get(i).getLongitude())); + courseLimit.getLimit().add(limit); + } + race.setCourseLimit(courseLimit); + + return race; + } + + private String alterRaceToWind(String s, double degrees) throws XMLReaderException, InvalidRaceDataException, JAXBException { + RaceXMLReader reader = new RaceXMLReader(s, XMLFileType.ResourcePath); + + mock.xml.Race race = copyRace(reader); + + JAXBContext context = JAXBContext.newInstance(mock.xml.Race.class); + Marshaller jaxbMarshaller = context.createMarshaller(); + jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); + + StringWriter sw = new StringWriter(); + + jaxbMarshaller.marshal(race, sw); + return sw.toString(); + } + } diff --git a/racevisionGame/src/main/java/mock/xml/ObjectFactory.java b/racevisionGame/src/main/java/mock/xml/ObjectFactory.java new file mode 100644 index 00000000..46d95ee5 --- /dev/null +++ b/racevisionGame/src/main/java/mock/xml/ObjectFactory.java @@ -0,0 +1,127 @@ +// +// 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.08.03 at 02:28:57 AM NZST +// + + +package mock.xml; + +import javax.xml.bind.annotation.XmlRegistry; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the race 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: race + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link Race } + * + */ + public Race createRace() { + return new Race(); + } + + /** + * Create an instance of {@link Race.CourseLimit } + * + */ + public Race.CourseLimit createRaceCourseLimit() { + return new Race.CourseLimit(); + } + + /** + * Create an instance of {@link Race.Course } + * + */ + public Race.Course createRaceCourse() { + return new Race.Course(); + } + + /** + * Create an instance of {@link Race.Course.CompoundMark } + * + */ + public Race.Course.CompoundMark createRaceCourseCompoundMark() { + return new Race.Course.CompoundMark(); + } + + /** + * Create an instance of {@link Race.CompoundMarkSequence } + * + */ + public Race.CompoundMarkSequence createRaceCompoundMarkSequence() { + return new Race.CompoundMarkSequence(); + } + + /** + * Create an instance of {@link Race.Participants } + * + */ + public Race.Participants createRaceParticipants() { + return new Race.Participants(); + } + + /** + * Create an instance of {@link Race.RaceStartTime } + * + */ + public Race.RaceStartTime createRaceRaceStartTime() { + return new Race.RaceStartTime(); + } + + /** + * Create an instance of {@link Race.CourseLimit.Limit } + * + */ + public Race.CourseLimit.Limit createRaceCourseLimitLimit() { + return new Race.CourseLimit.Limit(); + } + + /** + * Create an instance of {@link Race.Course.CompoundMark.Mark } + * + */ + public Race.Course.CompoundMark.Mark createRaceCourseCompoundMarkMark() { + return new Race.Course.CompoundMark.Mark(); + } + + /** + * Create an instance of {@link Race.CompoundMarkSequence.Corner } + * + */ + public Race.CompoundMarkSequence.Corner createRaceCompoundMarkSequenceCorner() { + return new Race.CompoundMarkSequence.Corner(); + } + + /** + * Create an instance of {@link Race.Participants.Yacht } + * + */ + public Race.Participants.Yacht createRaceParticipantsYacht() { + return new Race.Participants.Yacht(); + } + +} diff --git a/racevisionGame/src/main/java/mock/xml/Race.java b/racevisionGame/src/main/java/mock/xml/Race.java new file mode 100644 index 00000000..e2f1837d --- /dev/null +++ b/racevisionGame/src/main/java/mock/xml/Race.java @@ -0,0 +1,1258 @@ +// +// 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.08.03 at 02:28:57 AM NZST +// + + +package mock.xml; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +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="RaceID" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="RaceType" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="CreationTimeDate" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="RaceStartTime">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <attribute name="Postpone" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 <attribute name="Time" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="Participants">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="Yacht" maxOccurs="unbounded">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="CompoundMarkSequence">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="Corner" maxOccurs="unbounded">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="Course">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="CompoundMark" maxOccurs="unbounded">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <sequence>
+ *                             <element name="Mark" maxOccurs="unbounded">
+ *                               <complexType>
+ *                                 <complexContent>
+ *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                     <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                     <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                     <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                     <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                     <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                   </restriction>
+ *                                 </complexContent>
+ *                               </complexType>
+ *                             </element>
+ *                           </sequence>
+ *                           <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="CourseLimit">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="Limit" maxOccurs="unbounded">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="SeqID" use="required" 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 = { + "raceID", + "raceType", + "creationTimeDate", + "raceStartTime", + "participants", + "compoundMarkSequence", + "course", + "courseLimit" +}) +@XmlRootElement(name = "Race") +public class Race { + + @XmlElement(name = "RaceID", required = true) + protected String raceID; + @XmlElement(name = "RaceType", required = true) + protected String raceType; + @XmlElement(name = "CreationTimeDate", required = true) + protected String creationTimeDate; + @XmlElement(name = "RaceStartTime", required = true) + protected Race.RaceStartTime raceStartTime; + @XmlElement(name = "Participants", required = true) + protected Race.Participants participants; + @XmlElement(name = "CompoundMarkSequence", required = true) + protected Race.CompoundMarkSequence compoundMarkSequence; + @XmlElement(name = "Course", required = true) + protected Race.Course course; + @XmlElement(name = "CourseLimit", required = true) + protected Race.CourseLimit courseLimit; + + /** + * Gets the value of the raceID property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getRaceID() { + return raceID; + } + + /** + * Sets the value of the raceID property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setRaceID(String value) { + this.raceID = value; + } + + /** + * Gets the value of the raceType property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getRaceType() { + return raceType; + } + + /** + * Sets the value of the raceType property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setRaceType(String value) { + this.raceType = value; + } + + /** + * Gets the value of the creationTimeDate property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCreationTimeDate() { + return creationTimeDate; + } + + /** + * Sets the value of the creationTimeDate property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCreationTimeDate(String value) { + this.creationTimeDate = value; + } + + /** + * Gets the value of the raceStartTime property. + * + * @return + * possible object is + * {@link Race.RaceStartTime } + * + */ + public Race.RaceStartTime getRaceStartTime() { + return raceStartTime; + } + + /** + * Sets the value of the raceStartTime property. + * + * @param value + * allowed object is + * {@link Race.RaceStartTime } + * + */ + public void setRaceStartTime(Race.RaceStartTime value) { + this.raceStartTime = value; + } + + /** + * Gets the value of the participants property. + * + * @return + * possible object is + * {@link Race.Participants } + * + */ + public Race.Participants getParticipants() { + return participants; + } + + /** + * Sets the value of the participants property. + * + * @param value + * allowed object is + * {@link Race.Participants } + * + */ + public void setParticipants(Race.Participants value) { + this.participants = value; + } + + /** + * Gets the value of the compoundMarkSequence property. + * + * @return + * possible object is + * {@link Race.CompoundMarkSequence } + * + */ + public Race.CompoundMarkSequence getCompoundMarkSequence() { + return compoundMarkSequence; + } + + /** + * Sets the value of the compoundMarkSequence property. + * + * @param value + * allowed object is + * {@link Race.CompoundMarkSequence } + * + */ + public void setCompoundMarkSequence(Race.CompoundMarkSequence value) { + this.compoundMarkSequence = value; + } + + /** + * Gets the value of the course property. + * + * @return + * possible object is + * {@link Race.Course } + * + */ + public Race.Course getCourse() { + return course; + } + + /** + * Sets the value of the course property. + * + * @param value + * allowed object is + * {@link Race.Course } + * + */ + public void setCourse(Race.Course value) { + this.course = value; + } + + /** + * Gets the value of the courseLimit property. + * + * @return + * possible object is + * {@link Race.CourseLimit } + * + */ + public Race.CourseLimit getCourseLimit() { + return courseLimit; + } + + /** + * Sets the value of the courseLimit property. + * + * @param value + * allowed object is + * {@link Race.CourseLimit } + * + */ + public void setCourseLimit(Race.CourseLimit value) { + this.courseLimit = 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="Corner" maxOccurs="unbounded">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "corner" + }) + public static class CompoundMarkSequence { + + @XmlElement(name = "Corner", required = true) + protected List corner; + + /** + * Gets the value of the corner property. + * + *

+ * 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 corner property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getCorner().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Race.CompoundMarkSequence.Corner } + * + * + */ + public List getCorner() { + if (corner == null) { + corner = new ArrayList(); + } + return this.corner; + } + + + /** + *

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">
+         *       <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
+         * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class Corner { + + @XmlAttribute(name = "CompoundMarkID", required = true) + protected String compoundMarkID; + @XmlAttribute(name = "SeqID", required = true) + protected String seqID; + + /** + * Gets the value of the compoundMarkID property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCompoundMarkID() { + return compoundMarkID; + } + + /** + * Sets the value of the compoundMarkID property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCompoundMarkID(String value) { + this.compoundMarkID = value; + } + + /** + * Gets the value of the seqID property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSeqID() { + return seqID; + } + + /** + * Sets the value of the seqID property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSeqID(String value) { + this.seqID = 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="CompoundMark" maxOccurs="unbounded">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <sequence>
+     *                   <element name="Mark" maxOccurs="unbounded">
+     *                     <complexType>
+     *                       <complexContent>
+     *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                           <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                           <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                           <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                           <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                           <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                         </restriction>
+     *                       </complexContent>
+     *                     </complexType>
+     *                   </element>
+     *                 </sequence>
+     *                 <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "compoundMark" + }) + public static class Course { + + @XmlElement(name = "CompoundMark", required = true) + protected List compoundMark; + + /** + * Gets the value of the compoundMark property. + * + *

+ * 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 compoundMark property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getCompoundMark().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Race.Course.CompoundMark } + * + * + */ + public List getCompoundMark() { + if (compoundMark == null) { + compoundMark = new ArrayList(); + } + return this.compoundMark; + } + + + /** + *

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="Mark" maxOccurs="unbounded">
+         *           <complexType>
+         *             <complexContent>
+         *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                 <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *                 <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *                 <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *                 <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *                 <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *               </restriction>
+         *             </complexContent>
+         *           </complexType>
+         *         </element>
+         *       </sequence>
+         *       <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
+         * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "mark" + }) + public static class CompoundMark { + + @XmlElement(name = "Mark", required = true) + protected List mark; + @XmlAttribute(name = "CompoundMarkID", required = true) + protected String compoundMarkID; + @XmlAttribute(name = "Name", required = true) + protected String name; + + /** + * Gets the value of the mark property. + * + *

+ * 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 mark property. + * + *

+ * For example, to add a new item, do as follows: + *

+             *    getMark().add(newItem);
+             * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Race.Course.CompoundMark.Mark } + * + * + */ + public List getMark() { + if (mark == null) { + mark = new ArrayList(); + } + return this.mark; + } + + /** + * Gets the value of the compoundMarkID property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCompoundMarkID() { + return compoundMarkID; + } + + /** + * Sets the value of the compoundMarkID property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCompoundMarkID(String value) { + this.compoundMarkID = value; + } + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = 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">
+             *       <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
+             *       <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+             *       <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+             *       <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+             *       <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+             *     </restriction>
+             *   </complexContent>
+             * </complexType>
+             * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class Mark { + + @XmlAttribute(name = "SeqId") + protected String seqId; + @XmlAttribute(name = "Name", required = true) + protected String name; + @XmlAttribute(name = "TargetLat", required = true) + protected String targetLat; + @XmlAttribute(name = "TargetLng", required = true) + protected String targetLng; + @XmlAttribute(name = "SourceID", required = true) + protected String sourceID; + + /** + * Gets the value of the seqId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSeqId() { + return seqId; + } + + /** + * Sets the value of the seqId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSeqId(String value) { + this.seqId = value; + } + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the targetLat property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTargetLat() { + return targetLat; + } + + /** + * Sets the value of the targetLat property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTargetLat(String value) { + this.targetLat = value; + } + + /** + * Gets the value of the targetLng property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTargetLng() { + return targetLng; + } + + /** + * Sets the value of the targetLng property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTargetLng(String value) { + this.targetLng = value; + } + + /** + * Gets the value of the sourceID property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSourceID() { + return sourceID; + } + + /** + * Sets the value of the sourceID property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSourceID(String value) { + this.sourceID = 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="Limit" maxOccurs="unbounded">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "limit" + }) + public static class CourseLimit { + + @XmlElement(name = "Limit", required = true) + protected List limit; + + /** + * Gets the value of the limit property. + * + *

+ * 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 limit property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getLimit().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Race.CourseLimit.Limit } + * + * + */ + public List getLimit() { + if (limit == null) { + limit = new ArrayList(); + } + return this.limit; + } + + + /** + *

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">
+         *       <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
+         * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class Limit { + + @XmlAttribute(name = "Lat", required = true) + protected String lat; + @XmlAttribute(name = "Lon", required = true) + protected String lon; + @XmlAttribute(name = "SeqID", required = true) + protected String seqID; + + /** + * Gets the value of the lat property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLat() { + return lat; + } + + /** + * Sets the value of the lat property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLat(String value) { + this.lat = value; + } + + /** + * Gets the value of the lon property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLon() { + return lon; + } + + /** + * Sets the value of the lon property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLon(String value) { + this.lon = value; + } + + /** + * Gets the value of the seqID property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSeqID() { + return seqID; + } + + /** + * Sets the value of the seqID property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSeqID(String value) { + this.seqID = 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="Yacht" maxOccurs="unbounded">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "yacht" + }) + public static class Participants { + + @XmlElement(name = "Yacht", required = true) + protected List yacht; + + /** + * Gets the value of the yacht property. + * + *

+ * 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 yacht property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getYacht().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Race.Participants.Yacht } + * + * + */ + public List getYacht() { + if (yacht == null) { + yacht = new ArrayList(); + } + return this.yacht; + } + + + /** + *

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">
+         *       <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
+         * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class Yacht { + + @XmlAttribute(name = "SourceID", required = true) + protected String sourceID; + + /** + * Gets the value of the sourceID property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSourceID() { + return sourceID; + } + + /** + * Sets the value of the sourceID property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSourceID(String value) { + this.sourceID = 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">
+     *       <attribute name="Postpone" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       <attribute name="Time" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class RaceStartTime { + + @XmlAttribute(name = "Postpone", required = true) + protected String postpone; + @XmlAttribute(name = "Time", required = true) + protected String time; + + /** + * Gets the value of the postpone property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getPostpone() { + return postpone; + } + + /** + * Sets the value of the postpone property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setPostpone(String value) { + this.postpone = value; + } + + /** + * Gets the value of the time property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTime() { + return time; + } + + /** + * Sets the value of the time property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTime(String value) { + this.time = value; + } + + } + +} diff --git a/racevisionGame/src/main/java/mock/xml/RaceFactory.java b/racevisionGame/src/main/java/mock/xml/RaceFactory.java new file mode 100644 index 00000000..674fa849 --- /dev/null +++ b/racevisionGame/src/main/java/mock/xml/RaceFactory.java @@ -0,0 +1,127 @@ +// +// 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.08.03 at 01:07:33 AM NZST +// + + +package mock.xml; + +import javax.xml.bind.annotation.XmlRegistry; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the main.java.mock.xml 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 RaceFactory { + + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: main.java.mock.xml + * + */ + public RaceFactory() { + } + + /** + * Create an instance of {@link Race } + * + */ + public Race createRace() { + return new Race(); + } + + /** + * Create an instance of {@link Race.CourseLimit } + * + */ + public Race.CourseLimit createRaceCourseLimit() { + return new Race.CourseLimit(); + } + + /** + * Create an instance of {@link Race.Course } + * + */ + public Race.Course createRaceCourse() { + return new Race.Course(); + } + + /** + * Create an instance of {@link Race.Course.CompoundMark } + * + */ + public Race.Course.CompoundMark createRaceCourseCompoundMark() { + return new Race.Course.CompoundMark(); + } + + /** + * Create an instance of {@link Race.CompoundMarkSequence } + * + */ + public Race.CompoundMarkSequence createRaceCompoundMarkSequence() { + return new Race.CompoundMarkSequence(); + } + + /** + * Create an instance of {@link Race.Participants } + * + */ + public Race.Participants createRaceParticipants() { + return new Race.Participants(); + } + + /** + * Create an instance of {@link Race.RaceStartTime } + * + */ + public Race.RaceStartTime createRaceRaceStartTime() { + return new Race.RaceStartTime(); + } + + /** + * Create an instance of {@link Race.CourseLimit.Limit } + * + */ + public Race.CourseLimit.Limit createRaceCourseLimitLimit() { + return new Race.CourseLimit.Limit(); + } + + /** + * Create an instance of {@link Race.Course.CompoundMark.Mark } + * + */ + public Race.Course.CompoundMark.Mark createRaceCourseCompoundMarkMark() { + return new Race.Course.CompoundMark.Mark(); + } + + /** + * Create an instance of {@link Race.CompoundMarkSequence.Corner } + * + */ + public Race.CompoundMarkSequence.Corner createRaceCompoundMarkSequenceCorner() { + return new Race.CompoundMarkSequence.Corner(); + } + + /** + * Create an instance of {@link Race.Participants.Yacht } + * + */ + public Race.Participants.Yacht createRaceParticipantsYacht() { + return new Race.Participants.Yacht(); + } + +} diff --git a/racevisionGame/src/main/java/shared/dataInput/RaceXMLReader.java b/racevisionGame/src/main/java/shared/dataInput/RaceXMLReader.java index 7e61b3de..361fefd4 100644 --- a/racevisionGame/src/main/java/shared/dataInput/RaceXMLReader.java +++ b/racevisionGame/src/main/java/shared/dataInput/RaceXMLReader.java @@ -51,6 +51,10 @@ public class RaceXMLReader extends XMLReader implements RaceDataSource { */ private final List legs = new ArrayList<>(); + /** + * List of corners in the race + */ + private final List cornersList = new ArrayList<>(); /** * The time that the race.xml file was created. @@ -331,6 +335,10 @@ public class RaceXMLReader extends XMLReader implements RaceDataSource { //Gets the ID number of this corner element. int cornerID = getCompoundMarkID(cornerElement); + int cornerSeq = Integer.parseInt(getAttribute(cornerElement, "SeqID")); + + cornersList.add(new Corner(cornerID, cornerSeq)); + //Gets the CompoundMark associated with this corner. CompoundMark lastCompoundMark = this.compoundMarkMap.get(cornerID); @@ -346,6 +354,9 @@ public class RaceXMLReader extends XMLReader implements RaceDataSource { //Gets the ID number of this corner element. cornerID = getCompoundMarkID(cornerElement); + cornerSeq = Integer.parseInt(getAttribute(cornerElement, "SeqID")); + + cornersList.add(new Corner(cornerID, cornerSeq)); //Gets the CompoundMark associated with this corner. CompoundMark currentCompoundMark = this.compoundMarkMap.get(cornerID); @@ -460,4 +471,8 @@ public class RaceXMLReader extends XMLReader implements RaceDataSource { public List getParticipants() { return participants; } + + public List getCornersList() { + return cornersList; + } } diff --git a/racevisionGame/src/main/java/shared/model/Corner.java b/racevisionGame/src/main/java/shared/model/Corner.java new file mode 100644 index 00000000..9956b40e --- /dev/null +++ b/racevisionGame/src/main/java/shared/model/Corner.java @@ -0,0 +1,23 @@ +package shared.model; + +/** + * Created by Gondr on 3/08/2017. + */ +public class Corner { + + private int id; + private int seqID; + + public Corner(int id, int seqID){ + this.id = id; + this.seqID = seqID; + } + + public int getId() { + return id; + } + + public int getSeqID() { + return seqID; + } +} diff --git a/racevisionGame/src/main/resources/mock/mockXML/raceSchemaTest.xml b/racevisionGame/src/main/resources/mock/mockXML/raceSchemaTest.xml new file mode 100644 index 00000000..344279ff --- /dev/null +++ b/racevisionGame/src/main/resources/mock/mockXML/raceSchemaTest.xml @@ -0,0 +1,52 @@ + + + 5326 + FLEET + 2017-08-03T02:13:14+1200 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/raceSchema.xsd b/racevisionGame/src/main/resources/mock/mockXML/schema/raceSchema.xsd new file mode 100644 index 00000000..8cc15218 --- /dev/null +++ b/racevisionGame/src/main/resources/mock/mockXML/schema/raceSchema.xsd @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From f23c3f854d0cd3cc6ac643da5ad3e84aa2fa71fd Mon Sep 17 00:00:00 2001 From: Fan-Wu Yang Date: Thu, 3 Aug 2017 23:13:28 +1200 Subject: [PATCH 02/28] Seperated race xml creation into a class of its own - Created RaceXMLCreator class - made a function to convert limit to GPS Coordinate (limitToGPSCoordinate) - can rotate a GPS Coordinate around a point (rotate) - can get center of a race with (getCenter) #story[1092] --- .../src/main/java/mock/app/Event.java | 98 +----------- .../src/main/java/mock/xml/ObjectFactory.java | 127 ---------------- .../main/java/mock/xml/RaceXMLCreator.java | 142 ++++++++++++++++++ 3 files changed, 145 insertions(+), 222 deletions(-) delete mode 100644 racevisionGame/src/main/java/mock/xml/ObjectFactory.java create mode 100644 racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java diff --git a/racevisionGame/src/main/java/mock/app/Event.java b/racevisionGame/src/main/java/mock/app/Event.java index 631f431d..de210567 100644 --- a/racevisionGame/src/main/java/mock/app/Event.java +++ b/racevisionGame/src/main/java/mock/app/Event.java @@ -3,8 +3,7 @@ package mock.app; import mock.dataInput.PolarParser; import mock.model.MockRace; import mock.model.Polars; -import mock.xml.Race; -import mock.xml.RaceFactory; +import mock.xml.RaceXMLCreator; import network.Messages.LatestMessages; import shared.dataInput.*; import shared.enums.XMLFileType; @@ -12,13 +11,9 @@ import shared.exceptions.InvalidBoatDataException; import shared.exceptions.InvalidRaceDataException; import shared.exceptions.InvalidRegattaDataException; import shared.exceptions.XMLReaderException; -import shared.model.CompoundMark; import shared.model.Constants; -import shared.model.Corner; -import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; -import javax.xml.bind.Marshaller; import javax.xml.transform.TransformerException; import java.io.*; import java.net.UnknownHostException; @@ -49,7 +44,8 @@ public class Event { */ private Event() { try { - this.raceXML = getRaceXMLAtCurrentTime(alterRaceToWind("mock/mockXML/raceSchemaTest.xml", 0)); + this.raceXML = getRaceXMLAtCurrentTime(RaceXMLCreator.alterRaceToWind("mock/mockXML/raceSchemaTest.xml", 90)); + System.out.println(this.raceXML); this.boatXML = XMLReader.readXMLFileToString("mock/mockXML/boatsSinglePlayer.xml", StandardCharsets.UTF_8); this.regattaXML = XMLReader.readXMLFileToString("mock/mockXML/regattaTest.xml", StandardCharsets.UTF_8); this.xmlFileType = XMLFileType.Contents; @@ -143,92 +139,4 @@ public class Event { } - private Race copyRace(RaceXMLReader reader) throws InvalidRaceDataException, XMLReaderException { - mock.xml.RaceFactory raceFactory = new RaceFactory(); - mock.xml.Race race = raceFactory.createRace(); - race.setRaceID(String.valueOf(reader.getRaceId())); - race.setRaceType(String.valueOf(reader.getRaceType())); - race.setCreationTimeDate("CREATION_TIME");//this needs to be changed later - - //Race Start Time - mock.xml.Race.RaceStartTime raceStartTime = raceFactory.createRaceRaceStartTime(); - raceStartTime.setPostpone("false"); - raceStartTime.setTime("START_TIME");//this needs to be changed later - race.setRaceStartTime(raceStartTime); - - //Participants - Race.Participants participants = raceFactory.createRaceParticipants(); - for (int i :reader.getParticipants()) { - Race.Participants.Yacht yacht = raceFactory.createRaceParticipantsYacht(); - yacht.setSourceID(String.valueOf(i)); - participants.getYacht().add(yacht); //java schema does not clone the array so this is "safe". - } - race.setParticipants(participants); - - //compound marks sequence - Race.CompoundMarkSequence cms = raceFactory.createRaceCompoundMarkSequence(); - for (Corner mark: reader.getCornersList()){ - Race.CompoundMarkSequence.Corner corner = raceFactory.createRaceCompoundMarkSequenceCorner(); - corner.setCompoundMarkID(String.valueOf(mark.getId())); - corner.setSeqID(String.valueOf(mark.getSeqID())); - cms.getCorner().add(corner); - } - race.setCompoundMarkSequence(cms); - - //Course - Race.Course course = raceFactory.createRaceCourse(); - for (CompoundMark mark: reader.getCompoundMarks()){ - Race.Course.CompoundMark cm = raceFactory.createRaceCourseCompoundMark(); - cm.setName(mark.getName()); - cm.setCompoundMarkID(String.valueOf(mark.getId())); - if (mark.getMark1() != null){ - Race.Course.CompoundMark.Mark m1 = raceFactory.createRaceCourseCompoundMarkMark(); - m1.setName(mark.getMark1().getName()); - m1.setTargetLat(String.valueOf(mark.getMark1().getPosition().getLatitude())); - m1.setTargetLng(String.valueOf(mark.getMark1().getPosition().getLongitude())); - m1.setSourceID(String.valueOf(mark.getMark1().getSourceID())); - cm.getMark().add(m1); - } - //make this not copy paste later but just need the concept working right now - if (mark.getMark2() != null){ - Race.Course.CompoundMark.Mark m2 = raceFactory.createRaceCourseCompoundMarkMark(); - m2.setName(mark.getMark1().getName()); - m2.setTargetLat(String.valueOf(mark.getMark1().getPosition().getLatitude())); - m2.setTargetLng(String.valueOf(mark.getMark1().getPosition().getLongitude())); - m2.setSourceID(String.valueOf(mark.getMark1().getSourceID())); - cm.getMark().add(m2); - } - course.getCompoundMark().add(cm); - } - race.setCourse(course); - - //Course Limit - Race.CourseLimit courseLimit = raceFactory.createRaceCourseLimit(); - for (int i = 0; i < reader.getBoundary().size(); i++){ - Race.CourseLimit.Limit limit = raceFactory.createRaceCourseLimitLimit(); - limit.setSeqID(String.valueOf(i+1)); - limit.setLat(String.valueOf(reader.getBoundary().get(i).getLatitude())); - limit.setLon(String.valueOf(reader.getBoundary().get(i).getLongitude())); - courseLimit.getLimit().add(limit); - } - race.setCourseLimit(courseLimit); - - return race; - } - - private String alterRaceToWind(String s, double degrees) throws XMLReaderException, InvalidRaceDataException, JAXBException { - RaceXMLReader reader = new RaceXMLReader(s, XMLFileType.ResourcePath); - - mock.xml.Race race = copyRace(reader); - - JAXBContext context = JAXBContext.newInstance(mock.xml.Race.class); - Marshaller jaxbMarshaller = context.createMarshaller(); - jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); - - StringWriter sw = new StringWriter(); - - jaxbMarshaller.marshal(race, sw); - return sw.toString(); - } - } diff --git a/racevisionGame/src/main/java/mock/xml/ObjectFactory.java b/racevisionGame/src/main/java/mock/xml/ObjectFactory.java deleted file mode 100644 index 46d95ee5..00000000 --- a/racevisionGame/src/main/java/mock/xml/ObjectFactory.java +++ /dev/null @@ -1,127 +0,0 @@ -// -// 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.08.03 at 02:28:57 AM NZST -// - - -package mock.xml; - -import javax.xml.bind.annotation.XmlRegistry; - - -/** - * This object contains factory methods for each - * Java content interface and Java element interface - * generated in the race 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: race - * - */ - public ObjectFactory() { - } - - /** - * Create an instance of {@link Race } - * - */ - public Race createRace() { - return new Race(); - } - - /** - * Create an instance of {@link Race.CourseLimit } - * - */ - public Race.CourseLimit createRaceCourseLimit() { - return new Race.CourseLimit(); - } - - /** - * Create an instance of {@link Race.Course } - * - */ - public Race.Course createRaceCourse() { - return new Race.Course(); - } - - /** - * Create an instance of {@link Race.Course.CompoundMark } - * - */ - public Race.Course.CompoundMark createRaceCourseCompoundMark() { - return new Race.Course.CompoundMark(); - } - - /** - * Create an instance of {@link Race.CompoundMarkSequence } - * - */ - public Race.CompoundMarkSequence createRaceCompoundMarkSequence() { - return new Race.CompoundMarkSequence(); - } - - /** - * Create an instance of {@link Race.Participants } - * - */ - public Race.Participants createRaceParticipants() { - return new Race.Participants(); - } - - /** - * Create an instance of {@link Race.RaceStartTime } - * - */ - public Race.RaceStartTime createRaceRaceStartTime() { - return new Race.RaceStartTime(); - } - - /** - * Create an instance of {@link Race.CourseLimit.Limit } - * - */ - public Race.CourseLimit.Limit createRaceCourseLimitLimit() { - return new Race.CourseLimit.Limit(); - } - - /** - * Create an instance of {@link Race.Course.CompoundMark.Mark } - * - */ - public Race.Course.CompoundMark.Mark createRaceCourseCompoundMarkMark() { - return new Race.Course.CompoundMark.Mark(); - } - - /** - * Create an instance of {@link Race.CompoundMarkSequence.Corner } - * - */ - public Race.CompoundMarkSequence.Corner createRaceCompoundMarkSequenceCorner() { - return new Race.CompoundMarkSequence.Corner(); - } - - /** - * Create an instance of {@link Race.Participants.Yacht } - * - */ - public Race.Participants.Yacht createRaceParticipantsYacht() { - return new Race.Participants.Yacht(); - } - -} diff --git a/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java b/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java new file mode 100644 index 00000000..271b427a --- /dev/null +++ b/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java @@ -0,0 +1,142 @@ +package mock.xml; + +import shared.dataInput.RaceXMLReader; +import shared.enums.XMLFileType; +import shared.exceptions.InvalidRaceDataException; +import shared.exceptions.XMLReaderException; +import shared.model.CompoundMark; +import shared.model.Corner; +import shared.model.GPSCoordinate; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Marshaller; +import java.io.StringWriter; + +/** + * Created by Gondr on 3/08/2017. + */ +public class RaceXMLCreator { + + public static Race copyRace(RaceXMLReader reader) throws InvalidRaceDataException, XMLReaderException { + RaceFactory raceFactory = new RaceFactory(); + Race race = raceFactory.createRace(); + race.setRaceID(String.valueOf(reader.getRaceId())); + race.setRaceType(String.valueOf(reader.getRaceType())); + race.setCreationTimeDate("CREATION_TIME");//this needs to be changed later + + //Race Start Time + Race.RaceStartTime raceStartTime = raceFactory.createRaceRaceStartTime(); + raceStartTime.setPostpone("false"); + raceStartTime.setTime("START_TIME");//this needs to be changed later + race.setRaceStartTime(raceStartTime); + + //Participants + Race.Participants participants = raceFactory.createRaceParticipants(); + for (int i :reader.getParticipants()) { + Race.Participants.Yacht yacht = raceFactory.createRaceParticipantsYacht(); + yacht.setSourceID(String.valueOf(i)); + participants.getYacht().add(yacht); //java schema does not clone the array so this is "safe". + } + race.setParticipants(participants); + + //compound marks sequence + Race.CompoundMarkSequence cms = raceFactory.createRaceCompoundMarkSequence(); + for (Corner mark: reader.getCornersList()){ + Race.CompoundMarkSequence.Corner corner = raceFactory.createRaceCompoundMarkSequenceCorner(); + corner.setCompoundMarkID(String.valueOf(mark.getId())); + corner.setSeqID(String.valueOf(mark.getSeqID())); + cms.getCorner().add(corner); + } + race.setCompoundMarkSequence(cms); + + //Course + Race.Course course = raceFactory.createRaceCourse(); + for (CompoundMark mark: reader.getCompoundMarks()){ + Race.Course.CompoundMark cm = raceFactory.createRaceCourseCompoundMark(); + cm.setName(mark.getName()); + cm.setCompoundMarkID(String.valueOf(mark.getId())); + if (mark.getMark1() != null){ + Race.Course.CompoundMark.Mark m1 = raceFactory.createRaceCourseCompoundMarkMark(); + m1.setName(mark.getMark1().getName()); + m1.setTargetLat(String.valueOf(mark.getMark1().getPosition().getLatitude())); + m1.setTargetLng(String.valueOf(mark.getMark1().getPosition().getLongitude())); + m1.setSourceID(String.valueOf(mark.getMark1().getSourceID())); + cm.getMark().add(m1); + } + //make this not copy paste later but just need the concept working right now + if (mark.getMark2() != null){ + Race.Course.CompoundMark.Mark m2 = raceFactory.createRaceCourseCompoundMarkMark(); + m2.setName(mark.getMark1().getName()); + m2.setTargetLat(String.valueOf(mark.getMark1().getPosition().getLatitude())); + m2.setTargetLng(String.valueOf(mark.getMark1().getPosition().getLongitude())); + m2.setSourceID(String.valueOf(mark.getMark1().getSourceID())); + cm.getMark().add(m2); + } + course.getCompoundMark().add(cm); + } + race.setCourse(course); + + //Course Limit + Race.CourseLimit courseLimit = raceFactory.createRaceCourseLimit(); + for (int i = 0; i < reader.getBoundary().size(); i++){ + Race.CourseLimit.Limit limit = raceFactory.createRaceCourseLimitLimit(); + limit.setSeqID(String.valueOf(i+1)); + limit.setLat(String.valueOf(reader.getBoundary().get(i).getLatitude())); + limit.setLon(String.valueOf(reader.getBoundary().get(i).getLongitude())); + courseLimit.getLimit().add(limit); + } + race.setCourseLimit(courseLimit); + + return race; + } + + public static String alterRaceToWind(String s, double degrees) throws XMLReaderException, InvalidRaceDataException, JAXBException { + RaceXMLReader reader = new RaceXMLReader(s, XMLFileType.ResourcePath); + + Race race = copyRace(reader); + + GPSCoordinate center = getCenter(race); + for(Race.CourseLimit.Limit limit: race.getCourseLimit().getLimit()){ + GPSCoordinate rotatedLim = rotate(center, limitToGPSCoordinate(limit), degrees); + limit.setLat(String.valueOf(rotatedLim.getLatitude())); + limit.setLon(String.valueOf(rotatedLim.getLongitude())); + } + + JAXBContext context = JAXBContext.newInstance(Race.class); + Marshaller jaxbMarshaller = context.createMarshaller(); + jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); + + StringWriter sw = new StringWriter(); + + jaxbMarshaller.marshal(race, sw); + return sw.toString(); + } + + public static GPSCoordinate limitToGPSCoordinate(Race.CourseLimit.Limit limit){ + return new GPSCoordinate(Double.parseDouble(limit.getLat()), Double.parseDouble(limit.getLon())); + } + + public static GPSCoordinate rotate(GPSCoordinate pivot, GPSCoordinate point, double degrees){ + double radDeg = Math.toRadians(degrees); + double deltaLat = (point.getLatitude() - pivot.getLatitude()); + double deltaLon = (point.getLongitude() - pivot.getLongitude()); + //map to (0,1) vector and use vector maths to rotate. + double resLat = deltaLat * Math.cos(radDeg) - deltaLon * Math.sin(radDeg) + pivot.getLatitude(); + double resLon = deltaLat * Math.sin(radDeg) + deltaLon * Math.cos(radDeg) + pivot.getLongitude(); + return new GPSCoordinate(resLat, resLon); + } + + public static GPSCoordinate getCenter(Race race){ + double avgLat = 0; + double avgLng = 0; + for (Race.CourseLimit.Limit limit: race.getCourseLimit().getLimit()){ + avgLat += Double.parseDouble(limit.getLat()); + avgLng += Double.parseDouble(limit.getLon()); + } + avgLat = avgLat/race.getCourseLimit().getLimit().size(); + avgLng = avgLng/race.getCourseLimit().getLimit().size(); + return new GPSCoordinate(avgLat, avgLng); + } + +} From 2ce1c0786ee3d3c2b86394c84e5f11ef2f99a628 Mon Sep 17 00:00:00 2001 From: Fan-Wu Yang Date: Mon, 7 Aug 2017 02:01:41 +1200 Subject: [PATCH 03/28] The course points can now be rotated, - Created markToGPSCoordinate Class - Added Rotation to marks #story[1092] --- .../main/java/mock/xml/RaceXMLCreator.java | 44 ++++++++++++------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java b/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java index 271b427a..55f1b25c 100644 --- a/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java +++ b/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java @@ -7,6 +7,7 @@ import shared.exceptions.XMLReaderException; import shared.model.CompoundMark; import shared.model.Corner; import shared.model.GPSCoordinate; +import shared.model.Mark; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; @@ -56,21 +57,9 @@ public class RaceXMLCreator { Race.Course.CompoundMark cm = raceFactory.createRaceCourseCompoundMark(); cm.setName(mark.getName()); cm.setCompoundMarkID(String.valueOf(mark.getId())); - if (mark.getMark1() != null){ - Race.Course.CompoundMark.Mark m1 = raceFactory.createRaceCourseCompoundMarkMark(); - m1.setName(mark.getMark1().getName()); - m1.setTargetLat(String.valueOf(mark.getMark1().getPosition().getLatitude())); - m1.setTargetLng(String.valueOf(mark.getMark1().getPosition().getLongitude())); - m1.setSourceID(String.valueOf(mark.getMark1().getSourceID())); - cm.getMark().add(m1); - } - //make this not copy paste later but just need the concept working right now - if (mark.getMark2() != null){ - Race.Course.CompoundMark.Mark m2 = raceFactory.createRaceCourseCompoundMarkMark(); - m2.setName(mark.getMark1().getName()); - m2.setTargetLat(String.valueOf(mark.getMark1().getPosition().getLatitude())); - m2.setTargetLng(String.valueOf(mark.getMark1().getPosition().getLongitude())); - m2.setSourceID(String.valueOf(mark.getMark1().getSourceID())); + cm.getMark().add(setMarkFromMark(raceFactory, mark.getMark1())); + Race.Course.CompoundMark.Mark m2 = setMarkFromMark(raceFactory, mark.getMark2()); + if (m2 != null) { cm.getMark().add(m2); } course.getCompoundMark().add(cm); @@ -91,6 +80,18 @@ public class RaceXMLCreator { return race; } + public static Race.Course.CompoundMark.Mark setMarkFromMark(RaceFactory raceFactory, Mark mark){ + if (mark != null) { + Race.Course.CompoundMark.Mark m = raceFactory.createRaceCourseCompoundMarkMark(); + m.setName(mark.getName()); + m.setTargetLat(String.valueOf(mark.getPosition().getLatitude())); + m.setTargetLng(String.valueOf(mark.getPosition().getLongitude())); + m.setSourceID(String.valueOf(mark.getSourceID())); + return m; + } + return null; + } + public static String alterRaceToWind(String s, double degrees) throws XMLReaderException, InvalidRaceDataException, JAXBException { RaceXMLReader reader = new RaceXMLReader(s, XMLFileType.ResourcePath); @@ -103,6 +104,15 @@ public class RaceXMLCreator { limit.setLon(String.valueOf(rotatedLim.getLongitude())); } + for(Race.Course.CompoundMark compoundMark: race.getCourse().getCompoundMark()){ + for (Race.Course.CompoundMark.Mark mark: compoundMark.getMark()){ + System.out.println(mark); + GPSCoordinate rotatedMark = rotate(center, markToGPSCoordinate(mark), degrees); + mark.setTargetLat(String.valueOf(rotatedMark.getLatitude())); + mark.setTargetLng(String.valueOf(rotatedMark.getLongitude())); + } + } + JAXBContext context = JAXBContext.newInstance(Race.class); Marshaller jaxbMarshaller = context.createMarshaller(); jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); @@ -127,6 +137,10 @@ public class RaceXMLCreator { return new GPSCoordinate(resLat, resLon); } + public static GPSCoordinate markToGPSCoordinate(Race.Course.CompoundMark.Mark mark){ + return new GPSCoordinate(Double.parseDouble(mark.getTargetLat()), Double.parseDouble(mark.getTargetLng())); + } + public static GPSCoordinate getCenter(Race race){ double avgLat = 0; double avgLng = 0; From fef35d0b00f074311b20fa1bc1f9430a970cce63 Mon Sep 17 00:00:00 2001 From: Fan-Wu Yang Date: Mon, 7 Aug 2017 02:37:05 +1200 Subject: [PATCH 04/28] The race is rotated with it's initial rotation in mind - RaceXMLCreator now checks the bearing of the race with getLineAngle() - Split some methods into functions so that it is more readable #story[1096] --- .../main/java/mock/xml/RaceXMLCreator.java | 45 +++++++++++++++---- 1 file changed, 36 insertions(+), 9 deletions(-) diff --git a/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java b/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java index 55f1b25c..8e13b842 100644 --- a/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java +++ b/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java @@ -92,11 +92,42 @@ public class RaceXMLCreator { return null; } + public static CompoundMark getWindwardGate(RaceXMLReader reader){ + for (CompoundMark mark: reader.getCompoundMarks()){ + if (mark.getName().equals("Windward Gate")) return mark; + } + return null; + } + + public static CompoundMark getLeewardGate(RaceXMLReader reader){ + for (CompoundMark mark: reader.getCompoundMarks()){ + if (mark.getName().equals("Leeward Gate")) return mark; + } + return null; + } + public static String alterRaceToWind(String s, double degrees) throws XMLReaderException, InvalidRaceDataException, JAXBException { RaceXMLReader reader = new RaceXMLReader(s, XMLFileType.ResourcePath); Race race = copyRace(reader); + double raceOriginalBearing = getLineAngle(getLeewardGate(reader).getMark1Position(), getWindwardGate(reader).getMark1Position()); + + double degreesToRotate = degrees - raceOriginalBearing; + + alterRaceRotation(race, degreesToRotate); + + JAXBContext context = JAXBContext.newInstance(Race.class); + Marshaller jaxbMarshaller = context.createMarshaller(); + jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); + + StringWriter sw = new StringWriter(); + + jaxbMarshaller.marshal(race, sw); + return sw.toString(); + } + + public static void alterRaceRotation(Race race, double degrees){ GPSCoordinate center = getCenter(race); for(Race.CourseLimit.Limit limit: race.getCourseLimit().getLimit()){ GPSCoordinate rotatedLim = rotate(center, limitToGPSCoordinate(limit), degrees); @@ -112,15 +143,6 @@ public class RaceXMLCreator { mark.setTargetLng(String.valueOf(rotatedMark.getLongitude())); } } - - JAXBContext context = JAXBContext.newInstance(Race.class); - Marshaller jaxbMarshaller = context.createMarshaller(); - jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); - - StringWriter sw = new StringWriter(); - - jaxbMarshaller.marshal(race, sw); - return sw.toString(); } public static GPSCoordinate limitToGPSCoordinate(Race.CourseLimit.Limit limit){ @@ -152,5 +174,10 @@ public class RaceXMLCreator { avgLng = avgLng/race.getCourseLimit().getLimit().size(); return new GPSCoordinate(avgLat, avgLng); } + public static double getLineAngle(GPSCoordinate coord1, GPSCoordinate coord2){ + double dx = coord1.getLongitude() - coord2.getLongitude(); + double dy = coord1.getLatitude() - coord2.getLatitude(); + return Math.atan2(dy, dx)/Math.PI * 180; + } } From 0f9b191ccbd67cb5567cbb370e5b68d872b96120 Mon Sep 17 00:00:00 2001 From: Fan-Wu Yang Date: Mon, 7 Aug 2017 16:13:15 +1200 Subject: [PATCH 05/28] Added doc strings to RaceXML Creator #story[1096] --- .../main/java/mock/xml/RaceXMLCreator.java | 68 ++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) diff --git a/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java b/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java index 8e13b842..e876ffb9 100644 --- a/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java +++ b/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java @@ -15,10 +15,17 @@ import javax.xml.bind.Marshaller; import java.io.StringWriter; /** - * Created by Gondr on 3/08/2017. + * Helper Class for creating a Race XML */ public class RaceXMLCreator { + /** + * Copy the race to a mock.xml.Race class from a RaceXMlReader + * @param reader RaceXMlReader + * @return string of the new mock.xml.Race + * @throws InvalidRaceDataException If the reader is unable to be read + * @throws XMLReaderException If the reader is unable to be read + */ public static Race copyRace(RaceXMLReader reader) throws InvalidRaceDataException, XMLReaderException { RaceFactory raceFactory = new RaceFactory(); Race race = raceFactory.createRace(); @@ -80,6 +87,12 @@ public class RaceXMLCreator { return race; } + /** + * Sets a mock.xml.Mark from a shared.model.Mark + * @param raceFactory race Factory for creating mock.xml.Race classes and subclasses + * @param mark Mark to be converted. + * @return converted mock.xml.Mark. + */ public static Race.Course.CompoundMark.Mark setMarkFromMark(RaceFactory raceFactory, Mark mark){ if (mark != null) { Race.Course.CompoundMark.Mark m = raceFactory.createRaceCourseCompoundMarkMark(); @@ -92,6 +105,11 @@ public class RaceXMLCreator { return null; } + /** + * get the windward gate in a race + * @param reader reads in the mark + * @return the windward gate. + */ public static CompoundMark getWindwardGate(RaceXMLReader reader){ for (CompoundMark mark: reader.getCompoundMarks()){ if (mark.getName().equals("Windward Gate")) return mark; @@ -99,6 +117,11 @@ public class RaceXMLCreator { return null; } + /** + * get the leeward gate in a race + * @param reader reads in the mark + * @return the leeward gate. + */ public static CompoundMark getLeewardGate(RaceXMLReader reader){ for (CompoundMark mark: reader.getCompoundMarks()){ if (mark.getName().equals("Leeward Gate")) return mark; @@ -106,6 +129,15 @@ public class RaceXMLCreator { return null; } + /** + * Rotates the race in a specified direction. + * @param s xml file name + * @param degrees degrees to rotate + * @return the new xml file as a string + * @throws XMLReaderException if the xml is not readable + * @throws InvalidRaceDataException if the race is invalid + * @throws JAXBException if the Race class cannot be parsed into a xml. + */ public static String alterRaceToWind(String s, double degrees) throws XMLReaderException, InvalidRaceDataException, JAXBException { RaceXMLReader reader = new RaceXMLReader(s, XMLFileType.ResourcePath); @@ -127,6 +159,11 @@ public class RaceXMLCreator { return sw.toString(); } + /** + * Rotate the features in a race such as the boundary, and the marks. + * @param race the race to alter + * @param degrees the degrees to rotate by. + */ public static void alterRaceRotation(Race race, double degrees){ GPSCoordinate center = getCenter(race); for(Race.CourseLimit.Limit limit: race.getCourseLimit().getLimit()){ @@ -145,10 +182,22 @@ public class RaceXMLCreator { } } + /** + * Converts a Race.CourseLimit.Limit to a GPS coordinate + * @param limit limit to convert + * @return gps coordinate corresponding to the limit + */ public static GPSCoordinate limitToGPSCoordinate(Race.CourseLimit.Limit limit){ return new GPSCoordinate(Double.parseDouble(limit.getLat()), Double.parseDouble(limit.getLon())); } + /** + * get new gps coordinate after rotating + * @param pivot center point to rotating from. + * @param point point to rotate + * @param degrees number of degress to rotate by + * @return the new GPSCoordinate of the transformed point. + */ public static GPSCoordinate rotate(GPSCoordinate pivot, GPSCoordinate point, double degrees){ double radDeg = Math.toRadians(degrees); double deltaLat = (point.getLatitude() - pivot.getLatitude()); @@ -159,10 +208,20 @@ public class RaceXMLCreator { return new GPSCoordinate(resLat, resLon); } + /** + * obtains the GPSCoordinates of a mark + * @param mark mark to obtain the GPSCoordinates of + * @return the GPSCOordinatess of a mark + */ public static GPSCoordinate markToGPSCoordinate(Race.Course.CompoundMark.Mark mark){ return new GPSCoordinate(Double.parseDouble(mark.getTargetLat()), Double.parseDouble(mark.getTargetLng())); } + /** + * get the center of a race + * @param race race to get the center of + * @return GPSCoordinates of the center + */ public static GPSCoordinate getCenter(Race race){ double avgLat = 0; double avgLng = 0; @@ -174,6 +233,13 @@ public class RaceXMLCreator { avgLng = avgLng/race.getCourseLimit().getLimit().size(); return new GPSCoordinate(avgLat, avgLng); } + + /** + * gets the angle of a line + * @param coord1 point a of the line + * @param coord2 point b of the line + * @return the angle in degrees that the bearing of the line is [-180, 180] + */ public static double getLineAngle(GPSCoordinate coord1, GPSCoordinate coord2){ double dx = coord1.getLongitude() - coord2.getLongitude(); double dy = coord1.getLatitude() - coord2.getLatitude(); From a460df3e4d567d956bca71ada1e35df845f7a662 Mon Sep 17 00:00:00 2001 From: Fan-Wu Yang Date: Mon, 7 Aug 2017 16:30:06 +1200 Subject: [PATCH 06/28] Fixed Javadocs that were causing the build to fail. #story[1096] --- .../src/main/java/mock/xml/Race.java | 548 +++++++++--------- .../src/main/java/mock/xml/RaceFactory.java | 22 +- 2 files changed, 285 insertions(+), 285 deletions(-) diff --git a/racevisionGame/src/main/java/mock/xml/Race.java b/racevisionGame/src/main/java/mock/xml/Race.java index e2f1837d..a8c7696a 100644 --- a/racevisionGame/src/main/java/mock/xml/Race.java +++ b/racevisionGame/src/main/java/mock/xml/Race.java @@ -24,122 +24,122 @@ import javax.xml.bind.annotation.XmlType; *

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="RaceID" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="RaceType" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="CreationTimeDate" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="RaceStartTime">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <attribute name="Postpone" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                 <attribute name="Time" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="Participants">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="Yacht" maxOccurs="unbounded">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                         </restriction>
- *                       </complexContent>
- *                     </complexType>
- *                   </element>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="CompoundMarkSequence">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="Corner" maxOccurs="unbounded">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                           <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                         </restriction>
- *                       </complexContent>
- *                     </complexType>
- *                   </element>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="Course">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="CompoundMark" maxOccurs="unbounded">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <sequence>
- *                             <element name="Mark" maxOccurs="unbounded">
- *                               <complexType>
- *                                 <complexContent>
- *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                                     <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                                     <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                                     <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                                     <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                                     <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                                   </restriction>
- *                                 </complexContent>
- *                               </complexType>
- *                             </element>
- *                           </sequence>
- *                           <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                           <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                         </restriction>
- *                       </complexContent>
- *                     </complexType>
- *                   </element>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="CourseLimit">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="Limit" maxOccurs="unbounded">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                           <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                           <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                         </restriction>
- *                       </complexContent>
- *                     </complexType>
- *                   </element>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="RaceID" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="RaceType" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="CreationTimeDate" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="RaceStartTime">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <attribute name="Postpone" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 <attribute name="Time" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="Participants">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="Yacht" maxOccurs="unbounded">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="CompoundMarkSequence">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="Corner" maxOccurs="unbounded">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="Course">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="CompoundMark" maxOccurs="unbounded">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <sequence>
+ *                             <element name="Mark" maxOccurs="unbounded">
+ *                               <complexType>
+ *                                 <complexContent>
+ *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                     <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                     <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                     <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                     <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                     <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                   </restriction>
+ *                                 </complexContent>
+ *                               </complexType>
+ *                             </element>
+ *                           </sequence>
+ *                           <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="CourseLimit">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="Limit" maxOccurs="unbounded">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
* * @@ -374,24 +374,24 @@ public class Race { *

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="Corner" maxOccurs="unbounded">
-     *           <complexType>
-     *             <complexContent>
-     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *                 <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                 <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *               </restriction>
-     *             </complexContent>
-     *           </complexType>
-     *         </element>
-     *       </sequence>
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="Corner" maxOccurs="unbounded">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
      * 
* * @@ -424,7 +424,7 @@ public class Race { *

* Objects of the following type(s) are allowed in the list * {@link Race.CompoundMarkSequence.Corner } - * + * @return corners in the CompoundMarkSequence. * */ public List getCorner() { @@ -441,14 +441,14 @@ public class Race { *

The following schema fragment specifies the expected content contained within this class. * *

-         * <complexType>
-         *   <complexContent>
-         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-         *       <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *       <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *     </restriction>
-         *   </complexContent>
-         * </complexType>
+         * <complexType>
+         *   <complexContent>
+         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
          * 
* * @@ -521,39 +521,39 @@ public class Race { *

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="CompoundMark" maxOccurs="unbounded">
-     *           <complexType>
-     *             <complexContent>
-     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *                 <sequence>
-     *                   <element name="Mark" maxOccurs="unbounded">
-     *                     <complexType>
-     *                       <complexContent>
-     *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *                           <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                           <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                           <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                           <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                           <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                         </restriction>
-     *                       </complexContent>
-     *                     </complexType>
-     *                   </element>
-     *                 </sequence>
-     *                 <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                 <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *               </restriction>
-     *             </complexContent>
-     *           </complexType>
-     *         </element>
-     *       </sequence>
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="CompoundMark" maxOccurs="unbounded">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <sequence>
+     *                   <element name="Mark" maxOccurs="unbounded">
+     *                     <complexType>
+     *                       <complexContent>
+     *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                           <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                           <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                           <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                           <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                           <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                         </restriction>
+     *                       </complexContent>
+     *                     </complexType>
+     *                   </element>
+     *                 </sequence>
+     *                 <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
      * 
* * @@ -586,7 +586,7 @@ public class Race { *

* Objects of the following type(s) are allowed in the list * {@link Race.Course.CompoundMark } - * + * @return CompoundMarks in a Course * */ public List getCompoundMark() { @@ -603,29 +603,29 @@ public class Race { *

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="Mark" maxOccurs="unbounded">
-         *           <complexType>
-         *             <complexContent>
-         *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-         *                 <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *                 <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *                 <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *                 <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *                 <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *               </restriction>
-         *             </complexContent>
-         *           </complexType>
-         *         </element>
-         *       </sequence>
-         *       <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *       <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *     </restriction>
-         *   </complexContent>
-         * </complexType>
+         * <complexType>
+         *   <complexContent>
+         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       <sequence>
+         *         <element name="Mark" maxOccurs="unbounded">
+         *           <complexType>
+         *             <complexContent>
+         *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                 <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *                 <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *                 <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *                 <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *                 <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *               </restriction>
+         *             </complexContent>
+         *           </complexType>
+         *         </element>
+         *       </sequence>
+         *       <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
          * 
* * @@ -662,7 +662,7 @@ public class Race { *

* Objects of the following type(s) are allowed in the list * {@link Race.Course.CompoundMark.Mark } - * + * @return Marks in a CompoundMark * */ public List getMark() { @@ -727,17 +727,17 @@ public class Race { *

The following schema fragment specifies the expected content contained within this class. * *

-             * <complexType>
-             *   <complexContent>
-             *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-             *       <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
-             *       <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-             *       <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-             *       <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-             *       <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-             *     </restriction>
-             *   </complexContent>
-             * </complexType>
+             * <complexType>
+             *   <complexContent>
+             *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+             *       <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
+             *       <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+             *       <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+             *       <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+             *       <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+             *     </restriction>
+             *   </complexContent>
+             * </complexType>
              * 
* * @@ -890,25 +890,25 @@ public class Race { *

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="Limit" maxOccurs="unbounded">
-     *           <complexType>
-     *             <complexContent>
-     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *                 <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                 <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                 <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *               </restriction>
-     *             </complexContent>
-     *           </complexType>
-     *         </element>
-     *       </sequence>
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="Limit" maxOccurs="unbounded">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
      * 
* * @@ -941,7 +941,7 @@ public class Race { *

* Objects of the following type(s) are allowed in the list * {@link Race.CourseLimit.Limit } - * + * @return Limits in CourseLimits * */ public List getLimit() { @@ -958,15 +958,15 @@ public class Race { *

The following schema fragment specifies the expected content contained within this class. * *

-         * <complexType>
-         *   <complexContent>
-         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-         *       <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *       <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *       <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *     </restriction>
-         *   </complexContent>
-         * </complexType>
+         * <complexType>
+         *   <complexContent>
+         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
          * 
* * @@ -1065,23 +1065,23 @@ public class Race { *

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="Yacht" maxOccurs="unbounded">
-     *           <complexType>
-     *             <complexContent>
-     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *                 <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *               </restriction>
-     *             </complexContent>
-     *           </complexType>
-     *         </element>
-     *       </sequence>
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="Yacht" maxOccurs="unbounded">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
      * 
* * @@ -1114,7 +1114,7 @@ public class Race { *

* Objects of the following type(s) are allowed in the list * {@link Race.Participants.Yacht } - * + * @return yachts in a race. * */ public List getYacht() { @@ -1131,13 +1131,13 @@ public class Race { *

The following schema fragment specifies the expected content contained within this class. * *

-         * <complexType>
-         *   <complexContent>
-         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-         *       <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *     </restriction>
-         *   </complexContent>
-         * </complexType>
+         * <complexType>
+         *   <complexContent>
+         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
          * 
* * @@ -1184,14 +1184,14 @@ public class Race { *

The following schema fragment specifies the expected content contained within this class. * *

-     * <complexType>
-     *   <complexContent>
-     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *       <attribute name="Postpone" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *       <attribute name="Time" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <attribute name="Postpone" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       <attribute name="Time" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
      * 
* * diff --git a/racevisionGame/src/main/java/mock/xml/RaceFactory.java b/racevisionGame/src/main/java/mock/xml/RaceFactory.java index 674fa849..cdebfcc7 100644 --- a/racevisionGame/src/main/java/mock/xml/RaceFactory.java +++ b/racevisionGame/src/main/java/mock/xml/RaceFactory.java @@ -38,7 +38,7 @@ public class RaceFactory { /** * Create an instance of {@link Race } - * + * @return new Race instance */ public Race createRace() { return new Race(); @@ -46,7 +46,7 @@ public class RaceFactory { /** * Create an instance of {@link Race.CourseLimit } - * + * @return new RaceCourseLimit Instance */ public Race.CourseLimit createRaceCourseLimit() { return new Race.CourseLimit(); @@ -54,7 +54,7 @@ public class RaceFactory { /** * Create an instance of {@link Race.Course } - * + * @return new Course Instance */ public Race.Course createRaceCourse() { return new Race.Course(); @@ -62,7 +62,7 @@ public class RaceFactory { /** * Create an instance of {@link Race.Course.CompoundMark } - * + * @return new CompoundMark Instance */ public Race.Course.CompoundMark createRaceCourseCompoundMark() { return new Race.Course.CompoundMark(); @@ -70,7 +70,7 @@ public class RaceFactory { /** * Create an instance of {@link Race.CompoundMarkSequence } - * + * @return new CompoundMarkSequence Instance */ public Race.CompoundMarkSequence createRaceCompoundMarkSequence() { return new Race.CompoundMarkSequence(); @@ -78,7 +78,7 @@ public class RaceFactory { /** * Create an instance of {@link Race.Participants } - * + * @return new Race.Participants Instance */ public Race.Participants createRaceParticipants() { return new Race.Participants(); @@ -86,7 +86,7 @@ public class RaceFactory { /** * Create an instance of {@link Race.RaceStartTime } - * + * @return new RaceStartTime instance */ public Race.RaceStartTime createRaceRaceStartTime() { return new Race.RaceStartTime(); @@ -94,7 +94,7 @@ public class RaceFactory { /** * Create an instance of {@link Race.CourseLimit.Limit } - * + * @return new Limit instance */ public Race.CourseLimit.Limit createRaceCourseLimitLimit() { return new Race.CourseLimit.Limit(); @@ -102,7 +102,7 @@ public class RaceFactory { /** * Create an instance of {@link Race.Course.CompoundMark.Mark } - * + * @return new CompoundMark.Mark instance */ public Race.Course.CompoundMark.Mark createRaceCourseCompoundMarkMark() { return new Race.Course.CompoundMark.Mark(); @@ -110,7 +110,7 @@ public class RaceFactory { /** * Create an instance of {@link Race.CompoundMarkSequence.Corner } - * + * @return new Race.CompoundMarkSequence.Corner instance */ public Race.CompoundMarkSequence.Corner createRaceCompoundMarkSequenceCorner() { return new Race.CompoundMarkSequence.Corner(); @@ -118,7 +118,7 @@ public class RaceFactory { /** * Create an instance of {@link Race.Participants.Yacht } - * + * @return new Race.Participants.Yacht Instance. */ public Race.Participants.Yacht createRaceParticipantsYacht() { return new Race.Participants.Yacht(); From 7c6f0931ba92a810082c231852911a815b74d6bf Mon Sep 17 00:00:00 2001 From: Fan-Wu Yang Date: Sat, 12 Aug 2017 23:18:54 +1200 Subject: [PATCH 07/28] Transferring files from my laptop to desktop to work on, may be broken. --- .idea/copyright/profiles_settings.xml | 3 -- .../src/main/java/mock/app/Event.java | 10 +++- .../main/java/mock/xml/RaceXMLCreator.java | 49 ++++++++++++++++++- .../java/mock/xml/RaceXMLCreatorTest.java | 31 ++++++++++++ 4 files changed, 87 insertions(+), 6 deletions(-) delete mode 100644 .idea/copyright/profiles_settings.xml create mode 100644 racevisionGame/src/test/java/mock/xml/RaceXMLCreatorTest.java diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml deleted file mode 100644 index e7bedf33..00000000 --- a/.idea/copyright/profiles_settings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/racevisionGame/src/main/java/mock/app/Event.java b/racevisionGame/src/main/java/mock/app/Event.java index de210567..4d58cc9e 100644 --- a/racevisionGame/src/main/java/mock/app/Event.java +++ b/racevisionGame/src/main/java/mock/app/Event.java @@ -5,6 +5,7 @@ import mock.model.MockRace; import mock.model.Polars; import mock.xml.RaceXMLCreator; import network.Messages.LatestMessages; +import org.xml.sax.SAXException; import shared.dataInput.*; import shared.enums.XMLFileType; import shared.exceptions.InvalidBoatDataException; @@ -14,6 +15,7 @@ import shared.exceptions.XMLReaderException; import shared.model.Constants; import javax.xml.bind.JAXBException; +import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.TransformerException; import java.io.*; import java.net.UnknownHostException; @@ -44,7 +46,13 @@ public class Event { */ private Event() { try { - this.raceXML = getRaceXMLAtCurrentTime(RaceXMLCreator.alterRaceToWind("mock/mockXML/raceSchemaTest.xml", 90)); + try { + this.raceXML = getRaceXMLAtCurrentTime(RaceXMLCreator.alterRaceToWind("mock/mockXML/raceSchemaTest.xml", 90)); + } catch (SAXException e) { + e.printStackTrace(); + } catch (ParserConfigurationException e) { + e.printStackTrace(); + } System.out.println(this.raceXML); this.boatXML = XMLReader.readXMLFileToString("mock/mockXML/boatsSinglePlayer.xml", StandardCharsets.UTF_8); this.regattaXML = XMLReader.readXMLFileToString("mock/mockXML/regattaTest.xml", StandardCharsets.UTF_8); diff --git a/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java b/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java index e876ffb9..498bd0bd 100644 --- a/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java +++ b/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java @@ -1,5 +1,7 @@ package mock.xml; +import org.w3c.dom.Document; +import org.xml.sax.SAXException; import shared.dataInput.RaceXMLReader; import shared.enums.XMLFileType; import shared.exceptions.InvalidRaceDataException; @@ -9,10 +11,24 @@ import shared.model.Corner; import shared.model.GPSCoordinate; import shared.model.Mark; +import javax.xml.XMLConstants; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Marshaller; +import javax.xml.bind.Unmarshaller; +import javax.xml.bind.util.JAXBSource; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.Source; +import javax.xml.transform.dom.DOMSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; +import javax.xml.validation.Validator; +import java.io.File; +import java.io.IOException; import java.io.StringWriter; +import java.net.URL; /** * Helper Class for creating a Race XML @@ -138,10 +154,10 @@ public class RaceXMLCreator { * @throws InvalidRaceDataException if the race is invalid * @throws JAXBException if the Race class cannot be parsed into a xml. */ - public static String alterRaceToWind(String s, double degrees) throws XMLReaderException, InvalidRaceDataException, JAXBException { + public static String alterRaceToWind(String s, double degrees) throws XMLReaderException, InvalidRaceDataException, JAXBException, IOException, SAXException, ParserConfigurationException { RaceXMLReader reader = new RaceXMLReader(s, XMLFileType.ResourcePath); - Race race = copyRace(reader); + Race race = readRace(RaceXMLCreator.class.getClassLoader().getResource(s).getFile()); double raceOriginalBearing = getLineAngle(getLeewardGate(reader).getMark1Position(), getWindwardGate(reader).getMark1Position()); @@ -246,4 +262,33 @@ public class RaceXMLCreator { return Math.atan2(dy, dx)/Math.PI * 180; } + public static Race readRace(String file) throws IOException, SAXException, JAXBException, ParserConfigurationException { + //validateRace(file); + + DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + Document document = parser.parse(new File(file)); + + JAXBContext jc = JAXBContext.newInstance(Race.class); + Unmarshaller unmarshaller = jc.createUnmarshaller(); + + SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + URL schemaURL = RaceXMLCreator.class.getClassLoader().getResource("mock/mockXML/schema/raceSchema.xsd");// The URL to your XML Schema; + Schema schema = sf.newSchema(schemaURL); + unmarshaller.setSchema(schema); + + return (Race) unmarshaller.unmarshal(new DOMSource(document)); + } + + public static boolean validateRace(String file) throws SAXException, IOException, ParserConfigurationException { + DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + Document document = parser.parse(new File(file)); + + SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + URL schemaURL = RaceXMLCreator.class.getClassLoader().getResource("mock/mockXML/schema/raceSchema.xsd");// The URL to your XML Schema; + Schema schema = sf.newSchema(schemaURL); + Validator validator = schema.newValidator(); + validator.validate(new DOMSource(document)); + return true; + } + } diff --git a/racevisionGame/src/test/java/mock/xml/RaceXMLCreatorTest.java b/racevisionGame/src/test/java/mock/xml/RaceXMLCreatorTest.java new file mode 100644 index 00000000..1cda9efd --- /dev/null +++ b/racevisionGame/src/test/java/mock/xml/RaceXMLCreatorTest.java @@ -0,0 +1,31 @@ +package mock.xml; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mock; +import shared.dataInput.RaceXMLReader; +import shared.exceptions.InvalidRaceDataException; +import shared.exceptions.XMLReaderException; + +import javax.xml.bind.JAXBException; + +import static org.mockito.Mockito.mock; + +public class RaceXMLCreatorTest { + + String fileToTest = "mock/mockXML/raceSchemaTest.xml"; + @Mock + RaceXMLReader reader; + + + @Before + public void setup() throws XMLReaderException, JAXBException, InvalidRaceDataException { + + } + + @Test + public void getLineAngleTest(){ + + } + +} From 820898d92c59943b15fb432b7622135d0e18bbb9 Mon Sep 17 00:00:00 2001 From: Fan-Wu Yang Date: Sun, 13 Aug 2017 16:02:33 +1200 Subject: [PATCH 08/28] pushed work from school computer to do at home --- .idea/codeStyleSettings.xml | 6 ++++++ .../java/visualiser/model/VisualiserRace.java | 19 ++++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) create mode 100644 .idea/codeStyleSettings.xml diff --git a/.idea/codeStyleSettings.xml b/.idea/codeStyleSettings.xml new file mode 100644 index 00000000..5352bdf8 --- /dev/null +++ b/.idea/codeStyleSettings.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/racevisionGame/src/main/java/visualiser/model/VisualiserRace.java b/racevisionGame/src/main/java/visualiser/model/VisualiserRace.java index 3a76631d..0cde70af 100644 --- a/racevisionGame/src/main/java/visualiser/model/VisualiserRace.java +++ b/racevisionGame/src/main/java/visualiser/model/VisualiserRace.java @@ -307,18 +307,19 @@ public class VisualiserRace extends Race { * @param raceStatus The RaceStatus message received. */ private void updateRaceStatus(RaceStatus raceStatus) { + if (raceStatus != null) { + //Race status enum. + this.raceStatusEnum = RaceStatusEnum.fromByte(raceStatus.getRaceStatus()); - //Race status enum. - this.raceStatusEnum = RaceStatusEnum.fromByte(raceStatus.getRaceStatus()); + //Wind bearing. + this.windDirection.setDegrees(raceStatus.getScaledWindDirection()); - //Wind bearing. - this.windDirection.setDegrees(raceStatus.getScaledWindDirection()); + //Wind speed. + this.windSpeed = raceStatus.getWindSpeedKnots(); - //Wind speed. - this.windSpeed = raceStatus.getWindSpeedKnots(); - - //Current race time. - this.raceClock.setUTCTime(raceStatus.getCurrentTime()); + //Current race time. + this.raceClock.setUTCTime(raceStatus.getCurrentTime()); + } } From 70d5447e886c49b3b54b4fb21f987a4e347c4b25 Mon Sep 17 00:00:00 2001 From: Fan-Wu Yang Date: Sun, 13 Aug 2017 23:03:16 +1200 Subject: [PATCH 09/28] Moving stuff from school pc to home --- .../src/main/java/mock/app/Event.java | 12 +- .../src/main/java/mock/model/MockRace.java | 4 +- .../src/main/java/mock/xml/Race.java | 499 +++--- .../src/main/java/mock/xml/RaceFactory.java | 52 +- .../main/java/mock/xml/RaceXMLCreator.java | 34 +- .../src/main/java/shared/model/Race.java | 4 +- .../main/java/shared/xml/XMLUtilities.java | 70 +- .../resources/mock/mockXML/raceSchemaTest.xml | 12 +- .../resources/mock/mockXML/schema/binding.xml | 6 + .../schema/generated/ObjectFactory.java | 127 ++ .../mock/mockXML/schema/generated/Race.java | 1351 +++++++++++++++++ .../mockXML/schema/scd/ObjectFactory.java | 127 ++ .../mock/mockXML/schema/scd/Race.java | 1351 +++++++++++++++++ .../mockXML/schema/schema/CompoundMark.java | 143 ++ .../schema/schema/CompoundMarkSequence.java | 87 ++ .../mock/mockXML/schema/schema/Corner.java | 151 ++ .../mock/mockXML/schema/schema/Course.java | 100 ++ .../mockXML/schema/schema/CourseLimit.java | 86 ++ .../mock/mockXML/schema/schema/Limit.java | 119 ++ .../mock/mockXML/schema/schema/Mark.java | 173 +++ .../mockXML/schema/schema/ObjectFactory.java | 127 ++ .../mockXML/schema/schema/Participants.java | 85 ++ .../mock/mockXML/schema/schema/Race.java | 373 +++++ .../mockXML/schema/schema/RaceStartTime.java | 92 ++ .../mock/mockXML/schema/schema/Yacht.java | 92 ++ 25 files changed, 4995 insertions(+), 282 deletions(-) create mode 100644 racevisionGame/src/main/resources/mock/mockXML/schema/binding.xml create mode 100644 racevisionGame/src/main/resources/mock/mockXML/schema/generated/ObjectFactory.java create mode 100644 racevisionGame/src/main/resources/mock/mockXML/schema/generated/Race.java create mode 100644 racevisionGame/src/main/resources/mock/mockXML/schema/scd/ObjectFactory.java create mode 100644 racevisionGame/src/main/resources/mock/mockXML/schema/scd/Race.java create mode 100644 racevisionGame/src/main/resources/mock/mockXML/schema/schema/CompoundMark.java create mode 100644 racevisionGame/src/main/resources/mock/mockXML/schema/schema/CompoundMarkSequence.java create mode 100644 racevisionGame/src/main/resources/mock/mockXML/schema/schema/Corner.java create mode 100644 racevisionGame/src/main/resources/mock/mockXML/schema/schema/Course.java create mode 100644 racevisionGame/src/main/resources/mock/mockXML/schema/schema/CourseLimit.java create mode 100644 racevisionGame/src/main/resources/mock/mockXML/schema/schema/Limit.java create mode 100644 racevisionGame/src/main/resources/mock/mockXML/schema/schema/Mark.java create mode 100644 racevisionGame/src/main/resources/mock/mockXML/schema/schema/ObjectFactory.java create mode 100644 racevisionGame/src/main/resources/mock/mockXML/schema/schema/Participants.java create mode 100644 racevisionGame/src/main/resources/mock/mockXML/schema/schema/Race.java create mode 100644 racevisionGame/src/main/resources/mock/mockXML/schema/schema/RaceStartTime.java create mode 100644 racevisionGame/src/main/resources/mock/mockXML/schema/schema/Yacht.java diff --git a/racevisionGame/src/main/java/mock/app/Event.java b/racevisionGame/src/main/java/mock/app/Event.java index 4d58cc9e..a7ce5099 100644 --- a/racevisionGame/src/main/java/mock/app/Event.java +++ b/racevisionGame/src/main/java/mock/app/Event.java @@ -3,6 +3,7 @@ package mock.app; import mock.dataInput.PolarParser; import mock.model.MockRace; import mock.model.Polars; +import mock.xml.Race; import mock.xml.RaceXMLCreator; import network.Messages.LatestMessages; import org.xml.sax.SAXException; @@ -13,6 +14,7 @@ import shared.exceptions.InvalidRaceDataException; import shared.exceptions.InvalidRegattaDataException; import shared.exceptions.XMLReaderException; import shared.model.Constants; +import shared.xml.XMLUtilities; import javax.xml.bind.JAXBException; import javax.xml.parsers.ParserConfigurationException; @@ -53,7 +55,6 @@ public class Event { } catch (ParserConfigurationException e) { e.printStackTrace(); } - System.out.println(this.raceXML); this.boatXML = XMLReader.readXMLFileToString("mock/mockXML/boatsSinglePlayer.xml", StandardCharsets.UTF_8); this.regattaXML = XMLReader.readXMLFileToString("mock/mockXML/regattaTest.xml", StandardCharsets.UTF_8); this.xmlFileType = XMLFileType.Contents; @@ -95,18 +96,21 @@ public class Event { * @throws InvalidBoatDataException Thrown if the boat xml file cannot be parsed. * @throws InvalidRegattaDataException Thrown if the regatta xml file cannot be parsed. */ - public void start() throws InvalidRaceDataException, XMLReaderException, InvalidBoatDataException, InvalidRegattaDataException { + public void start() throws InvalidRaceDataException, XMLReaderException, InvalidBoatDataException, InvalidRegattaDataException, ParserConfigurationException, JAXBException, SAXException, IOException { new Thread(mockOutput).start(); sendXMLs(); //Parse the XML files into data sources. - RaceDataSource raceDataSource = new RaceXMLReader(this.raceXML, this.xmlFileType); +// RaceDataSource raceDataSource = new RaceXMLReader(this.raceXML, this.xmlFileType); + Race race = (Race) XMLUtilities.xmlToClass(raceXML, + RaceXMLCreator.class.getClassLoader().getResource("mock/mockXML/schema/raceSchema.xsd"), + Race.class); BoatDataSource boatDataSource = new BoatXMLReader(this.boatXML, this.xmlFileType); RegattaDataSource regattaDataSource = new RegattaXMLReader(this.regattaXML, this.xmlFileType); //Create and start race. - MockRace newRace = new MockRace(boatDataSource, raceDataSource, regattaDataSource, this.latestMessages, this.boatPolars, Constants.RaceTimeScale); + MockRace newRace = new MockRace(boatDataSource, race, regattaDataSource, this.latestMessages, this.boatPolars, Constants.RaceTimeScale); new Thread(newRace).start(); } diff --git a/racevisionGame/src/main/java/mock/model/MockRace.java b/racevisionGame/src/main/java/mock/model/MockRace.java index ad259bdc..739eb29f 100644 --- a/racevisionGame/src/main/java/mock/model/MockRace.java +++ b/racevisionGame/src/main/java/mock/model/MockRace.java @@ -1,6 +1,7 @@ package mock.model; import javafx.animation.AnimationTimer; +import mock.xml.*; import network.Messages.BoatLocation; import network.Messages.BoatStatus; import network.Messages.Enums.BoatStatusEnum; @@ -12,6 +13,7 @@ import shared.dataInput.RaceDataSource; import network.Messages.Enums.RaceStatusEnum; import shared.dataInput.RegattaDataSource; import shared.model.*; +import shared.model.Race; import java.time.ZonedDateTime; import java.time.temporal.ChronoUnit; @@ -88,7 +90,7 @@ public class MockRace extends Race { * @param polars The polars table to be used for boat simulation. * @param timeScale The timeScale for the race. See {@link Constants#RaceTimeScale}. */ - public MockRace(BoatDataSource boatDataSource, RaceDataSource raceDataSource, RegattaDataSource regattaDataSource, LatestMessages latestMessages, Polars polars, int timeScale) { + public MockRace(BoatDataSource boatDataSource, mock.xml.Race raceDataSource, RegattaDataSource regattaDataSource, LatestMessages latestMessages, Polars polars, int timeScale) { super(boatDataSource, raceDataSource, regattaDataSource, latestMessages); diff --git a/racevisionGame/src/main/java/mock/xml/Race.java b/racevisionGame/src/main/java/mock/xml/Race.java index a8c7696a..0b32bd09 100644 --- a/racevisionGame/src/main/java/mock/xml/Race.java +++ b/racevisionGame/src/main/java/mock/xml/Race.java @@ -2,12 +2,13 @@ // 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.08.03 at 02:28:57 AM NZST +// Generated on: 2017.08.13 at 10:39:29 PM NZST // package mock.xml; +import java.math.BigInteger; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; @@ -15,20 +16,21 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlSchemaType; 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="RaceID" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="RaceID" type="{http://www.w3.org/2001/XMLSchema}positiveInteger"/>
  *         <element name="RaceType" type="{http://www.w3.org/2001/XMLSchema}string"/>
  *         <element name="CreationTimeDate" type="{http://www.w3.org/2001/XMLSchema}string"/>
  *         <element name="RaceStartTime">
@@ -51,6 +53,7 @@ import javax.xml.bind.annotation.XmlType;
  *                       <complexContent>
  *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
  *                           <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="Entry" type="{http://www.w3.org/2001/XMLSchema}string" />
  *                         </restriction>
  *                       </complexContent>
  *                     </complexType>
@@ -69,8 +72,10 @@ import javax.xml.bind.annotation.XmlType;
  *                     <complexType>
  *                       <complexContent>
  *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                           <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ *                           <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ *                           <attribute name="Rounding" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="ZoneSize" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
  *                         </restriction>
  *                       </complexContent>
  *                     </complexType>
@@ -141,25 +146,26 @@ import javax.xml.bind.annotation.XmlType;
  *   </complexContent>
  * </complexType>
  * 
- * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { - "raceID", - "raceType", - "creationTimeDate", - "raceStartTime", - "participants", - "compoundMarkSequence", - "course", - "courseLimit" + "raceID", + "raceType", + "creationTimeDate", + "raceStartTime", + "participants", + "compoundMarkSequence", + "course", + "courseLimit" }) @XmlRootElement(name = "Race") public class Race { @XmlElement(name = "RaceID", required = true) - protected String raceID; + @XmlSchemaType(name = "positiveInteger") + protected BigInteger raceID; @XmlElement(name = "RaceType", required = true) protected String raceType; @XmlElement(name = "CreationTimeDate", required = true) @@ -177,35 +183,35 @@ public class Race { /** * Gets the value of the raceID property. - * + * * @return * possible object is - * {@link String } - * + * {@link BigInteger } + * */ - public String getRaceID() { + public BigInteger getRaceID() { return raceID; } /** * Sets the value of the raceID property. - * + * * @param value * allowed object is - * {@link String } - * + * {@link BigInteger } + * */ - public void setRaceID(String value) { + public void setRaceID(BigInteger value) { this.raceID = value; } /** * Gets the value of the raceType property. - * + * * @return * possible object is * {@link String } - * + * */ public String getRaceType() { return raceType; @@ -213,11 +219,11 @@ public class Race { /** * Sets the value of the raceType property. - * + * * @param value * allowed object is * {@link String } - * + * */ public void setRaceType(String value) { this.raceType = value; @@ -225,11 +231,11 @@ public class Race { /** * Gets the value of the creationTimeDate property. - * + * * @return * possible object is * {@link String } - * + * */ public String getCreationTimeDate() { return creationTimeDate; @@ -237,11 +243,11 @@ public class Race { /** * Sets the value of the creationTimeDate property. - * + * * @param value * allowed object is * {@link String } - * + * */ public void setCreationTimeDate(String value) { this.creationTimeDate = value; @@ -249,11 +255,11 @@ public class Race { /** * Gets the value of the raceStartTime property. - * + * * @return * possible object is * {@link Race.RaceStartTime } - * + * */ public Race.RaceStartTime getRaceStartTime() { return raceStartTime; @@ -261,11 +267,11 @@ public class Race { /** * Sets the value of the raceStartTime property. - * + * * @param value * allowed object is * {@link Race.RaceStartTime } - * + * */ public void setRaceStartTime(Race.RaceStartTime value) { this.raceStartTime = value; @@ -273,11 +279,11 @@ public class Race { /** * Gets the value of the participants property. - * + * * @return * possible object is * {@link Race.Participants } - * + * */ public Race.Participants getParticipants() { return participants; @@ -285,11 +291,11 @@ public class Race { /** * Sets the value of the participants property. - * + * * @param value * allowed object is * {@link Race.Participants } - * + * */ public void setParticipants(Race.Participants value) { this.participants = value; @@ -297,11 +303,11 @@ public class Race { /** * Gets the value of the compoundMarkSequence property. - * + * * @return * possible object is * {@link Race.CompoundMarkSequence } - * + * */ public Race.CompoundMarkSequence getCompoundMarkSequence() { return compoundMarkSequence; @@ -309,11 +315,11 @@ public class Race { /** * Sets the value of the compoundMarkSequence property. - * + * * @param value * allowed object is * {@link Race.CompoundMarkSequence } - * + * */ public void setCompoundMarkSequence(Race.CompoundMarkSequence value) { this.compoundMarkSequence = value; @@ -321,11 +327,11 @@ public class Race { /** * Gets the value of the course property. - * + * * @return * possible object is * {@link Race.Course } - * + * */ public Race.Course getCourse() { return course; @@ -333,11 +339,11 @@ public class Race { /** * Sets the value of the course property. - * + * * @param value * allowed object is * {@link Race.Course } - * + * */ public void setCourse(Race.Course value) { this.course = value; @@ -345,11 +351,11 @@ public class Race { /** * Gets the value of the courseLimit property. - * + * * @return * possible object is * {@link Race.CourseLimit } - * + * */ public Race.CourseLimit getCourseLimit() { return courseLimit; @@ -357,11 +363,11 @@ public class Race { /** * Sets the value of the courseLimit property. - * + * * @param value * allowed object is * {@link Race.CourseLimit } - * + * */ public void setCourseLimit(Race.CourseLimit value) { this.courseLimit = value; @@ -370,9 +376,9 @@ public class Race { /** *

Java class for anonymous complex type. - * + * *

The following schema fragment specifies the expected content contained within this class. - * + * *

      * <complexType>
      *   <complexContent>
@@ -382,8 +388,10 @@ public class Race {
      *           <complexType>
      *             <complexContent>
      *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *                 <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                 <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+     *                 <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+     *                 <attribute name="Rounding" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 <attribute name="ZoneSize" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
      *               </restriction>
      *             </complexContent>
      *           </complexType>
@@ -393,12 +401,12 @@ public class Race {
      *   </complexContent>
      * </complexType>
      * 
- * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { - "corner" + "corner" }) public static class CompoundMarkSequence { @@ -407,25 +415,25 @@ public class Race { /** * Gets the value of the corner property. - * + * *

* 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 corner property. - * + * *

* For example, to add a new item, do as follows: *

          *    getCorner().add(newItem);
          * 
- * - * + * + * *

* Objects of the following type(s) are allowed in the list * {@link Race.CompoundMarkSequence.Corner } - * @return corners in the CompoundMarkSequence. - * + * + * */ public List getCorner() { if (corner == null) { @@ -437,79 +445,136 @@ public class Race { /** *

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">
-         *       <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *       <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+         *       <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+         *       <attribute name="Rounding" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       <attribute name="ZoneSize" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
          *     </restriction>
          *   </complexContent>
          * </complexType>
          * 
- * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") public static class Corner { @XmlAttribute(name = "CompoundMarkID", required = true) - protected String compoundMarkID; + @XmlSchemaType(name = "positiveInteger") + protected BigInteger compoundMarkID; @XmlAttribute(name = "SeqID", required = true) - protected String seqID; + @XmlSchemaType(name = "positiveInteger") + protected BigInteger seqID; + @XmlAttribute(name = "Rounding", required = true) + protected String rounding; + @XmlAttribute(name = "ZoneSize", required = true) + @XmlSchemaType(name = "positiveInteger") + protected BigInteger zoneSize; /** * Gets the value of the compoundMarkID property. - * + * * @return * possible object is - * {@link String } - * + * {@link BigInteger } + * */ - public String getCompoundMarkID() { + public BigInteger getCompoundMarkID() { return compoundMarkID; } /** * Sets the value of the compoundMarkID property. - * + * * @param value * allowed object is - * {@link String } - * + * {@link BigInteger } + * */ - public void setCompoundMarkID(String value) { + public void setCompoundMarkID(BigInteger value) { this.compoundMarkID = value; } /** * Gets the value of the seqID property. - * + * * @return * possible object is - * {@link String } - * + * {@link BigInteger } + * */ - public String getSeqID() { + public BigInteger getSeqID() { return seqID; } /** * Sets the value of the seqID property. - * + * * @param value * allowed object is - * {@link String } - * + * {@link BigInteger } + * */ - public void setSeqID(String value) { + public void setSeqID(BigInteger value) { this.seqID = value; } + /** + * Gets the value of the rounding property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getRounding() { + return rounding; + } + + /** + * Sets the value of the rounding property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setRounding(String value) { + this.rounding = value; + } + + /** + * Gets the value of the zoneSize property. + * + * @return + * possible object is + * {@link BigInteger } + * + */ + public BigInteger getZoneSize() { + return zoneSize; + } + + /** + * Sets the value of the zoneSize property. + * + * @param value + * allowed object is + * {@link BigInteger } + * + */ + public void setZoneSize(BigInteger value) { + this.zoneSize = value; + } + } } @@ -517,9 +582,9 @@ public class Race { /** *

Java class for anonymous complex type. - * + * *

The following schema fragment specifies the expected content contained within this class. - * + * *

      * <complexType>
      *   <complexContent>
@@ -555,12 +620,12 @@ public class Race {
      *   </complexContent>
      * </complexType>
      * 
- * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { - "compoundMark" + "compoundMark" }) public static class Course { @@ -569,25 +634,25 @@ public class Race { /** * Gets the value of the compoundMark property. - * + * *

* 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 compoundMark property. - * + * *

* For example, to add a new item, do as follows: *

          *    getCompoundMark().add(newItem);
          * 
- * - * + * + * *

* Objects of the following type(s) are allowed in the list * {@link Race.Course.CompoundMark } - * @return CompoundMarks in a Course - * + * + * */ public List getCompoundMark() { if (compoundMark == null) { @@ -599,9 +664,9 @@ public class Race { /** *

Java class for anonymous complex type. - * + * *

The following schema fragment specifies the expected content contained within this class. - * + * *

          * <complexType>
          *   <complexContent>
@@ -627,12 +692,12 @@ public class Race {
          *   </complexContent>
          * </complexType>
          * 
- * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { - "mark" + "mark" }) public static class CompoundMark { @@ -645,25 +710,25 @@ public class Race { /** * Gets the value of the mark property. - * + * *

* 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 mark property. - * + * *

* For example, to add a new item, do as follows: *

              *    getMark().add(newItem);
              * 
- * - * + * + * *

* Objects of the following type(s) are allowed in the list * {@link Race.Course.CompoundMark.Mark } - * @return Marks in a CompoundMark - * + * + * */ public List getMark() { if (mark == null) { @@ -674,11 +739,11 @@ public class Race { /** * Gets the value of the compoundMarkID property. - * + * * @return * possible object is * {@link String } - * + * */ public String getCompoundMarkID() { return compoundMarkID; @@ -686,11 +751,11 @@ public class Race { /** * Sets the value of the compoundMarkID property. - * + * * @param value * allowed object is * {@link String } - * + * */ public void setCompoundMarkID(String value) { this.compoundMarkID = value; @@ -698,11 +763,11 @@ public class Race { /** * Gets the value of the name property. - * + * * @return * possible object is * {@link String } - * + * */ public String getName() { return name; @@ -710,11 +775,11 @@ public class Race { /** * Sets the value of the name property. - * + * * @param value * allowed object is * {@link String } - * + * */ public void setName(String value) { this.name = value; @@ -723,9 +788,9 @@ public class Race { /** *

Java class for anonymous complex type. - * + * *

The following schema fragment specifies the expected content contained within this class. - * + * *

              * <complexType>
              *   <complexContent>
@@ -739,8 +804,8 @@ public class Race {
              *   </complexContent>
              * </complexType>
              * 
- * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") @@ -759,11 +824,11 @@ public class Race { /** * Gets the value of the seqId property. - * + * * @return * possible object is * {@link String } - * + * */ public String getSeqId() { return seqId; @@ -771,11 +836,11 @@ public class Race { /** * Sets the value of the seqId property. - * + * * @param value * allowed object is * {@link String } - * + * */ public void setSeqId(String value) { this.seqId = value; @@ -783,11 +848,11 @@ public class Race { /** * Gets the value of the name property. - * + * * @return * possible object is * {@link String } - * + * */ public String getName() { return name; @@ -795,11 +860,11 @@ public class Race { /** * Sets the value of the name property. - * + * * @param value * allowed object is * {@link String } - * + * */ public void setName(String value) { this.name = value; @@ -807,11 +872,11 @@ public class Race { /** * Gets the value of the targetLat property. - * + * * @return * possible object is * {@link String } - * + * */ public String getTargetLat() { return targetLat; @@ -819,11 +884,11 @@ public class Race { /** * Sets the value of the targetLat property. - * + * * @param value * allowed object is * {@link String } - * + * */ public void setTargetLat(String value) { this.targetLat = value; @@ -831,11 +896,11 @@ public class Race { /** * Gets the value of the targetLng property. - * + * * @return * possible object is * {@link String } - * + * */ public String getTargetLng() { return targetLng; @@ -843,11 +908,11 @@ public class Race { /** * Sets the value of the targetLng property. - * + * * @param value * allowed object is * {@link String } - * + * */ public void setTargetLng(String value) { this.targetLng = value; @@ -855,11 +920,11 @@ public class Race { /** * Gets the value of the sourceID property. - * + * * @return * possible object is * {@link String } - * + * */ public String getSourceID() { return sourceID; @@ -867,11 +932,11 @@ public class Race { /** * Sets the value of the sourceID property. - * + * * @param value * allowed object is * {@link String } - * + * */ public void setSourceID(String value) { this.sourceID = value; @@ -886,9 +951,9 @@ public class Race { /** *

Java class for anonymous complex type. - * + * *

The following schema fragment specifies the expected content contained within this class. - * + * *

      * <complexType>
      *   <complexContent>
@@ -910,12 +975,12 @@ public class Race {
      *   </complexContent>
      * </complexType>
      * 
- * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { - "limit" + "limit" }) public static class CourseLimit { @@ -924,25 +989,25 @@ public class Race { /** * Gets the value of the limit property. - * + * *

* 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 limit property. - * + * *

* For example, to add a new item, do as follows: *

          *    getLimit().add(newItem);
          * 
- * - * + * + * *

* Objects of the following type(s) are allowed in the list * {@link Race.CourseLimit.Limit } - * @return Limits in CourseLimits - * + * + * */ public List getLimit() { if (limit == null) { @@ -954,9 +1019,9 @@ public class Race { /** *

Java class for anonymous complex type. - * + * *

The following schema fragment specifies the expected content contained within this class. - * + * *

          * <complexType>
          *   <complexContent>
@@ -968,8 +1033,8 @@ public class Race {
          *   </complexContent>
          * </complexType>
          * 
- * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") @@ -984,11 +1049,11 @@ public class Race { /** * Gets the value of the lat property. - * + * * @return * possible object is * {@link String } - * + * */ public String getLat() { return lat; @@ -996,11 +1061,11 @@ public class Race { /** * Sets the value of the lat property. - * + * * @param value * allowed object is * {@link String } - * + * */ public void setLat(String value) { this.lat = value; @@ -1008,11 +1073,11 @@ public class Race { /** * Gets the value of the lon property. - * + * * @return * possible object is * {@link String } - * + * */ public String getLon() { return lon; @@ -1020,11 +1085,11 @@ public class Race { /** * Sets the value of the lon property. - * + * * @param value * allowed object is * {@link String } - * + * */ public void setLon(String value) { this.lon = value; @@ -1032,11 +1097,11 @@ public class Race { /** * Gets the value of the seqID property. - * + * * @return * possible object is * {@link String } - * + * */ public String getSeqID() { return seqID; @@ -1044,11 +1109,11 @@ public class Race { /** * Sets the value of the seqID property. - * + * * @param value * allowed object is * {@link String } - * + * */ public void setSeqID(String value) { this.seqID = value; @@ -1061,9 +1126,9 @@ public class Race { /** *

Java class for anonymous complex type. - * + * *

The following schema fragment specifies the expected content contained within this class. - * + * *

      * <complexType>
      *   <complexContent>
@@ -1074,6 +1139,7 @@ public class Race {
      *             <complexContent>
      *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
      *                 <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 <attribute name="Entry" type="{http://www.w3.org/2001/XMLSchema}string" />
      *               </restriction>
      *             </complexContent>
      *           </complexType>
@@ -1083,12 +1149,12 @@ public class Race {
      *   </complexContent>
      * </complexType>
      * 
- * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { - "yacht" + "yacht" }) public static class Participants { @@ -1097,25 +1163,25 @@ public class Race { /** * Gets the value of the yacht property. - * + * *

* 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 yacht property. - * + * *

* For example, to add a new item, do as follows: *

          *    getYacht().add(newItem);
          * 
- * - * + * + * *

* Objects of the following type(s) are allowed in the list * {@link Race.Participants.Yacht } - * @return yachts in a race. - * + * + * */ public List getYacht() { if (yacht == null) { @@ -1127,20 +1193,21 @@ public class Race { /** *

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">
          *       <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       <attribute name="Entry" type="{http://www.w3.org/2001/XMLSchema}string" />
          *     </restriction>
          *   </complexContent>
          * </complexType>
          * 
- * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") @@ -1148,14 +1215,16 @@ public class Race { @XmlAttribute(name = "SourceID", required = true) protected String sourceID; + @XmlAttribute(name = "Entry") + protected String entry; /** * Gets the value of the sourceID property. - * + * * @return * possible object is * {@link String } - * + * */ public String getSourceID() { return sourceID; @@ -1163,16 +1232,40 @@ public class Race { /** * Sets the value of the sourceID property. - * + * * @param value * allowed object is * {@link String } - * + * */ public void setSourceID(String value) { this.sourceID = value; } + /** + * Gets the value of the entry property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getEntry() { + return entry; + } + + /** + * Sets the value of the entry property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setEntry(String value) { + this.entry = value; + } + } } @@ -1180,9 +1273,9 @@ public class Race { /** *

Java class for anonymous complex type. - * + * *

The following schema fragment specifies the expected content contained within this class. - * + * *

      * <complexType>
      *   <complexContent>
@@ -1193,8 +1286,8 @@ public class Race {
      *   </complexContent>
      * </complexType>
      * 
- * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") @@ -1207,11 +1300,11 @@ public class Race { /** * Gets the value of the postpone property. - * + * * @return * possible object is * {@link String } - * + * */ public String getPostpone() { return postpone; @@ -1219,11 +1312,11 @@ public class Race { /** * Sets the value of the postpone property. - * + * * @param value * allowed object is * {@link String } - * + * */ public void setPostpone(String value) { this.postpone = value; @@ -1231,11 +1324,11 @@ public class Race { /** * Gets the value of the time property. - * + * * @return * possible object is * {@link String } - * + * */ public String getTime() { return time; @@ -1243,11 +1336,11 @@ public class Race { /** * Sets the value of the time property. - * + * * @param value * allowed object is * {@link String } - * + * */ public void setTime(String value) { this.time = value; @@ -1255,4 +1348,4 @@ public class Race { } -} +} \ No newline at end of file diff --git a/racevisionGame/src/main/java/mock/xml/RaceFactory.java b/racevisionGame/src/main/java/mock/xml/RaceFactory.java index cdebfcc7..24223f74 100644 --- a/racevisionGame/src/main/java/mock/xml/RaceFactory.java +++ b/racevisionGame/src/main/java/mock/xml/RaceFactory.java @@ -2,7 +2,7 @@ // 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.08.03 at 01:07:33 AM NZST +// Generated on: 2017.08.13 at 10:39:29 PM NZST // @@ -12,33 +12,33 @@ import javax.xml.bind.annotation.XmlRegistry; /** - * This object contains factory methods for each - * Java content interface and Java element interface - * generated in the main.java.mock.xml 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 + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the scd 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 RaceFactory { /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: main.java.mock.xml - * + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: scd + * */ public RaceFactory() { } /** * Create an instance of {@link Race } - * @return new Race instance + * */ public Race createRace() { return new Race(); @@ -46,7 +46,7 @@ public class RaceFactory { /** * Create an instance of {@link Race.CourseLimit } - * @return new RaceCourseLimit Instance + * */ public Race.CourseLimit createRaceCourseLimit() { return new Race.CourseLimit(); @@ -54,7 +54,7 @@ public class RaceFactory { /** * Create an instance of {@link Race.Course } - * @return new Course Instance + * */ public Race.Course createRaceCourse() { return new Race.Course(); @@ -62,7 +62,7 @@ public class RaceFactory { /** * Create an instance of {@link Race.Course.CompoundMark } - * @return new CompoundMark Instance + * */ public Race.Course.CompoundMark createRaceCourseCompoundMark() { return new Race.Course.CompoundMark(); @@ -70,7 +70,7 @@ public class RaceFactory { /** * Create an instance of {@link Race.CompoundMarkSequence } - * @return new CompoundMarkSequence Instance + * */ public Race.CompoundMarkSequence createRaceCompoundMarkSequence() { return new Race.CompoundMarkSequence(); @@ -78,7 +78,7 @@ public class RaceFactory { /** * Create an instance of {@link Race.Participants } - * @return new Race.Participants Instance + * */ public Race.Participants createRaceParticipants() { return new Race.Participants(); @@ -86,7 +86,7 @@ public class RaceFactory { /** * Create an instance of {@link Race.RaceStartTime } - * @return new RaceStartTime instance + * */ public Race.RaceStartTime createRaceRaceStartTime() { return new Race.RaceStartTime(); @@ -94,7 +94,7 @@ public class RaceFactory { /** * Create an instance of {@link Race.CourseLimit.Limit } - * @return new Limit instance + * */ public Race.CourseLimit.Limit createRaceCourseLimitLimit() { return new Race.CourseLimit.Limit(); @@ -102,7 +102,7 @@ public class RaceFactory { /** * Create an instance of {@link Race.Course.CompoundMark.Mark } - * @return new CompoundMark.Mark instance + * */ public Race.Course.CompoundMark.Mark createRaceCourseCompoundMarkMark() { return new Race.Course.CompoundMark.Mark(); @@ -110,7 +110,7 @@ public class RaceFactory { /** * Create an instance of {@link Race.CompoundMarkSequence.Corner } - * @return new Race.CompoundMarkSequence.Corner instance + * */ public Race.CompoundMarkSequence.Corner createRaceCompoundMarkSequenceCorner() { return new Race.CompoundMarkSequence.Corner(); @@ -118,10 +118,10 @@ public class RaceFactory { /** * Create an instance of {@link Race.Participants.Yacht } - * @return new Race.Participants.Yacht Instance. + * */ public Race.Participants.Yacht createRaceParticipantsYacht() { return new Race.Participants.Yacht(); } -} +} \ No newline at end of file diff --git a/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java b/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java index 498bd0bd..155f3644 100644 --- a/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java +++ b/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java @@ -10,6 +10,7 @@ import shared.model.CompoundMark; import shared.model.Corner; import shared.model.GPSCoordinate; import shared.model.Mark; +import shared.xml.XMLUtilities; import javax.xml.XMLConstants; import javax.xml.bind.JAXBContext; @@ -157,7 +158,9 @@ public class RaceXMLCreator { public static String alterRaceToWind(String s, double degrees) throws XMLReaderException, InvalidRaceDataException, JAXBException, IOException, SAXException, ParserConfigurationException { RaceXMLReader reader = new RaceXMLReader(s, XMLFileType.ResourcePath); - Race race = readRace(RaceXMLCreator.class.getClassLoader().getResource(s).getFile()); + Race race = (Race) XMLUtilities.xmlToClass(new File(RaceXMLCreator.class.getClassLoader().getResource(s).getFile()), + RaceXMLCreator.class.getClassLoader().getResource("mock/mockXML/schema/raceSchema.xsd"), + Race.class); double raceOriginalBearing = getLineAngle(getLeewardGate(reader).getMark1Position(), getWindwardGate(reader).getMark1Position()); @@ -262,33 +265,4 @@ public class RaceXMLCreator { return Math.atan2(dy, dx)/Math.PI * 180; } - public static Race readRace(String file) throws IOException, SAXException, JAXBException, ParserConfigurationException { - //validateRace(file); - - DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - Document document = parser.parse(new File(file)); - - JAXBContext jc = JAXBContext.newInstance(Race.class); - Unmarshaller unmarshaller = jc.createUnmarshaller(); - - SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); - URL schemaURL = RaceXMLCreator.class.getClassLoader().getResource("mock/mockXML/schema/raceSchema.xsd");// The URL to your XML Schema; - Schema schema = sf.newSchema(schemaURL); - unmarshaller.setSchema(schema); - - return (Race) unmarshaller.unmarshal(new DOMSource(document)); - } - - public static boolean validateRace(String file) throws SAXException, IOException, ParserConfigurationException { - DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - Document document = parser.parse(new File(file)); - - SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); - URL schemaURL = RaceXMLCreator.class.getClassLoader().getResource("mock/mockXML/schema/raceSchema.xsd");// The URL to your XML Schema; - Schema schema = sf.newSchema(schemaURL); - Validator validator = schema.newValidator(); - validator.validate(new DOMSource(document)); - return true; - } - } diff --git a/racevisionGame/src/main/java/shared/model/Race.java b/racevisionGame/src/main/java/shared/model/Race.java index 415e9f77..6f428ad0 100644 --- a/racevisionGame/src/main/java/shared/model/Race.java +++ b/racevisionGame/src/main/java/shared/model/Race.java @@ -23,7 +23,7 @@ public abstract class Race implements Runnable { /** * The source of race related data. */ - protected RaceDataSource raceDataSource; + protected mock.xml.Race raceDataSource; /** * The source of boat related data. @@ -134,7 +134,7 @@ public abstract class Race implements Runnable { * @param regattaDataSource Data source for race related data (course name, location, timezone, etc...). * @param latestMessages The collection of latest messages, which can be written to, or read from. */ - public Race(BoatDataSource boatDataSource, RaceDataSource raceDataSource, RegattaDataSource regattaDataSource, LatestMessages latestMessages) { + public Race(BoatDataSource boatDataSource, mock.xml.Race raceDataSource, RegattaDataSource regattaDataSource, LatestMessages latestMessages) { //Keep a reference to data sources. this.raceDataSource = raceDataSource; diff --git a/racevisionGame/src/main/java/shared/xml/XMLUtilities.java b/racevisionGame/src/main/java/shared/xml/XMLUtilities.java index b865b230..78ed493d 100644 --- a/racevisionGame/src/main/java/shared/xml/XMLUtilities.java +++ b/racevisionGame/src/main/java/shared/xml/XMLUtilities.java @@ -1,9 +1,26 @@ package shared.xml; +import mock.xml.Race; +import mock.xml.RaceXMLCreator; +import org.w3c.dom.Document; +import org.xml.sax.SAXException; + +import javax.xml.XMLConstants; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Marshaller; +import javax.xml.bind.Unmarshaller; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.dom.DOMSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; +import javax.xml.validation.Validator; +import java.io.File; +import java.io.IOException; import java.io.StringWriter; +import java.net.URL; /** * Created by fwy13 on 13/08/17. @@ -21,16 +38,49 @@ public class XMLUtilities { return sw.toString(); } - public static String xmlToClass(){ -// JAXBContext jc = JAXBContext.newInstance(YourXMLClass.class); -// Unmarshaller unmarshaller = jc.createUnmarshaller(); -// -// SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); -// URL schemaURL = // The URL to your XML Schema; -// Schema schema = sf.newSchema(schemaURL); -// unmarshaller.setSchema(schema); -// -// YourXMLClass yourXMLClass = (YourXMLClass) unmarshaller.unmarshal(xml); + public static Object xmlToClass(File file, URL schemaURL, Class c) throws ParserConfigurationException, IOException, SAXException, JAXBException { + DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + Document document = parser.parse(file); + + return xmlToClass(document, schemaURL, c); } + public static Object xmlToClass(String xml, URL schemaURL, Class c) throws ParserConfigurationException, IOException, SAXException, JAXBException { + DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + Document document = parser.parse(xml); + + return xmlToClass(document, schemaURL, c); + } + + public static Object xmlToClass(Document document, URL schemaURL, Class c) throws ParserConfigurationException, IOException, SAXException, JAXBException { + JAXBContext jc = JAXBContext.newInstance(c); + Unmarshaller unmarshaller = jc.createUnmarshaller(); + + SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + Schema schema = sf.newSchema(schemaURL); + unmarshaller.setSchema(schema); + + return unmarshaller.unmarshal(new DOMSource(document)); + } + + public static boolean validateXML(String file, URL schemaURL){ + try { + DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + Document document = parser.parse(new File(file)); + + SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + Schema schema = sf.newSchema(schemaURL); + Validator validator = schema.newValidator(); + validator.validate(new DOMSource(document)); + } catch (ParserConfigurationException e) { + return false; + } catch (IOException e) { + return false; + } catch (SAXException e) { + return false; + } + return true; + } + + } diff --git a/racevisionGame/src/main/resources/mock/mockXML/raceSchemaTest.xml b/racevisionGame/src/main/resources/mock/mockXML/raceSchemaTest.xml index 344279ff..168e3c31 100644 --- a/racevisionGame/src/main/resources/mock/mockXML/raceSchemaTest.xml +++ b/racevisionGame/src/main/resources/mock/mockXML/raceSchemaTest.xml @@ -8,12 +8,12 @@ - - - - - - + + + + + + diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/binding.xml b/racevisionGame/src/main/resources/mock/mockXML/schema/binding.xml new file mode 100644 index 00000000..b1d2a55e --- /dev/null +++ b/racevisionGame/src/main/resources/mock/mockXML/schema/binding.xml @@ -0,0 +1,6 @@ + + + diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/generated/ObjectFactory.java b/racevisionGame/src/main/resources/mock/mockXML/schema/generated/ObjectFactory.java new file mode 100644 index 00000000..3a391bcd --- /dev/null +++ b/racevisionGame/src/main/resources/mock/mockXML/schema/generated/ObjectFactory.java @@ -0,0 +1,127 @@ +// +// 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.08.13 at 11:00:04 PM NZST +// + + +package generated; + +import javax.xml.bind.annotation.XmlRegistry; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the generated 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: generated + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link Race } + * + */ + public Race createRace() { + return new Race(); + } + + /** + * Create an instance of {@link Race.CourseLimit } + * + */ + public Race.CourseLimit createRaceCourseLimit() { + return new Race.CourseLimit(); + } + + /** + * Create an instance of {@link Race.Course } + * + */ + public Race.Course createRaceCourse() { + return new Race.Course(); + } + + /** + * Create an instance of {@link Race.Course.CompoundMark } + * + */ + public Race.Course.CompoundMark createRaceCourseCompoundMark() { + return new Race.Course.CompoundMark(); + } + + /** + * Create an instance of {@link Race.CompoundMarkSequence } + * + */ + public Race.CompoundMarkSequence createRaceCompoundMarkSequence() { + return new Race.CompoundMarkSequence(); + } + + /** + * Create an instance of {@link Race.Participants } + * + */ + public Race.Participants createRaceParticipants() { + return new Race.Participants(); + } + + /** + * Create an instance of {@link Race.RaceStartTime } + * + */ + public Race.RaceStartTime createRaceRaceStartTime() { + return new Race.RaceStartTime(); + } + + /** + * Create an instance of {@link Race.CourseLimit.Limit } + * + */ + public Race.CourseLimit.Limit createRaceCourseLimitLimit() { + return new Race.CourseLimit.Limit(); + } + + /** + * Create an instance of {@link Race.Course.CompoundMark.Mark } + * + */ + public Race.Course.CompoundMark.Mark createRaceCourseCompoundMarkMark() { + return new Race.Course.CompoundMark.Mark(); + } + + /** + * Create an instance of {@link Race.CompoundMarkSequence.Corner } + * + */ + public Race.CompoundMarkSequence.Corner createRaceCompoundMarkSequenceCorner() { + return new Race.CompoundMarkSequence.Corner(); + } + + /** + * Create an instance of {@link Race.Participants.Yacht } + * + */ + public Race.Participants.Yacht createRaceParticipantsYacht() { + return new Race.Participants.Yacht(); + } + +} diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/generated/Race.java b/racevisionGame/src/main/resources/mock/mockXML/schema/generated/Race.java new file mode 100644 index 00000000..07598160 --- /dev/null +++ b/racevisionGame/src/main/resources/mock/mockXML/schema/generated/Race.java @@ -0,0 +1,1351 @@ +// +// 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.08.13 at 11:00:04 PM NZST +// + + +package generated; + +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlSchemaType; +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="RaceID" type="{http://www.w3.org/2001/XMLSchema}positiveInteger"/>
+ *         <element name="RaceType" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="CreationTimeDate" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="RaceStartTime">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <attribute name="Postpone" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 <attribute name="Time" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="Participants">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="Yacht" maxOccurs="unbounded">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="Entry" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="CompoundMarkSequence">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="Corner" maxOccurs="unbounded">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ *                           <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ *                           <attribute name="Rounding" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="ZoneSize" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="Course">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="CompoundMark" maxOccurs="unbounded">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <sequence>
+ *                             <element name="Mark" maxOccurs="unbounded">
+ *                               <complexType>
+ *                                 <complexContent>
+ *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                     <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                     <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                     <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                     <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                     <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                   </restriction>
+ *                                 </complexContent>
+ *                               </complexType>
+ *                             </element>
+ *                           </sequence>
+ *                           <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="CourseLimit">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="Limit" maxOccurs="unbounded">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="SeqID" use="required" 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 = { + "raceID", + "raceType", + "creationTimeDate", + "raceStartTime", + "participants", + "compoundMarkSequence", + "course", + "courseLimit" +}) +@XmlRootElement(name = "Race") +public class Race { + + @XmlElement(name = "RaceID", required = true) + @XmlSchemaType(name = "positiveInteger") + protected BigInteger raceID; + @XmlElement(name = "RaceType", required = true) + protected String raceType; + @XmlElement(name = "CreationTimeDate", required = true) + protected String creationTimeDate; + @XmlElement(name = "RaceStartTime", required = true) + protected Race.RaceStartTime raceStartTime; + @XmlElement(name = "Participants", required = true) + protected Race.Participants participants; + @XmlElement(name = "CompoundMarkSequence", required = true) + protected Race.CompoundMarkSequence compoundMarkSequence; + @XmlElement(name = "Course", required = true) + protected Race.Course course; + @XmlElement(name = "CourseLimit", required = true) + protected Race.CourseLimit courseLimit; + + /** + * Gets the value of the raceID property. + * + * @return + * possible object is + * {@link BigInteger } + * + */ + public BigInteger getRaceID() { + return raceID; + } + + /** + * Sets the value of the raceID property. + * + * @param value + * allowed object is + * {@link BigInteger } + * + */ + public void setRaceID(BigInteger value) { + this.raceID = value; + } + + /** + * Gets the value of the raceType property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getRaceType() { + return raceType; + } + + /** + * Sets the value of the raceType property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setRaceType(String value) { + this.raceType = value; + } + + /** + * Gets the value of the creationTimeDate property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCreationTimeDate() { + return creationTimeDate; + } + + /** + * Sets the value of the creationTimeDate property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCreationTimeDate(String value) { + this.creationTimeDate = value; + } + + /** + * Gets the value of the raceStartTime property. + * + * @return + * possible object is + * {@link Race.RaceStartTime } + * + */ + public Race.RaceStartTime getRaceStartTime() { + return raceStartTime; + } + + /** + * Sets the value of the raceStartTime property. + * + * @param value + * allowed object is + * {@link Race.RaceStartTime } + * + */ + public void setRaceStartTime(Race.RaceStartTime value) { + this.raceStartTime = value; + } + + /** + * Gets the value of the participants property. + * + * @return + * possible object is + * {@link Race.Participants } + * + */ + public Race.Participants getParticipants() { + return participants; + } + + /** + * Sets the value of the participants property. + * + * @param value + * allowed object is + * {@link Race.Participants } + * + */ + public void setParticipants(Race.Participants value) { + this.participants = value; + } + + /** + * Gets the value of the compoundMarkSequence property. + * + * @return + * possible object is + * {@link Race.CompoundMarkSequence } + * + */ + public Race.CompoundMarkSequence getCompoundMarkSequence() { + return compoundMarkSequence; + } + + /** + * Sets the value of the compoundMarkSequence property. + * + * @param value + * allowed object is + * {@link Race.CompoundMarkSequence } + * + */ + public void setCompoundMarkSequence(Race.CompoundMarkSequence value) { + this.compoundMarkSequence = value; + } + + /** + * Gets the value of the course property. + * + * @return + * possible object is + * {@link Race.Course } + * + */ + public Race.Course getCourse() { + return course; + } + + /** + * Sets the value of the course property. + * + * @param value + * allowed object is + * {@link Race.Course } + * + */ + public void setCourse(Race.Course value) { + this.course = value; + } + + /** + * Gets the value of the courseLimit property. + * + * @return + * possible object is + * {@link Race.CourseLimit } + * + */ + public Race.CourseLimit getCourseLimit() { + return courseLimit; + } + + /** + * Sets the value of the courseLimit property. + * + * @param value + * allowed object is + * {@link Race.CourseLimit } + * + */ + public void setCourseLimit(Race.CourseLimit value) { + this.courseLimit = 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="Corner" maxOccurs="unbounded">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+     *                 <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+     *                 <attribute name="Rounding" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 <attribute name="ZoneSize" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "corner" + }) + public static class CompoundMarkSequence { + + @XmlElement(name = "Corner", required = true) + protected List corner; + + /** + * Gets the value of the corner property. + * + *

+ * 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 corner property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getCorner().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Race.CompoundMarkSequence.Corner } + * + * + */ + public List getCorner() { + if (corner == null) { + corner = new ArrayList(); + } + return this.corner; + } + + + /** + *

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">
+         *       <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+         *       <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+         *       <attribute name="Rounding" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       <attribute name="ZoneSize" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
+         * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class Corner { + + @XmlAttribute(name = "CompoundMarkID", required = true) + @XmlSchemaType(name = "positiveInteger") + protected BigInteger compoundMarkID; + @XmlAttribute(name = "SeqID", required = true) + @XmlSchemaType(name = "positiveInteger") + protected BigInteger seqID; + @XmlAttribute(name = "Rounding", required = true) + protected String rounding; + @XmlAttribute(name = "ZoneSize", required = true) + @XmlSchemaType(name = "positiveInteger") + protected BigInteger zoneSize; + + /** + * Gets the value of the compoundMarkID property. + * + * @return + * possible object is + * {@link BigInteger } + * + */ + public BigInteger getCompoundMarkID() { + return compoundMarkID; + } + + /** + * Sets the value of the compoundMarkID property. + * + * @param value + * allowed object is + * {@link BigInteger } + * + */ + public void setCompoundMarkID(BigInteger value) { + this.compoundMarkID = value; + } + + /** + * Gets the value of the seqID property. + * + * @return + * possible object is + * {@link BigInteger } + * + */ + public BigInteger getSeqID() { + return seqID; + } + + /** + * Sets the value of the seqID property. + * + * @param value + * allowed object is + * {@link BigInteger } + * + */ + public void setSeqID(BigInteger value) { + this.seqID = value; + } + + /** + * Gets the value of the rounding property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getRounding() { + return rounding; + } + + /** + * Sets the value of the rounding property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setRounding(String value) { + this.rounding = value; + } + + /** + * Gets the value of the zoneSize property. + * + * @return + * possible object is + * {@link BigInteger } + * + */ + public BigInteger getZoneSize() { + return zoneSize; + } + + /** + * Sets the value of the zoneSize property. + * + * @param value + * allowed object is + * {@link BigInteger } + * + */ + public void setZoneSize(BigInteger value) { + this.zoneSize = 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="CompoundMark" maxOccurs="unbounded">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <sequence>
+     *                   <element name="Mark" maxOccurs="unbounded">
+     *                     <complexType>
+     *                       <complexContent>
+     *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                           <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                           <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                           <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                           <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                           <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                         </restriction>
+     *                       </complexContent>
+     *                     </complexType>
+     *                   </element>
+     *                 </sequence>
+     *                 <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "compoundMark" + }) + public static class Course { + + @XmlElement(name = "CompoundMark", required = true) + protected List compoundMark; + + /** + * Gets the value of the compoundMark property. + * + *

+ * 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 compoundMark property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getCompoundMark().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Race.Course.CompoundMark } + * + * + */ + public List getCompoundMark() { + if (compoundMark == null) { + compoundMark = new ArrayList(); + } + return this.compoundMark; + } + + + /** + *

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="Mark" maxOccurs="unbounded">
+         *           <complexType>
+         *             <complexContent>
+         *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                 <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *                 <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *                 <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *                 <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *                 <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *               </restriction>
+         *             </complexContent>
+         *           </complexType>
+         *         </element>
+         *       </sequence>
+         *       <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
+         * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "mark" + }) + public static class CompoundMark { + + @XmlElement(name = "Mark", required = true) + protected List mark; + @XmlAttribute(name = "CompoundMarkID", required = true) + protected String compoundMarkID; + @XmlAttribute(name = "Name", required = true) + protected String name; + + /** + * Gets the value of the mark property. + * + *

+ * 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 mark property. + * + *

+ * For example, to add a new item, do as follows: + *

+             *    getMark().add(newItem);
+             * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Race.Course.CompoundMark.Mark } + * + * + */ + public List getMark() { + if (mark == null) { + mark = new ArrayList(); + } + return this.mark; + } + + /** + * Gets the value of the compoundMarkID property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCompoundMarkID() { + return compoundMarkID; + } + + /** + * Sets the value of the compoundMarkID property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCompoundMarkID(String value) { + this.compoundMarkID = value; + } + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = 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">
+             *       <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
+             *       <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+             *       <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+             *       <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+             *       <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+             *     </restriction>
+             *   </complexContent>
+             * </complexType>
+             * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class Mark { + + @XmlAttribute(name = "SeqId") + protected String seqId; + @XmlAttribute(name = "Name", required = true) + protected String name; + @XmlAttribute(name = "TargetLat", required = true) + protected String targetLat; + @XmlAttribute(name = "TargetLng", required = true) + protected String targetLng; + @XmlAttribute(name = "SourceID", required = true) + protected String sourceID; + + /** + * Gets the value of the seqId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSeqId() { + return seqId; + } + + /** + * Sets the value of the seqId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSeqId(String value) { + this.seqId = value; + } + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the targetLat property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTargetLat() { + return targetLat; + } + + /** + * Sets the value of the targetLat property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTargetLat(String value) { + this.targetLat = value; + } + + /** + * Gets the value of the targetLng property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTargetLng() { + return targetLng; + } + + /** + * Sets the value of the targetLng property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTargetLng(String value) { + this.targetLng = value; + } + + /** + * Gets the value of the sourceID property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSourceID() { + return sourceID; + } + + /** + * Sets the value of the sourceID property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSourceID(String value) { + this.sourceID = 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="Limit" maxOccurs="unbounded">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "limit" + }) + public static class CourseLimit { + + @XmlElement(name = "Limit", required = true) + protected List limit; + + /** + * Gets the value of the limit property. + * + *

+ * 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 limit property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getLimit().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Race.CourseLimit.Limit } + * + * + */ + public List getLimit() { + if (limit == null) { + limit = new ArrayList(); + } + return this.limit; + } + + + /** + *

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">
+         *       <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
+         * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class Limit { + + @XmlAttribute(name = "Lat", required = true) + protected String lat; + @XmlAttribute(name = "Lon", required = true) + protected String lon; + @XmlAttribute(name = "SeqID", required = true) + protected String seqID; + + /** + * Gets the value of the lat property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLat() { + return lat; + } + + /** + * Sets the value of the lat property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLat(String value) { + this.lat = value; + } + + /** + * Gets the value of the lon property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLon() { + return lon; + } + + /** + * Sets the value of the lon property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLon(String value) { + this.lon = value; + } + + /** + * Gets the value of the seqID property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSeqID() { + return seqID; + } + + /** + * Sets the value of the seqID property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSeqID(String value) { + this.seqID = 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="Yacht" maxOccurs="unbounded">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 <attribute name="Entry" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "yacht" + }) + public static class Participants { + + @XmlElement(name = "Yacht", required = true) + protected List yacht; + + /** + * Gets the value of the yacht property. + * + *

+ * 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 yacht property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getYacht().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Race.Participants.Yacht } + * + * + */ + public List getYacht() { + if (yacht == null) { + yacht = new ArrayList(); + } + return this.yacht; + } + + + /** + *

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">
+         *       <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       <attribute name="Entry" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
+         * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class Yacht { + + @XmlAttribute(name = "SourceID", required = true) + protected String sourceID; + @XmlAttribute(name = "Entry") + protected String entry; + + /** + * Gets the value of the sourceID property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSourceID() { + return sourceID; + } + + /** + * Sets the value of the sourceID property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSourceID(String value) { + this.sourceID = value; + } + + /** + * Gets the value of the entry property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getEntry() { + return entry; + } + + /** + * Sets the value of the entry property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setEntry(String value) { + this.entry = 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">
+     *       <attribute name="Postpone" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       <attribute name="Time" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class RaceStartTime { + + @XmlAttribute(name = "Postpone", required = true) + protected String postpone; + @XmlAttribute(name = "Time", required = true) + protected String time; + + /** + * Gets the value of the postpone property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getPostpone() { + return postpone; + } + + /** + * Sets the value of the postpone property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setPostpone(String value) { + this.postpone = value; + } + + /** + * Gets the value of the time property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTime() { + return time; + } + + /** + * Sets the value of the time property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTime(String value) { + this.time = value; + } + + } + +} diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/scd/ObjectFactory.java b/racevisionGame/src/main/resources/mock/mockXML/schema/scd/ObjectFactory.java new file mode 100644 index 00000000..2a57580d --- /dev/null +++ b/racevisionGame/src/main/resources/mock/mockXML/schema/scd/ObjectFactory.java @@ -0,0 +1,127 @@ +// +// 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.08.13 at 10:39:29 PM NZST +// + + +package scd; + +import javax.xml.bind.annotation.XmlRegistry; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the scd 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: scd + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link Race } + * + */ + public Race createRace() { + return new Race(); + } + + /** + * Create an instance of {@link Race.CourseLimit } + * + */ + public Race.CourseLimit createRaceCourseLimit() { + return new Race.CourseLimit(); + } + + /** + * Create an instance of {@link Race.Course } + * + */ + public Race.Course createRaceCourse() { + return new Race.Course(); + } + + /** + * Create an instance of {@link Race.Course.CompoundMark } + * + */ + public Race.Course.CompoundMark createRaceCourseCompoundMark() { + return new Race.Course.CompoundMark(); + } + + /** + * Create an instance of {@link Race.CompoundMarkSequence } + * + */ + public Race.CompoundMarkSequence createRaceCompoundMarkSequence() { + return new Race.CompoundMarkSequence(); + } + + /** + * Create an instance of {@link Race.Participants } + * + */ + public Race.Participants createRaceParticipants() { + return new Race.Participants(); + } + + /** + * Create an instance of {@link Race.RaceStartTime } + * + */ + public Race.RaceStartTime createRaceRaceStartTime() { + return new Race.RaceStartTime(); + } + + /** + * Create an instance of {@link Race.CourseLimit.Limit } + * + */ + public Race.CourseLimit.Limit createRaceCourseLimitLimit() { + return new Race.CourseLimit.Limit(); + } + + /** + * Create an instance of {@link Race.Course.CompoundMark.Mark } + * + */ + public Race.Course.CompoundMark.Mark createRaceCourseCompoundMarkMark() { + return new Race.Course.CompoundMark.Mark(); + } + + /** + * Create an instance of {@link Race.CompoundMarkSequence.Corner } + * + */ + public Race.CompoundMarkSequence.Corner createRaceCompoundMarkSequenceCorner() { + return new Race.CompoundMarkSequence.Corner(); + } + + /** + * Create an instance of {@link Race.Participants.Yacht } + * + */ + public Race.Participants.Yacht createRaceParticipantsYacht() { + return new Race.Participants.Yacht(); + } + +} diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/scd/Race.java b/racevisionGame/src/main/resources/mock/mockXML/schema/scd/Race.java new file mode 100644 index 00000000..77b991a7 --- /dev/null +++ b/racevisionGame/src/main/resources/mock/mockXML/schema/scd/Race.java @@ -0,0 +1,1351 @@ +// +// 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.08.13 at 10:39:29 PM NZST +// + + +package scd; + +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlSchemaType; +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="RaceID" type="{http://www.w3.org/2001/XMLSchema}positiveInteger"/>
+ *         <element name="RaceType" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="CreationTimeDate" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="RaceStartTime">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <attribute name="Postpone" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 <attribute name="Time" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="Participants">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="Yacht" maxOccurs="unbounded">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="Entry" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="CompoundMarkSequence">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="Corner" maxOccurs="unbounded">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ *                           <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ *                           <attribute name="Rounding" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="ZoneSize" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="Course">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="CompoundMark" maxOccurs="unbounded">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <sequence>
+ *                             <element name="Mark" maxOccurs="unbounded">
+ *                               <complexType>
+ *                                 <complexContent>
+ *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                     <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                     <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                     <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                     <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                     <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                   </restriction>
+ *                                 </complexContent>
+ *                               </complexType>
+ *                             </element>
+ *                           </sequence>
+ *                           <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="CourseLimit">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="Limit" maxOccurs="unbounded">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="SeqID" use="required" 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 = { + "raceID", + "raceType", + "creationTimeDate", + "raceStartTime", + "participants", + "compoundMarkSequence", + "course", + "courseLimit" +}) +@XmlRootElement(name = "Race") +public class Race { + + @XmlElement(name = "RaceID", required = true) + @XmlSchemaType(name = "positiveInteger") + protected BigInteger raceID; + @XmlElement(name = "RaceType", required = true) + protected String raceType; + @XmlElement(name = "CreationTimeDate", required = true) + protected String creationTimeDate; + @XmlElement(name = "RaceStartTime", required = true) + protected Race.RaceStartTime raceStartTime; + @XmlElement(name = "Participants", required = true) + protected Race.Participants participants; + @XmlElement(name = "CompoundMarkSequence", required = true) + protected Race.CompoundMarkSequence compoundMarkSequence; + @XmlElement(name = "Course", required = true) + protected Race.Course course; + @XmlElement(name = "CourseLimit", required = true) + protected Race.CourseLimit courseLimit; + + /** + * Gets the value of the raceID property. + * + * @return + * possible object is + * {@link BigInteger } + * + */ + public BigInteger getRaceID() { + return raceID; + } + + /** + * Sets the value of the raceID property. + * + * @param value + * allowed object is + * {@link BigInteger } + * + */ + public void setRaceID(BigInteger value) { + this.raceID = value; + } + + /** + * Gets the value of the raceType property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getRaceType() { + return raceType; + } + + /** + * Sets the value of the raceType property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setRaceType(String value) { + this.raceType = value; + } + + /** + * Gets the value of the creationTimeDate property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCreationTimeDate() { + return creationTimeDate; + } + + /** + * Sets the value of the creationTimeDate property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCreationTimeDate(String value) { + this.creationTimeDate = value; + } + + /** + * Gets the value of the raceStartTime property. + * + * @return + * possible object is + * {@link Race.RaceStartTime } + * + */ + public Race.RaceStartTime getRaceStartTime() { + return raceStartTime; + } + + /** + * Sets the value of the raceStartTime property. + * + * @param value + * allowed object is + * {@link Race.RaceStartTime } + * + */ + public void setRaceStartTime(Race.RaceStartTime value) { + this.raceStartTime = value; + } + + /** + * Gets the value of the participants property. + * + * @return + * possible object is + * {@link Race.Participants } + * + */ + public Race.Participants getParticipants() { + return participants; + } + + /** + * Sets the value of the participants property. + * + * @param value + * allowed object is + * {@link Race.Participants } + * + */ + public void setParticipants(Race.Participants value) { + this.participants = value; + } + + /** + * Gets the value of the compoundMarkSequence property. + * + * @return + * possible object is + * {@link Race.CompoundMarkSequence } + * + */ + public Race.CompoundMarkSequence getCompoundMarkSequence() { + return compoundMarkSequence; + } + + /** + * Sets the value of the compoundMarkSequence property. + * + * @param value + * allowed object is + * {@link Race.CompoundMarkSequence } + * + */ + public void setCompoundMarkSequence(Race.CompoundMarkSequence value) { + this.compoundMarkSequence = value; + } + + /** + * Gets the value of the course property. + * + * @return + * possible object is + * {@link Race.Course } + * + */ + public Race.Course getCourse() { + return course; + } + + /** + * Sets the value of the course property. + * + * @param value + * allowed object is + * {@link Race.Course } + * + */ + public void setCourse(Race.Course value) { + this.course = value; + } + + /** + * Gets the value of the courseLimit property. + * + * @return + * possible object is + * {@link Race.CourseLimit } + * + */ + public Race.CourseLimit getCourseLimit() { + return courseLimit; + } + + /** + * Sets the value of the courseLimit property. + * + * @param value + * allowed object is + * {@link Race.CourseLimit } + * + */ + public void setCourseLimit(Race.CourseLimit value) { + this.courseLimit = 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="Corner" maxOccurs="unbounded">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+     *                 <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+     *                 <attribute name="Rounding" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 <attribute name="ZoneSize" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "corner" + }) + public static class CompoundMarkSequence { + + @XmlElement(name = "Corner", required = true) + protected List corner; + + /** + * Gets the value of the corner property. + * + *

+ * 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 corner property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getCorner().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Race.CompoundMarkSequence.Corner } + * + * + */ + public List getCorner() { + if (corner == null) { + corner = new ArrayList(); + } + return this.corner; + } + + + /** + *

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">
+         *       <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+         *       <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+         *       <attribute name="Rounding" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       <attribute name="ZoneSize" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
+         * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class Corner { + + @XmlAttribute(name = "CompoundMarkID", required = true) + @XmlSchemaType(name = "positiveInteger") + protected BigInteger compoundMarkID; + @XmlAttribute(name = "SeqID", required = true) + @XmlSchemaType(name = "positiveInteger") + protected BigInteger seqID; + @XmlAttribute(name = "Rounding", required = true) + protected String rounding; + @XmlAttribute(name = "ZoneSize", required = true) + @XmlSchemaType(name = "positiveInteger") + protected BigInteger zoneSize; + + /** + * Gets the value of the compoundMarkID property. + * + * @return + * possible object is + * {@link BigInteger } + * + */ + public BigInteger getCompoundMarkID() { + return compoundMarkID; + } + + /** + * Sets the value of the compoundMarkID property. + * + * @param value + * allowed object is + * {@link BigInteger } + * + */ + public void setCompoundMarkID(BigInteger value) { + this.compoundMarkID = value; + } + + /** + * Gets the value of the seqID property. + * + * @return + * possible object is + * {@link BigInteger } + * + */ + public BigInteger getSeqID() { + return seqID; + } + + /** + * Sets the value of the seqID property. + * + * @param value + * allowed object is + * {@link BigInteger } + * + */ + public void setSeqID(BigInteger value) { + this.seqID = value; + } + + /** + * Gets the value of the rounding property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getRounding() { + return rounding; + } + + /** + * Sets the value of the rounding property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setRounding(String value) { + this.rounding = value; + } + + /** + * Gets the value of the zoneSize property. + * + * @return + * possible object is + * {@link BigInteger } + * + */ + public BigInteger getZoneSize() { + return zoneSize; + } + + /** + * Sets the value of the zoneSize property. + * + * @param value + * allowed object is + * {@link BigInteger } + * + */ + public void setZoneSize(BigInteger value) { + this.zoneSize = 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="CompoundMark" maxOccurs="unbounded">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <sequence>
+     *                   <element name="Mark" maxOccurs="unbounded">
+     *                     <complexType>
+     *                       <complexContent>
+     *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                           <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                           <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                           <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                           <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                           <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                         </restriction>
+     *                       </complexContent>
+     *                     </complexType>
+     *                   </element>
+     *                 </sequence>
+     *                 <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "compoundMark" + }) + public static class Course { + + @XmlElement(name = "CompoundMark", required = true) + protected List compoundMark; + + /** + * Gets the value of the compoundMark property. + * + *

+ * 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 compoundMark property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getCompoundMark().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Race.Course.CompoundMark } + * + * + */ + public List getCompoundMark() { + if (compoundMark == null) { + compoundMark = new ArrayList(); + } + return this.compoundMark; + } + + + /** + *

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="Mark" maxOccurs="unbounded">
+         *           <complexType>
+         *             <complexContent>
+         *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                 <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *                 <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *                 <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *                 <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *                 <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *               </restriction>
+         *             </complexContent>
+         *           </complexType>
+         *         </element>
+         *       </sequence>
+         *       <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
+         * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "mark" + }) + public static class CompoundMark { + + @XmlElement(name = "Mark", required = true) + protected List mark; + @XmlAttribute(name = "CompoundMarkID", required = true) + protected String compoundMarkID; + @XmlAttribute(name = "Name", required = true) + protected String name; + + /** + * Gets the value of the mark property. + * + *

+ * 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 mark property. + * + *

+ * For example, to add a new item, do as follows: + *

+             *    getMark().add(newItem);
+             * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Race.Course.CompoundMark.Mark } + * + * + */ + public List getMark() { + if (mark == null) { + mark = new ArrayList(); + } + return this.mark; + } + + /** + * Gets the value of the compoundMarkID property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCompoundMarkID() { + return compoundMarkID; + } + + /** + * Sets the value of the compoundMarkID property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCompoundMarkID(String value) { + this.compoundMarkID = value; + } + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = 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">
+             *       <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
+             *       <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+             *       <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+             *       <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+             *       <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+             *     </restriction>
+             *   </complexContent>
+             * </complexType>
+             * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class Mark { + + @XmlAttribute(name = "SeqId") + protected String seqId; + @XmlAttribute(name = "Name", required = true) + protected String name; + @XmlAttribute(name = "TargetLat", required = true) + protected String targetLat; + @XmlAttribute(name = "TargetLng", required = true) + protected String targetLng; + @XmlAttribute(name = "SourceID", required = true) + protected String sourceID; + + /** + * Gets the value of the seqId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSeqId() { + return seqId; + } + + /** + * Sets the value of the seqId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSeqId(String value) { + this.seqId = value; + } + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the targetLat property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTargetLat() { + return targetLat; + } + + /** + * Sets the value of the targetLat property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTargetLat(String value) { + this.targetLat = value; + } + + /** + * Gets the value of the targetLng property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTargetLng() { + return targetLng; + } + + /** + * Sets the value of the targetLng property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTargetLng(String value) { + this.targetLng = value; + } + + /** + * Gets the value of the sourceID property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSourceID() { + return sourceID; + } + + /** + * Sets the value of the sourceID property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSourceID(String value) { + this.sourceID = 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="Limit" maxOccurs="unbounded">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "limit" + }) + public static class CourseLimit { + + @XmlElement(name = "Limit", required = true) + protected List limit; + + /** + * Gets the value of the limit property. + * + *

+ * 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 limit property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getLimit().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Race.CourseLimit.Limit } + * + * + */ + public List getLimit() { + if (limit == null) { + limit = new ArrayList(); + } + return this.limit; + } + + + /** + *

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">
+         *       <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
+         * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class Limit { + + @XmlAttribute(name = "Lat", required = true) + protected String lat; + @XmlAttribute(name = "Lon", required = true) + protected String lon; + @XmlAttribute(name = "SeqID", required = true) + protected String seqID; + + /** + * Gets the value of the lat property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLat() { + return lat; + } + + /** + * Sets the value of the lat property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLat(String value) { + this.lat = value; + } + + /** + * Gets the value of the lon property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLon() { + return lon; + } + + /** + * Sets the value of the lon property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLon(String value) { + this.lon = value; + } + + /** + * Gets the value of the seqID property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSeqID() { + return seqID; + } + + /** + * Sets the value of the seqID property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSeqID(String value) { + this.seqID = 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="Yacht" maxOccurs="unbounded">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 <attribute name="Entry" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "yacht" + }) + public static class Participants { + + @XmlElement(name = "Yacht", required = true) + protected List yacht; + + /** + * Gets the value of the yacht property. + * + *

+ * 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 yacht property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getYacht().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Race.Participants.Yacht } + * + * + */ + public List getYacht() { + if (yacht == null) { + yacht = new ArrayList(); + } + return this.yacht; + } + + + /** + *

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">
+         *       <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       <attribute name="Entry" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
+         * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class Yacht { + + @XmlAttribute(name = "SourceID", required = true) + protected String sourceID; + @XmlAttribute(name = "Entry") + protected String entry; + + /** + * Gets the value of the sourceID property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSourceID() { + return sourceID; + } + + /** + * Sets the value of the sourceID property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSourceID(String value) { + this.sourceID = value; + } + + /** + * Gets the value of the entry property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getEntry() { + return entry; + } + + /** + * Sets the value of the entry property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setEntry(String value) { + this.entry = 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">
+     *       <attribute name="Postpone" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       <attribute name="Time" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class RaceStartTime { + + @XmlAttribute(name = "Postpone", required = true) + protected String postpone; + @XmlAttribute(name = "Time", required = true) + protected String time; + + /** + * Gets the value of the postpone property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getPostpone() { + return postpone; + } + + /** + * Sets the value of the postpone property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setPostpone(String value) { + this.postpone = value; + } + + /** + * Gets the value of the time property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTime() { + return time; + } + + /** + * Sets the value of the time property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTime(String value) { + this.time = value; + } + + } + +} diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/schema/CompoundMark.java b/racevisionGame/src/main/resources/mock/mockXML/schema/schema/CompoundMark.java new file mode 100644 index 00000000..965d79b6 --- /dev/null +++ b/racevisionGame/src/main/resources/mock/mockXML/schema/schema/CompoundMark.java @@ -0,0 +1,143 @@ +// +// 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.08.13 at 11:01:23 PM NZST +// + + +package schema; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +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="Mark" maxOccurs="unbounded">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *       <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "mark" +}) +public class CompoundMark { + + @XmlElement(name = "Mark", required = true) + protected List mark; + @XmlAttribute(name = "CompoundMarkID", required = true) + protected String compoundMarkID; + @XmlAttribute(name = "Name", required = true) + protected String name; + + /** + * Gets the value of the mark property. + * + *

+ * 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 mark property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getMark().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Mark } + * + * + */ + public List getMark() { + if (mark == null) { + mark = new ArrayList(); + } + return this.mark; + } + + /** + * Gets the value of the compoundMarkID property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCompoundMarkID() { + return compoundMarkID; + } + + /** + * Sets the value of the compoundMarkID property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCompoundMarkID(String value) { + this.compoundMarkID = value; + } + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + +} diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/schema/CompoundMarkSequence.java b/racevisionGame/src/main/resources/mock/mockXML/schema/schema/CompoundMarkSequence.java new file mode 100644 index 00000000..6a4edc52 --- /dev/null +++ b/racevisionGame/src/main/resources/mock/mockXML/schema/schema/CompoundMarkSequence.java @@ -0,0 +1,87 @@ +// +// 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.08.13 at 11:01:23 PM NZST +// + + +package schema; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +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="Corner" maxOccurs="unbounded">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ *                 <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ *                 <attribute name="Rounding" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 <attribute name="ZoneSize" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "corner" +}) +public class CompoundMarkSequence { + + @XmlElement(name = "Corner", required = true) + protected List corner; + + /** + * Gets the value of the corner property. + * + *

+ * 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 corner property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getCorner().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Corner } + * + * + */ + public List getCorner() { + if (corner == null) { + corner = new ArrayList(); + } + return this.corner; + } + +} diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/schema/Corner.java b/racevisionGame/src/main/resources/mock/mockXML/schema/schema/Corner.java new file mode 100644 index 00000000..467e9ae6 --- /dev/null +++ b/racevisionGame/src/main/resources/mock/mockXML/schema/schema/Corner.java @@ -0,0 +1,151 @@ +// +// 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.08.13 at 11:01:23 PM NZST +// + + +package schema; + +import java.math.BigInteger; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +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">
+ *       <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ *       <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ *       <attribute name="Rounding" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="ZoneSize" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +public class Corner { + + @XmlAttribute(name = "CompoundMarkID", required = true) + @XmlSchemaType(name = "positiveInteger") + protected BigInteger compoundMarkID; + @XmlAttribute(name = "SeqID", required = true) + @XmlSchemaType(name = "positiveInteger") + protected BigInteger seqID; + @XmlAttribute(name = "Rounding", required = true) + protected String rounding; + @XmlAttribute(name = "ZoneSize", required = true) + @XmlSchemaType(name = "positiveInteger") + protected BigInteger zoneSize; + + /** + * Gets the value of the compoundMarkID property. + * + * @return + * possible object is + * {@link BigInteger } + * + */ + public BigInteger getCompoundMarkID() { + return compoundMarkID; + } + + /** + * Sets the value of the compoundMarkID property. + * + * @param value + * allowed object is + * {@link BigInteger } + * + */ + public void setCompoundMarkID(BigInteger value) { + this.compoundMarkID = value; + } + + /** + * Gets the value of the seqID property. + * + * @return + * possible object is + * {@link BigInteger } + * + */ + public BigInteger getSeqID() { + return seqID; + } + + /** + * Sets the value of the seqID property. + * + * @param value + * allowed object is + * {@link BigInteger } + * + */ + public void setSeqID(BigInteger value) { + this.seqID = value; + } + + /** + * Gets the value of the rounding property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getRounding() { + return rounding; + } + + /** + * Sets the value of the rounding property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setRounding(String value) { + this.rounding = value; + } + + /** + * Gets the value of the zoneSize property. + * + * @return + * possible object is + * {@link BigInteger } + * + */ + public BigInteger getZoneSize() { + return zoneSize; + } + + /** + * Sets the value of the zoneSize property. + * + * @param value + * allowed object is + * {@link BigInteger } + * + */ + public void setZoneSize(BigInteger value) { + this.zoneSize = value; + } + +} diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/schema/Course.java b/racevisionGame/src/main/resources/mock/mockXML/schema/schema/Course.java new file mode 100644 index 00000000..5c135655 --- /dev/null +++ b/racevisionGame/src/main/resources/mock/mockXML/schema/schema/Course.java @@ -0,0 +1,100 @@ +// +// 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.08.13 at 11:01:23 PM NZST +// + + +package schema; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +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="CompoundMark" maxOccurs="unbounded">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="Mark" maxOccurs="unbounded">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *                 <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "compoundMark" +}) +public class Course { + + @XmlElement(name = "CompoundMark", required = true) + protected List compoundMark; + + /** + * Gets the value of the compoundMark property. + * + *

+ * 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 compoundMark property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getCompoundMark().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link CompoundMark } + * + * + */ + public List getCompoundMark() { + if (compoundMark == null) { + compoundMark = new ArrayList(); + } + return this.compoundMark; + } + +} diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/schema/CourseLimit.java b/racevisionGame/src/main/resources/mock/mockXML/schema/schema/CourseLimit.java new file mode 100644 index 00000000..2b9c39c8 --- /dev/null +++ b/racevisionGame/src/main/resources/mock/mockXML/schema/schema/CourseLimit.java @@ -0,0 +1,86 @@ +// +// 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.08.13 at 11:01:23 PM NZST +// + + +package schema; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +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="Limit" maxOccurs="unbounded">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "limit" +}) +public class CourseLimit { + + @XmlElement(name = "Limit", required = true) + protected List limit; + + /** + * Gets the value of the limit property. + * + *

+ * 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 limit property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getLimit().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Limit } + * + * + */ + public List getLimit() { + if (limit == null) { + limit = new ArrayList(); + } + return this.limit; + } + +} diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/schema/Limit.java b/racevisionGame/src/main/resources/mock/mockXML/schema/schema/Limit.java new file mode 100644 index 00000000..8abda089 --- /dev/null +++ b/racevisionGame/src/main/resources/mock/mockXML/schema/schema/Limit.java @@ -0,0 +1,119 @@ +// +// 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.08.13 at 11:01:23 PM NZST +// + + +package schema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +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">
+ *       <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +public class Limit { + + @XmlAttribute(name = "Lat", required = true) + protected String lat; + @XmlAttribute(name = "Lon", required = true) + protected String lon; + @XmlAttribute(name = "SeqID", required = true) + protected String seqID; + + /** + * Gets the value of the lat property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLat() { + return lat; + } + + /** + * Sets the value of the lat property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLat(String value) { + this.lat = value; + } + + /** + * Gets the value of the lon property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLon() { + return lon; + } + + /** + * Sets the value of the lon property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLon(String value) { + this.lon = value; + } + + /** + * Gets the value of the seqID property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSeqID() { + return seqID; + } + + /** + * Sets the value of the seqID property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSeqID(String value) { + this.seqID = value; + } + +} diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/schema/Mark.java b/racevisionGame/src/main/resources/mock/mockXML/schema/schema/Mark.java new file mode 100644 index 00000000..ef4d4e1e --- /dev/null +++ b/racevisionGame/src/main/resources/mock/mockXML/schema/schema/Mark.java @@ -0,0 +1,173 @@ +// +// 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.08.13 at 11:01:23 PM NZST +// + + +package schema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +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">
+ *       <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +public class Mark { + + @XmlAttribute(name = "SeqId") + protected String seqId; + @XmlAttribute(name = "Name", required = true) + protected String name; + @XmlAttribute(name = "TargetLat", required = true) + protected String targetLat; + @XmlAttribute(name = "TargetLng", required = true) + protected String targetLng; + @XmlAttribute(name = "SourceID", required = true) + protected String sourceID; + + /** + * Gets the value of the seqId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSeqId() { + return seqId; + } + + /** + * Sets the value of the seqId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSeqId(String value) { + this.seqId = value; + } + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the targetLat property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTargetLat() { + return targetLat; + } + + /** + * Sets the value of the targetLat property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTargetLat(String value) { + this.targetLat = value; + } + + /** + * Gets the value of the targetLng property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTargetLng() { + return targetLng; + } + + /** + * Sets the value of the targetLng property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTargetLng(String value) { + this.targetLng = value; + } + + /** + * Gets the value of the sourceID property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSourceID() { + return sourceID; + } + + /** + * Sets the value of the sourceID property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSourceID(String value) { + this.sourceID = value; + } + +} diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/schema/ObjectFactory.java b/racevisionGame/src/main/resources/mock/mockXML/schema/schema/ObjectFactory.java new file mode 100644 index 00000000..eb4b55e9 --- /dev/null +++ b/racevisionGame/src/main/resources/mock/mockXML/schema/schema/ObjectFactory.java @@ -0,0 +1,127 @@ +// +// 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.08.13 at 11:01:23 PM NZST +// + + +package schema; + +import javax.xml.bind.annotation.XmlRegistry; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the schema 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: schema + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link Race } + * + */ + public Race createRace() { + return new Race(); + } + + /** + * Create an instance of {@link RaceStartTime } + * + */ + public RaceStartTime createRaceStartTime() { + return new RaceStartTime(); + } + + /** + * Create an instance of {@link Participants } + * + */ + public Participants createParticipants() { + return new Participants(); + } + + /** + * Create an instance of {@link CompoundMarkSequence } + * + */ + public CompoundMarkSequence createCompoundMarkSequence() { + return new CompoundMarkSequence(); + } + + /** + * Create an instance of {@link Course } + * + */ + public Course createCourse() { + return new Course(); + } + + /** + * Create an instance of {@link CourseLimit } + * + */ + public CourseLimit createCourseLimit() { + return new CourseLimit(); + } + + /** + * Create an instance of {@link Limit } + * + */ + public Limit createLimit() { + return new Limit(); + } + + /** + * Create an instance of {@link CompoundMark } + * + */ + public CompoundMark createCompoundMark() { + return new CompoundMark(); + } + + /** + * Create an instance of {@link Mark } + * + */ + public Mark createMark() { + return new Mark(); + } + + /** + * Create an instance of {@link Corner } + * + */ + public Corner createCorner() { + return new Corner(); + } + + /** + * Create an instance of {@link Yacht } + * + */ + public Yacht createYacht() { + return new Yacht(); + } + +} diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/schema/Participants.java b/racevisionGame/src/main/resources/mock/mockXML/schema/schema/Participants.java new file mode 100644 index 00000000..b2dcb7d6 --- /dev/null +++ b/racevisionGame/src/main/resources/mock/mockXML/schema/schema/Participants.java @@ -0,0 +1,85 @@ +// +// 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.08.13 at 11:01:23 PM NZST +// + + +package schema; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +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="Yacht" maxOccurs="unbounded">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 <attribute name="Entry" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "yacht" +}) +public class Participants { + + @XmlElement(name = "Yacht", required = true) + protected List yacht; + + /** + * Gets the value of the yacht property. + * + *

+ * 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 yacht property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getYacht().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Yacht } + * + * + */ + public List getYacht() { + if (yacht == null) { + yacht = new ArrayList(); + } + return this.yacht; + } + +} diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/schema/Race.java b/racevisionGame/src/main/resources/mock/mockXML/schema/schema/Race.java new file mode 100644 index 00000000..1ae28e9d --- /dev/null +++ b/racevisionGame/src/main/resources/mock/mockXML/schema/schema/Race.java @@ -0,0 +1,373 @@ +// +// 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.08.13 at 11:01:23 PM NZST +// + + +package schema; + +import java.math.BigInteger; +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.XmlSchemaType; +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="RaceID" type="{http://www.w3.org/2001/XMLSchema}positiveInteger"/>
+ *         <element name="RaceType" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="CreationTimeDate" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="RaceStartTime">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <attribute name="Postpone" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 <attribute name="Time" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="Participants">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="Yacht" maxOccurs="unbounded">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="Entry" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="CompoundMarkSequence">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="Corner" maxOccurs="unbounded">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ *                           <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ *                           <attribute name="Rounding" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="ZoneSize" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="Course">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="CompoundMark" maxOccurs="unbounded">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <sequence>
+ *                             <element name="Mark" maxOccurs="unbounded">
+ *                               <complexType>
+ *                                 <complexContent>
+ *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                     <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                     <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                     <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                     <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                     <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                   </restriction>
+ *                                 </complexContent>
+ *                               </complexType>
+ *                             </element>
+ *                           </sequence>
+ *                           <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="CourseLimit">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="Limit" maxOccurs="unbounded">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="SeqID" use="required" 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 = { + "raceID", + "raceType", + "creationTimeDate", + "raceStartTime", + "participants", + "compoundMarkSequence", + "course", + "courseLimit" +}) +@XmlRootElement(name = "Race") +public class Race { + + @XmlElement(name = "RaceID", required = true) + @XmlSchemaType(name = "positiveInteger") + protected BigInteger raceID; + @XmlElement(name = "RaceType", required = true) + protected String raceType; + @XmlElement(name = "CreationTimeDate", required = true) + protected String creationTimeDate; + @XmlElement(name = "RaceStartTime", required = true) + protected RaceStartTime raceStartTime; + @XmlElement(name = "Participants", required = true) + protected Participants participants; + @XmlElement(name = "CompoundMarkSequence", required = true) + protected CompoundMarkSequence compoundMarkSequence; + @XmlElement(name = "Course", required = true) + protected Course course; + @XmlElement(name = "CourseLimit", required = true) + protected CourseLimit courseLimit; + + /** + * Gets the value of the raceID property. + * + * @return + * possible object is + * {@link BigInteger } + * + */ + public BigInteger getRaceID() { + return raceID; + } + + /** + * Sets the value of the raceID property. + * + * @param value + * allowed object is + * {@link BigInteger } + * + */ + public void setRaceID(BigInteger value) { + this.raceID = value; + } + + /** + * Gets the value of the raceType property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getRaceType() { + return raceType; + } + + /** + * Sets the value of the raceType property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setRaceType(String value) { + this.raceType = value; + } + + /** + * Gets the value of the creationTimeDate property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCreationTimeDate() { + return creationTimeDate; + } + + /** + * Sets the value of the creationTimeDate property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCreationTimeDate(String value) { + this.creationTimeDate = value; + } + + /** + * Gets the value of the raceStartTime property. + * + * @return + * possible object is + * {@link RaceStartTime } + * + */ + public RaceStartTime getRaceStartTime() { + return raceStartTime; + } + + /** + * Sets the value of the raceStartTime property. + * + * @param value + * allowed object is + * {@link RaceStartTime } + * + */ + public void setRaceStartTime(RaceStartTime value) { + this.raceStartTime = value; + } + + /** + * Gets the value of the participants property. + * + * @return + * possible object is + * {@link Participants } + * + */ + public Participants getParticipants() { + return participants; + } + + /** + * Sets the value of the participants property. + * + * @param value + * allowed object is + * {@link Participants } + * + */ + public void setParticipants(Participants value) { + this.participants = value; + } + + /** + * Gets the value of the compoundMarkSequence property. + * + * @return + * possible object is + * {@link CompoundMarkSequence } + * + */ + public CompoundMarkSequence getCompoundMarkSequence() { + return compoundMarkSequence; + } + + /** + * Sets the value of the compoundMarkSequence property. + * + * @param value + * allowed object is + * {@link CompoundMarkSequence } + * + */ + public void setCompoundMarkSequence(CompoundMarkSequence value) { + this.compoundMarkSequence = value; + } + + /** + * Gets the value of the course property. + * + * @return + * possible object is + * {@link Course } + * + */ + public Course getCourse() { + return course; + } + + /** + * Sets the value of the course property. + * + * @param value + * allowed object is + * {@link Course } + * + */ + public void setCourse(Course value) { + this.course = value; + } + + /** + * Gets the value of the courseLimit property. + * + * @return + * possible object is + * {@link CourseLimit } + * + */ + public CourseLimit getCourseLimit() { + return courseLimit; + } + + /** + * Sets the value of the courseLimit property. + * + * @param value + * allowed object is + * {@link CourseLimit } + * + */ + public void setCourseLimit(CourseLimit value) { + this.courseLimit = value; + } + +} diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/schema/RaceStartTime.java b/racevisionGame/src/main/resources/mock/mockXML/schema/schema/RaceStartTime.java new file mode 100644 index 00000000..e01f3b64 --- /dev/null +++ b/racevisionGame/src/main/resources/mock/mockXML/schema/schema/RaceStartTime.java @@ -0,0 +1,92 @@ +// +// 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.08.13 at 11:01:23 PM NZST +// + + +package schema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +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">
+ *       <attribute name="Postpone" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="Time" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +public class RaceStartTime { + + @XmlAttribute(name = "Postpone", required = true) + protected String postpone; + @XmlAttribute(name = "Time", required = true) + protected String time; + + /** + * Gets the value of the postpone property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getPostpone() { + return postpone; + } + + /** + * Sets the value of the postpone property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setPostpone(String value) { + this.postpone = value; + } + + /** + * Gets the value of the time property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTime() { + return time; + } + + /** + * Sets the value of the time property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTime(String value) { + this.time = value; + } + +} diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/schema/Yacht.java b/racevisionGame/src/main/resources/mock/mockXML/schema/schema/Yacht.java new file mode 100644 index 00000000..7f8ad761 --- /dev/null +++ b/racevisionGame/src/main/resources/mock/mockXML/schema/schema/Yacht.java @@ -0,0 +1,92 @@ +// +// 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.08.13 at 11:01:23 PM NZST +// + + +package schema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +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">
+ *       <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="Entry" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +public class Yacht { + + @XmlAttribute(name = "SourceID", required = true) + protected String sourceID; + @XmlAttribute(name = "Entry") + protected String entry; + + /** + * Gets the value of the sourceID property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSourceID() { + return sourceID; + } + + /** + * Sets the value of the sourceID property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSourceID(String value) { + this.sourceID = value; + } + + /** + * Gets the value of the entry property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getEntry() { + return entry; + } + + /** + * Sets the value of the entry property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setEntry(String value) { + this.entry = value; + } + +} From b5e414f97a0b9a02dfc06b2aaceb362fadd67b28 Mon Sep 17 00:00:00 2001 From: Fan-Wu Yang Date: Mon, 14 Aug 2017 03:47:42 +1200 Subject: [PATCH 10/28] Made all the model classes extend off the schema xml classes for race, and made xml builder, validator and reader utility class. #story[1092] --- .idea/copyright/profiles_settings.xml | 3 + .../src/main/java/mock/app/Event.java | 38 +- .../src/main/java/mock/model/MockRace.java | 2 +- .../src/main/java/mock/xml/Race.java | 1351 ----------------- .../src/main/java/mock/xml/RaceFactory.java | 127 -- .../main/java/mock/xml/RaceXMLCreator.java | 154 +- .../java/shared/dataInput/RaceXMLReader.java | 4 +- .../main/java/shared/model/CompoundMark.java | 25 +- .../src/main/java/shared/model/Corner.java | 18 +- .../src/main/java/shared/model/Mark.java | 35 +- .../src/main/java/shared/model/Race.java | 4 +- .../shared/xml/Race/XMLCompoundMark.java} | 38 +- .../xml/Race/XMLCompoundMarkSequence.java} | 20 +- .../shared/xml/Race/XMLCorner.java} | 59 +- .../shared/xml/Race/XMLCourse.java} | 24 +- .../shared/xml/Race/XMLCourseLimit.java} | 20 +- .../shared/xml/Race/XMLLimit.java} | 54 +- .../shared/xml/Race/XMLMark.java} | 66 +- .../shared/xml/Race/XMLParticipants.java} | 16 +- .../shared/xml/Race/XMLRace.java} | 185 ++- .../java/shared/xml/Race/XMLRaceFactory.java | 127 ++ .../shared/xml/Race/XMLRaceStartTime.java} | 6 +- .../shared/xml/Race/XMLYacht.java} | 22 +- .../main/java/shared/xml/XMLUtilities.java | 4 +- .../Controllers/ConnectionController.java | 11 + .../Controllers/HostController.java | 9 + .../mock/mockXML/schema/bindingwp.xjb | 17 + .../schema/generated/ObjectFactory.java | 127 -- .../mock/mockXML/schema/generated/Race.java | 1351 ----------------- .../mock/mockXML/schema/raceSchema.xsd | 26 +- .../mockXML/schema/scd/ObjectFactory.java | 127 -- .../mock/mockXML/schema/scd/Race.java | 1351 ----------------- .../mockXML/schema/schema/ObjectFactory.java | 127 -- 33 files changed, 477 insertions(+), 5071 deletions(-) create mode 100644 .idea/copyright/profiles_settings.xml delete mode 100644 racevisionGame/src/main/java/mock/xml/Race.java delete mode 100644 racevisionGame/src/main/java/mock/xml/RaceFactory.java rename racevisionGame/src/main/{resources/mock/mockXML/schema/schema/CompoundMark.java => java/shared/xml/Race/XMLCompoundMark.java} (82%) rename racevisionGame/src/main/{resources/mock/mockXML/schema/schema/CompoundMarkSequence.java => java/shared/xml/Race/XMLCompoundMarkSequence.java} (85%) rename racevisionGame/src/main/{resources/mock/mockXML/schema/schema/Corner.java => java/shared/xml/Race/XMLCorner.java} (65%) rename racevisionGame/src/main/{resources/mock/mockXML/schema/schema/Course.java => java/shared/xml/Race/XMLCourse.java} (84%) rename racevisionGame/src/main/{resources/mock/mockXML/schema/schema/CourseLimit.java => java/shared/xml/Race/XMLCourseLimit.java} (85%) rename racevisionGame/src/main/{resources/mock/mockXML/schema/schema/Limit.java => java/shared/xml/Race/XMLLimit.java} (64%) rename racevisionGame/src/main/{resources/mock/mockXML/schema/schema/Mark.java => java/shared/xml/Race/XMLMark.java} (70%) rename racevisionGame/src/main/{resources/mock/mockXML/schema/schema/Participants.java => java/shared/xml/Race/XMLParticipants.java} (88%) rename racevisionGame/src/main/{resources/mock/mockXML/schema/schema/Race.java => java/shared/xml/Race/XMLRace.java} (77%) create mode 100644 racevisionGame/src/main/java/shared/xml/Race/XMLRaceFactory.java rename racevisionGame/src/main/{resources/mock/mockXML/schema/schema/RaceStartTime.java => java/shared/xml/Race/XMLRaceStartTime.java} (95%) rename racevisionGame/src/main/{resources/mock/mockXML/schema/schema/Yacht.java => java/shared/xml/Race/XMLYacht.java} (81%) create mode 100644 racevisionGame/src/main/resources/mock/mockXML/schema/bindingwp.xjb delete mode 100644 racevisionGame/src/main/resources/mock/mockXML/schema/generated/ObjectFactory.java delete mode 100644 racevisionGame/src/main/resources/mock/mockXML/schema/generated/Race.java delete mode 100644 racevisionGame/src/main/resources/mock/mockXML/schema/scd/ObjectFactory.java delete mode 100644 racevisionGame/src/main/resources/mock/mockXML/schema/scd/Race.java delete mode 100644 racevisionGame/src/main/resources/mock/mockXML/schema/schema/ObjectFactory.java diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 00000000..e7bedf33 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/racevisionGame/src/main/java/mock/app/Event.java b/racevisionGame/src/main/java/mock/app/Event.java index a7ce5099..a0208ac0 100644 --- a/racevisionGame/src/main/java/mock/app/Event.java +++ b/racevisionGame/src/main/java/mock/app/Event.java @@ -3,7 +3,6 @@ package mock.app; import mock.dataInput.PolarParser; import mock.model.MockRace; import mock.model.Polars; -import mock.xml.Race; import mock.xml.RaceXMLCreator; import network.Messages.LatestMessages; import org.xml.sax.SAXException; @@ -14,6 +13,7 @@ import shared.exceptions.InvalidRaceDataException; import shared.exceptions.InvalidRegattaDataException; import shared.exceptions.XMLReaderException; import shared.model.Constants; +import shared.xml.Race.XMLRace; import shared.xml.XMLUtilities; import javax.xml.bind.JAXBException; @@ -22,8 +22,6 @@ import javax.xml.transform.TransformerException; import java.io.*; import java.net.UnknownHostException; import java.nio.charset.StandardCharsets; -import java.time.ZonedDateTime; -import java.time.format.DateTimeFormatter; /** @@ -49,7 +47,7 @@ public class Event { private Event() { try { try { - this.raceXML = getRaceXMLAtCurrentTime(RaceXMLCreator.alterRaceToWind("mock/mockXML/raceSchemaTest.xml", 90)); + this.raceXML = RaceXMLCreator.alterRaceToWind("mock/mockXML/raceSchemaTest.xml", 90); } catch (SAXException e) { e.printStackTrace(); } catch (ParserConfigurationException e) { @@ -102,15 +100,16 @@ public class Event { sendXMLs(); //Parse the XML files into data sources. -// RaceDataSource raceDataSource = new RaceXMLReader(this.raceXML, this.xmlFileType); - Race race = (Race) XMLUtilities.xmlToClass(raceXML, + RaceDataSource raceDataSource = new RaceXMLReader(this.raceXML, this.xmlFileType); + //more work here + XMLRace race = (XMLRace) XMLUtilities.xmlToClass(raceXML, RaceXMLCreator.class.getClassLoader().getResource("mock/mockXML/schema/raceSchema.xsd"), - Race.class); + XMLRace.class); BoatDataSource boatDataSource = new BoatXMLReader(this.boatXML, this.xmlFileType); RegattaDataSource regattaDataSource = new RegattaXMLReader(this.regattaXML, this.xmlFileType); //Create and start race. - MockRace newRace = new MockRace(boatDataSource, race, regattaDataSource, this.latestMessages, this.boatPolars, Constants.RaceTimeScale); + MockRace newRace = new MockRace(boatDataSource, raceDataSource, regattaDataSource, this.latestMessages, this.boatPolars, Constants.RaceTimeScale); new Thread(newRace).start(); } @@ -127,28 +126,5 @@ public class Event { mockOutput.setBoatsXml(boatXML); } - /** - * Sets the xml description of the race to show the race was created now, and starts in 4 minutes - * @param raceXML The race.xml contents. - * @return String containing edited xml - */ - private String getRaceXMLAtCurrentTime(String raceXML) { - - //The start time is current time + 4 minutes. prestart is 3 minutes, and we add another minute. - long millisecondsToAdd = Constants.RacePreStartTime + (1 * 60 * 1000); - long secondsToAdd = millisecondsToAdd / 1000; - //Scale the time using our time scalar. - secondsToAdd = secondsToAdd / Constants.RaceTimeScale; - - DateTimeFormatter dateFormat = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssZ"); - ZonedDateTime creationTime = ZonedDateTime.now(); - raceXML = raceXML.replace("CREATION_TIME", dateFormat.format(creationTime)); - - raceXML = raceXML.replace("START_TIME", dateFormat.format(creationTime.plusSeconds(secondsToAdd))); - - return raceXML; - - } - } diff --git a/racevisionGame/src/main/java/mock/model/MockRace.java b/racevisionGame/src/main/java/mock/model/MockRace.java index 739eb29f..3f76ab94 100644 --- a/racevisionGame/src/main/java/mock/model/MockRace.java +++ b/racevisionGame/src/main/java/mock/model/MockRace.java @@ -90,7 +90,7 @@ public class MockRace extends Race { * @param polars The polars table to be used for boat simulation. * @param timeScale The timeScale for the race. See {@link Constants#RaceTimeScale}. */ - public MockRace(BoatDataSource boatDataSource, mock.xml.Race raceDataSource, RegattaDataSource regattaDataSource, LatestMessages latestMessages, Polars polars, int timeScale) { + public MockRace(BoatDataSource boatDataSource, RaceDataSource raceDataSource, RegattaDataSource regattaDataSource, LatestMessages latestMessages, Polars polars, int timeScale) { super(boatDataSource, raceDataSource, regattaDataSource, latestMessages); diff --git a/racevisionGame/src/main/java/mock/xml/Race.java b/racevisionGame/src/main/java/mock/xml/Race.java deleted file mode 100644 index 0b32bd09..00000000 --- a/racevisionGame/src/main/java/mock/xml/Race.java +++ /dev/null @@ -1,1351 +0,0 @@ -// -// 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.08.13 at 10:39:29 PM NZST -// - - -package mock.xml; - -import java.math.BigInteger; -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSchemaType; -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="RaceID" type="{http://www.w3.org/2001/XMLSchema}positiveInteger"/>
- *         <element name="RaceType" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="CreationTimeDate" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="RaceStartTime">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <attribute name="Postpone" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                 <attribute name="Time" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="Participants">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="Yacht" maxOccurs="unbounded">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                           <attribute name="Entry" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                         </restriction>
- *                       </complexContent>
- *                     </complexType>
- *                   </element>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="CompoundMarkSequence">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="Corner" maxOccurs="unbounded">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
- *                           <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
- *                           <attribute name="Rounding" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                           <attribute name="ZoneSize" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
- *                         </restriction>
- *                       </complexContent>
- *                     </complexType>
- *                   </element>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="Course">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="CompoundMark" maxOccurs="unbounded">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <sequence>
- *                             <element name="Mark" maxOccurs="unbounded">
- *                               <complexType>
- *                                 <complexContent>
- *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                                     <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                                     <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                                     <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                                     <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                                     <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                                   </restriction>
- *                                 </complexContent>
- *                               </complexType>
- *                             </element>
- *                           </sequence>
- *                           <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                           <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                         </restriction>
- *                       </complexContent>
- *                     </complexType>
- *                   </element>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="CourseLimit">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="Limit" maxOccurs="unbounded">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                           <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                           <attribute name="SeqID" use="required" 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 = { - "raceID", - "raceType", - "creationTimeDate", - "raceStartTime", - "participants", - "compoundMarkSequence", - "course", - "courseLimit" -}) -@XmlRootElement(name = "Race") -public class Race { - - @XmlElement(name = "RaceID", required = true) - @XmlSchemaType(name = "positiveInteger") - protected BigInteger raceID; - @XmlElement(name = "RaceType", required = true) - protected String raceType; - @XmlElement(name = "CreationTimeDate", required = true) - protected String creationTimeDate; - @XmlElement(name = "RaceStartTime", required = true) - protected Race.RaceStartTime raceStartTime; - @XmlElement(name = "Participants", required = true) - protected Race.Participants participants; - @XmlElement(name = "CompoundMarkSequence", required = true) - protected Race.CompoundMarkSequence compoundMarkSequence; - @XmlElement(name = "Course", required = true) - protected Race.Course course; - @XmlElement(name = "CourseLimit", required = true) - protected Race.CourseLimit courseLimit; - - /** - * Gets the value of the raceID property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - public BigInteger getRaceID() { - return raceID; - } - - /** - * Sets the value of the raceID property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setRaceID(BigInteger value) { - this.raceID = value; - } - - /** - * Gets the value of the raceType property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getRaceType() { - return raceType; - } - - /** - * Sets the value of the raceType property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setRaceType(String value) { - this.raceType = value; - } - - /** - * Gets the value of the creationTimeDate property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getCreationTimeDate() { - return creationTimeDate; - } - - /** - * Sets the value of the creationTimeDate property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setCreationTimeDate(String value) { - this.creationTimeDate = value; - } - - /** - * Gets the value of the raceStartTime property. - * - * @return - * possible object is - * {@link Race.RaceStartTime } - * - */ - public Race.RaceStartTime getRaceStartTime() { - return raceStartTime; - } - - /** - * Sets the value of the raceStartTime property. - * - * @param value - * allowed object is - * {@link Race.RaceStartTime } - * - */ - public void setRaceStartTime(Race.RaceStartTime value) { - this.raceStartTime = value; - } - - /** - * Gets the value of the participants property. - * - * @return - * possible object is - * {@link Race.Participants } - * - */ - public Race.Participants getParticipants() { - return participants; - } - - /** - * Sets the value of the participants property. - * - * @param value - * allowed object is - * {@link Race.Participants } - * - */ - public void setParticipants(Race.Participants value) { - this.participants = value; - } - - /** - * Gets the value of the compoundMarkSequence property. - * - * @return - * possible object is - * {@link Race.CompoundMarkSequence } - * - */ - public Race.CompoundMarkSequence getCompoundMarkSequence() { - return compoundMarkSequence; - } - - /** - * Sets the value of the compoundMarkSequence property. - * - * @param value - * allowed object is - * {@link Race.CompoundMarkSequence } - * - */ - public void setCompoundMarkSequence(Race.CompoundMarkSequence value) { - this.compoundMarkSequence = value; - } - - /** - * Gets the value of the course property. - * - * @return - * possible object is - * {@link Race.Course } - * - */ - public Race.Course getCourse() { - return course; - } - - /** - * Sets the value of the course property. - * - * @param value - * allowed object is - * {@link Race.Course } - * - */ - public void setCourse(Race.Course value) { - this.course = value; - } - - /** - * Gets the value of the courseLimit property. - * - * @return - * possible object is - * {@link Race.CourseLimit } - * - */ - public Race.CourseLimit getCourseLimit() { - return courseLimit; - } - - /** - * Sets the value of the courseLimit property. - * - * @param value - * allowed object is - * {@link Race.CourseLimit } - * - */ - public void setCourseLimit(Race.CourseLimit value) { - this.courseLimit = 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="Corner" maxOccurs="unbounded">
-     *           <complexType>
-     *             <complexContent>
-     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *                 <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
-     *                 <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
-     *                 <attribute name="Rounding" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                 <attribute name="ZoneSize" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
-     *               </restriction>
-     *             </complexContent>
-     *           </complexType>
-     *         </element>
-     *       </sequence>
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
-     * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { - "corner" - }) - public static class CompoundMarkSequence { - - @XmlElement(name = "Corner", required = true) - protected List corner; - - /** - * Gets the value of the corner property. - * - *

- * 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 corner property. - * - *

- * For example, to add a new item, do as follows: - *

-         *    getCorner().add(newItem);
-         * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Race.CompoundMarkSequence.Corner } - * - * - */ - public List getCorner() { - if (corner == null) { - corner = new ArrayList(); - } - return this.corner; - } - - - /** - *

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">
-         *       <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
-         *       <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
-         *       <attribute name="Rounding" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *       <attribute name="ZoneSize" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
-         *     </restriction>
-         *   </complexContent>
-         * </complexType>
-         * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class Corner { - - @XmlAttribute(name = "CompoundMarkID", required = true) - @XmlSchemaType(name = "positiveInteger") - protected BigInteger compoundMarkID; - @XmlAttribute(name = "SeqID", required = true) - @XmlSchemaType(name = "positiveInteger") - protected BigInteger seqID; - @XmlAttribute(name = "Rounding", required = true) - protected String rounding; - @XmlAttribute(name = "ZoneSize", required = true) - @XmlSchemaType(name = "positiveInteger") - protected BigInteger zoneSize; - - /** - * Gets the value of the compoundMarkID property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - public BigInteger getCompoundMarkID() { - return compoundMarkID; - } - - /** - * Sets the value of the compoundMarkID property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setCompoundMarkID(BigInteger value) { - this.compoundMarkID = value; - } - - /** - * Gets the value of the seqID property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - public BigInteger getSeqID() { - return seqID; - } - - /** - * Sets the value of the seqID property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setSeqID(BigInteger value) { - this.seqID = value; - } - - /** - * Gets the value of the rounding property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getRounding() { - return rounding; - } - - /** - * Sets the value of the rounding property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setRounding(String value) { - this.rounding = value; - } - - /** - * Gets the value of the zoneSize property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - public BigInteger getZoneSize() { - return zoneSize; - } - - /** - * Sets the value of the zoneSize property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setZoneSize(BigInteger value) { - this.zoneSize = 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="CompoundMark" maxOccurs="unbounded">
-     *           <complexType>
-     *             <complexContent>
-     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *                 <sequence>
-     *                   <element name="Mark" maxOccurs="unbounded">
-     *                     <complexType>
-     *                       <complexContent>
-     *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *                           <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                           <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                           <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                           <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                           <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                         </restriction>
-     *                       </complexContent>
-     *                     </complexType>
-     *                   </element>
-     *                 </sequence>
-     *                 <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                 <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *               </restriction>
-     *             </complexContent>
-     *           </complexType>
-     *         </element>
-     *       </sequence>
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
-     * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { - "compoundMark" - }) - public static class Course { - - @XmlElement(name = "CompoundMark", required = true) - protected List compoundMark; - - /** - * Gets the value of the compoundMark property. - * - *

- * 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 compoundMark property. - * - *

- * For example, to add a new item, do as follows: - *

-         *    getCompoundMark().add(newItem);
-         * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Race.Course.CompoundMark } - * - * - */ - public List getCompoundMark() { - if (compoundMark == null) { - compoundMark = new ArrayList(); - } - return this.compoundMark; - } - - - /** - *

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="Mark" maxOccurs="unbounded">
-         *           <complexType>
-         *             <complexContent>
-         *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-         *                 <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *                 <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *                 <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *                 <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *                 <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *               </restriction>
-         *             </complexContent>
-         *           </complexType>
-         *         </element>
-         *       </sequence>
-         *       <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *       <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *     </restriction>
-         *   </complexContent>
-         * </complexType>
-         * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { - "mark" - }) - public static class CompoundMark { - - @XmlElement(name = "Mark", required = true) - protected List mark; - @XmlAttribute(name = "CompoundMarkID", required = true) - protected String compoundMarkID; - @XmlAttribute(name = "Name", required = true) - protected String name; - - /** - * Gets the value of the mark property. - * - *

- * 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 mark property. - * - *

- * For example, to add a new item, do as follows: - *

-             *    getMark().add(newItem);
-             * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Race.Course.CompoundMark.Mark } - * - * - */ - public List getMark() { - if (mark == null) { - mark = new ArrayList(); - } - return this.mark; - } - - /** - * Gets the value of the compoundMarkID property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getCompoundMarkID() { - return compoundMarkID; - } - - /** - * Sets the value of the compoundMarkID property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setCompoundMarkID(String value) { - this.compoundMarkID = value; - } - - /** - * Gets the value of the name property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getName() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setName(String value) { - this.name = 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">
-             *       <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
-             *       <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-             *       <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-             *       <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-             *       <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-             *     </restriction>
-             *   </complexContent>
-             * </complexType>
-             * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class Mark { - - @XmlAttribute(name = "SeqId") - protected String seqId; - @XmlAttribute(name = "Name", required = true) - protected String name; - @XmlAttribute(name = "TargetLat", required = true) - protected String targetLat; - @XmlAttribute(name = "TargetLng", required = true) - protected String targetLng; - @XmlAttribute(name = "SourceID", required = true) - protected String sourceID; - - /** - * Gets the value of the seqId property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getSeqId() { - return seqId; - } - - /** - * Sets the value of the seqId property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setSeqId(String value) { - this.seqId = value; - } - - /** - * Gets the value of the name property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getName() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setName(String value) { - this.name = value; - } - - /** - * Gets the value of the targetLat property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getTargetLat() { - return targetLat; - } - - /** - * Sets the value of the targetLat property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setTargetLat(String value) { - this.targetLat = value; - } - - /** - * Gets the value of the targetLng property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getTargetLng() { - return targetLng; - } - - /** - * Sets the value of the targetLng property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setTargetLng(String value) { - this.targetLng = value; - } - - /** - * Gets the value of the sourceID property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getSourceID() { - return sourceID; - } - - /** - * Sets the value of the sourceID property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setSourceID(String value) { - this.sourceID = 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="Limit" maxOccurs="unbounded">
-     *           <complexType>
-     *             <complexContent>
-     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *                 <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                 <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                 <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *               </restriction>
-     *             </complexContent>
-     *           </complexType>
-     *         </element>
-     *       </sequence>
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
-     * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { - "limit" - }) - public static class CourseLimit { - - @XmlElement(name = "Limit", required = true) - protected List limit; - - /** - * Gets the value of the limit property. - * - *

- * 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 limit property. - * - *

- * For example, to add a new item, do as follows: - *

-         *    getLimit().add(newItem);
-         * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Race.CourseLimit.Limit } - * - * - */ - public List getLimit() { - if (limit == null) { - limit = new ArrayList(); - } - return this.limit; - } - - - /** - *

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">
-         *       <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *       <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *       <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *     </restriction>
-         *   </complexContent>
-         * </complexType>
-         * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class Limit { - - @XmlAttribute(name = "Lat", required = true) - protected String lat; - @XmlAttribute(name = "Lon", required = true) - protected String lon; - @XmlAttribute(name = "SeqID", required = true) - protected String seqID; - - /** - * Gets the value of the lat property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getLat() { - return lat; - } - - /** - * Sets the value of the lat property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setLat(String value) { - this.lat = value; - } - - /** - * Gets the value of the lon property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getLon() { - return lon; - } - - /** - * Sets the value of the lon property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setLon(String value) { - this.lon = value; - } - - /** - * Gets the value of the seqID property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getSeqID() { - return seqID; - } - - /** - * Sets the value of the seqID property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setSeqID(String value) { - this.seqID = 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="Yacht" maxOccurs="unbounded">
-     *           <complexType>
-     *             <complexContent>
-     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *                 <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                 <attribute name="Entry" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *               </restriction>
-     *             </complexContent>
-     *           </complexType>
-     *         </element>
-     *       </sequence>
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
-     * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { - "yacht" - }) - public static class Participants { - - @XmlElement(name = "Yacht", required = true) - protected List yacht; - - /** - * Gets the value of the yacht property. - * - *

- * 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 yacht property. - * - *

- * For example, to add a new item, do as follows: - *

-         *    getYacht().add(newItem);
-         * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Race.Participants.Yacht } - * - * - */ - public List getYacht() { - if (yacht == null) { - yacht = new ArrayList(); - } - return this.yacht; - } - - - /** - *

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">
-         *       <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *       <attribute name="Entry" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *     </restriction>
-         *   </complexContent>
-         * </complexType>
-         * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class Yacht { - - @XmlAttribute(name = "SourceID", required = true) - protected String sourceID; - @XmlAttribute(name = "Entry") - protected String entry; - - /** - * Gets the value of the sourceID property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getSourceID() { - return sourceID; - } - - /** - * Sets the value of the sourceID property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setSourceID(String value) { - this.sourceID = value; - } - - /** - * Gets the value of the entry property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getEntry() { - return entry; - } - - /** - * Sets the value of the entry property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setEntry(String value) { - this.entry = 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">
-     *       <attribute name="Postpone" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *       <attribute name="Time" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
-     * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class RaceStartTime { - - @XmlAttribute(name = "Postpone", required = true) - protected String postpone; - @XmlAttribute(name = "Time", required = true) - protected String time; - - /** - * Gets the value of the postpone property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getPostpone() { - return postpone; - } - - /** - * Sets the value of the postpone property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setPostpone(String value) { - this.postpone = value; - } - - /** - * Gets the value of the time property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getTime() { - return time; - } - - /** - * Sets the value of the time property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setTime(String value) { - this.time = value; - } - - } - -} \ No newline at end of file diff --git a/racevisionGame/src/main/java/mock/xml/RaceFactory.java b/racevisionGame/src/main/java/mock/xml/RaceFactory.java deleted file mode 100644 index 24223f74..00000000 --- a/racevisionGame/src/main/java/mock/xml/RaceFactory.java +++ /dev/null @@ -1,127 +0,0 @@ -// -// 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.08.13 at 10:39:29 PM NZST -// - - -package mock.xml; - -import javax.xml.bind.annotation.XmlRegistry; - - -/** - * This object contains factory methods for each - * Java content interface and Java element interface - * generated in the scd 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 RaceFactory { - - - /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: scd - * - */ - public RaceFactory() { - } - - /** - * Create an instance of {@link Race } - * - */ - public Race createRace() { - return new Race(); - } - - /** - * Create an instance of {@link Race.CourseLimit } - * - */ - public Race.CourseLimit createRaceCourseLimit() { - return new Race.CourseLimit(); - } - - /** - * Create an instance of {@link Race.Course } - * - */ - public Race.Course createRaceCourse() { - return new Race.Course(); - } - - /** - * Create an instance of {@link Race.Course.CompoundMark } - * - */ - public Race.Course.CompoundMark createRaceCourseCompoundMark() { - return new Race.Course.CompoundMark(); - } - - /** - * Create an instance of {@link Race.CompoundMarkSequence } - * - */ - public Race.CompoundMarkSequence createRaceCompoundMarkSequence() { - return new Race.CompoundMarkSequence(); - } - - /** - * Create an instance of {@link Race.Participants } - * - */ - public Race.Participants createRaceParticipants() { - return new Race.Participants(); - } - - /** - * Create an instance of {@link Race.RaceStartTime } - * - */ - public Race.RaceStartTime createRaceRaceStartTime() { - return new Race.RaceStartTime(); - } - - /** - * Create an instance of {@link Race.CourseLimit.Limit } - * - */ - public Race.CourseLimit.Limit createRaceCourseLimitLimit() { - return new Race.CourseLimit.Limit(); - } - - /** - * Create an instance of {@link Race.Course.CompoundMark.Mark } - * - */ - public Race.Course.CompoundMark.Mark createRaceCourseCompoundMarkMark() { - return new Race.Course.CompoundMark.Mark(); - } - - /** - * Create an instance of {@link Race.CompoundMarkSequence.Corner } - * - */ - public Race.CompoundMarkSequence.Corner createRaceCompoundMarkSequenceCorner() { - return new Race.CompoundMarkSequence.Corner(); - } - - /** - * Create an instance of {@link Race.Participants.Yacht } - * - */ - public Race.Participants.Yacht createRaceParticipantsYacht() { - return new Race.Participants.Yacht(); - } - -} \ No newline at end of file diff --git a/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java b/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java index 155f3644..4daf3cce 100644 --- a/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java +++ b/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java @@ -6,10 +6,8 @@ import shared.dataInput.RaceXMLReader; import shared.enums.XMLFileType; import shared.exceptions.InvalidRaceDataException; import shared.exceptions.XMLReaderException; -import shared.model.CompoundMark; -import shared.model.Corner; -import shared.model.GPSCoordinate; -import shared.model.Mark; +import shared.model.*; +import shared.xml.Race.*; import shared.xml.XMLUtilities; import javax.xml.XMLConstants; @@ -29,98 +27,16 @@ import javax.xml.validation.Validator; import java.io.File; import java.io.IOException; import java.io.StringWriter; +import java.math.BigInteger; import java.net.URL; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; /** * Helper Class for creating a Race XML */ public class RaceXMLCreator { - /** - * Copy the race to a mock.xml.Race class from a RaceXMlReader - * @param reader RaceXMlReader - * @return string of the new mock.xml.Race - * @throws InvalidRaceDataException If the reader is unable to be read - * @throws XMLReaderException If the reader is unable to be read - */ - public static Race copyRace(RaceXMLReader reader) throws InvalidRaceDataException, XMLReaderException { - RaceFactory raceFactory = new RaceFactory(); - Race race = raceFactory.createRace(); - race.setRaceID(String.valueOf(reader.getRaceId())); - race.setRaceType(String.valueOf(reader.getRaceType())); - race.setCreationTimeDate("CREATION_TIME");//this needs to be changed later - - //Race Start Time - Race.RaceStartTime raceStartTime = raceFactory.createRaceRaceStartTime(); - raceStartTime.setPostpone("false"); - raceStartTime.setTime("START_TIME");//this needs to be changed later - race.setRaceStartTime(raceStartTime); - - //Participants - Race.Participants participants = raceFactory.createRaceParticipants(); - for (int i :reader.getParticipants()) { - Race.Participants.Yacht yacht = raceFactory.createRaceParticipantsYacht(); - yacht.setSourceID(String.valueOf(i)); - participants.getYacht().add(yacht); //java schema does not clone the array so this is "safe". - } - race.setParticipants(participants); - - //compound marks sequence - Race.CompoundMarkSequence cms = raceFactory.createRaceCompoundMarkSequence(); - for (Corner mark: reader.getCornersList()){ - Race.CompoundMarkSequence.Corner corner = raceFactory.createRaceCompoundMarkSequenceCorner(); - corner.setCompoundMarkID(String.valueOf(mark.getId())); - corner.setSeqID(String.valueOf(mark.getSeqID())); - cms.getCorner().add(corner); - } - race.setCompoundMarkSequence(cms); - - //Course - Race.Course course = raceFactory.createRaceCourse(); - for (CompoundMark mark: reader.getCompoundMarks()){ - Race.Course.CompoundMark cm = raceFactory.createRaceCourseCompoundMark(); - cm.setName(mark.getName()); - cm.setCompoundMarkID(String.valueOf(mark.getId())); - cm.getMark().add(setMarkFromMark(raceFactory, mark.getMark1())); - Race.Course.CompoundMark.Mark m2 = setMarkFromMark(raceFactory, mark.getMark2()); - if (m2 != null) { - cm.getMark().add(m2); - } - course.getCompoundMark().add(cm); - } - race.setCourse(course); - - //Course Limit - Race.CourseLimit courseLimit = raceFactory.createRaceCourseLimit(); - for (int i = 0; i < reader.getBoundary().size(); i++){ - Race.CourseLimit.Limit limit = raceFactory.createRaceCourseLimitLimit(); - limit.setSeqID(String.valueOf(i+1)); - limit.setLat(String.valueOf(reader.getBoundary().get(i).getLatitude())); - limit.setLon(String.valueOf(reader.getBoundary().get(i).getLongitude())); - courseLimit.getLimit().add(limit); - } - race.setCourseLimit(courseLimit); - - return race; - } - - /** - * Sets a mock.xml.Mark from a shared.model.Mark - * @param raceFactory race Factory for creating mock.xml.Race classes and subclasses - * @param mark Mark to be converted. - * @return converted mock.xml.Mark. - */ - public static Race.Course.CompoundMark.Mark setMarkFromMark(RaceFactory raceFactory, Mark mark){ - if (mark != null) { - Race.Course.CompoundMark.Mark m = raceFactory.createRaceCourseCompoundMarkMark(); - m.setName(mark.getName()); - m.setTargetLat(String.valueOf(mark.getPosition().getLatitude())); - m.setTargetLng(String.valueOf(mark.getPosition().getLongitude())); - m.setSourceID(String.valueOf(mark.getSourceID())); - return m; - } - return null; - } /** * get the windward gate in a race @@ -158,9 +74,11 @@ public class RaceXMLCreator { public static String alterRaceToWind(String s, double degrees) throws XMLReaderException, InvalidRaceDataException, JAXBException, IOException, SAXException, ParserConfigurationException { RaceXMLReader reader = new RaceXMLReader(s, XMLFileType.ResourcePath); - Race race = (Race) XMLUtilities.xmlToClass(new File(RaceXMLCreator.class.getClassLoader().getResource(s).getFile()), + XMLRace race = (XMLRace) XMLUtilities.xmlToClass(new File(RaceXMLCreator.class.getClassLoader().getResource(s).getFile()), RaceXMLCreator.class.getClassLoader().getResource("mock/mockXML/schema/raceSchema.xsd"), - Race.class); + XMLRace.class); + + setRaceXMLAtCurrentTimeToNow(race); double raceOriginalBearing = getLineAngle(getLeewardGate(reader).getMark1Position(), getWindwardGate(reader).getMark1Position()); @@ -168,7 +86,7 @@ public class RaceXMLCreator { alterRaceRotation(race, degreesToRotate); - JAXBContext context = JAXBContext.newInstance(Race.class); + JAXBContext context = JAXBContext.newInstance(XMLRace.class); Marshaller jaxbMarshaller = context.createMarshaller(); jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); @@ -183,20 +101,20 @@ public class RaceXMLCreator { * @param race the race to alter * @param degrees the degrees to rotate by. */ - public static void alterRaceRotation(Race race, double degrees){ + public static void alterRaceRotation(XMLRace race, double degrees){ GPSCoordinate center = getCenter(race); - for(Race.CourseLimit.Limit limit: race.getCourseLimit().getLimit()){ + for(XMLLimit limit: race.getCourseLimit().getLimit()){ GPSCoordinate rotatedLim = rotate(center, limitToGPSCoordinate(limit), degrees); - limit.setLat(String.valueOf(rotatedLim.getLatitude())); - limit.setLon(String.valueOf(rotatedLim.getLongitude())); + limit.setLat(rotatedLim.getLatitude()); + limit.setLon(rotatedLim.getLongitude()); } - for(Race.Course.CompoundMark compoundMark: race.getCourse().getCompoundMark()){ - for (Race.Course.CompoundMark.Mark mark: compoundMark.getMark()){ + for(XMLCompoundMark compoundMark: race.getCourse().getCompoundMark()){ + for (XMLMark mark: compoundMark.getMark()){ System.out.println(mark); GPSCoordinate rotatedMark = rotate(center, markToGPSCoordinate(mark), degrees); - mark.setTargetLat(String.valueOf(rotatedMark.getLatitude())); - mark.setTargetLng(String.valueOf(rotatedMark.getLongitude())); + mark.setTargetLat(rotatedMark.getLatitude()); + mark.setTargetLng(rotatedMark.getLongitude()); } } } @@ -206,8 +124,8 @@ public class RaceXMLCreator { * @param limit limit to convert * @return gps coordinate corresponding to the limit */ - public static GPSCoordinate limitToGPSCoordinate(Race.CourseLimit.Limit limit){ - return new GPSCoordinate(Double.parseDouble(limit.getLat()), Double.parseDouble(limit.getLon())); + public static GPSCoordinate limitToGPSCoordinate(XMLLimit limit){ + return new GPSCoordinate(limit.getLat(), limit.getLon()); } /** @@ -232,8 +150,8 @@ public class RaceXMLCreator { * @param mark mark to obtain the GPSCoordinates of * @return the GPSCOordinatess of a mark */ - public static GPSCoordinate markToGPSCoordinate(Race.Course.CompoundMark.Mark mark){ - return new GPSCoordinate(Double.parseDouble(mark.getTargetLat()), Double.parseDouble(mark.getTargetLng())); + public static GPSCoordinate markToGPSCoordinate(XMLMark mark){ + return new GPSCoordinate(mark.getTargetLat(), mark.getTargetLng()); } /** @@ -241,12 +159,12 @@ public class RaceXMLCreator { * @param race race to get the center of * @return GPSCoordinates of the center */ - public static GPSCoordinate getCenter(Race race){ + public static GPSCoordinate getCenter(XMLRace race){ double avgLat = 0; double avgLng = 0; - for (Race.CourseLimit.Limit limit: race.getCourseLimit().getLimit()){ - avgLat += Double.parseDouble(limit.getLat()); - avgLng += Double.parseDouble(limit.getLon()); + for (XMLLimit limit: race.getCourseLimit().getLimit()){ + avgLat += limit.getLat(); + avgLng += limit.getLon(); } avgLat = avgLat/race.getCourseLimit().getLimit().size(); avgLng = avgLng/race.getCourseLimit().getLimit().size(); @@ -265,4 +183,24 @@ public class RaceXMLCreator { return Math.atan2(dy, dx)/Math.PI * 180; } + + /** + * Sets the xml description of the race to show the race was created now, and starts in 4 minutes + * @param raceXML The race.xml contents. + * @return String containing edited xml + */ + public static void setRaceXMLAtCurrentTimeToNow(XMLRace raceXML) { + + //The start time is current time + 4 minutes. prestart is 3 minutes, and we add another minute. + long millisecondsToAdd = Constants.RacePreStartTime + (1 * 60 * 1000); + long secondsToAdd = millisecondsToAdd / 1000; + //Scale the time using our time scalar. + secondsToAdd = secondsToAdd / Constants.RaceTimeScale; + + DateTimeFormatter dateFormat = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssZ"); + ZonedDateTime creationTime = ZonedDateTime.now(); + raceXML.setCreationTimeDate(dateFormat.format(creationTime)); + raceXML.getRaceStartTime().setTime(dateFormat.format(creationTime.plusSeconds(secondsToAdd))); + } + } diff --git a/racevisionGame/src/main/java/shared/dataInput/RaceXMLReader.java b/racevisionGame/src/main/java/shared/dataInput/RaceXMLReader.java index 361fefd4..bf00d4ec 100644 --- a/racevisionGame/src/main/java/shared/dataInput/RaceXMLReader.java +++ b/racevisionGame/src/main/java/shared/dataInput/RaceXMLReader.java @@ -337,7 +337,7 @@ public class RaceXMLReader extends XMLReader implements RaceDataSource { int cornerSeq = Integer.parseInt(getAttribute(cornerElement, "SeqID")); - cornersList.add(new Corner(cornerID, cornerSeq)); + cornersList.add(new Corner(cornerID, cornerSeq, "SP", 3)); //Gets the CompoundMark associated with this corner. CompoundMark lastCompoundMark = this.compoundMarkMap.get(cornerID); @@ -356,7 +356,7 @@ public class RaceXMLReader extends XMLReader implements RaceDataSource { cornerSeq = Integer.parseInt(getAttribute(cornerElement, "SeqID")); - cornersList.add(new Corner(cornerID, cornerSeq)); + cornersList.add(new Corner(cornerID, cornerSeq, "Port", 3)); //Gets the CompoundMark associated with this corner. CompoundMark currentCompoundMark = this.compoundMarkMap.get(cornerID); diff --git a/racevisionGame/src/main/java/shared/model/CompoundMark.java b/racevisionGame/src/main/java/shared/model/CompoundMark.java index b9f45753..f56330e3 100644 --- a/racevisionGame/src/main/java/shared/model/CompoundMark.java +++ b/racevisionGame/src/main/java/shared/model/CompoundMark.java @@ -1,10 +1,12 @@ package shared.model; +import shared.xml.Race.XMLCompoundMark; + /** * Represents a compound mark - that is, either one or two individual marks which form a single compound mark. */ -public class CompoundMark { +public class CompoundMark extends XMLCompoundMark{ /** * The ID of the compound mark. @@ -39,11 +41,7 @@ public class CompoundMark { * @param mark1 The individual mark that comprises this compound mark. */ public CompoundMark(int id, String name, Mark mark1) { - this.id = id; - this.name = name; - this.mark1 = mark1; - this.averageGPSCoordinate = calculateAverage(); - + this(id, name, mark1, null); } @@ -55,6 +53,13 @@ public class CompoundMark { * @param mark2 The second individual mark that comprises this compound mark. */ public CompoundMark(int id, String name, Mark mark1, Mark mark2) { + //parent set up + super(); + setName(name); + setCompoundMarkID(id); + getMark().add(mark1); + if (mark2 != null) getMark().add(mark2); + this.id = id; this.name = name; this.mark1 = mark1; @@ -72,14 +77,6 @@ public class CompoundMark { return id; } - /** - * Returns the name of this compound mark - * @return The name of this compound mark. - */ - public String getName() { - return name; - } - /** * Returns the first mark of the compound mark. * @return The first mark of the compound mark. diff --git a/racevisionGame/src/main/java/shared/model/Corner.java b/racevisionGame/src/main/java/shared/model/Corner.java index 9956b40e..a8f72b82 100644 --- a/racevisionGame/src/main/java/shared/model/Corner.java +++ b/racevisionGame/src/main/java/shared/model/Corner.java @@ -1,23 +1,25 @@ package shared.model; +import shared.xml.Race.XMLCorner; + /** * Created by Gondr on 3/08/2017. */ -public class Corner { +public class Corner extends XMLCorner{ private int id; - private int seqID; - public Corner(int id, int seqID){ + public Corner(int id, int seqID, String rounding, int zoneSize){ + super(); + setCompoundMarkID(id); + setSeqID(seqID); + setRounding(rounding); + setZoneSize(zoneSize); + this.id = id; - this.seqID = seqID; } public int getId() { return id; } - - public int getSeqID() { - return seqID; - } } diff --git a/racevisionGame/src/main/java/shared/model/Mark.java b/racevisionGame/src/main/java/shared/model/Mark.java index 5781861a..522388cd 100644 --- a/racevisionGame/src/main/java/shared/model/Mark.java +++ b/racevisionGame/src/main/java/shared/model/Mark.java @@ -1,28 +1,21 @@ package shared.model; +import shared.xml.Race.XMLMark; + +import java.math.BigDecimal; +import java.math.BigInteger; + /** * Represents an individual mark. * Has a source ID, name, and position. */ -public class Mark { - - /** - * The source ID of the mark. - */ - private int sourceID; - - /** - * The name of the mark. - */ - private String name; +public class Mark extends XMLMark{ /** * The position of the mark. */ private GPSCoordinate position; - - /** * Constructs a mark with a given source ID, name, and position. * @param sourceID The source ID of the mark. @@ -30,8 +23,12 @@ public class Mark { * @param position The position of the mark. */ public Mark(int sourceID, String name, GPSCoordinate position) { - this.sourceID = sourceID; - this.name = name; + super(); + targetLat = position.getLatitude(); + targetLng = position.getLongitude(); + setSourceID(sourceID); + setName(name); + this.position = position; } @@ -44,14 +41,6 @@ public class Mark { return name; } - /** - * Returns the source ID of the mark. - * @return The source ID of the mark. - */ - public int getSourceID() { - return sourceID; - } - /** * Returns the position of the mark. * @return The position of the mark. diff --git a/racevisionGame/src/main/java/shared/model/Race.java b/racevisionGame/src/main/java/shared/model/Race.java index 6f428ad0..415e9f77 100644 --- a/racevisionGame/src/main/java/shared/model/Race.java +++ b/racevisionGame/src/main/java/shared/model/Race.java @@ -23,7 +23,7 @@ public abstract class Race implements Runnable { /** * The source of race related data. */ - protected mock.xml.Race raceDataSource; + protected RaceDataSource raceDataSource; /** * The source of boat related data. @@ -134,7 +134,7 @@ public abstract class Race implements Runnable { * @param regattaDataSource Data source for race related data (course name, location, timezone, etc...). * @param latestMessages The collection of latest messages, which can be written to, or read from. */ - public Race(BoatDataSource boatDataSource, mock.xml.Race raceDataSource, RegattaDataSource regattaDataSource, LatestMessages latestMessages) { + public Race(BoatDataSource boatDataSource, RaceDataSource raceDataSource, RegattaDataSource regattaDataSource, LatestMessages latestMessages) { //Keep a reference to data sources. this.raceDataSource = raceDataSource; diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/schema/CompoundMark.java b/racevisionGame/src/main/java/shared/xml/Race/XMLCompoundMark.java similarity index 82% rename from racevisionGame/src/main/resources/mock/mockXML/schema/schema/CompoundMark.java rename to racevisionGame/src/main/java/shared/xml/Race/XMLCompoundMark.java index 965d79b6..41d5a70d 100644 --- a/racevisionGame/src/main/resources/mock/mockXML/schema/schema/CompoundMark.java +++ b/racevisionGame/src/main/java/shared/xml/Race/XMLCompoundMark.java @@ -2,11 +2,11 @@ // 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.08.13 at 11:01:23 PM NZST +// Generated on: 2017.08.14 at 02:54:32 AM NZST // -package schema; +package shared.xml.Race; import java.util.ArrayList; import java.util.List; @@ -31,17 +31,17 @@ import javax.xml.bind.annotation.XmlType; * <complexType> * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" /> + * <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}int" /> * <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> - * <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> - * <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> - * <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> + * <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}double" /> + * <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}double" /> + * <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" /> * </restriction> * </complexContent> * </complexType> * </element> * </sequence> - * <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> + * <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" /> * <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * </restriction> * </complexContent> @@ -54,12 +54,12 @@ import javax.xml.bind.annotation.XmlType; @XmlType(name = "", propOrder = { "mark" }) -public class CompoundMark { +public class XMLCompoundMark { @XmlElement(name = "Mark", required = true) - protected List mark; + protected List mark; @XmlAttribute(name = "CompoundMarkID", required = true) - protected String compoundMarkID; + protected int compoundMarkID; @XmlAttribute(name = "Name", required = true) protected String name; @@ -81,13 +81,13 @@ public class CompoundMark { * *

* Objects of the following type(s) are allowed in the list - * {@link Mark } + * {@link XMLMark } * * */ - public List getMark() { + public List getMark() { if (mark == null) { - mark = new ArrayList(); + mark = new ArrayList(); } return this.mark; } @@ -95,24 +95,16 @@ public class CompoundMark { /** * Gets the value of the compoundMarkID property. * - * @return - * possible object is - * {@link String } - * */ - public String getCompoundMarkID() { + public int getCompoundMarkID() { return compoundMarkID; } /** * Sets the value of the compoundMarkID property. * - * @param value - * allowed object is - * {@link String } - * */ - public void setCompoundMarkID(String value) { + public void setCompoundMarkID(int value) { this.compoundMarkID = value; } diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/schema/CompoundMarkSequence.java b/racevisionGame/src/main/java/shared/xml/Race/XMLCompoundMarkSequence.java similarity index 85% rename from racevisionGame/src/main/resources/mock/mockXML/schema/schema/CompoundMarkSequence.java rename to racevisionGame/src/main/java/shared/xml/Race/XMLCompoundMarkSequence.java index 6a4edc52..be92b837 100644 --- a/racevisionGame/src/main/resources/mock/mockXML/schema/schema/CompoundMarkSequence.java +++ b/racevisionGame/src/main/java/shared/xml/Race/XMLCompoundMarkSequence.java @@ -2,11 +2,11 @@ // 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.08.13 at 11:01:23 PM NZST +// Generated on: 2017.08.14 at 02:54:32 AM NZST // -package schema; +package shared.xml.Race; import java.util.ArrayList; import java.util.List; @@ -30,10 +30,10 @@ import javax.xml.bind.annotation.XmlType; * <complexType> * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /> - * <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /> + * <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" /> + * <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" /> * <attribute name="Rounding" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> - * <attribute name="ZoneSize" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /> + * <attribute name="ZoneSize" use="required" type="{http://www.w3.org/2001/XMLSchema}int" /> * </restriction> * </complexContent> * </complexType> @@ -50,10 +50,10 @@ import javax.xml.bind.annotation.XmlType; @XmlType(name = "", propOrder = { "corner" }) -public class CompoundMarkSequence { +public class XMLCompoundMarkSequence { @XmlElement(name = "Corner", required = true) - protected List corner; + protected List corner; /** * Gets the value of the corner property. @@ -73,13 +73,13 @@ public class CompoundMarkSequence { * *

* Objects of the following type(s) are allowed in the list - * {@link Corner } + * {@link XMLCorner } * * */ - public List getCorner() { + public List getCorner() { if (corner == null) { - corner = new ArrayList(); + corner = new ArrayList(); } return this.corner; } diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/schema/Corner.java b/racevisionGame/src/main/java/shared/xml/Race/XMLCorner.java similarity index 65% rename from racevisionGame/src/main/resources/mock/mockXML/schema/schema/Corner.java rename to racevisionGame/src/main/java/shared/xml/Race/XMLCorner.java index 467e9ae6..780ea352 100644 --- a/racevisionGame/src/main/resources/mock/mockXML/schema/schema/Corner.java +++ b/racevisionGame/src/main/java/shared/xml/Race/XMLCorner.java @@ -2,17 +2,15 @@ // 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.08.13 at 11:01:23 PM NZST +// Generated on: 2017.08.14 at 02:54:32 AM NZST // -package schema; +package shared.xml.Race; -import java.math.BigInteger; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; @@ -25,10 +23,10 @@ import javax.xml.bind.annotation.XmlType; * <complexType> * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /> - * <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /> + * <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" /> + * <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" /> * <attribute name="Rounding" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> - * <attribute name="ZoneSize" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /> + * <attribute name="ZoneSize" use="required" type="{http://www.w3.org/2001/XMLSchema}int" /> * </restriction> * </complexContent> * </complexType> @@ -38,65 +36,46 @@ import javax.xml.bind.annotation.XmlType; */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") -public class Corner { +public class XMLCorner { @XmlAttribute(name = "CompoundMarkID", required = true) - @XmlSchemaType(name = "positiveInteger") - protected BigInteger compoundMarkID; + protected int compoundMarkID; @XmlAttribute(name = "SeqID", required = true) - @XmlSchemaType(name = "positiveInteger") - protected BigInteger seqID; + protected int seqID; @XmlAttribute(name = "Rounding", required = true) protected String rounding; @XmlAttribute(name = "ZoneSize", required = true) - @XmlSchemaType(name = "positiveInteger") - protected BigInteger zoneSize; + protected int zoneSize; /** * Gets the value of the compoundMarkID property. * - * @return - * possible object is - * {@link BigInteger } - * */ - public BigInteger getCompoundMarkID() { + public int getCompoundMarkID() { return compoundMarkID; } /** * Sets the value of the compoundMarkID property. * - * @param value - * allowed object is - * {@link BigInteger } - * */ - public void setCompoundMarkID(BigInteger value) { + public void setCompoundMarkID(int value) { this.compoundMarkID = value; } /** * Gets the value of the seqID property. * - * @return - * possible object is - * {@link BigInteger } - * */ - public BigInteger getSeqID() { + public int getSeqID() { return seqID; } /** * Sets the value of the seqID property. * - * @param value - * allowed object is - * {@link BigInteger } - * */ - public void setSeqID(BigInteger value) { + public void setSeqID(int value) { this.seqID = value; } @@ -127,24 +106,16 @@ public class Corner { /** * Gets the value of the zoneSize property. * - * @return - * possible object is - * {@link BigInteger } - * */ - public BigInteger getZoneSize() { + public int getZoneSize() { return zoneSize; } /** * Sets the value of the zoneSize property. * - * @param value - * allowed object is - * {@link BigInteger } - * */ - public void setZoneSize(BigInteger value) { + public void setZoneSize(int value) { this.zoneSize = value; } diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/schema/Course.java b/racevisionGame/src/main/java/shared/xml/Race/XMLCourse.java similarity index 84% rename from racevisionGame/src/main/resources/mock/mockXML/schema/schema/Course.java rename to racevisionGame/src/main/java/shared/xml/Race/XMLCourse.java index 5c135655..be527f7a 100644 --- a/racevisionGame/src/main/resources/mock/mockXML/schema/schema/Course.java +++ b/racevisionGame/src/main/java/shared/xml/Race/XMLCourse.java @@ -2,11 +2,11 @@ // 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.08.13 at 11:01:23 PM NZST +// Generated on: 2017.08.14 at 02:54:32 AM NZST // -package schema; +package shared.xml.Race; import java.util.ArrayList; import java.util.List; @@ -35,17 +35,17 @@ import javax.xml.bind.annotation.XmlType; * <complexType> * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" /> + * <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}int" /> * <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> - * <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> - * <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> - * <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> + * <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}double" /> + * <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}double" /> + * <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" /> * </restriction> * </complexContent> * </complexType> * </element> * </sequence> - * <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> + * <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" /> * <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * </restriction> * </complexContent> @@ -63,10 +63,10 @@ import javax.xml.bind.annotation.XmlType; @XmlType(name = "", propOrder = { "compoundMark" }) -public class Course { +public class XMLCourse { @XmlElement(name = "CompoundMark", required = true) - protected List compoundMark; + protected List compoundMark; /** * Gets the value of the compoundMark property. @@ -86,13 +86,13 @@ public class Course { * *

* Objects of the following type(s) are allowed in the list - * {@link CompoundMark } + * {@link XMLCompoundMark } * * */ - public List getCompoundMark() { + public List getCompoundMark() { if (compoundMark == null) { - compoundMark = new ArrayList(); + compoundMark = new ArrayList(); } return this.compoundMark; } diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/schema/CourseLimit.java b/racevisionGame/src/main/java/shared/xml/Race/XMLCourseLimit.java similarity index 85% rename from racevisionGame/src/main/resources/mock/mockXML/schema/schema/CourseLimit.java rename to racevisionGame/src/main/java/shared/xml/Race/XMLCourseLimit.java index 2b9c39c8..b4a55197 100644 --- a/racevisionGame/src/main/resources/mock/mockXML/schema/schema/CourseLimit.java +++ b/racevisionGame/src/main/java/shared/xml/Race/XMLCourseLimit.java @@ -2,11 +2,11 @@ // 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.08.13 at 11:01:23 PM NZST +// Generated on: 2017.08.14 at 02:54:32 AM NZST // -package schema; +package shared.xml.Race; import java.util.ArrayList; import java.util.List; @@ -30,9 +30,9 @@ import javax.xml.bind.annotation.XmlType; * <complexType> * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> - * <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> - * <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> + * <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}double" /> + * <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}double" /> + * <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" /> * </restriction> * </complexContent> * </complexType> @@ -49,10 +49,10 @@ import javax.xml.bind.annotation.XmlType; @XmlType(name = "", propOrder = { "limit" }) -public class CourseLimit { +public class XMLCourseLimit { @XmlElement(name = "Limit", required = true) - protected List limit; + protected List limit; /** * Gets the value of the limit property. @@ -72,13 +72,13 @@ public class CourseLimit { * *

* Objects of the following type(s) are allowed in the list - * {@link Limit } + * {@link XMLLimit } * * */ - public List getLimit() { + public List getLimit() { if (limit == null) { - limit = new ArrayList(); + limit = new ArrayList(); } return this.limit; } diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/schema/Limit.java b/racevisionGame/src/main/java/shared/xml/Race/XMLLimit.java similarity index 64% rename from racevisionGame/src/main/resources/mock/mockXML/schema/schema/Limit.java rename to racevisionGame/src/main/java/shared/xml/Race/XMLLimit.java index 8abda089..421f206c 100644 --- a/racevisionGame/src/main/resources/mock/mockXML/schema/schema/Limit.java +++ b/racevisionGame/src/main/java/shared/xml/Race/XMLLimit.java @@ -2,11 +2,11 @@ // 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.08.13 at 11:01:23 PM NZST +// Generated on: 2017.08.14 at 02:54:32 AM NZST // -package schema; +package shared.xml.Race; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; @@ -23,9 +23,9 @@ import javax.xml.bind.annotation.XmlType; * <complexType> * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> - * <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> - * <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> + * <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}double" /> + * <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}double" /> + * <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" /> * </restriction> * </complexContent> * </complexType> @@ -35,84 +35,60 @@ import javax.xml.bind.annotation.XmlType; */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") -public class Limit { +public class XMLLimit { @XmlAttribute(name = "Lat", required = true) - protected String lat; + protected double lat; @XmlAttribute(name = "Lon", required = true) - protected String lon; + protected double lon; @XmlAttribute(name = "SeqID", required = true) - protected String seqID; + protected int seqID; /** * Gets the value of the lat property. * - * @return - * possible object is - * {@link String } - * */ - public String getLat() { + public double getLat() { return lat; } /** * Sets the value of the lat property. * - * @param value - * allowed object is - * {@link String } - * */ - public void setLat(String value) { + public void setLat(double value) { this.lat = value; } /** * Gets the value of the lon property. * - * @return - * possible object is - * {@link String } - * */ - public String getLon() { + public double getLon() { return lon; } /** * Sets the value of the lon property. * - * @param value - * allowed object is - * {@link String } - * */ - public void setLon(String value) { + public void setLon(double value) { this.lon = value; } /** * Gets the value of the seqID property. * - * @return - * possible object is - * {@link String } - * */ - public String getSeqID() { + public int getSeqID() { return seqID; } /** * Sets the value of the seqID property. * - * @param value - * allowed object is - * {@link String } - * */ - public void setSeqID(String value) { + public void setSeqID(int value) { this.seqID = value; } diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/schema/Mark.java b/racevisionGame/src/main/java/shared/xml/Race/XMLMark.java similarity index 70% rename from racevisionGame/src/main/resources/mock/mockXML/schema/schema/Mark.java rename to racevisionGame/src/main/java/shared/xml/Race/XMLMark.java index ef4d4e1e..299b03ab 100644 --- a/racevisionGame/src/main/resources/mock/mockXML/schema/schema/Mark.java +++ b/racevisionGame/src/main/java/shared/xml/Race/XMLMark.java @@ -2,11 +2,11 @@ // 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.08.13 at 11:01:23 PM NZST +// Generated on: 2017.08.14 at 02:54:32 AM NZST // -package schema; +package shared.xml.Race; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; @@ -23,11 +23,11 @@ import javax.xml.bind.annotation.XmlType; * <complexType> * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" /> + * <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}int" /> * <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> - * <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> - * <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> - * <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> + * <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}double" /> + * <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}double" /> + * <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" /> * </restriction> * </complexContent> * </complexType> @@ -37,28 +37,28 @@ import javax.xml.bind.annotation.XmlType; */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") -public class Mark { +public class XMLMark { @XmlAttribute(name = "SeqId") - protected String seqId; + protected Integer seqId; @XmlAttribute(name = "Name", required = true) protected String name; @XmlAttribute(name = "TargetLat", required = true) - protected String targetLat; + protected double targetLat; @XmlAttribute(name = "TargetLng", required = true) - protected String targetLng; + protected double targetLng; @XmlAttribute(name = "SourceID", required = true) - protected String sourceID; + protected int sourceID; /** * Gets the value of the seqId property. * * @return * possible object is - * {@link String } + * {@link Integer } * */ - public String getSeqId() { + public Integer getSeqId() { return seqId; } @@ -67,10 +67,10 @@ public class Mark { * * @param value * allowed object is - * {@link String } + * {@link Integer } * */ - public void setSeqId(String value) { + public void setSeqId(Integer value) { this.seqId = value; } @@ -101,72 +101,48 @@ public class Mark { /** * Gets the value of the targetLat property. * - * @return - * possible object is - * {@link String } - * */ - public String getTargetLat() { + public double getTargetLat() { return targetLat; } /** * Sets the value of the targetLat property. * - * @param value - * allowed object is - * {@link String } - * */ - public void setTargetLat(String value) { + public void setTargetLat(double value) { this.targetLat = value; } /** * Gets the value of the targetLng property. * - * @return - * possible object is - * {@link String } - * */ - public String getTargetLng() { + public double getTargetLng() { return targetLng; } /** * Sets the value of the targetLng property. * - * @param value - * allowed object is - * {@link String } - * */ - public void setTargetLng(String value) { + public void setTargetLng(double value) { this.targetLng = value; } /** * Gets the value of the sourceID property. * - * @return - * possible object is - * {@link String } - * */ - public String getSourceID() { + public int getSourceID() { return sourceID; } /** * Sets the value of the sourceID property. * - * @param value - * allowed object is - * {@link String } - * */ - public void setSourceID(String value) { + public void setSourceID(int value) { this.sourceID = value; } diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/schema/Participants.java b/racevisionGame/src/main/java/shared/xml/Race/XMLParticipants.java similarity index 88% rename from racevisionGame/src/main/resources/mock/mockXML/schema/schema/Participants.java rename to racevisionGame/src/main/java/shared/xml/Race/XMLParticipants.java index b2dcb7d6..b23586a6 100644 --- a/racevisionGame/src/main/resources/mock/mockXML/schema/schema/Participants.java +++ b/racevisionGame/src/main/java/shared/xml/Race/XMLParticipants.java @@ -2,11 +2,11 @@ // 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.08.13 at 11:01:23 PM NZST +// Generated on: 2017.08.14 at 02:54:32 AM NZST // -package schema; +package shared.xml.Race; import java.util.ArrayList; import java.util.List; @@ -30,7 +30,7 @@ import javax.xml.bind.annotation.XmlType; * <complexType> * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <attribute name="SourceID" 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="Entry" type="{http://www.w3.org/2001/XMLSchema}string" /> * </restriction> * </complexContent> @@ -48,10 +48,10 @@ import javax.xml.bind.annotation.XmlType; @XmlType(name = "", propOrder = { "yacht" }) -public class Participants { +public class XMLParticipants { @XmlElement(name = "Yacht", required = true) - protected List yacht; + protected List yacht; /** * Gets the value of the yacht property. @@ -71,13 +71,13 @@ public class Participants { * *

* Objects of the following type(s) are allowed in the list - * {@link Yacht } + * {@link XMLYacht } * * */ - public List getYacht() { + public List getYacht() { if (yacht == null) { - yacht = new ArrayList(); + yacht = new ArrayList(); } return this.yacht; } diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/schema/Race.java b/racevisionGame/src/main/java/shared/xml/Race/XMLRace.java similarity index 77% rename from racevisionGame/src/main/resources/mock/mockXML/schema/schema/Race.java rename to racevisionGame/src/main/java/shared/xml/Race/XMLRace.java index 1ae28e9d..b5fa4a3f 100644 --- a/racevisionGame/src/main/resources/mock/mockXML/schema/schema/Race.java +++ b/racevisionGame/src/main/java/shared/xml/Race/XMLRace.java @@ -2,32 +2,30 @@ // 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.08.13 at 11:01:23 PM NZST +// Generated on: 2017.08.14 at 03:20:03 AM NZST // -package schema; +package shared.xml.Race; -import java.math.BigInteger; 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.XmlSchemaType; 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="RaceID" type="{http://www.w3.org/2001/XMLSchema}positiveInteger"/>
+ *         <element name="RaceID" type="{http://www.w3.org/2001/XMLSchema}int"/>
  *         <element name="RaceType" type="{http://www.w3.org/2001/XMLSchema}string"/>
  *         <element name="CreationTimeDate" type="{http://www.w3.org/2001/XMLSchema}string"/>
  *         <element name="RaceStartTime">
@@ -49,7 +47,7 @@ import javax.xml.bind.annotation.XmlType;
  *                     <complexType>
  *                       <complexContent>
  *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <attribute name="SourceID" 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="Entry" type="{http://www.w3.org/2001/XMLSchema}string" />
  *                         </restriction>
  *                       </complexContent>
@@ -69,10 +67,10 @@ import javax.xml.bind.annotation.XmlType;
  *                     <complexType>
  *                       <complexContent>
  *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
- *                           <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ *                           <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                           <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
  *                           <attribute name="Rounding" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                           <attribute name="ZoneSize" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ *                           <attribute name="ZoneSize" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
  *                         </restriction>
  *                       </complexContent>
  *                     </complexType>
@@ -96,17 +94,17 @@ import javax.xml.bind.annotation.XmlType;
  *                               <complexType>
  *                                 <complexContent>
  *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                                     <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                     <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}int" />
  *                                     <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                                     <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                                     <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                                     <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                     <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
+ *                                     <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
+ *                                     <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
  *                                   </restriction>
  *                                 </complexContent>
  *                               </complexType>
  *                             </element>
  *                           </sequence>
- *                           <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
  *                           <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
  *                         </restriction>
  *                       </complexContent>
@@ -126,9 +124,9 @@ import javax.xml.bind.annotation.XmlType;
  *                     <complexType>
  *                       <complexContent>
  *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                           <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                           <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
+ *                           <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
+ *                           <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
  *                         </restriction>
  *                       </complexContent>
  *                     </complexType>
@@ -143,72 +141,63 @@ import javax.xml.bind.annotation.XmlType;
  *   </complexContent>
  * </complexType>
  * 
- * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { - "raceID", - "raceType", - "creationTimeDate", - "raceStartTime", - "participants", - "compoundMarkSequence", - "course", - "courseLimit" + "raceID", + "raceType", + "creationTimeDate", + "raceStartTime", + "participants", + "compoundMarkSequence", + "course", + "courseLimit" }) @XmlRootElement(name = "Race") -public class Race { +public class XMLRace { - @XmlElement(name = "RaceID", required = true) - @XmlSchemaType(name = "positiveInteger") - protected BigInteger raceID; + @XmlElement(name = "RaceID") + protected int raceID; @XmlElement(name = "RaceType", required = true) protected String raceType; @XmlElement(name = "CreationTimeDate", required = true) protected String creationTimeDate; @XmlElement(name = "RaceStartTime", required = true) - protected RaceStartTime raceStartTime; + protected XMLRaceStartTime raceStartTime; @XmlElement(name = "Participants", required = true) - protected Participants participants; + protected XMLParticipants participants; @XmlElement(name = "CompoundMarkSequence", required = true) - protected CompoundMarkSequence compoundMarkSequence; + protected XMLCompoundMarkSequence compoundMarkSequence; @XmlElement(name = "Course", required = true) - protected Course course; + protected XMLCourse course; @XmlElement(name = "CourseLimit", required = true) - protected CourseLimit courseLimit; + protected XMLCourseLimit courseLimit; /** * Gets the value of the raceID property. - * - * @return - * possible object is - * {@link BigInteger } - * + * */ - public BigInteger getRaceID() { + public int getRaceID() { return raceID; } /** * Sets the value of the raceID property. - * - * @param value - * allowed object is - * {@link BigInteger } - * + * */ - public void setRaceID(BigInteger value) { + public void setRaceID(int value) { this.raceID = value; } /** * Gets the value of the raceType property. - * + * * @return * possible object is * {@link String } - * + * */ public String getRaceType() { return raceType; @@ -216,11 +205,11 @@ public class Race { /** * Sets the value of the raceType property. - * + * * @param value * allowed object is * {@link String } - * + * */ public void setRaceType(String value) { this.raceType = value; @@ -228,11 +217,11 @@ public class Race { /** * Gets the value of the creationTimeDate property. - * + * * @return * possible object is * {@link String } - * + * */ public String getCreationTimeDate() { return creationTimeDate; @@ -240,11 +229,11 @@ public class Race { /** * Sets the value of the creationTimeDate property. - * + * * @param value * allowed object is * {@link String } - * + * */ public void setCreationTimeDate(String value) { this.creationTimeDate = value; @@ -252,121 +241,121 @@ public class Race { /** * Gets the value of the raceStartTime property. - * + * * @return * possible object is - * {@link RaceStartTime } - * + * {@link XMLRaceStartTime } + * */ - public RaceStartTime getRaceStartTime() { + public XMLRaceStartTime getRaceStartTime() { return raceStartTime; } /** * Sets the value of the raceStartTime property. - * + * * @param value * allowed object is - * {@link RaceStartTime } - * + * {@link XMLRaceStartTime } + * */ - public void setRaceStartTime(RaceStartTime value) { + public void setRaceStartTime(XMLRaceStartTime value) { this.raceStartTime = value; } /** * Gets the value of the participants property. - * + * * @return * possible object is - * {@link Participants } - * + * {@link XMLParticipants } + * */ - public Participants getParticipants() { + public XMLParticipants getParticipants() { return participants; } /** * Sets the value of the participants property. - * + * * @param value * allowed object is - * {@link Participants } - * + * {@link XMLParticipants } + * */ - public void setParticipants(Participants value) { + public void setParticipants(XMLParticipants value) { this.participants = value; } /** * Gets the value of the compoundMarkSequence property. - * + * * @return * possible object is - * {@link CompoundMarkSequence } - * + * {@link XMLCompoundMarkSequence } + * */ - public CompoundMarkSequence getCompoundMarkSequence() { + public XMLCompoundMarkSequence getCompoundMarkSequence() { return compoundMarkSequence; } /** * Sets the value of the compoundMarkSequence property. - * + * * @param value * allowed object is - * {@link CompoundMarkSequence } - * + * {@link XMLCompoundMarkSequence } + * */ - public void setCompoundMarkSequence(CompoundMarkSequence value) { + public void setCompoundMarkSequence(XMLCompoundMarkSequence value) { this.compoundMarkSequence = value; } /** * Gets the value of the course property. - * + * * @return * possible object is - * {@link Course } - * + * {@link XMLCourse } + * */ - public Course getCourse() { + public XMLCourse getCourse() { return course; } /** * Sets the value of the course property. - * + * * @param value * allowed object is - * {@link Course } - * + * {@link XMLCourse } + * */ - public void setCourse(Course value) { + public void setCourse(XMLCourse value) { this.course = value; } /** * Gets the value of the courseLimit property. - * + * * @return * possible object is - * {@link CourseLimit } - * + * {@link XMLCourseLimit } + * */ - public CourseLimit getCourseLimit() { + public XMLCourseLimit getCourseLimit() { return courseLimit; } /** * Sets the value of the courseLimit property. - * + * * @param value * allowed object is - * {@link CourseLimit } - * + * {@link XMLCourseLimit } + * */ - public void setCourseLimit(CourseLimit value) { + public void setCourseLimit(XMLCourseLimit value) { this.courseLimit = value; } diff --git a/racevisionGame/src/main/java/shared/xml/Race/XMLRaceFactory.java b/racevisionGame/src/main/java/shared/xml/Race/XMLRaceFactory.java new file mode 100644 index 00000000..385f7fae --- /dev/null +++ b/racevisionGame/src/main/java/shared/xml/Race/XMLRaceFactory.java @@ -0,0 +1,127 @@ +// +// 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.08.14 at 02:41:51 AM NZST +// + + +package shared.xml.Race; + +import javax.xml.bind.annotation.XmlRegistry; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the shared.xml.Race 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 XMLRaceFactory { + + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: shared.xml.Race + * + */ + public XMLRaceFactory() { + } + + /** + * Create an instance of {@link XMLRace } + * + */ + public XMLRace createRace() { + return new XMLRace(); + } + + /** + * Create an instance of {@link XMLRaceStartTime } + * + */ + public XMLRaceStartTime createXMLRaceStartTime() { + return new XMLRaceStartTime(); + } + + /** + * Create an instance of {@link XMLParticipants } + * + */ + public XMLParticipants createXMLParticipants() { + return new XMLParticipants(); + } + + /** + * Create an instance of {@link XMLCompoundMarkSequence } + * + */ + public XMLCompoundMarkSequence createXMLCompoundMarkSequence() { + return new XMLCompoundMarkSequence(); + } + + /** + * Create an instance of {@link XMLCourse } + * + */ + public XMLCourse createXMLCourse() { + return new XMLCourse(); + } + + /** + * Create an instance of {@link XMLCourseLimit } + * + */ + public XMLCourseLimit createXMLCourseLimit() { + return new XMLCourseLimit(); + } + + /** + * Create an instance of {@link XMLLimit } + * + */ + public XMLLimit createXMLLimit() { + return new XMLLimit(); + } + + /** + * Create an instance of {@link XMLCompoundMark } + * + */ + public XMLCompoundMark createXMLCompoundMark() { + return new XMLCompoundMark(); + } + + /** + * Create an instance of {@link XMLMark } + * + */ + public XMLMark createXMLMark() { + return new XMLMark(); + } + + /** + * Create an instance of {@link XMLCorner } + * + */ + public XMLCorner createXMLCorner() { + return new XMLCorner(); + } + + /** + * Create an instance of {@link XMLYacht } + * + */ + public XMLYacht createXMLYacht() { + return new XMLYacht(); + } + +} diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/schema/RaceStartTime.java b/racevisionGame/src/main/java/shared/xml/Race/XMLRaceStartTime.java similarity index 95% rename from racevisionGame/src/main/resources/mock/mockXML/schema/schema/RaceStartTime.java rename to racevisionGame/src/main/java/shared/xml/Race/XMLRaceStartTime.java index e01f3b64..362d2590 100644 --- a/racevisionGame/src/main/resources/mock/mockXML/schema/schema/RaceStartTime.java +++ b/racevisionGame/src/main/java/shared/xml/Race/XMLRaceStartTime.java @@ -2,11 +2,11 @@ // 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.08.13 at 11:01:23 PM NZST +// Generated on: 2017.08.14 at 02:54:32 AM NZST // -package schema; +package shared.xml.Race; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; @@ -34,7 +34,7 @@ import javax.xml.bind.annotation.XmlType; */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") -public class RaceStartTime { +public class XMLRaceStartTime { @XmlAttribute(name = "Postpone", required = true) protected String postpone; diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/schema/Yacht.java b/racevisionGame/src/main/java/shared/xml/Race/XMLYacht.java similarity index 81% rename from racevisionGame/src/main/resources/mock/mockXML/schema/schema/Yacht.java rename to racevisionGame/src/main/java/shared/xml/Race/XMLYacht.java index 7f8ad761..1b2f0764 100644 --- a/racevisionGame/src/main/resources/mock/mockXML/schema/schema/Yacht.java +++ b/racevisionGame/src/main/java/shared/xml/Race/XMLYacht.java @@ -2,11 +2,11 @@ // 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.08.13 at 11:01:23 PM NZST +// Generated on: 2017.08.14 at 02:54:32 AM NZST // -package schema; +package shared.xml.Race; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; @@ -23,7 +23,7 @@ import javax.xml.bind.annotation.XmlType; * <complexType> * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <attribute name="SourceID" 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="Entry" type="{http://www.w3.org/2001/XMLSchema}string" /> * </restriction> * </complexContent> @@ -34,34 +34,26 @@ import javax.xml.bind.annotation.XmlType; */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") -public class Yacht { +public class XMLYacht { @XmlAttribute(name = "SourceID", required = true) - protected String sourceID; + protected int sourceID; @XmlAttribute(name = "Entry") protected String entry; /** * Gets the value of the sourceID property. * - * @return - * possible object is - * {@link String } - * */ - public String getSourceID() { + public int getSourceID() { return sourceID; } /** * Sets the value of the sourceID property. * - * @param value - * allowed object is - * {@link String } - * */ - public void setSourceID(String value) { + public void setSourceID(int value) { this.sourceID = value; } diff --git a/racevisionGame/src/main/java/shared/xml/XMLUtilities.java b/racevisionGame/src/main/java/shared/xml/XMLUtilities.java index 78ed493d..95332c28 100644 --- a/racevisionGame/src/main/java/shared/xml/XMLUtilities.java +++ b/racevisionGame/src/main/java/shared/xml/XMLUtilities.java @@ -3,6 +3,7 @@ package shared.xml; import mock.xml.Race; import mock.xml.RaceXMLCreator; import org.w3c.dom.Document; +import org.xml.sax.InputSource; import org.xml.sax.SAXException; import javax.xml.XMLConstants; @@ -17,6 +18,7 @@ import javax.xml.transform.dom.DOMSource; import javax.xml.validation.Schema; import javax.xml.validation.SchemaFactory; import javax.xml.validation.Validator; +import java.io.ByteArrayInputStream; import java.io.File; import java.io.IOException; import java.io.StringWriter; @@ -47,7 +49,7 @@ public class XMLUtilities { public static Object xmlToClass(String xml, URL schemaURL, Class c) throws ParserConfigurationException, IOException, SAXException, JAXBException { DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - Document document = parser.parse(xml); + Document document = parser.parse(new InputSource(new ByteArrayInputStream(xml.getBytes("utf-8")))); return xmlToClass(document, schemaURL, c); } diff --git a/racevisionGame/src/main/java/visualiser/Controllers/ConnectionController.java b/racevisionGame/src/main/java/visualiser/Controllers/ConnectionController.java index ae8c682c..b66a8c4b 100644 --- a/racevisionGame/src/main/java/visualiser/Controllers/ConnectionController.java +++ b/racevisionGame/src/main/java/visualiser/Controllers/ConnectionController.java @@ -6,12 +6,15 @@ import javafx.fxml.FXML; import javafx.scene.control.*; import javafx.scene.layout.AnchorPane; import mock.app.Event; +import org.xml.sax.SAXException; import shared.exceptions.InvalidBoatDataException; import shared.exceptions.InvalidRaceDataException; import shared.exceptions.InvalidRegattaDataException; import shared.exceptions.XMLReaderException; import visualiser.model.RaceConnection; +import javax.xml.bind.JAXBException; +import javax.xml.parsers.ParserConfigurationException; import javax.xml.soap.Text; import java.io.IOException; import java.net.Socket; @@ -170,6 +173,14 @@ public class ConnectionController extends Controller { e.printStackTrace(); } catch (UnknownHostException e) { e.printStackTrace(); + } catch (SAXException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } catch (JAXBException e) { + e.printStackTrace(); + } catch (ParserConfigurationException e) { + e.printStackTrace(); } } } diff --git a/racevisionGame/src/main/java/visualiser/Controllers/HostController.java b/racevisionGame/src/main/java/visualiser/Controllers/HostController.java index e87ea689..a4a20340 100644 --- a/racevisionGame/src/main/java/visualiser/Controllers/HostController.java +++ b/racevisionGame/src/main/java/visualiser/Controllers/HostController.java @@ -6,12 +6,15 @@ import javafx.scene.control.*; import javafx.scene.layout.AnchorPane; import javafx.stage.Stage; import mock.app.Event; +import org.xml.sax.SAXException; import shared.exceptions.InvalidBoatDataException; import shared.exceptions.InvalidRaceDataException; import shared.exceptions.InvalidRegattaDataException; import shared.exceptions.XMLReaderException; import visualiser.model.RaceConnection; +import javax.xml.bind.JAXBException; +import javax.xml.parsers.ParserConfigurationException; import java.io.IOException; import java.net.Socket; import java.net.URL; @@ -55,6 +58,12 @@ public class HostController extends Controller { e.printStackTrace(); } catch (InvalidRegattaDataException e) { e.printStackTrace(); + } catch (SAXException e) { + e.printStackTrace(); + } catch (JAXBException e) { + e.printStackTrace(); + } catch (ParserConfigurationException e) { + e.printStackTrace(); } } diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/bindingwp.xjb b/racevisionGame/src/main/resources/mock/mockXML/schema/bindingwp.xjb new file mode 100644 index 00000000..7d19360a --- /dev/null +++ b/racevisionGame/src/main/resources/mock/mockXML/schema/bindingwp.xjb @@ -0,0 +1,17 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/generated/ObjectFactory.java b/racevisionGame/src/main/resources/mock/mockXML/schema/generated/ObjectFactory.java deleted file mode 100644 index 3a391bcd..00000000 --- a/racevisionGame/src/main/resources/mock/mockXML/schema/generated/ObjectFactory.java +++ /dev/null @@ -1,127 +0,0 @@ -// -// 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.08.13 at 11:00:04 PM NZST -// - - -package generated; - -import javax.xml.bind.annotation.XmlRegistry; - - -/** - * This object contains factory methods for each - * Java content interface and Java element interface - * generated in the generated 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: generated - * - */ - public ObjectFactory() { - } - - /** - * Create an instance of {@link Race } - * - */ - public Race createRace() { - return new Race(); - } - - /** - * Create an instance of {@link Race.CourseLimit } - * - */ - public Race.CourseLimit createRaceCourseLimit() { - return new Race.CourseLimit(); - } - - /** - * Create an instance of {@link Race.Course } - * - */ - public Race.Course createRaceCourse() { - return new Race.Course(); - } - - /** - * Create an instance of {@link Race.Course.CompoundMark } - * - */ - public Race.Course.CompoundMark createRaceCourseCompoundMark() { - return new Race.Course.CompoundMark(); - } - - /** - * Create an instance of {@link Race.CompoundMarkSequence } - * - */ - public Race.CompoundMarkSequence createRaceCompoundMarkSequence() { - return new Race.CompoundMarkSequence(); - } - - /** - * Create an instance of {@link Race.Participants } - * - */ - public Race.Participants createRaceParticipants() { - return new Race.Participants(); - } - - /** - * Create an instance of {@link Race.RaceStartTime } - * - */ - public Race.RaceStartTime createRaceRaceStartTime() { - return new Race.RaceStartTime(); - } - - /** - * Create an instance of {@link Race.CourseLimit.Limit } - * - */ - public Race.CourseLimit.Limit createRaceCourseLimitLimit() { - return new Race.CourseLimit.Limit(); - } - - /** - * Create an instance of {@link Race.Course.CompoundMark.Mark } - * - */ - public Race.Course.CompoundMark.Mark createRaceCourseCompoundMarkMark() { - return new Race.Course.CompoundMark.Mark(); - } - - /** - * Create an instance of {@link Race.CompoundMarkSequence.Corner } - * - */ - public Race.CompoundMarkSequence.Corner createRaceCompoundMarkSequenceCorner() { - return new Race.CompoundMarkSequence.Corner(); - } - - /** - * Create an instance of {@link Race.Participants.Yacht } - * - */ - public Race.Participants.Yacht createRaceParticipantsYacht() { - return new Race.Participants.Yacht(); - } - -} diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/generated/Race.java b/racevisionGame/src/main/resources/mock/mockXML/schema/generated/Race.java deleted file mode 100644 index 07598160..00000000 --- a/racevisionGame/src/main/resources/mock/mockXML/schema/generated/Race.java +++ /dev/null @@ -1,1351 +0,0 @@ -// -// 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.08.13 at 11:00:04 PM NZST -// - - -package generated; - -import java.math.BigInteger; -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSchemaType; -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="RaceID" type="{http://www.w3.org/2001/XMLSchema}positiveInteger"/>
- *         <element name="RaceType" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="CreationTimeDate" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="RaceStartTime">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <attribute name="Postpone" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                 <attribute name="Time" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="Participants">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="Yacht" maxOccurs="unbounded">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                           <attribute name="Entry" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                         </restriction>
- *                       </complexContent>
- *                     </complexType>
- *                   </element>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="CompoundMarkSequence">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="Corner" maxOccurs="unbounded">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
- *                           <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
- *                           <attribute name="Rounding" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                           <attribute name="ZoneSize" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
- *                         </restriction>
- *                       </complexContent>
- *                     </complexType>
- *                   </element>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="Course">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="CompoundMark" maxOccurs="unbounded">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <sequence>
- *                             <element name="Mark" maxOccurs="unbounded">
- *                               <complexType>
- *                                 <complexContent>
- *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                                     <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                                     <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                                     <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                                     <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                                     <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                                   </restriction>
- *                                 </complexContent>
- *                               </complexType>
- *                             </element>
- *                           </sequence>
- *                           <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                           <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                         </restriction>
- *                       </complexContent>
- *                     </complexType>
- *                   </element>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="CourseLimit">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="Limit" maxOccurs="unbounded">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                           <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                           <attribute name="SeqID" use="required" 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 = { - "raceID", - "raceType", - "creationTimeDate", - "raceStartTime", - "participants", - "compoundMarkSequence", - "course", - "courseLimit" -}) -@XmlRootElement(name = "Race") -public class Race { - - @XmlElement(name = "RaceID", required = true) - @XmlSchemaType(name = "positiveInteger") - protected BigInteger raceID; - @XmlElement(name = "RaceType", required = true) - protected String raceType; - @XmlElement(name = "CreationTimeDate", required = true) - protected String creationTimeDate; - @XmlElement(name = "RaceStartTime", required = true) - protected Race.RaceStartTime raceStartTime; - @XmlElement(name = "Participants", required = true) - protected Race.Participants participants; - @XmlElement(name = "CompoundMarkSequence", required = true) - protected Race.CompoundMarkSequence compoundMarkSequence; - @XmlElement(name = "Course", required = true) - protected Race.Course course; - @XmlElement(name = "CourseLimit", required = true) - protected Race.CourseLimit courseLimit; - - /** - * Gets the value of the raceID property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - public BigInteger getRaceID() { - return raceID; - } - - /** - * Sets the value of the raceID property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setRaceID(BigInteger value) { - this.raceID = value; - } - - /** - * Gets the value of the raceType property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getRaceType() { - return raceType; - } - - /** - * Sets the value of the raceType property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setRaceType(String value) { - this.raceType = value; - } - - /** - * Gets the value of the creationTimeDate property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getCreationTimeDate() { - return creationTimeDate; - } - - /** - * Sets the value of the creationTimeDate property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setCreationTimeDate(String value) { - this.creationTimeDate = value; - } - - /** - * Gets the value of the raceStartTime property. - * - * @return - * possible object is - * {@link Race.RaceStartTime } - * - */ - public Race.RaceStartTime getRaceStartTime() { - return raceStartTime; - } - - /** - * Sets the value of the raceStartTime property. - * - * @param value - * allowed object is - * {@link Race.RaceStartTime } - * - */ - public void setRaceStartTime(Race.RaceStartTime value) { - this.raceStartTime = value; - } - - /** - * Gets the value of the participants property. - * - * @return - * possible object is - * {@link Race.Participants } - * - */ - public Race.Participants getParticipants() { - return participants; - } - - /** - * Sets the value of the participants property. - * - * @param value - * allowed object is - * {@link Race.Participants } - * - */ - public void setParticipants(Race.Participants value) { - this.participants = value; - } - - /** - * Gets the value of the compoundMarkSequence property. - * - * @return - * possible object is - * {@link Race.CompoundMarkSequence } - * - */ - public Race.CompoundMarkSequence getCompoundMarkSequence() { - return compoundMarkSequence; - } - - /** - * Sets the value of the compoundMarkSequence property. - * - * @param value - * allowed object is - * {@link Race.CompoundMarkSequence } - * - */ - public void setCompoundMarkSequence(Race.CompoundMarkSequence value) { - this.compoundMarkSequence = value; - } - - /** - * Gets the value of the course property. - * - * @return - * possible object is - * {@link Race.Course } - * - */ - public Race.Course getCourse() { - return course; - } - - /** - * Sets the value of the course property. - * - * @param value - * allowed object is - * {@link Race.Course } - * - */ - public void setCourse(Race.Course value) { - this.course = value; - } - - /** - * Gets the value of the courseLimit property. - * - * @return - * possible object is - * {@link Race.CourseLimit } - * - */ - public Race.CourseLimit getCourseLimit() { - return courseLimit; - } - - /** - * Sets the value of the courseLimit property. - * - * @param value - * allowed object is - * {@link Race.CourseLimit } - * - */ - public void setCourseLimit(Race.CourseLimit value) { - this.courseLimit = 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="Corner" maxOccurs="unbounded">
-     *           <complexType>
-     *             <complexContent>
-     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *                 <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
-     *                 <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
-     *                 <attribute name="Rounding" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                 <attribute name="ZoneSize" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
-     *               </restriction>
-     *             </complexContent>
-     *           </complexType>
-     *         </element>
-     *       </sequence>
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
-     * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { - "corner" - }) - public static class CompoundMarkSequence { - - @XmlElement(name = "Corner", required = true) - protected List corner; - - /** - * Gets the value of the corner property. - * - *

- * 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 corner property. - * - *

- * For example, to add a new item, do as follows: - *

-         *    getCorner().add(newItem);
-         * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Race.CompoundMarkSequence.Corner } - * - * - */ - public List getCorner() { - if (corner == null) { - corner = new ArrayList(); - } - return this.corner; - } - - - /** - *

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">
-         *       <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
-         *       <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
-         *       <attribute name="Rounding" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *       <attribute name="ZoneSize" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
-         *     </restriction>
-         *   </complexContent>
-         * </complexType>
-         * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class Corner { - - @XmlAttribute(name = "CompoundMarkID", required = true) - @XmlSchemaType(name = "positiveInteger") - protected BigInteger compoundMarkID; - @XmlAttribute(name = "SeqID", required = true) - @XmlSchemaType(name = "positiveInteger") - protected BigInteger seqID; - @XmlAttribute(name = "Rounding", required = true) - protected String rounding; - @XmlAttribute(name = "ZoneSize", required = true) - @XmlSchemaType(name = "positiveInteger") - protected BigInteger zoneSize; - - /** - * Gets the value of the compoundMarkID property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - public BigInteger getCompoundMarkID() { - return compoundMarkID; - } - - /** - * Sets the value of the compoundMarkID property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setCompoundMarkID(BigInteger value) { - this.compoundMarkID = value; - } - - /** - * Gets the value of the seqID property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - public BigInteger getSeqID() { - return seqID; - } - - /** - * Sets the value of the seqID property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setSeqID(BigInteger value) { - this.seqID = value; - } - - /** - * Gets the value of the rounding property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getRounding() { - return rounding; - } - - /** - * Sets the value of the rounding property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setRounding(String value) { - this.rounding = value; - } - - /** - * Gets the value of the zoneSize property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - public BigInteger getZoneSize() { - return zoneSize; - } - - /** - * Sets the value of the zoneSize property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setZoneSize(BigInteger value) { - this.zoneSize = 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="CompoundMark" maxOccurs="unbounded">
-     *           <complexType>
-     *             <complexContent>
-     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *                 <sequence>
-     *                   <element name="Mark" maxOccurs="unbounded">
-     *                     <complexType>
-     *                       <complexContent>
-     *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *                           <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                           <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                           <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                           <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                           <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                         </restriction>
-     *                       </complexContent>
-     *                     </complexType>
-     *                   </element>
-     *                 </sequence>
-     *                 <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                 <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *               </restriction>
-     *             </complexContent>
-     *           </complexType>
-     *         </element>
-     *       </sequence>
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
-     * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { - "compoundMark" - }) - public static class Course { - - @XmlElement(name = "CompoundMark", required = true) - protected List compoundMark; - - /** - * Gets the value of the compoundMark property. - * - *

- * 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 compoundMark property. - * - *

- * For example, to add a new item, do as follows: - *

-         *    getCompoundMark().add(newItem);
-         * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Race.Course.CompoundMark } - * - * - */ - public List getCompoundMark() { - if (compoundMark == null) { - compoundMark = new ArrayList(); - } - return this.compoundMark; - } - - - /** - *

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="Mark" maxOccurs="unbounded">
-         *           <complexType>
-         *             <complexContent>
-         *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-         *                 <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *                 <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *                 <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *                 <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *                 <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *               </restriction>
-         *             </complexContent>
-         *           </complexType>
-         *         </element>
-         *       </sequence>
-         *       <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *       <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *     </restriction>
-         *   </complexContent>
-         * </complexType>
-         * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { - "mark" - }) - public static class CompoundMark { - - @XmlElement(name = "Mark", required = true) - protected List mark; - @XmlAttribute(name = "CompoundMarkID", required = true) - protected String compoundMarkID; - @XmlAttribute(name = "Name", required = true) - protected String name; - - /** - * Gets the value of the mark property. - * - *

- * 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 mark property. - * - *

- * For example, to add a new item, do as follows: - *

-             *    getMark().add(newItem);
-             * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Race.Course.CompoundMark.Mark } - * - * - */ - public List getMark() { - if (mark == null) { - mark = new ArrayList(); - } - return this.mark; - } - - /** - * Gets the value of the compoundMarkID property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getCompoundMarkID() { - return compoundMarkID; - } - - /** - * Sets the value of the compoundMarkID property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setCompoundMarkID(String value) { - this.compoundMarkID = value; - } - - /** - * Gets the value of the name property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getName() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setName(String value) { - this.name = 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">
-             *       <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
-             *       <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-             *       <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-             *       <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-             *       <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-             *     </restriction>
-             *   </complexContent>
-             * </complexType>
-             * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class Mark { - - @XmlAttribute(name = "SeqId") - protected String seqId; - @XmlAttribute(name = "Name", required = true) - protected String name; - @XmlAttribute(name = "TargetLat", required = true) - protected String targetLat; - @XmlAttribute(name = "TargetLng", required = true) - protected String targetLng; - @XmlAttribute(name = "SourceID", required = true) - protected String sourceID; - - /** - * Gets the value of the seqId property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getSeqId() { - return seqId; - } - - /** - * Sets the value of the seqId property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setSeqId(String value) { - this.seqId = value; - } - - /** - * Gets the value of the name property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getName() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setName(String value) { - this.name = value; - } - - /** - * Gets the value of the targetLat property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getTargetLat() { - return targetLat; - } - - /** - * Sets the value of the targetLat property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setTargetLat(String value) { - this.targetLat = value; - } - - /** - * Gets the value of the targetLng property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getTargetLng() { - return targetLng; - } - - /** - * Sets the value of the targetLng property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setTargetLng(String value) { - this.targetLng = value; - } - - /** - * Gets the value of the sourceID property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getSourceID() { - return sourceID; - } - - /** - * Sets the value of the sourceID property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setSourceID(String value) { - this.sourceID = 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="Limit" maxOccurs="unbounded">
-     *           <complexType>
-     *             <complexContent>
-     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *                 <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                 <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                 <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *               </restriction>
-     *             </complexContent>
-     *           </complexType>
-     *         </element>
-     *       </sequence>
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
-     * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { - "limit" - }) - public static class CourseLimit { - - @XmlElement(name = "Limit", required = true) - protected List limit; - - /** - * Gets the value of the limit property. - * - *

- * 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 limit property. - * - *

- * For example, to add a new item, do as follows: - *

-         *    getLimit().add(newItem);
-         * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Race.CourseLimit.Limit } - * - * - */ - public List getLimit() { - if (limit == null) { - limit = new ArrayList(); - } - return this.limit; - } - - - /** - *

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">
-         *       <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *       <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *       <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *     </restriction>
-         *   </complexContent>
-         * </complexType>
-         * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class Limit { - - @XmlAttribute(name = "Lat", required = true) - protected String lat; - @XmlAttribute(name = "Lon", required = true) - protected String lon; - @XmlAttribute(name = "SeqID", required = true) - protected String seqID; - - /** - * Gets the value of the lat property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getLat() { - return lat; - } - - /** - * Sets the value of the lat property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setLat(String value) { - this.lat = value; - } - - /** - * Gets the value of the lon property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getLon() { - return lon; - } - - /** - * Sets the value of the lon property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setLon(String value) { - this.lon = value; - } - - /** - * Gets the value of the seqID property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getSeqID() { - return seqID; - } - - /** - * Sets the value of the seqID property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setSeqID(String value) { - this.seqID = 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="Yacht" maxOccurs="unbounded">
-     *           <complexType>
-     *             <complexContent>
-     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *                 <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                 <attribute name="Entry" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *               </restriction>
-     *             </complexContent>
-     *           </complexType>
-     *         </element>
-     *       </sequence>
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
-     * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { - "yacht" - }) - public static class Participants { - - @XmlElement(name = "Yacht", required = true) - protected List yacht; - - /** - * Gets the value of the yacht property. - * - *

- * 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 yacht property. - * - *

- * For example, to add a new item, do as follows: - *

-         *    getYacht().add(newItem);
-         * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Race.Participants.Yacht } - * - * - */ - public List getYacht() { - if (yacht == null) { - yacht = new ArrayList(); - } - return this.yacht; - } - - - /** - *

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">
-         *       <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *       <attribute name="Entry" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *     </restriction>
-         *   </complexContent>
-         * </complexType>
-         * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class Yacht { - - @XmlAttribute(name = "SourceID", required = true) - protected String sourceID; - @XmlAttribute(name = "Entry") - protected String entry; - - /** - * Gets the value of the sourceID property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getSourceID() { - return sourceID; - } - - /** - * Sets the value of the sourceID property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setSourceID(String value) { - this.sourceID = value; - } - - /** - * Gets the value of the entry property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getEntry() { - return entry; - } - - /** - * Sets the value of the entry property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setEntry(String value) { - this.entry = 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">
-     *       <attribute name="Postpone" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *       <attribute name="Time" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
-     * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class RaceStartTime { - - @XmlAttribute(name = "Postpone", required = true) - protected String postpone; - @XmlAttribute(name = "Time", required = true) - protected String time; - - /** - * Gets the value of the postpone property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getPostpone() { - return postpone; - } - - /** - * Sets the value of the postpone property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setPostpone(String value) { - this.postpone = value; - } - - /** - * Gets the value of the time property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getTime() { - return time; - } - - /** - * Sets the value of the time property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setTime(String value) { - this.time = value; - } - - } - -} diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/raceSchema.xsd b/racevisionGame/src/main/resources/mock/mockXML/schema/raceSchema.xsd index 755722ff..3752209e 100644 --- a/racevisionGame/src/main/resources/mock/mockXML/schema/raceSchema.xsd +++ b/racevisionGame/src/main/resources/mock/mockXML/schema/raceSchema.xsd @@ -3,7 +3,7 @@ - + @@ -17,7 +17,7 @@ - + @@ -29,10 +29,10 @@ - - + + - + @@ -46,15 +46,15 @@ - + - - - + + + - + @@ -66,9 +66,9 @@ - - - + + + diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/scd/ObjectFactory.java b/racevisionGame/src/main/resources/mock/mockXML/schema/scd/ObjectFactory.java deleted file mode 100644 index 2a57580d..00000000 --- a/racevisionGame/src/main/resources/mock/mockXML/schema/scd/ObjectFactory.java +++ /dev/null @@ -1,127 +0,0 @@ -// -// 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.08.13 at 10:39:29 PM NZST -// - - -package scd; - -import javax.xml.bind.annotation.XmlRegistry; - - -/** - * This object contains factory methods for each - * Java content interface and Java element interface - * generated in the scd 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: scd - * - */ - public ObjectFactory() { - } - - /** - * Create an instance of {@link Race } - * - */ - public Race createRace() { - return new Race(); - } - - /** - * Create an instance of {@link Race.CourseLimit } - * - */ - public Race.CourseLimit createRaceCourseLimit() { - return new Race.CourseLimit(); - } - - /** - * Create an instance of {@link Race.Course } - * - */ - public Race.Course createRaceCourse() { - return new Race.Course(); - } - - /** - * Create an instance of {@link Race.Course.CompoundMark } - * - */ - public Race.Course.CompoundMark createRaceCourseCompoundMark() { - return new Race.Course.CompoundMark(); - } - - /** - * Create an instance of {@link Race.CompoundMarkSequence } - * - */ - public Race.CompoundMarkSequence createRaceCompoundMarkSequence() { - return new Race.CompoundMarkSequence(); - } - - /** - * Create an instance of {@link Race.Participants } - * - */ - public Race.Participants createRaceParticipants() { - return new Race.Participants(); - } - - /** - * Create an instance of {@link Race.RaceStartTime } - * - */ - public Race.RaceStartTime createRaceRaceStartTime() { - return new Race.RaceStartTime(); - } - - /** - * Create an instance of {@link Race.CourseLimit.Limit } - * - */ - public Race.CourseLimit.Limit createRaceCourseLimitLimit() { - return new Race.CourseLimit.Limit(); - } - - /** - * Create an instance of {@link Race.Course.CompoundMark.Mark } - * - */ - public Race.Course.CompoundMark.Mark createRaceCourseCompoundMarkMark() { - return new Race.Course.CompoundMark.Mark(); - } - - /** - * Create an instance of {@link Race.CompoundMarkSequence.Corner } - * - */ - public Race.CompoundMarkSequence.Corner createRaceCompoundMarkSequenceCorner() { - return new Race.CompoundMarkSequence.Corner(); - } - - /** - * Create an instance of {@link Race.Participants.Yacht } - * - */ - public Race.Participants.Yacht createRaceParticipantsYacht() { - return new Race.Participants.Yacht(); - } - -} diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/scd/Race.java b/racevisionGame/src/main/resources/mock/mockXML/schema/scd/Race.java deleted file mode 100644 index 77b991a7..00000000 --- a/racevisionGame/src/main/resources/mock/mockXML/schema/scd/Race.java +++ /dev/null @@ -1,1351 +0,0 @@ -// -// 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.08.13 at 10:39:29 PM NZST -// - - -package scd; - -import java.math.BigInteger; -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSchemaType; -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="RaceID" type="{http://www.w3.org/2001/XMLSchema}positiveInteger"/>
- *         <element name="RaceType" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="CreationTimeDate" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="RaceStartTime">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <attribute name="Postpone" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                 <attribute name="Time" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="Participants">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="Yacht" maxOccurs="unbounded">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                           <attribute name="Entry" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                         </restriction>
- *                       </complexContent>
- *                     </complexType>
- *                   </element>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="CompoundMarkSequence">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="Corner" maxOccurs="unbounded">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
- *                           <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
- *                           <attribute name="Rounding" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                           <attribute name="ZoneSize" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
- *                         </restriction>
- *                       </complexContent>
- *                     </complexType>
- *                   </element>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="Course">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="CompoundMark" maxOccurs="unbounded">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <sequence>
- *                             <element name="Mark" maxOccurs="unbounded">
- *                               <complexType>
- *                                 <complexContent>
- *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                                     <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                                     <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                                     <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                                     <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                                     <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                                   </restriction>
- *                                 </complexContent>
- *                               </complexType>
- *                             </element>
- *                           </sequence>
- *                           <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                           <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                         </restriction>
- *                       </complexContent>
- *                     </complexType>
- *                   </element>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="CourseLimit">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="Limit" maxOccurs="unbounded">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                           <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                           <attribute name="SeqID" use="required" 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 = { - "raceID", - "raceType", - "creationTimeDate", - "raceStartTime", - "participants", - "compoundMarkSequence", - "course", - "courseLimit" -}) -@XmlRootElement(name = "Race") -public class Race { - - @XmlElement(name = "RaceID", required = true) - @XmlSchemaType(name = "positiveInteger") - protected BigInteger raceID; - @XmlElement(name = "RaceType", required = true) - protected String raceType; - @XmlElement(name = "CreationTimeDate", required = true) - protected String creationTimeDate; - @XmlElement(name = "RaceStartTime", required = true) - protected Race.RaceStartTime raceStartTime; - @XmlElement(name = "Participants", required = true) - protected Race.Participants participants; - @XmlElement(name = "CompoundMarkSequence", required = true) - protected Race.CompoundMarkSequence compoundMarkSequence; - @XmlElement(name = "Course", required = true) - protected Race.Course course; - @XmlElement(name = "CourseLimit", required = true) - protected Race.CourseLimit courseLimit; - - /** - * Gets the value of the raceID property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - public BigInteger getRaceID() { - return raceID; - } - - /** - * Sets the value of the raceID property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setRaceID(BigInteger value) { - this.raceID = value; - } - - /** - * Gets the value of the raceType property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getRaceType() { - return raceType; - } - - /** - * Sets the value of the raceType property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setRaceType(String value) { - this.raceType = value; - } - - /** - * Gets the value of the creationTimeDate property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getCreationTimeDate() { - return creationTimeDate; - } - - /** - * Sets the value of the creationTimeDate property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setCreationTimeDate(String value) { - this.creationTimeDate = value; - } - - /** - * Gets the value of the raceStartTime property. - * - * @return - * possible object is - * {@link Race.RaceStartTime } - * - */ - public Race.RaceStartTime getRaceStartTime() { - return raceStartTime; - } - - /** - * Sets the value of the raceStartTime property. - * - * @param value - * allowed object is - * {@link Race.RaceStartTime } - * - */ - public void setRaceStartTime(Race.RaceStartTime value) { - this.raceStartTime = value; - } - - /** - * Gets the value of the participants property. - * - * @return - * possible object is - * {@link Race.Participants } - * - */ - public Race.Participants getParticipants() { - return participants; - } - - /** - * Sets the value of the participants property. - * - * @param value - * allowed object is - * {@link Race.Participants } - * - */ - public void setParticipants(Race.Participants value) { - this.participants = value; - } - - /** - * Gets the value of the compoundMarkSequence property. - * - * @return - * possible object is - * {@link Race.CompoundMarkSequence } - * - */ - public Race.CompoundMarkSequence getCompoundMarkSequence() { - return compoundMarkSequence; - } - - /** - * Sets the value of the compoundMarkSequence property. - * - * @param value - * allowed object is - * {@link Race.CompoundMarkSequence } - * - */ - public void setCompoundMarkSequence(Race.CompoundMarkSequence value) { - this.compoundMarkSequence = value; - } - - /** - * Gets the value of the course property. - * - * @return - * possible object is - * {@link Race.Course } - * - */ - public Race.Course getCourse() { - return course; - } - - /** - * Sets the value of the course property. - * - * @param value - * allowed object is - * {@link Race.Course } - * - */ - public void setCourse(Race.Course value) { - this.course = value; - } - - /** - * Gets the value of the courseLimit property. - * - * @return - * possible object is - * {@link Race.CourseLimit } - * - */ - public Race.CourseLimit getCourseLimit() { - return courseLimit; - } - - /** - * Sets the value of the courseLimit property. - * - * @param value - * allowed object is - * {@link Race.CourseLimit } - * - */ - public void setCourseLimit(Race.CourseLimit value) { - this.courseLimit = 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="Corner" maxOccurs="unbounded">
-     *           <complexType>
-     *             <complexContent>
-     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *                 <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
-     *                 <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
-     *                 <attribute name="Rounding" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                 <attribute name="ZoneSize" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
-     *               </restriction>
-     *             </complexContent>
-     *           </complexType>
-     *         </element>
-     *       </sequence>
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
-     * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { - "corner" - }) - public static class CompoundMarkSequence { - - @XmlElement(name = "Corner", required = true) - protected List corner; - - /** - * Gets the value of the corner property. - * - *

- * 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 corner property. - * - *

- * For example, to add a new item, do as follows: - *

-         *    getCorner().add(newItem);
-         * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Race.CompoundMarkSequence.Corner } - * - * - */ - public List getCorner() { - if (corner == null) { - corner = new ArrayList(); - } - return this.corner; - } - - - /** - *

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">
-         *       <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
-         *       <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
-         *       <attribute name="Rounding" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *       <attribute name="ZoneSize" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
-         *     </restriction>
-         *   </complexContent>
-         * </complexType>
-         * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class Corner { - - @XmlAttribute(name = "CompoundMarkID", required = true) - @XmlSchemaType(name = "positiveInteger") - protected BigInteger compoundMarkID; - @XmlAttribute(name = "SeqID", required = true) - @XmlSchemaType(name = "positiveInteger") - protected BigInteger seqID; - @XmlAttribute(name = "Rounding", required = true) - protected String rounding; - @XmlAttribute(name = "ZoneSize", required = true) - @XmlSchemaType(name = "positiveInteger") - protected BigInteger zoneSize; - - /** - * Gets the value of the compoundMarkID property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - public BigInteger getCompoundMarkID() { - return compoundMarkID; - } - - /** - * Sets the value of the compoundMarkID property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setCompoundMarkID(BigInteger value) { - this.compoundMarkID = value; - } - - /** - * Gets the value of the seqID property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - public BigInteger getSeqID() { - return seqID; - } - - /** - * Sets the value of the seqID property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setSeqID(BigInteger value) { - this.seqID = value; - } - - /** - * Gets the value of the rounding property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getRounding() { - return rounding; - } - - /** - * Sets the value of the rounding property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setRounding(String value) { - this.rounding = value; - } - - /** - * Gets the value of the zoneSize property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - public BigInteger getZoneSize() { - return zoneSize; - } - - /** - * Sets the value of the zoneSize property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setZoneSize(BigInteger value) { - this.zoneSize = 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="CompoundMark" maxOccurs="unbounded">
-     *           <complexType>
-     *             <complexContent>
-     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *                 <sequence>
-     *                   <element name="Mark" maxOccurs="unbounded">
-     *                     <complexType>
-     *                       <complexContent>
-     *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *                           <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                           <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                           <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                           <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                           <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                         </restriction>
-     *                       </complexContent>
-     *                     </complexType>
-     *                   </element>
-     *                 </sequence>
-     *                 <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                 <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *               </restriction>
-     *             </complexContent>
-     *           </complexType>
-     *         </element>
-     *       </sequence>
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
-     * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { - "compoundMark" - }) - public static class Course { - - @XmlElement(name = "CompoundMark", required = true) - protected List compoundMark; - - /** - * Gets the value of the compoundMark property. - * - *

- * 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 compoundMark property. - * - *

- * For example, to add a new item, do as follows: - *

-         *    getCompoundMark().add(newItem);
-         * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Race.Course.CompoundMark } - * - * - */ - public List getCompoundMark() { - if (compoundMark == null) { - compoundMark = new ArrayList(); - } - return this.compoundMark; - } - - - /** - *

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="Mark" maxOccurs="unbounded">
-         *           <complexType>
-         *             <complexContent>
-         *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-         *                 <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *                 <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *                 <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *                 <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *                 <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *               </restriction>
-         *             </complexContent>
-         *           </complexType>
-         *         </element>
-         *       </sequence>
-         *       <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *       <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *     </restriction>
-         *   </complexContent>
-         * </complexType>
-         * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { - "mark" - }) - public static class CompoundMark { - - @XmlElement(name = "Mark", required = true) - protected List mark; - @XmlAttribute(name = "CompoundMarkID", required = true) - protected String compoundMarkID; - @XmlAttribute(name = "Name", required = true) - protected String name; - - /** - * Gets the value of the mark property. - * - *

- * 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 mark property. - * - *

- * For example, to add a new item, do as follows: - *

-             *    getMark().add(newItem);
-             * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Race.Course.CompoundMark.Mark } - * - * - */ - public List getMark() { - if (mark == null) { - mark = new ArrayList(); - } - return this.mark; - } - - /** - * Gets the value of the compoundMarkID property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getCompoundMarkID() { - return compoundMarkID; - } - - /** - * Sets the value of the compoundMarkID property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setCompoundMarkID(String value) { - this.compoundMarkID = value; - } - - /** - * Gets the value of the name property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getName() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setName(String value) { - this.name = 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">
-             *       <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}string" />
-             *       <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-             *       <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-             *       <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-             *       <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-             *     </restriction>
-             *   </complexContent>
-             * </complexType>
-             * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class Mark { - - @XmlAttribute(name = "SeqId") - protected String seqId; - @XmlAttribute(name = "Name", required = true) - protected String name; - @XmlAttribute(name = "TargetLat", required = true) - protected String targetLat; - @XmlAttribute(name = "TargetLng", required = true) - protected String targetLng; - @XmlAttribute(name = "SourceID", required = true) - protected String sourceID; - - /** - * Gets the value of the seqId property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getSeqId() { - return seqId; - } - - /** - * Sets the value of the seqId property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setSeqId(String value) { - this.seqId = value; - } - - /** - * Gets the value of the name property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getName() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setName(String value) { - this.name = value; - } - - /** - * Gets the value of the targetLat property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getTargetLat() { - return targetLat; - } - - /** - * Sets the value of the targetLat property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setTargetLat(String value) { - this.targetLat = value; - } - - /** - * Gets the value of the targetLng property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getTargetLng() { - return targetLng; - } - - /** - * Sets the value of the targetLng property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setTargetLng(String value) { - this.targetLng = value; - } - - /** - * Gets the value of the sourceID property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getSourceID() { - return sourceID; - } - - /** - * Sets the value of the sourceID property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setSourceID(String value) { - this.sourceID = 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="Limit" maxOccurs="unbounded">
-     *           <complexType>
-     *             <complexContent>
-     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *                 <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                 <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                 <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *               </restriction>
-     *             </complexContent>
-     *           </complexType>
-     *         </element>
-     *       </sequence>
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
-     * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { - "limit" - }) - public static class CourseLimit { - - @XmlElement(name = "Limit", required = true) - protected List limit; - - /** - * Gets the value of the limit property. - * - *

- * 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 limit property. - * - *

- * For example, to add a new item, do as follows: - *

-         *    getLimit().add(newItem);
-         * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Race.CourseLimit.Limit } - * - * - */ - public List getLimit() { - if (limit == null) { - limit = new ArrayList(); - } - return this.limit; - } - - - /** - *

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">
-         *       <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *       <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *       <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *     </restriction>
-         *   </complexContent>
-         * </complexType>
-         * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class Limit { - - @XmlAttribute(name = "Lat", required = true) - protected String lat; - @XmlAttribute(name = "Lon", required = true) - protected String lon; - @XmlAttribute(name = "SeqID", required = true) - protected String seqID; - - /** - * Gets the value of the lat property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getLat() { - return lat; - } - - /** - * Sets the value of the lat property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setLat(String value) { - this.lat = value; - } - - /** - * Gets the value of the lon property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getLon() { - return lon; - } - - /** - * Sets the value of the lon property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setLon(String value) { - this.lon = value; - } - - /** - * Gets the value of the seqID property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getSeqID() { - return seqID; - } - - /** - * Sets the value of the seqID property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setSeqID(String value) { - this.seqID = 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="Yacht" maxOccurs="unbounded">
-     *           <complexType>
-     *             <complexContent>
-     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *                 <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *                 <attribute name="Entry" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *               </restriction>
-     *             </complexContent>
-     *           </complexType>
-     *         </element>
-     *       </sequence>
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
-     * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { - "yacht" - }) - public static class Participants { - - @XmlElement(name = "Yacht", required = true) - protected List yacht; - - /** - * Gets the value of the yacht property. - * - *

- * 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 yacht property. - * - *

- * For example, to add a new item, do as follows: - *

-         *    getYacht().add(newItem);
-         * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Race.Participants.Yacht } - * - * - */ - public List getYacht() { - if (yacht == null) { - yacht = new ArrayList(); - } - return this.yacht; - } - - - /** - *

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">
-         *       <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *       <attribute name="Entry" type="{http://www.w3.org/2001/XMLSchema}string" />
-         *     </restriction>
-         *   </complexContent>
-         * </complexType>
-         * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class Yacht { - - @XmlAttribute(name = "SourceID", required = true) - protected String sourceID; - @XmlAttribute(name = "Entry") - protected String entry; - - /** - * Gets the value of the sourceID property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getSourceID() { - return sourceID; - } - - /** - * Sets the value of the sourceID property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setSourceID(String value) { - this.sourceID = value; - } - - /** - * Gets the value of the entry property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getEntry() { - return entry; - } - - /** - * Sets the value of the entry property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setEntry(String value) { - this.entry = 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">
-     *       <attribute name="Postpone" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *       <attribute name="Time" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
-     * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class RaceStartTime { - - @XmlAttribute(name = "Postpone", required = true) - protected String postpone; - @XmlAttribute(name = "Time", required = true) - protected String time; - - /** - * Gets the value of the postpone property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getPostpone() { - return postpone; - } - - /** - * Sets the value of the postpone property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setPostpone(String value) { - this.postpone = value; - } - - /** - * Gets the value of the time property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getTime() { - return time; - } - - /** - * Sets the value of the time property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setTime(String value) { - this.time = value; - } - - } - -} diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/schema/ObjectFactory.java b/racevisionGame/src/main/resources/mock/mockXML/schema/schema/ObjectFactory.java deleted file mode 100644 index eb4b55e9..00000000 --- a/racevisionGame/src/main/resources/mock/mockXML/schema/schema/ObjectFactory.java +++ /dev/null @@ -1,127 +0,0 @@ -// -// 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.08.13 at 11:01:23 PM NZST -// - - -package schema; - -import javax.xml.bind.annotation.XmlRegistry; - - -/** - * This object contains factory methods for each - * Java content interface and Java element interface - * generated in the schema 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: schema - * - */ - public ObjectFactory() { - } - - /** - * Create an instance of {@link Race } - * - */ - public Race createRace() { - return new Race(); - } - - /** - * Create an instance of {@link RaceStartTime } - * - */ - public RaceStartTime createRaceStartTime() { - return new RaceStartTime(); - } - - /** - * Create an instance of {@link Participants } - * - */ - public Participants createParticipants() { - return new Participants(); - } - - /** - * Create an instance of {@link CompoundMarkSequence } - * - */ - public CompoundMarkSequence createCompoundMarkSequence() { - return new CompoundMarkSequence(); - } - - /** - * Create an instance of {@link Course } - * - */ - public Course createCourse() { - return new Course(); - } - - /** - * Create an instance of {@link CourseLimit } - * - */ - public CourseLimit createCourseLimit() { - return new CourseLimit(); - } - - /** - * Create an instance of {@link Limit } - * - */ - public Limit createLimit() { - return new Limit(); - } - - /** - * Create an instance of {@link CompoundMark } - * - */ - public CompoundMark createCompoundMark() { - return new CompoundMark(); - } - - /** - * Create an instance of {@link Mark } - * - */ - public Mark createMark() { - return new Mark(); - } - - /** - * Create an instance of {@link Corner } - * - */ - public Corner createCorner() { - return new Corner(); - } - - /** - * Create an instance of {@link Yacht } - * - */ - public Yacht createYacht() { - return new Yacht(); - } - -} From a5b21799d321a7c62b07296aff0460739b9826f0 Mon Sep 17 00:00:00 2001 From: Fan-Wu Yang Date: Mon, 14 Aug 2017 04:10:24 +1200 Subject: [PATCH 11/28] Fixed java doc issue #story[1092] --- .../java/shared/xml/Race/XMLCompoundMark.java | 46 ++-- .../xml/Race/XMLCompoundMarkSequence.java | 40 +-- .../main/java/shared/xml/Race/XMLCorner.java | 20 +- .../main/java/shared/xml/Race/XMLCourse.java | 66 ++--- .../java/shared/xml/Race/XMLCourseLimit.java | 38 +-- .../main/java/shared/xml/Race/XMLLimit.java | 18 +- .../main/java/shared/xml/Race/XMLMark.java | 22 +- .../java/shared/xml/Race/XMLParticipants.java | 36 +-- .../main/java/shared/xml/Race/XMLRace.java | 238 +++++++++--------- .../shared/xml/Race/XMLRaceStartTime.java | 16 +- .../main/java/shared/xml/Race/XMLYacht.java | 16 +- 11 files changed, 278 insertions(+), 278 deletions(-) diff --git a/racevisionGame/src/main/java/shared/xml/Race/XMLCompoundMark.java b/racevisionGame/src/main/java/shared/xml/Race/XMLCompoundMark.java index 41d5a70d..c4de29c7 100644 --- a/racevisionGame/src/main/java/shared/xml/Race/XMLCompoundMark.java +++ b/racevisionGame/src/main/java/shared/xml/Race/XMLCompoundMark.java @@ -23,29 +23,29 @@ import javax.xml.bind.annotation.XmlType; *

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="Mark" maxOccurs="unbounded">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}int" />
- *                 <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                 <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
- *                 <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
- *                 <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *       </sequence>
- *       <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
- *       <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="Mark" maxOccurs="unbounded">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                 <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
+ *                 <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
+ *                 <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *       <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *       <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
* * diff --git a/racevisionGame/src/main/java/shared/xml/Race/XMLCompoundMarkSequence.java b/racevisionGame/src/main/java/shared/xml/Race/XMLCompoundMarkSequence.java index be92b837..87f28dda 100644 --- a/racevisionGame/src/main/java/shared/xml/Race/XMLCompoundMarkSequence.java +++ b/racevisionGame/src/main/java/shared/xml/Race/XMLCompoundMarkSequence.java @@ -22,26 +22,26 @@ import javax.xml.bind.annotation.XmlType; *

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="Corner" maxOccurs="unbounded">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
- *                 <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
- *                 <attribute name="Rounding" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                 <attribute name="ZoneSize" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="Corner" maxOccurs="unbounded">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                 <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                 <attribute name="Rounding" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 <attribute name="ZoneSize" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
* * diff --git a/racevisionGame/src/main/java/shared/xml/Race/XMLCorner.java b/racevisionGame/src/main/java/shared/xml/Race/XMLCorner.java index 780ea352..db203fee 100644 --- a/racevisionGame/src/main/java/shared/xml/Race/XMLCorner.java +++ b/racevisionGame/src/main/java/shared/xml/Race/XMLCorner.java @@ -20,16 +20,16 @@ import javax.xml.bind.annotation.XmlType; *

The following schema fragment specifies the expected content contained within this class. * *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
- *       <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
- *       <attribute name="Rounding" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="ZoneSize" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *       <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *       <attribute name="Rounding" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="ZoneSize" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
* * diff --git a/racevisionGame/src/main/java/shared/xml/Race/XMLCourse.java b/racevisionGame/src/main/java/shared/xml/Race/XMLCourse.java index be527f7a..8a937e83 100644 --- a/racevisionGame/src/main/java/shared/xml/Race/XMLCourse.java +++ b/racevisionGame/src/main/java/shared/xml/Race/XMLCourse.java @@ -22,39 +22,39 @@ import javax.xml.bind.annotation.XmlType; *

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="CompoundMark" maxOccurs="unbounded">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="Mark" maxOccurs="unbounded">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}int" />
- *                           <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                           <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
- *                           <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
- *                           <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
- *                         </restriction>
- *                       </complexContent>
- *                     </complexType>
- *                   </element>
- *                 </sequence>
- *                 <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
- *                 <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="CompoundMark" maxOccurs="unbounded">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="Mark" maxOccurs="unbounded">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                           <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
+ *                           <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
+ *                           <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *                 <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                 <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
* * diff --git a/racevisionGame/src/main/java/shared/xml/Race/XMLCourseLimit.java b/racevisionGame/src/main/java/shared/xml/Race/XMLCourseLimit.java index b4a55197..144d3f9d 100644 --- a/racevisionGame/src/main/java/shared/xml/Race/XMLCourseLimit.java +++ b/racevisionGame/src/main/java/shared/xml/Race/XMLCourseLimit.java @@ -22,25 +22,25 @@ import javax.xml.bind.annotation.XmlType; *

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="Limit" maxOccurs="unbounded">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
- *                 <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
- *                 <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="Limit" maxOccurs="unbounded">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
+ *                 <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
+ *                 <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
* * diff --git a/racevisionGame/src/main/java/shared/xml/Race/XMLLimit.java b/racevisionGame/src/main/java/shared/xml/Race/XMLLimit.java index 421f206c..bf000511 100644 --- a/racevisionGame/src/main/java/shared/xml/Race/XMLLimit.java +++ b/racevisionGame/src/main/java/shared/xml/Race/XMLLimit.java @@ -20,15 +20,15 @@ import javax.xml.bind.annotation.XmlType; *

The following schema fragment specifies the expected content contained within this class. * *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
- *       <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
- *       <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
+ *       <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
+ *       <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
* * diff --git a/racevisionGame/src/main/java/shared/xml/Race/XMLMark.java b/racevisionGame/src/main/java/shared/xml/Race/XMLMark.java index 299b03ab..c8c2c644 100644 --- a/racevisionGame/src/main/java/shared/xml/Race/XMLMark.java +++ b/racevisionGame/src/main/java/shared/xml/Race/XMLMark.java @@ -20,17 +20,17 @@ import javax.xml.bind.annotation.XmlType; *

The following schema fragment specifies the expected content contained within this class. * *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}int" />
- *       <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
- *       <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
- *       <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *       <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
+ *       <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
+ *       <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
* * diff --git a/racevisionGame/src/main/java/shared/xml/Race/XMLParticipants.java b/racevisionGame/src/main/java/shared/xml/Race/XMLParticipants.java index b23586a6..597758fa 100644 --- a/racevisionGame/src/main/java/shared/xml/Race/XMLParticipants.java +++ b/racevisionGame/src/main/java/shared/xml/Race/XMLParticipants.java @@ -22,24 +22,24 @@ import javax.xml.bind.annotation.XmlType; *

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="Yacht" maxOccurs="unbounded">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
- *                 <attribute name="Entry" type="{http://www.w3.org/2001/XMLSchema}string" />
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="Yacht" maxOccurs="unbounded">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                 <attribute name="Entry" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
* * diff --git a/racevisionGame/src/main/java/shared/xml/Race/XMLRace.java b/racevisionGame/src/main/java/shared/xml/Race/XMLRace.java index b5fa4a3f..69493b3d 100644 --- a/racevisionGame/src/main/java/shared/xml/Race/XMLRace.java +++ b/racevisionGame/src/main/java/shared/xml/Race/XMLRace.java @@ -21,125 +21,125 @@ import javax.xml.bind.annotation.XmlType; *

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="RaceID" type="{http://www.w3.org/2001/XMLSchema}int"/>
- *         <element name="RaceType" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="CreationTimeDate" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="RaceStartTime">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <attribute name="Postpone" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                 <attribute name="Time" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="Participants">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="Yacht" maxOccurs="unbounded">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
- *                           <attribute name="Entry" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                         </restriction>
- *                       </complexContent>
- *                     </complexType>
- *                   </element>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="CompoundMarkSequence">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="Corner" maxOccurs="unbounded">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
- *                           <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
- *                           <attribute name="Rounding" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                           <attribute name="ZoneSize" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
- *                         </restriction>
- *                       </complexContent>
- *                     </complexType>
- *                   </element>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="Course">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="CompoundMark" maxOccurs="unbounded">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <sequence>
- *                             <element name="Mark" maxOccurs="unbounded">
- *                               <complexType>
- *                                 <complexContent>
- *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                                     <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}int" />
- *                                     <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                                     <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
- *                                     <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
- *                                     <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
- *                                   </restriction>
- *                                 </complexContent>
- *                               </complexType>
- *                             </element>
- *                           </sequence>
- *                           <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
- *                           <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                         </restriction>
- *                       </complexContent>
- *                     </complexType>
- *                   </element>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="CourseLimit">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="Limit" maxOccurs="unbounded">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
- *                           <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
- *                           <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
- *                         </restriction>
- *                       </complexContent>
- *                     </complexType>
- *                   </element>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="RaceID" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ *         <element name="RaceType" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="CreationTimeDate" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="RaceStartTime">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <attribute name="Postpone" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 <attribute name="Time" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="Participants">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="Yacht" maxOccurs="unbounded">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                           <attribute name="Entry" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="CompoundMarkSequence">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="Corner" maxOccurs="unbounded">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                           <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                           <attribute name="Rounding" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="ZoneSize" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="Course">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="CompoundMark" maxOccurs="unbounded">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <sequence>
+ *                             <element name="Mark" maxOccurs="unbounded">
+ *                               <complexType>
+ *                                 <complexContent>
+ *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                     <attribute name="SeqId" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                                     <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                     <attribute name="TargetLat" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
+ *                                     <attribute name="TargetLng" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
+ *                                     <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                                   </restriction>
+ *                                 </complexContent>
+ *                               </complexType>
+ *                             </element>
+ *                           </sequence>
+ *                           <attribute name="CompoundMarkID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                           <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="CourseLimit">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="Limit" maxOccurs="unbounded">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <attribute name="Lat" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
+ *                           <attribute name="Lon" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
+ *                           <attribute name="SeqID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
* * diff --git a/racevisionGame/src/main/java/shared/xml/Race/XMLRaceStartTime.java b/racevisionGame/src/main/java/shared/xml/Race/XMLRaceStartTime.java index 362d2590..ceaa124d 100644 --- a/racevisionGame/src/main/java/shared/xml/Race/XMLRaceStartTime.java +++ b/racevisionGame/src/main/java/shared/xml/Race/XMLRaceStartTime.java @@ -20,14 +20,14 @@ import javax.xml.bind.annotation.XmlType; *

The following schema fragment specifies the expected content contained within this class. * *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="Postpone" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="Time" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="Postpone" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="Time" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
* * diff --git a/racevisionGame/src/main/java/shared/xml/Race/XMLYacht.java b/racevisionGame/src/main/java/shared/xml/Race/XMLYacht.java index 1b2f0764..eb76ad94 100644 --- a/racevisionGame/src/main/java/shared/xml/Race/XMLYacht.java +++ b/racevisionGame/src/main/java/shared/xml/Race/XMLYacht.java @@ -20,14 +20,14 @@ import javax.xml.bind.annotation.XmlType; *

The following schema fragment specifies the expected content contained within this class. * *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
- *       <attribute name="Entry" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="SourceID" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *       <attribute name="Entry" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
* * From b07c30704a6c79494ec21f75a14d4107fb0209c7 Mon Sep 17 00:00:00 2001 From: fjc40 Date: Mon, 14 Aug 2017 12:58:05 +1200 Subject: [PATCH 12/28] The trackpoint line is now a line (poly-line) instead of a sequence of circles. A point along the poly-line is added every 250ms. issue #18 --- .../visualiser/model/ResizableRaceCanvas.java | 19 +++++++++++++++++-- .../java/visualiser/model/TrackPoint.java | 14 -------------- .../java/visualiser/model/VisualiserBoat.java | 6 ++---- 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/racevisionGame/src/main/java/visualiser/model/ResizableRaceCanvas.java b/racevisionGame/src/main/java/visualiser/model/ResizableRaceCanvas.java index 5a0243f6..345fa43b 100644 --- a/racevisionGame/src/main/java/visualiser/model/ResizableRaceCanvas.java +++ b/racevisionGame/src/main/java/visualiser/model/ResizableRaceCanvas.java @@ -2,6 +2,7 @@ package visualiser.model; import javafx.scene.paint.Color; +import javafx.scene.paint.LinearGradient; import javafx.scene.paint.Paint; import javafx.scene.transform.Rotate; import network.Messages.Enums.BoatStatusEnum; @@ -11,6 +12,7 @@ import shared.model.Mark; import shared.model.RaceClock; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; /** @@ -171,6 +173,7 @@ public class ResizableRaceCanvas extends ResizableCanvas { graphCoordinateB.getX(), graphCoordinateB.getY() ); + } /** @@ -523,15 +526,27 @@ public class ResizableRaceCanvas extends ResizableCanvas { //Apply the boat color. gc.setFill(boat.getColor()); + double[] xPoints = new double[boat.getTrack().size()]; + double[] yPoints = new double[boat.getTrack().size()]; + int index = 0; + //Draw each TrackPoint. for (TrackPoint point : new ArrayList<>(boat.getTrack())) { //Convert the GPSCoordinate to a screen coordinate. GraphCoordinate scaledCoordinate = this.map.convertGPS(point.getCoordinate()); - //Draw a circle for the trackpoint. - gc.fillOval(scaledCoordinate.getX(), scaledCoordinate.getY(), point.getDiameter(), point.getDiameter()); + xPoints[index] = ((double)scaledCoordinate.getX()); + yPoints[index] = ((double)scaledCoordinate.getY()); + + + + index++; } + + + + gc.strokePolyline(xPoints, yPoints, xPoints.length); } } diff --git a/racevisionGame/src/main/java/visualiser/model/TrackPoint.java b/racevisionGame/src/main/java/visualiser/model/TrackPoint.java index 4e0c76c0..f3378a43 100644 --- a/racevisionGame/src/main/java/visualiser/model/TrackPoint.java +++ b/racevisionGame/src/main/java/visualiser/model/TrackPoint.java @@ -34,11 +34,6 @@ public class TrackPoint { */ private final double minAlpha; - /** - * The diameter to draw the track point with. - */ - private final double diameter; - /** * Creates a new track point with fixed GPS coordinates and time, to reach minimum opacity on expiry. @@ -53,7 +48,6 @@ public class TrackPoint { this.expiry = expiry; this.minAlpha = 0.1; - this.diameter = 5d; } @@ -97,12 +91,4 @@ public class TrackPoint { return timeAdded; } - - /** - * Returns the diameter to draw the track point with. - * @return The diameter to draw the track point with. - */ - public double getDiameter() { - return diameter; - } } diff --git a/racevisionGame/src/main/java/visualiser/model/VisualiserBoat.java b/racevisionGame/src/main/java/visualiser/model/VisualiserBoat.java index 41d0e484..0d32c513 100644 --- a/racevisionGame/src/main/java/visualiser/model/VisualiserBoat.java +++ b/racevisionGame/src/main/java/visualiser/model/VisualiserBoat.java @@ -1,7 +1,5 @@ package visualiser.model; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; import javafx.scene.paint.Color; import network.Messages.Enums.BoatStatusEnum; import shared.model.Azimuth; @@ -38,7 +36,7 @@ public class VisualiserBoat extends Boat { /** * The minimum period of time, in milliseconds, between the creation of each track point. */ - private static final long trackPointTimeInterval = 5000; + private static final long trackPointTimeInterval = 250; /** * The number of track points that should be created before fully diminishing the alpha of a given track point. @@ -55,7 +53,7 @@ public class VisualiserBoat extends Boat { /** * Scalar used to scale the boat's wake. */ - private static final double wakeScale = 5; + private static final double wakeScale = 20; /** * If true then this boat has been allocated to the client. From 5a03d97713026c967445a6f59d0e7d9d864d238c Mon Sep 17 00:00:00 2001 From: fjc40 Date: Mon, 14 Aug 2017 13:01:27 +1200 Subject: [PATCH 13/28] Added comment. --- .../src/main/java/visualiser/model/ResizableRaceCanvas.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/racevisionGame/src/main/java/visualiser/model/ResizableRaceCanvas.java b/racevisionGame/src/main/java/visualiser/model/ResizableRaceCanvas.java index 345fa43b..b09c4b51 100644 --- a/racevisionGame/src/main/java/visualiser/model/ResizableRaceCanvas.java +++ b/racevisionGame/src/main/java/visualiser/model/ResizableRaceCanvas.java @@ -530,7 +530,7 @@ public class ResizableRaceCanvas extends ResizableCanvas { double[] yPoints = new double[boat.getTrack().size()]; int index = 0; - //Draw each TrackPoint. + //Copy trackpoint locations to x/y arrays. for (TrackPoint point : new ArrayList<>(boat.getTrack())) { //Convert the GPSCoordinate to a screen coordinate. @@ -539,13 +539,9 @@ public class ResizableRaceCanvas extends ResizableCanvas { xPoints[index] = ((double)scaledCoordinate.getX()); yPoints[index] = ((double)scaledCoordinate.getY()); - - index++; } - - gc.strokePolyline(xPoints, yPoints, xPoints.length); } From a4e1dfb3d7b8c8ab1135d3266b0f5fc58231b4ca Mon Sep 17 00:00:00 2001 From: Fan-Wu Yang Date: Tue, 15 Aug 2017 20:46:10 +1200 Subject: [PATCH 14/28] Fixed import that was messing up the build #story[1092] --- racevisionGame/src/main/java/shared/xml/XMLUtilities.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/racevisionGame/src/main/java/shared/xml/XMLUtilities.java b/racevisionGame/src/main/java/shared/xml/XMLUtilities.java index 95332c28..76694d62 100644 --- a/racevisionGame/src/main/java/shared/xml/XMLUtilities.java +++ b/racevisionGame/src/main/java/shared/xml/XMLUtilities.java @@ -1,7 +1,5 @@ package shared.xml; -import mock.xml.Race; -import mock.xml.RaceXMLCreator; import org.w3c.dom.Document; import org.xml.sax.InputSource; import org.xml.sax.SAXException; From 8d87da620612ba23fbdf33f7f4d9ff49ee2bfa3b Mon Sep 17 00:00:00 2001 From: Fan-Wu Yang Date: Tue, 15 Aug 2017 22:44:56 +1200 Subject: [PATCH 15/28] fixed java doc issues on my side #story[1092] --- .../src/main/java/mock/app/Event.java | 4 ++++ .../main/java/mock/xml/RaceXMLCreator.java | 4 +++- .../java/shared/xml/Race/XMLCompoundMark.java | 6 ++--- .../xml/Race/XMLCompoundMarkSequence.java | 2 +- .../main/java/shared/xml/Race/XMLCorner.java | 12 +++++----- .../main/java/shared/xml/Race/XMLCourse.java | 2 +- .../java/shared/xml/Race/XMLCourseLimit.java | 2 +- .../main/java/shared/xml/Race/XMLLimit.java | 12 +++++----- .../main/java/shared/xml/Race/XMLMark.java | 12 +++++----- .../java/shared/xml/Race/XMLParticipants.java | 2 +- .../main/java/shared/xml/Race/XMLRace.java | 4 ++-- .../java/shared/xml/Race/XMLRaceFactory.java | 22 +++++++++---------- .../main/java/shared/xml/Race/XMLYacht.java | 4 ++-- 13 files changed, 47 insertions(+), 41 deletions(-) diff --git a/racevisionGame/src/main/java/mock/app/Event.java b/racevisionGame/src/main/java/mock/app/Event.java index 0b742786..6b8f5553 100644 --- a/racevisionGame/src/main/java/mock/app/Event.java +++ b/racevisionGame/src/main/java/mock/app/Event.java @@ -94,6 +94,10 @@ public class Event { * @throws XMLReaderException Thrown if any of the xml files cannot be parsed. * @throws InvalidBoatDataException Thrown if the boat xml file cannot be parsed. * @throws InvalidRegattaDataException Thrown if the regatta xml file cannot be parsed. + * @throws ParserConfigurationException Error in parsing XML + * @throws JAXBException error in mapping the xml to a schema + * @throws SAXException error in reading the schema + * @throws IOException error in finding the schema */ public void start() throws InvalidRaceDataException, XMLReaderException, InvalidBoatDataException, InvalidRegattaDataException, ParserConfigurationException, JAXBException, SAXException, IOException { new Thread(connectionAcceptor, "Event.Start()->ConnectionAcceptor thread").start(); diff --git a/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java b/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java index 4daf3cce..5f7b12cf 100644 --- a/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java +++ b/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java @@ -70,6 +70,9 @@ public class RaceXMLCreator { * @throws XMLReaderException if the xml is not readable * @throws InvalidRaceDataException if the race is invalid * @throws JAXBException if the Race class cannot be parsed into a xml. + * @throws IOException if the schema file cannot be found + * @throws SAXException error in schema file + * @throws ParserConfigurationException error in parsing the schema file */ public static String alterRaceToWind(String s, double degrees) throws XMLReaderException, InvalidRaceDataException, JAXBException, IOException, SAXException, ParserConfigurationException { RaceXMLReader reader = new RaceXMLReader(s, XMLFileType.ResourcePath); @@ -187,7 +190,6 @@ public class RaceXMLCreator { /** * Sets the xml description of the race to show the race was created now, and starts in 4 minutes * @param raceXML The race.xml contents. - * @return String containing edited xml */ public static void setRaceXMLAtCurrentTimeToNow(XMLRace raceXML) { diff --git a/racevisionGame/src/main/java/shared/xml/Race/XMLCompoundMark.java b/racevisionGame/src/main/java/shared/xml/Race/XMLCompoundMark.java index c4de29c7..7149c4f1 100644 --- a/racevisionGame/src/main/java/shared/xml/Race/XMLCompoundMark.java +++ b/racevisionGame/src/main/java/shared/xml/Race/XMLCompoundMark.java @@ -83,7 +83,7 @@ public class XMLCompoundMark { * Objects of the following type(s) are allowed in the list * {@link XMLMark } * - * + * @return list of marks */ public List getMark() { if (mark == null) { @@ -94,7 +94,7 @@ public class XMLCompoundMark { /** * Gets the value of the compoundMarkID property. - * + * @return the id of the compound mark */ public int getCompoundMarkID() { return compoundMarkID; @@ -102,7 +102,7 @@ public class XMLCompoundMark { /** * Sets the value of the compoundMarkID property. - * + * @param value sets ID of the compound mark */ public void setCompoundMarkID(int value) { this.compoundMarkID = value; diff --git a/racevisionGame/src/main/java/shared/xml/Race/XMLCompoundMarkSequence.java b/racevisionGame/src/main/java/shared/xml/Race/XMLCompoundMarkSequence.java index 87f28dda..cca11aa5 100644 --- a/racevisionGame/src/main/java/shared/xml/Race/XMLCompoundMarkSequence.java +++ b/racevisionGame/src/main/java/shared/xml/Race/XMLCompoundMarkSequence.java @@ -75,7 +75,7 @@ public class XMLCompoundMarkSequence { * Objects of the following type(s) are allowed in the list * {@link XMLCorner } * - * + * @return getCorners/legs that the boats are to sequentially pass */ public List getCorner() { if (corner == null) { diff --git a/racevisionGame/src/main/java/shared/xml/Race/XMLCorner.java b/racevisionGame/src/main/java/shared/xml/Race/XMLCorner.java index db203fee..fa6237ac 100644 --- a/racevisionGame/src/main/java/shared/xml/Race/XMLCorner.java +++ b/racevisionGame/src/main/java/shared/xml/Race/XMLCorner.java @@ -49,7 +49,7 @@ public class XMLCorner { /** * Gets the value of the compoundMarkID property. - * + * @return Id of the compound mark */ public int getCompoundMarkID() { return compoundMarkID; @@ -57,7 +57,7 @@ public class XMLCorner { /** * Sets the value of the compoundMarkID property. - * + * @param value sets the id of the compound mark */ public void setCompoundMarkID(int value) { this.compoundMarkID = value; @@ -65,7 +65,7 @@ public class XMLCorner { /** * Gets the value of the seqID property. - * + * @return the order that the mark is to be passed at */ public int getSeqID() { return seqID; @@ -73,7 +73,7 @@ public class XMLCorner { /** * Sets the value of the seqID property. - * + * @param value sets the order that this corner is to appear in a race at. */ public void setSeqID(int value) { this.seqID = value; @@ -105,7 +105,7 @@ public class XMLCorner { /** * Gets the value of the zoneSize property. - * + * @return the size of the leg */ public int getZoneSize() { return zoneSize; @@ -113,7 +113,7 @@ public class XMLCorner { /** * Sets the value of the zoneSize property. - * + * @param value sets the size of the corner. */ public void setZoneSize(int value) { this.zoneSize = value; diff --git a/racevisionGame/src/main/java/shared/xml/Race/XMLCourse.java b/racevisionGame/src/main/java/shared/xml/Race/XMLCourse.java index 8a937e83..8fe22193 100644 --- a/racevisionGame/src/main/java/shared/xml/Race/XMLCourse.java +++ b/racevisionGame/src/main/java/shared/xml/Race/XMLCourse.java @@ -88,7 +88,7 @@ public class XMLCourse { * Objects of the following type(s) are allowed in the list * {@link XMLCompoundMark } * - * + * @return the compound marks in the course. */ public List getCompoundMark() { if (compoundMark == null) { diff --git a/racevisionGame/src/main/java/shared/xml/Race/XMLCourseLimit.java b/racevisionGame/src/main/java/shared/xml/Race/XMLCourseLimit.java index 144d3f9d..5218128f 100644 --- a/racevisionGame/src/main/java/shared/xml/Race/XMLCourseLimit.java +++ b/racevisionGame/src/main/java/shared/xml/Race/XMLCourseLimit.java @@ -74,7 +74,7 @@ public class XMLCourseLimit { * Objects of the following type(s) are allowed in the list * {@link XMLLimit } * - * + * @return the limits of the race */ public List getLimit() { if (limit == null) { diff --git a/racevisionGame/src/main/java/shared/xml/Race/XMLLimit.java b/racevisionGame/src/main/java/shared/xml/Race/XMLLimit.java index bf000511..b6519069 100644 --- a/racevisionGame/src/main/java/shared/xml/Race/XMLLimit.java +++ b/racevisionGame/src/main/java/shared/xml/Race/XMLLimit.java @@ -46,7 +46,7 @@ public class XMLLimit { /** * Gets the value of the lat property. - * + * @return get the latitude of the limit */ public double getLat() { return lat; @@ -54,7 +54,7 @@ public class XMLLimit { /** * Sets the value of the lat property. - * + * @param value sets the latitude of the limit */ public void setLat(double value) { this.lat = value; @@ -62,7 +62,7 @@ public class XMLLimit { /** * Gets the value of the lon property. - * + * @return sets the longitude of the limit */ public double getLon() { return lon; @@ -70,7 +70,7 @@ public class XMLLimit { /** * Sets the value of the lon property. - * + * @param value sets the longitude of the limit */ public void setLon(double value) { this.lon = value; @@ -78,7 +78,7 @@ public class XMLLimit { /** * Gets the value of the seqID property. - * + * @return gets the sequence that the limit is at. */ public int getSeqID() { return seqID; @@ -86,7 +86,7 @@ public class XMLLimit { /** * Sets the value of the seqID property. - * + * @param value sets the order that this limit is to appear in. */ public void setSeqID(int value) { this.seqID = value; diff --git a/racevisionGame/src/main/java/shared/xml/Race/XMLMark.java b/racevisionGame/src/main/java/shared/xml/Race/XMLMark.java index c8c2c644..8affde4a 100644 --- a/racevisionGame/src/main/java/shared/xml/Race/XMLMark.java +++ b/racevisionGame/src/main/java/shared/xml/Race/XMLMark.java @@ -100,7 +100,7 @@ public class XMLMark { /** * Gets the value of the targetLat property. - * + * @return latitude that mark is at */ public double getTargetLat() { return targetLat; @@ -108,7 +108,7 @@ public class XMLMark { /** * Sets the value of the targetLat property. - * + * @param value sets the latitude that the mark is at. */ public void setTargetLat(double value) { this.targetLat = value; @@ -116,7 +116,7 @@ public class XMLMark { /** * Gets the value of the targetLng property. - * + * @return the longitude the mark is at */ public double getTargetLng() { return targetLng; @@ -124,7 +124,7 @@ public class XMLMark { /** * Sets the value of the targetLng property. - * + * @param value sets the longitude that the value is at */ public void setTargetLng(double value) { this.targetLng = value; @@ -132,7 +132,7 @@ public class XMLMark { /** * Gets the value of the sourceID property. - * + * @return the markerboats source ID */ public int getSourceID() { return sourceID; @@ -140,7 +140,7 @@ public class XMLMark { /** * Sets the value of the sourceID property. - * + * @param value sets the id of the boat that the mark is referencing to. */ public void setSourceID(int value) { this.sourceID = value; diff --git a/racevisionGame/src/main/java/shared/xml/Race/XMLParticipants.java b/racevisionGame/src/main/java/shared/xml/Race/XMLParticipants.java index 597758fa..331cc861 100644 --- a/racevisionGame/src/main/java/shared/xml/Race/XMLParticipants.java +++ b/racevisionGame/src/main/java/shared/xml/Race/XMLParticipants.java @@ -73,7 +73,7 @@ public class XMLParticipants { * Objects of the following type(s) are allowed in the list * {@link XMLYacht } * - * + * @return the yachts that are part of the race. */ public List getYacht() { if (yacht == null) { diff --git a/racevisionGame/src/main/java/shared/xml/Race/XMLRace.java b/racevisionGame/src/main/java/shared/xml/Race/XMLRace.java index 69493b3d..2bbc21d4 100644 --- a/racevisionGame/src/main/java/shared/xml/Race/XMLRace.java +++ b/racevisionGame/src/main/java/shared/xml/Race/XMLRace.java @@ -177,7 +177,7 @@ public class XMLRace { /** * Gets the value of the raceID property. - * + * @return the id of the race */ public int getRaceID() { return raceID; @@ -185,7 +185,7 @@ public class XMLRace { /** * Sets the value of the raceID property. - * + * @param value sets the id of the race */ public void setRaceID(int value) { this.raceID = value; diff --git a/racevisionGame/src/main/java/shared/xml/Race/XMLRaceFactory.java b/racevisionGame/src/main/java/shared/xml/Race/XMLRaceFactory.java index 385f7fae..35a45cbb 100644 --- a/racevisionGame/src/main/java/shared/xml/Race/XMLRaceFactory.java +++ b/racevisionGame/src/main/java/shared/xml/Race/XMLRaceFactory.java @@ -38,7 +38,7 @@ public class XMLRaceFactory { /** * Create an instance of {@link XMLRace } - * + * @return a new instance of a race. */ public XMLRace createRace() { return new XMLRace(); @@ -46,7 +46,7 @@ public class XMLRaceFactory { /** * Create an instance of {@link XMLRaceStartTime } - * + * @return a new start time for the race */ public XMLRaceStartTime createXMLRaceStartTime() { return new XMLRaceStartTime(); @@ -54,7 +54,7 @@ public class XMLRaceFactory { /** * Create an instance of {@link XMLParticipants } - * + * @return a new participant of the race */ public XMLParticipants createXMLParticipants() { return new XMLParticipants(); @@ -62,7 +62,7 @@ public class XMLRaceFactory { /** * Create an instance of {@link XMLCompoundMarkSequence } - * + * @return a new Compound Mark Sequence that hte race is to follow. */ public XMLCompoundMarkSequence createXMLCompoundMarkSequence() { return new XMLCompoundMarkSequence(); @@ -70,7 +70,7 @@ public class XMLRaceFactory { /** * Create an instance of {@link XMLCourse } - * + * @return the course the race is to use. */ public XMLCourse createXMLCourse() { return new XMLCourse(); @@ -78,7 +78,7 @@ public class XMLRaceFactory { /** * Create an instance of {@link XMLCourseLimit } - * + * @return the limits/boundaries of the course. */ public XMLCourseLimit createXMLCourseLimit() { return new XMLCourseLimit(); @@ -86,7 +86,7 @@ public class XMLRaceFactory { /** * Create an instance of {@link XMLLimit } - * + * @return a point on hte boundaries */ public XMLLimit createXMLLimit() { return new XMLLimit(); @@ -94,7 +94,7 @@ public class XMLRaceFactory { /** * Create an instance of {@link XMLCompoundMark } - * + * @return a compound mark (made out of multiple marks) */ public XMLCompoundMark createXMLCompoundMark() { return new XMLCompoundMark(); @@ -102,7 +102,7 @@ public class XMLRaceFactory { /** * Create an instance of {@link XMLMark } - * + * @return a mark */ public XMLMark createXMLMark() { return new XMLMark(); @@ -110,7 +110,7 @@ public class XMLRaceFactory { /** * Create an instance of {@link XMLCorner } - * + * @return a corner of a compound mark sequence */ public XMLCorner createXMLCorner() { return new XMLCorner(); @@ -118,7 +118,7 @@ public class XMLRaceFactory { /** * Create an instance of {@link XMLYacht } - * + * @return creates a new Yacht. */ public XMLYacht createXMLYacht() { return new XMLYacht(); diff --git a/racevisionGame/src/main/java/shared/xml/Race/XMLYacht.java b/racevisionGame/src/main/java/shared/xml/Race/XMLYacht.java index eb76ad94..652af26a 100644 --- a/racevisionGame/src/main/java/shared/xml/Race/XMLYacht.java +++ b/racevisionGame/src/main/java/shared/xml/Race/XMLYacht.java @@ -43,7 +43,7 @@ public class XMLYacht { /** * Gets the value of the sourceID property. - * + * @return the id of the yacht */ public int getSourceID() { return sourceID; @@ -51,7 +51,7 @@ public class XMLYacht { /** * Sets the value of the sourceID property. - * + * @param value sets the source ID of the a yacht that is participating in the race */ public void setSourceID(int value) { this.sourceID = value; From 9f7c5d8c0c69bfe33f2d2a1743744e66981fde87 Mon Sep 17 00:00:00 2001 From: Fan-Wu Yang Date: Tue, 15 Aug 2017 22:48:35 +1200 Subject: [PATCH 16/28] Fixed other javadocs that were causing the build to fail #story[1092] --- .../src/main/java/mock/model/commandFactory/CommandFactory.java | 2 +- .../main/java/visualiser/gameController/ControllerServer.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/racevisionGame/src/main/java/mock/model/commandFactory/CommandFactory.java b/racevisionGame/src/main/java/mock/model/commandFactory/CommandFactory.java index fba06cb5..5fed862c 100644 --- a/racevisionGame/src/main/java/mock/model/commandFactory/CommandFactory.java +++ b/racevisionGame/src/main/java/mock/model/commandFactory/CommandFactory.java @@ -13,7 +13,7 @@ public class CommandFactory { * @param race to receive command * @param boat to receive command in race * @param action number to select command - * @return + * @return returns a new command based on a Command ENUM */ public static Command createCommand(MockRace race, MockBoat boat, BoatActionEnum action) { switch(action) { diff --git a/racevisionGame/src/main/java/visualiser/gameController/ControllerServer.java b/racevisionGame/src/main/java/visualiser/gameController/ControllerServer.java index 63c5b263..64698217 100644 --- a/racevisionGame/src/main/java/visualiser/gameController/ControllerServer.java +++ b/racevisionGame/src/main/java/visualiser/gameController/ControllerServer.java @@ -38,6 +38,7 @@ public class ControllerServer extends Observable implements Runnable { /** * Initialise server-side controller with live client socket * @param socket to client + * @param rc RaceLogic that is to be applied to the race */ public ControllerServer(Socket socket, RaceLogic rc) { this.socket = socket; From fdd0b30a51104b9be562a971182795b969f442ef Mon Sep 17 00:00:00 2001 From: hba56 Date: Wed, 16 Aug 2017 02:04:07 +1200 Subject: [PATCH 17/28] Added the ability to hide and show info table with a key press -the wind arrow also scales with the new size of the screen --- .../Controllers/RaceController.java | 30 +++++++++++++++++-- .../resources/visualiser/scenes/race.fxml | 6 +--- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/racevisionGame/src/main/java/visualiser/Controllers/RaceController.java b/racevisionGame/src/main/java/visualiser/Controllers/RaceController.java index 3e4c1398..b62a1e99 100644 --- a/racevisionGame/src/main/java/visualiser/Controllers/RaceController.java +++ b/racevisionGame/src/main/java/visualiser/Controllers/RaceController.java @@ -10,7 +10,6 @@ import javafx.collections.transformation.SortedList; import javafx.fxml.FXML; import javafx.scene.chart.LineChart; import javafx.scene.control.*; -import javafx.scene.control.Label; import javafx.scene.input.KeyEvent; import javafx.scene.layout.AnchorPane; import javafx.scene.layout.GridPane; @@ -23,7 +22,6 @@ import visualiser.gameController.ControllerClient; import visualiser.gameController.Keys.ControlKey; import visualiser.gameController.Keys.KeyFactory; import visualiser.model.*; -import visualiser.network.ServerConnection; import java.net.URL; import java.util.ResourceBundle; @@ -62,6 +60,11 @@ public class RaceController extends Controller { */ private Sparkline sparkline; + /** + * state of the info table + */ + private boolean infoTableShow; + /** * The arrow controller. */ @@ -106,10 +109,14 @@ public class RaceController extends Controller { @Override public void initialize(URL location, ResourceBundle resources) { KeyFactory keyFactory = KeyFactory.getFactory(); + infoTableShow = true; // Initialise keyboard handler race.addEventFilter(KeyEvent.KEY_PRESSED, event -> { String codeString = event.getCode().toString(); + + if (codeString.equals("TAB")){toggleTable();} + ControlKey controlKey = keyFactory.getKey(codeString); if(controlKey != null) { try { @@ -437,4 +444,23 @@ public class RaceController extends Controller { }.start(); } + private void toggleTable() { + if (infoTableShow){ + race.setDividerPositions(0.4); + + arrowPane.setScaleX(0.5); + arrowPane.setScaleY(0.5); + arrowPane.setTranslateX(0 + (arrowPane.getScene().getWidth()/4)*0.4); + arrowPane.setTranslateY(0 - arrowPane.getScene().getHeight()/4); + }else{ + race.setDividerPositions(1); + + arrowPane.setScaleX(1); + arrowPane.setScaleY(1); + arrowPane.setTranslateX(0); + arrowPane.setTranslateY(0); + } + infoTableShow = !infoTableShow; + } + } diff --git a/racevisionGame/src/main/resources/visualiser/scenes/race.fxml b/racevisionGame/src/main/resources/visualiser/scenes/race.fxml index 718e65ff..bbc1c077 100644 --- a/racevisionGame/src/main/resources/visualiser/scenes/race.fxml +++ b/racevisionGame/src/main/resources/visualiser/scenes/race.fxml @@ -1,9 +1,5 @@ - - - - @@ -26,7 +22,7 @@ - + From 20055b188325c6a0218bb02b46d6a596c46d811d Mon Sep 17 00:00:00 2001 From: fjc40 Date: Wed, 16 Aug 2017 18:10:30 +1200 Subject: [PATCH 18/28] Removed redunant calls in VisualiserRaceState.initialiseBoats(). Slightly refactored ResizableRaceCanvas - removed a redundant drawPoint() function, functions which alter the gc stroke call save/restore. Text is drawn black, at 20pts. The drawBoats() function: instead of drawing everything for each boat, one boat at a time, it draws the track points for all boats, then wake for all boats, etc..., to have better layering. issue #18 --- .../visualiser/model/ResizableRaceCanvas.java | 154 ++++++++++++------ .../java/visualiser/model/VisualiserBoat.java | 2 +- .../visualiser/model/VisualiserRaceState.java | 4 - 3 files changed, 106 insertions(+), 54 deletions(-) diff --git a/racevisionGame/src/main/java/visualiser/model/ResizableRaceCanvas.java b/racevisionGame/src/main/java/visualiser/model/ResizableRaceCanvas.java index 0d9f0562..986c778d 100644 --- a/racevisionGame/src/main/java/visualiser/model/ResizableRaceCanvas.java +++ b/racevisionGame/src/main/java/visualiser/model/ResizableRaceCanvas.java @@ -4,6 +4,7 @@ package visualiser.model; import javafx.scene.paint.Color; import javafx.scene.paint.LinearGradient; import javafx.scene.paint.Paint; +import javafx.scene.text.Font; import javafx.scene.transform.Rotate; import network.Messages.Enums.BoatStatusEnum; import shared.dataInput.RaceDataSource; @@ -12,6 +13,7 @@ import shared.model.*; import java.util.ArrayList; import java.util.Arrays; +import java.util.Comparator; import java.util.List; /** @@ -141,8 +143,14 @@ public class ResizableRaceCanvas extends ResizableCanvas { * Draws a circle with a given diameter, centred on a given graph coordinate. * @param center The center coordinate of the circle. * @param diameter The diameter of the circle. + * @param paint The paint to use for the circle. */ - private void drawCircle(GraphCoordinate center, double diameter) { + private void drawCircle(GraphCoordinate center, double diameter, Paint paint) { + + gc.save(); + + gc.setFill(paint); + gc.setStroke(paint); //The graphCoordinates are for the center of the point, so we offset them to get the corner coordinate. gc.fillOval( @@ -150,6 +158,7 @@ public class ResizableRaceCanvas extends ResizableCanvas { center.getY() - (diameter / 2), diameter, diameter ); + gc.restore(); } /** @@ -158,20 +167,16 @@ public class ResizableRaceCanvas extends ResizableCanvas { * @param graphCoordinateA Starting Point of the line in GraphCoordinate. * @param graphCoordinateB End Point of the line in GraphCoordinate. * @param paint Colour the line is to coloured. + * @param lineWidth The width of the line. */ - private void drawLine(GraphCoordinate graphCoordinateA, GraphCoordinate graphCoordinateB, Paint paint) { + private void drawLine(GraphCoordinate graphCoordinateA, GraphCoordinate graphCoordinateB, Paint paint, double lineWidth) { + + gc.save(); gc.setStroke(paint); gc.setFill(paint); - - double endPointDiameter = 6; - - //Draw first end-point. - drawCircle(graphCoordinateA, endPointDiameter); - - //Draw second end-point. - drawCircle(graphCoordinateB, endPointDiameter); + gc.setLineWidth(lineWidth); //Draw line between them. gc.strokeLine( @@ -180,25 +185,10 @@ public class ResizableRaceCanvas extends ResizableCanvas { graphCoordinateB.getX(), graphCoordinateB.getY() ); + gc.restore(); } - /** - * Display a point on the Canvas. It has a diameter of 10 pixels. - * - * @param graphCoordinate Coordinate that the point is to be displayed at. - * @param paint Paint to use for the point. - */ - private void drawPoint(GraphCoordinate graphCoordinate, Paint paint) { - - //Set paint. - gc.setFill(paint); - - double pointDiameter = 10; - - //Draw the point. - drawCircle(graphCoordinate, pointDiameter); - } /** @@ -210,8 +200,10 @@ public class ResizableRaceCanvas extends ResizableCanvas { * @param coordinate coordinate the text appears * @param timeToNextMark The time until the boat reaches the next mark. * @param timeSinceLastMark The time since the boat passed the last mark. + * @param paint The color of the text. + * @param fontSize The size of the font. */ - private void drawText(String name, String abbrev, double speed, GraphCoordinate coordinate, String timeToNextMark, String timeSinceLastMark) { + private void drawText(String name, String abbrev, double speed, GraphCoordinate coordinate, String timeToNextMark, String timeSinceLastMark, Paint paint, double fontSize) { //The text to draw. Built during the function. String text = ""; @@ -257,8 +249,15 @@ public class ResizableRaceCanvas extends ResizableCanvas { yCoord += 30; } + gc.save(); + + gc.setStroke(paint); + gc.setFont(new Font(gc.getFont().getName(), fontSize)); + //Draw text. gc.fillText(text, xCoord, yCoord); + + gc.restore(); } @@ -274,7 +273,9 @@ public class ResizableRaceCanvas extends ResizableCanvas { boat.getCurrentSpeed(), this.map.convertGPS(boat.getCurrentPosition()), boat.getTimeToNextMarkFormatted(this.visualiserRace.getVisualiserRaceState().getRaceClock().getCurrentTime()), - boat.getTimeSinceLastMarkFormatted(this.visualiserRace.getVisualiserRaceState().getRaceClock().getCurrentTime()) ); + boat.getTimeSinceLastMarkFormatted(this.visualiserRace.getVisualiserRaceState().getRaceClock().getCurrentTime()), + Color.BLACK, + 20 ); } @@ -286,29 +287,51 @@ public class ResizableRaceCanvas extends ResizableCanvas { */ private void drawBoats() { - for (VisualiserBoat boat : new ArrayList<>(visualiserRace.getVisualiserRaceState().getBoats())) { + List boats = new ArrayList<>(visualiserRace.getVisualiserRaceState().getBoats()); + //Sort to ensure we draw boats in consistent order. + boats.sort(Comparator.comparingInt(Boat::getSourceID)); - //Draw the boat. - drawBoat(boat); + //Current draw order: + // track points + // wake + // boat + // text + //Track points. + for (VisualiserBoat boat : boats) { + drawTrack(boat); + } + + //Wake. + for (VisualiserBoat boat : boats) { //Only draw wake if they are currently racing. if (boat.getStatus() == BoatStatusEnum.RACING) { drawWake(boat); } + } + + //Boat. + for (VisualiserBoat boat : boats) { + drawBoat(boat); + } + + //Text. + for (VisualiserBoat boat : boats) { + drawBoatText(boat); + } + + +/* //If the race hasn't started, we set the time since last mark to the current time, to ensure we don't start counting until the race actually starts. if ((boat.getStatus() != BoatStatusEnum.RACING) && (boat.getStatus() == BoatStatusEnum.FINISHED)) { boat.setTimeAtLastMark(visualiserRace.getVisualiserRaceState().getRaceClock().getCurrentTime()); } +*/ - //Draw boat label. - drawBoatText(boat); - //Draw track. - drawTrack(boat); - } } @@ -341,12 +364,14 @@ public class ResizableRaceCanvas extends ResizableCanvas { //The above shape is essentially a triangle 12px wide, and 24px long. + + gc.save(); + //Draw the boat. gc.setFill(boat.getColor()); - gc.save(); rotate(boat.getBearing().degrees(), pos.getX(), pos.getY()); - gc.fillPolygon(x, y, 3); + gc.fillPolygon(x, y, x.length); gc.restore(); @@ -375,12 +400,14 @@ public class ResizableRaceCanvas extends ResizableCanvas { //The above shape is essentially a triangle 24px wide, and 48 long. + + gc.save(); + //Draw the boat. gc.setFill(Color.BLACK); - gc.save(); rotate(boat.getBearing().degrees(), pos.getX(), pos.getY()); - gc.fillPolygon(x, y, 3); + gc.fillPolygon(x, y, x.length); gc.restore(); } @@ -396,8 +423,15 @@ public class ResizableRaceCanvas extends ResizableCanvas { GraphCoordinate wakeFrom = this.map.convertGPS(boat.getCurrentPosition()); GraphCoordinate wakeTo = this.map.convertGPS(boat.getWake()); - //Draw. - drawLine(wakeFrom, wakeTo, boat.getColor()); + double lineWidth = 4; + double endPointDiameter = 12; + + //Line. + drawLine(wakeFrom, wakeTo, boat.getColor(), lineWidth); + + //Draw end-point. + drawCircle(wakeTo, endPointDiameter, Color.BLACK); + } @@ -423,8 +457,10 @@ public class ResizableRaceCanvas extends ResizableCanvas { //Calculate screen position. GraphCoordinate mark1 = this.map.convertGPS(mark.getPosition()); + double diameter = 10; + //Draw. - drawPoint(mark1, Color.LIMEGREEN); + drawCircle(mark1, diameter, Color.LIMEGREEN); } @@ -462,6 +498,8 @@ public class ResizableRaceCanvas extends ResizableCanvas { */ private void drawBoundary() { + gc.save(); + //Prepare to draw. gc.setLineWidth(1); gc.setFill(Color.AQUA); @@ -484,6 +522,8 @@ public class ResizableRaceCanvas extends ResizableCanvas { //Draw the boundary. gc.fillPolygon(xpoints, ypoints, xpoints.length); + gc.restore(); + } /** @@ -496,7 +536,6 @@ public class ResizableRaceCanvas extends ResizableCanvas { this.map.setGPSTopLeft(visualiserRace.getVisualiserRaceState().getRaceDataSource().getMapTopLeft()); this.map.setGPSBotRight(visualiserRace.getVisualiserRaceState().getRaceDataSource().getMapBottomRight()); - gc.setLineWidth(2); clear(); @@ -604,6 +643,8 @@ public class ResizableRaceCanvas extends ResizableCanvas { GraphCoordinate c1 = this.map.convertGPS(controlPoint); GraphCoordinate c2 = this.map.convertGPS(controlPoint2); + gc.save(); + gc.setLineWidth(2); gc.setStroke(Color.MEDIUMAQUAMARINE); @@ -614,20 +655,26 @@ public class ResizableRaceCanvas extends ResizableCanvas { gc.bezierCurveTo(c1.getX(), c1.getY(), c2.getX(), c2.getY(), curvePointEnd.getX(), curvePointEnd.getY()); gc.stroke(); gc.closePath(); - gc.save(); + //gc.save(); + gc.restore(); return pointToEndCurve; }else{//last leg so no curve GraphCoordinate startPath = this.map.convertGPS(legStartPoint); GraphCoordinate endPath = this.map.convertGPS(legs.get(index).getEndCompoundMark().getAverageGPSCoordinate()); + gc.save(); + gc.beginPath(); gc.moveTo(startPath.getX(), startPath.getY()); gc.lineTo(endPath.getX(), endPath.getY()); gc.stroke(); gc.closePath(); - gc.save(); + //gc.save(); drawArrowHead(legStartPoint, legs.get(index).getEndCompoundMark().getAverageGPSCoordinate()); + + gc.restore(); + return null; } } @@ -664,15 +711,22 @@ public class ResizableRaceCanvas extends ResizableCanvas { //Check that track points are enabled. if (this.annoPath) { + gc.save(); + + gc.setLineWidth(3); + //Apply the boat color. gc.setFill(boat.getColor()); + gc.setStroke(boat.getColor()); - double[] xPoints = new double[boat.getTrack().size()]; - double[] yPoints = new double[boat.getTrack().size()]; + List trackPoints = new ArrayList<>(boat.getTrack()); + + double[] xPoints = new double[trackPoints.size()]; + double[] yPoints = new double[trackPoints.size()]; int index = 0; //Copy trackpoint locations to x/y arrays. - for (TrackPoint point : new ArrayList<>(boat.getTrack())) { + for (TrackPoint point : trackPoints) { //Convert the GPSCoordinate to a screen coordinate. GraphCoordinate scaledCoordinate = this.map.convertGPS(point.getCoordinate()); @@ -684,6 +738,8 @@ public class ResizableRaceCanvas extends ResizableCanvas { } gc.strokePolyline(xPoints, yPoints, xPoints.length); + + gc.restore(); } } diff --git a/racevisionGame/src/main/java/visualiser/model/VisualiserBoat.java b/racevisionGame/src/main/java/visualiser/model/VisualiserBoat.java index 0d65d7ad..6b91e6ac 100644 --- a/racevisionGame/src/main/java/visualiser/model/VisualiserBoat.java +++ b/racevisionGame/src/main/java/visualiser/model/VisualiserBoat.java @@ -53,7 +53,7 @@ public class VisualiserBoat extends Boat { /** * Scalar used to scale the boat's wake. */ - private static final double wakeScale = 20; + private static final double wakeScale = 25; /** * If true then this boat has been allocated to the client. diff --git a/racevisionGame/src/main/java/visualiser/model/VisualiserRaceState.java b/racevisionGame/src/main/java/visualiser/model/VisualiserRaceState.java index b1767cd5..a1f21844 100644 --- a/racevisionGame/src/main/java/visualiser/model/VisualiserRaceState.java +++ b/racevisionGame/src/main/java/visualiser/model/VisualiserRaceState.java @@ -225,11 +225,7 @@ public class VisualiserRaceState extends RaceState { Leg startingLeg = getLegs().get(0); for (VisualiserBoat boat : boats) { - boat.setCurrentLeg(startingLeg); - boat.setTimeAtLastMark(getRaceClock().getCurrentTime()); - boat.setCurrentPosition(new GPSCoordinate(0, 0)); - } } From 114c18763bbd75139eb8ebb62e3d8f3c000d487e Mon Sep 17 00:00:00 2001 From: fjc40 Date: Wed, 16 Aug 2017 19:44:42 +1200 Subject: [PATCH 19/28] Reduced track point period to 1000ms. issue #18 --- .../src/main/java/visualiser/model/VisualiserBoat.java | 2 +- racevisionGame/src/main/resources/css/dayMode.css | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/racevisionGame/src/main/java/visualiser/model/VisualiserBoat.java b/racevisionGame/src/main/java/visualiser/model/VisualiserBoat.java index 6b91e6ac..bb2d2d12 100644 --- a/racevisionGame/src/main/java/visualiser/model/VisualiserBoat.java +++ b/racevisionGame/src/main/java/visualiser/model/VisualiserBoat.java @@ -36,7 +36,7 @@ public class VisualiserBoat extends Boat { /** * The minimum period of time, in milliseconds, between the creation of each track point. */ - private static final long trackPointTimeInterval = 250; + private static final long trackPointTimeInterval = 1000; /** * The number of track points that should be created before fully diminishing the alpha of a given track point. diff --git a/racevisionGame/src/main/resources/css/dayMode.css b/racevisionGame/src/main/resources/css/dayMode.css index d0f62fb7..aa14c68b 100644 --- a/racevisionGame/src/main/resources/css/dayMode.css +++ b/racevisionGame/src/main/resources/css/dayMode.css @@ -52,4 +52,6 @@ -fx-background-color: -fx-mark-highlight-color, rgb(255, 255, 255); } - +#arrowImage { + -fx-image: url("/visualiser/images/arrow.png"); +} From df2b674b94235d63ab02ffc772c0c25357c9a929 Mon Sep 17 00:00:00 2001 From: hwball Date: Thu, 17 Aug 2017 11:51:33 +1200 Subject: [PATCH 20/28] update scale for table displaying --- .idea/copyright/profiles_settings.xml | 3 --- .../main/java/visualiser/Controllers/RaceController.java | 6 ++++-- 2 files changed, 4 insertions(+), 5 deletions(-) delete mode 100644 .idea/copyright/profiles_settings.xml diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml deleted file mode 100644 index e7bedf33..00000000 --- a/.idea/copyright/profiles_settings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/racevisionGame/src/main/java/visualiser/Controllers/RaceController.java b/racevisionGame/src/main/java/visualiser/Controllers/RaceController.java index b62a1e99..5fe58894 100644 --- a/racevisionGame/src/main/java/visualiser/Controllers/RaceController.java +++ b/racevisionGame/src/main/java/visualiser/Controllers/RaceController.java @@ -445,12 +445,14 @@ public class RaceController extends Controller { } private void toggleTable() { + double tablePercent = 1 - (boatPlacingColumn.getPrefWidth() + boatTeamColumn.getPrefWidth() + boatMarkColumn.getPrefWidth() + boatSpeedColumn.getPrefWidth())/race.getWidth(); + if (infoTableShow){ - race.setDividerPositions(0.4); + race.setDividerPositions(tablePercent); arrowPane.setScaleX(0.5); arrowPane.setScaleY(0.5); - arrowPane.setTranslateX(0 + (arrowPane.getScene().getWidth()/4)*0.4); + arrowPane.setTranslateX(0 + (arrowPane.getScene().getWidth()/4)*tablePercent); arrowPane.setTranslateY(0 - arrowPane.getScene().getHeight()/4); }else{ race.setDividerPositions(1); From 4cf8846cda2e6a203d25474066ebc84800a58353 Mon Sep 17 00:00:00 2001 From: Joseph Gardner Date: Thu, 17 Aug 2017 12:17:45 +1200 Subject: [PATCH 21/28] Map wind rotation works with multiplayer xml. #story[1092] --- .../src/main/java/mock/app/Event.java | 75 ++++--------------- .../src/main/java/mock/model/MockRace.java | 10 +-- .../mock/mockXML/raceSinglePlayer.xml | 4 +- .../main/resources/mock/mockXML/raceTest.xml | 4 +- 4 files changed, 22 insertions(+), 71 deletions(-) diff --git a/racevisionGame/src/main/java/mock/app/Event.java b/racevisionGame/src/main/java/mock/app/Event.java index 6398e9d2..47696875 100644 --- a/racevisionGame/src/main/java/mock/app/Event.java +++ b/racevisionGame/src/main/java/mock/app/Event.java @@ -4,12 +4,7 @@ import mock.dataInput.PolarParser; import mock.exceptions.EventConstructionException; import mock.model.*; import mock.model.commandFactory.CompositeCommand; -import mock.model.MockRace; -import mock.model.Polars; import mock.xml.RaceXMLCreator; -import mock.model.RaceLogic; -import mock.model.SourceIdAllocator; -import mock.model.commandFactory.CompositeCommand; import network.Messages.LatestMessages; import org.xml.sax.SAXException; import shared.dataInput.*; @@ -20,13 +15,11 @@ import shared.exceptions.InvalidRegattaDataException; import shared.exceptions.XMLReaderException; import shared.model.Bearing; import shared.model.Constants; -import shared.xml.Race.XMLRace; -import shared.xml.XMLUtilities; import javax.xml.bind.JAXBException; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.TransformerException; -import java.io.*; +import java.io.IOException; import java.net.UnknownHostException; import java.nio.charset.StandardCharsets; import java.time.Duration; @@ -93,55 +86,32 @@ public class Event { //Read XML files. try { - this.raceXML = RaceXMLCreator.alterRaceToWind("mock/mockXML/raceSchemaTest.xml", 90); + this.raceXML = RaceXMLCreator.alterRaceToWind(raceXMLFile, 90); this.boatXML = XMLReader.readXMLFileToString(boatsXMLFile, StandardCharsets.UTF_8); this.regattaXML = XMLReader.readXMLFileToString(regattaXMLFile, StandardCharsets.UTF_8); } catch (XMLReaderException e) { throw new EventConstructionException("Could not read XML files.", e); + } catch (IOException e) { + e.printStackTrace(); + } catch (ParserConfigurationException e) { + e.printStackTrace(); + } catch (SAXException e) { + e.printStackTrace(); + } catch (InvalidRaceDataException e) { + e.printStackTrace(); + } catch (JAXBException e) { + e.printStackTrace(); } this.xmlFileType = XMLFileType.Contents; this.boatPolars = PolarParser.parse("mock/polars/acc_polars.csv"); - this.latestMessages = new LatestMessages(); - this.connectionAcceptor = new ConnectionAcceptor(latestMessages); - } - - public static Event getEvent() { - return theEvent; - } - - public String getAddress() throws UnknownHostException { - return connectionAcceptor.getAddress(); - } - - public int getPort() { - return connectionAcceptor.getServerPort(); - } - - /** - * Sends the initial race data and then begins race simulation. - * @throws InvalidRaceDataException Thrown if the race xml file cannot be parsed. - * @throws XMLReaderException Thrown if any of the xml files cannot be parsed. - * @throws InvalidBoatDataException Thrown if the boat xml file cannot be parsed. - * @throws InvalidRegattaDataException Thrown if the regatta xml file cannot be parsed. - * @throws ParserConfigurationException Error in parsing XML - * @throws JAXBException error in mapping the xml to a schema - * @throws SAXException error in reading the schema - * @throws IOException error in finding the schema - */ - public void start() throws InvalidRaceDataException, XMLReaderException, InvalidBoatDataException, InvalidRegattaDataException, ParserConfigurationException, JAXBException, SAXException, IOException { - new Thread(connectionAcceptor, "Event.Start()->ConnectionAcceptor thread").start(); - - sendXMLs(); + //Parse the XML files into data sources. try { this.raceDataSource = new RaceXMLReader(this.raceXML, this.xmlFileType); - XMLRace race = (XMLRace) XMLUtilities.xmlToClass(raceXML, - RaceXMLCreator.class.getClassLoader().getResource("mock/mockXML/schema/raceSchema.xsd"), - XMLRace.class); this.boatDataSource = new BoatXMLReader(this.boatXML, this.xmlFileType); this.regattaDataSource = new RegattaXMLReader(this.regattaXML, this.xmlFileType); @@ -215,21 +185,4 @@ public class Event { connectionAcceptor.setBoatsXml(boatXML); } - - - //The start time is current time + 4 minutes. prestart is 3 minutes, and we add another minute. - long millisecondsToAdd = Constants.RacePreStartTime + Duration.ofMinutes(1).toMillis(); - long secondsToAdd = millisecondsToAdd / 1000; - //Scale the time using our time scalar. - secondsToAdd = secondsToAdd / Constants.RaceTimeScale; - - DateTimeFormatter dateFormat = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssZ"); - ZonedDateTime creationTime = ZonedDateTime.now(); - raceXML = raceXML.replace("CREATION_TIME", dateFormat.format(creationTime)); - - raceXML = raceXML.replace("START_TIME", dateFormat.format(creationTime.plusSeconds(secondsToAdd))); - - return raceXML; - - } -} +} \ No newline at end of file diff --git a/racevisionGame/src/main/java/mock/model/MockRace.java b/racevisionGame/src/main/java/mock/model/MockRace.java index 9d8f3616..e2a044ef 100644 --- a/racevisionGame/src/main/java/mock/model/MockRace.java +++ b/racevisionGame/src/main/java/mock/model/MockRace.java @@ -399,8 +399,7 @@ public class MockRace extends Race { double lastAngle = -1; boolean lastAngleWasGood = false; - //Check all bearings between [0his.latestMessages = new LatestMessages(); - thi, 360). + //Check all bearings between [0, 360) for (double angle = 0; angle < 360; angle += 1) { //Create bearing from angle. @@ -636,8 +635,6 @@ public class MockRace extends Race { protected int getNumberOfActiveBoats() { int numberOfActiveBoats = 0; -his.latestMessages = new LatestMessages(); - thi for (MockBoat boat : this.boats) { //If the boat is currently racing, count it. @@ -710,6 +707,7 @@ his.latestMessages = new LatestMessages(); } - - + public List getCompoundMarks() { + return compoundMarks; + } } diff --git a/racevisionGame/src/main/resources/mock/mockXML/raceSinglePlayer.xml b/racevisionGame/src/main/resources/mock/mockXML/raceSinglePlayer.xml index 553c2571..f939b16d 100644 --- a/racevisionGame/src/main/resources/mock/mockXML/raceSinglePlayer.xml +++ b/racevisionGame/src/main/resources/mock/mockXML/raceSinglePlayer.xml @@ -2,8 +2,8 @@ 5326 FLEET - CREATION_TIME - + 2017-08-03T02:13:14+1200 + diff --git a/racevisionGame/src/main/resources/mock/mockXML/raceTest.xml b/racevisionGame/src/main/resources/mock/mockXML/raceTest.xml index edd634dc..761b9b91 100644 --- a/racevisionGame/src/main/resources/mock/mockXML/raceTest.xml +++ b/racevisionGame/src/main/resources/mock/mockXML/raceTest.xml @@ -2,8 +2,8 @@ 5326 FLEET - CREATION_TIME - + 2017-08-03T02:13:14+1200 + From fa26abe10c9750a0f7112fe847898e1d9ac795b1 Mon Sep 17 00:00:00 2001 From: fjc40 Date: Thu, 17 Aug 2017 12:18:17 +1200 Subject: [PATCH 22/28] Minor tidy. --- .../main/java/visualiser/model/ResizableRaceCanvas.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/racevisionGame/src/main/java/visualiser/model/ResizableRaceCanvas.java b/racevisionGame/src/main/java/visualiser/model/ResizableRaceCanvas.java index 986c778d..a26c467e 100644 --- a/racevisionGame/src/main/java/visualiser/model/ResizableRaceCanvas.java +++ b/racevisionGame/src/main/java/visualiser/model/ResizableRaceCanvas.java @@ -200,10 +200,10 @@ public class ResizableRaceCanvas extends ResizableCanvas { * @param coordinate coordinate the text appears * @param timeToNextMark The time until the boat reaches the next mark. * @param timeSinceLastMark The time since the boat passed the last mark. - * @param paint The color of the text. + * @param textPaint The color of the text. * @param fontSize The size of the font. */ - private void drawText(String name, String abbrev, double speed, GraphCoordinate coordinate, String timeToNextMark, String timeSinceLastMark, Paint paint, double fontSize) { + private void drawText(String name, String abbrev, double speed, GraphCoordinate coordinate, String timeToNextMark, String timeSinceLastMark, Paint textPaint, double fontSize) { //The text to draw. Built during the function. String text = ""; @@ -251,7 +251,8 @@ public class ResizableRaceCanvas extends ResizableCanvas { gc.save(); - gc.setStroke(paint); + gc.setStroke(textPaint); + gc.setFill(textPaint); gc.setFont(new Font(gc.getFont().getName(), fontSize)); //Draw text. From a3fe57ed5a410b0125c0d3bc9beebff9bd34ce3a Mon Sep 17 00:00:00 2001 From: Joseph Gardner Date: Thu, 17 Aug 2017 12:27:59 +1200 Subject: [PATCH 23/28] Removed print statement. #story[1092] --- racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java | 1 - 1 file changed, 1 deletion(-) diff --git a/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java b/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java index 5f7b12cf..55ff04ce 100644 --- a/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java +++ b/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java @@ -114,7 +114,6 @@ public class RaceXMLCreator { for(XMLCompoundMark compoundMark: race.getCourse().getCompoundMark()){ for (XMLMark mark: compoundMark.getMark()){ - System.out.println(mark); GPSCoordinate rotatedMark = rotate(center, markToGPSCoordinate(mark), degrees); mark.setTargetLat(rotatedMark.getLatitude()); mark.setTargetLng(rotatedMark.getLongitude()); From 62f400b924fec1dc0f5ae5ffdda69326f2a1de2f Mon Sep 17 00:00:00 2001 From: fjc40 Date: Thu, 17 Aug 2017 12:56:11 +1200 Subject: [PATCH 24/28] Trackpoint line color fades out. --- .../visualiser/model/ResizableRaceCanvas.java | 49 +++++++++++-------- .../java/visualiser/model/VisualiserBoat.java | 2 +- 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/racevisionGame/src/main/java/visualiser/model/ResizableRaceCanvas.java b/racevisionGame/src/main/java/visualiser/model/ResizableRaceCanvas.java index a26c467e..00830c42 100644 --- a/racevisionGame/src/main/java/visualiser/model/ResizableRaceCanvas.java +++ b/racevisionGame/src/main/java/visualiser/model/ResizableRaceCanvas.java @@ -428,7 +428,7 @@ public class ResizableRaceCanvas extends ResizableCanvas { double endPointDiameter = 12; //Line. - drawLine(wakeFrom, wakeTo, boat.getColor(), lineWidth); + drawLine(wakeFrom, wakeTo, Color.DARKBLUE, lineWidth); //Draw end-point. drawCircle(wakeTo, endPointDiameter, Color.BLACK); @@ -712,35 +712,44 @@ public class ResizableRaceCanvas extends ResizableCanvas { //Check that track points are enabled. if (this.annoPath) { - gc.save(); + List trackPoints = new ArrayList<>(boat.getTrack()); - gc.setLineWidth(3); + if (trackPoints.size() > 2 ) { - //Apply the boat color. - gc.setFill(boat.getColor()); - gc.setStroke(boat.getColor()); + gc.save(); - List trackPoints = new ArrayList<>(boat.getTrack()); + gc.setLineWidth(3); - double[] xPoints = new double[trackPoints.size()]; - double[] yPoints = new double[trackPoints.size()]; - int index = 0; - //Copy trackpoint locations to x/y arrays. - for (TrackPoint point : trackPoints) { + //Draw a line between each adjacent pair of track points. + for (int i = 0; i < trackPoints.size() - 1; i++) { - //Convert the GPSCoordinate to a screen coordinate. - GraphCoordinate scaledCoordinate = this.map.convertGPS(point.getCoordinate()); + //Convert the GPSCoordinate to a screen coordinate. + GraphCoordinate scaledCoordinate1 = this.map.convertGPS(trackPoints.get(i).getCoordinate()); + GraphCoordinate scaledCoordinate2 = this.map.convertGPS(trackPoints.get(i + 1).getCoordinate()); - xPoints[index] = ((double)scaledCoordinate.getX()); - yPoints[index] = ((double)scaledCoordinate.getY()); + double alpha = trackPoints.get(i).getAlpha(); + Paint fadedPaint = new Color( + boat.getColor().getRed(), + boat.getColor().getGreen(), + boat.getColor().getBlue(), + alpha ); - index++; - } + //Apply the faded boat color. + gc.setFill(fadedPaint); + gc.setStroke(fadedPaint); - gc.strokePolyline(xPoints, yPoints, xPoints.length); + gc.strokeLine( + scaledCoordinate1.getX(), + scaledCoordinate1.getY(), + scaledCoordinate2.getX(), + scaledCoordinate2.getY() ); + } - gc.restore(); + + gc.restore(); + + } } } diff --git a/racevisionGame/src/main/java/visualiser/model/VisualiserBoat.java b/racevisionGame/src/main/java/visualiser/model/VisualiserBoat.java index bb2d2d12..9f0a72e4 100644 --- a/racevisionGame/src/main/java/visualiser/model/VisualiserBoat.java +++ b/racevisionGame/src/main/java/visualiser/model/VisualiserBoat.java @@ -41,7 +41,7 @@ public class VisualiserBoat extends Boat { /** * The number of track points that should be created before fully diminishing the alpha of a given track point. */ - private static final int trackPointLimit = 10; + private static final int trackPointLimit = 50; /** From 3cf50c56f84e8acb5de835fc591e6057bd647882 Mon Sep 17 00:00:00 2001 From: hba56 Date: Thu, 17 Aug 2017 13:15:33 +1200 Subject: [PATCH 25/28] added a refresh for the info table so no new values are shown when the game is in full screen --- .../src/main/java/visualiser/Controllers/RaceController.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/racevisionGame/src/main/java/visualiser/Controllers/RaceController.java b/racevisionGame/src/main/java/visualiser/Controllers/RaceController.java index 5fe58894..d2729bfd 100644 --- a/racevisionGame/src/main/java/visualiser/Controllers/RaceController.java +++ b/racevisionGame/src/main/java/visualiser/Controllers/RaceController.java @@ -454,14 +454,17 @@ public class RaceController extends Controller { arrowPane.setScaleY(0.5); arrowPane.setTranslateX(0 + (arrowPane.getScene().getWidth()/4)*tablePercent); arrowPane.setTranslateY(0 - arrowPane.getScene().getHeight()/4); + }else{ race.setDividerPositions(1); - + arrowPane.setScaleX(1); arrowPane.setScaleY(1); arrowPane.setTranslateX(0); arrowPane.setTranslateY(0); + } + boatInfoTable.refresh(); infoTableShow = !infoTableShow; } From 02ab0e8a00306ffc0af4603d6573bc8251d354bf Mon Sep 17 00:00:00 2001 From: hba56 Date: Thu, 17 Aug 2017 13:16:47 +1200 Subject: [PATCH 26/28] added javadoc --- .../src/main/java/visualiser/Controllers/RaceController.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/racevisionGame/src/main/java/visualiser/Controllers/RaceController.java b/racevisionGame/src/main/java/visualiser/Controllers/RaceController.java index d2729bfd..9fd43b7a 100644 --- a/racevisionGame/src/main/java/visualiser/Controllers/RaceController.java +++ b/racevisionGame/src/main/java/visualiser/Controllers/RaceController.java @@ -444,6 +444,9 @@ public class RaceController extends Controller { }.start(); } + /** + * toggles if the info table is shown + */ private void toggleTable() { double tablePercent = 1 - (boatPlacingColumn.getPrefWidth() + boatTeamColumn.getPrefWidth() + boatMarkColumn.getPrefWidth() + boatSpeedColumn.getPrefWidth())/race.getWidth(); @@ -457,7 +460,7 @@ public class RaceController extends Controller { }else{ race.setDividerPositions(1); - + arrowPane.setScaleX(1); arrowPane.setScaleY(1); arrowPane.setTranslateX(0); From 2e9c6fe5936fa7b3bda120366136b56435470ebb Mon Sep 17 00:00:00 2001 From: Fan-Wu Yang Date: Thu, 17 Aug 2017 13:23:55 +1200 Subject: [PATCH 27/28] Merged most recent master in, #story[1092] --- .../src/main/java/mock/model/RaceLogic.java | 8 ++++---- .../src/main/java/shared/model/CompoundMark.java | 3 ++- .../src/main/java/shared/model/Mark.java | 15 +++++++++++++-- .../src/main/java/shared/xml/Race/XMLMark.java | 4 +++- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/racevisionGame/src/main/java/mock/model/RaceLogic.java b/racevisionGame/src/main/java/mock/model/RaceLogic.java index a3560bbd..ecc2309e 100644 --- a/racevisionGame/src/main/java/mock/model/RaceLogic.java +++ b/racevisionGame/src/main/java/mock/model/RaceLogic.java @@ -180,9 +180,9 @@ public class RaceLogic implements RunnableWithFramePeriod, Observer { public void update(Observable o, Object arg) { Collision e = (Collision)arg; - if(e.getBearing().degrees() == 0) System.out.println("Ahead"); - else if(e.getBearing().degrees() < 90) System.out.println("Starboard"); - else if(e.getBearing().degrees() > 270) System.out.println("Port"); - else System.out.println("Behind"); +// if(e.getBearing().degrees() == 0) System.out.println("Ahead"); +// else if(e.getBearing().degrees() < 90) System.out.println("Starboard"); +// else if(e.getBearing().degrees() > 270) System.out.println("Port"); +// else System.out.println("Behind"); } } diff --git a/racevisionGame/src/main/java/shared/model/CompoundMark.java b/racevisionGame/src/main/java/shared/model/CompoundMark.java index 71e1ada8..e7c6c1af 100644 --- a/racevisionGame/src/main/java/shared/model/CompoundMark.java +++ b/racevisionGame/src/main/java/shared/model/CompoundMark.java @@ -64,8 +64,9 @@ public class CompoundMark extends XMLCompoundMark{ super(); setName(name); setCompoundMarkID(id); + /*TODO need to talk to connor about this as Mark should be extending XMLMark getMark().add(mark1); - if (mark2 != null) getMark().add(mark2); + if (mark2 != null) getMark().add(mark2);*/ this.id = id; this.name = name; diff --git a/racevisionGame/src/main/java/shared/model/Mark.java b/racevisionGame/src/main/java/shared/model/Mark.java index 0511d621..d236d076 100644 --- a/racevisionGame/src/main/java/shared/model/Mark.java +++ b/racevisionGame/src/main/java/shared/model/Mark.java @@ -12,7 +12,7 @@ import mock.model.collider.Collision; * Represents an individual mark. * Has a source ID, name, and position. */ -public class Mark extends Collider, XMLMark { +public class Mark extends Collider{ /** * The source ID of the mark. @@ -42,11 +42,14 @@ public class Mark extends Collider, XMLMark { */ public Mark(int sourceID, String name, GPSCoordinate position) { super(); + /* TODO need to talk to connor about this as this class should be extending XMLMark targetLat = position.getLatitude(); targetLng = position.getLongitude(); setSourceID(sourceID); - setName(name); + setName(name);*/ + this.sourceID = sourceID; + this.name = name; this.position = position; } @@ -68,6 +71,14 @@ public class Mark extends Collider, XMLMark { return name; } + /** + * Returns the source ID of the mark + * @return the source ID of the mark + */ + public int getSourceID() { + return sourceID; + } + /** * Returns the position of the mark. * @return The position of the mark. diff --git a/racevisionGame/src/main/java/shared/xml/Race/XMLMark.java b/racevisionGame/src/main/java/shared/xml/Race/XMLMark.java index 8affde4a..0ad01ce4 100644 --- a/racevisionGame/src/main/java/shared/xml/Race/XMLMark.java +++ b/racevisionGame/src/main/java/shared/xml/Race/XMLMark.java @@ -8,6 +8,8 @@ package shared.xml.Race; +import mock.model.collider.Collider; + import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; @@ -37,7 +39,7 @@ import javax.xml.bind.annotation.XmlType; */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") -public class XMLMark { +public class XMLMark{ @XmlAttribute(name = "SeqId") protected Integer seqId; From 2656efcb4db6b609dcea24e8628126bae2221bad Mon Sep 17 00:00:00 2001 From: fjc40 Date: Thu, 17 Aug 2017 13:30:10 +1200 Subject: [PATCH 28/28] Marks are a bit darker. Wake no longer has circle at end. --- .../src/main/java/visualiser/model/ResizableRaceCanvas.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/racevisionGame/src/main/java/visualiser/model/ResizableRaceCanvas.java b/racevisionGame/src/main/java/visualiser/model/ResizableRaceCanvas.java index f812412e..1c17b540 100644 --- a/racevisionGame/src/main/java/visualiser/model/ResizableRaceCanvas.java +++ b/racevisionGame/src/main/java/visualiser/model/ResizableRaceCanvas.java @@ -431,7 +431,7 @@ public class ResizableRaceCanvas extends ResizableCanvas { drawLine(wakeFrom, wakeTo, Color.DARKBLUE, lineWidth); //Draw end-point. - drawCircle(wakeTo, endPointDiameter, Color.BLACK); + //drawCircle(wakeTo, endPointDiameter, Color.BLACK); } @@ -461,7 +461,7 @@ public class ResizableRaceCanvas extends ResizableCanvas { double diameter = 10; //Draw. - drawCircle(mark1, diameter, Color.LIMEGREEN); + drawCircle(mark1, diameter, Color.DARKGREEN); }