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 @@
-
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 The following schema fragment specifies the expected content contained within this class.
*
* The following schema fragment specifies the expected content contained within this class.
*
*
* Objects of the following type(s) are allowed in the list
* {@link Race.Course.CompoundMark }
- *
+ * @return CompoundMarks in a Course
*
*/
public List The following schema fragment specifies the expected content contained within this class.
*
*
* Objects of the following type(s) are allowed in the list
* {@link Race.Course.CompoundMark.Mark }
- *
+ * @return Marks in a CompoundMark
*
*/
public List The following schema fragment specifies the expected content contained within this class.
*
* The following schema fragment specifies the expected content contained within this class.
*
*
* Objects of the following type(s) are allowed in the list
* {@link Race.CourseLimit.Limit }
- *
+ * @return Limits in CourseLimits
*
*/
public List The following schema fragment specifies the expected content contained within this class.
*
* The following schema fragment specifies the expected content contained within this class.
*
*
* Objects of the following type(s) are allowed in the list
* {@link Race.Participants.Yacht }
- *
+ * @return yachts in a race.
*
*/
public List The following schema fragment specifies the expected content contained within this class.
*
* 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 {
*
- * <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 {
*
- * <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 {
*
- * <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 {
*
- * <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 {
*
- * <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 {
*
- * <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 {
*
- * <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 {
*
- * <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();
diff --git a/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java b/racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java
index 8e13b842..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,16 +11,37 @@ 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;
/**
- * 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 +103,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 +121,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 +133,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,10 +145,19 @@ public class RaceXMLCreator {
return null;
}
- public static String alterRaceToWind(String s, double degrees) throws XMLReaderException, InvalidRaceDataException, JAXBException {
+ /**
+ * 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, 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());
@@ -127,6 +175,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 +198,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 +224,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,10 +249,46 @@ 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();
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/xml/XMLUtilities.java b/racevisionGame/src/main/java/shared/xml/XMLUtilities.java
new file mode 100644
index 00000000..b865b230
--- /dev/null
+++ b/racevisionGame/src/main/java/shared/xml/XMLUtilities.java
@@ -0,0 +1,36 @@
+package shared.xml;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import java.io.StringWriter;
+
+/**
+ * Created by fwy13 on 13/08/17.
+ */
+public class XMLUtilities {
+
+ public static String classToXML(Object o) throws JAXBException {
+ JAXBContext context = JAXBContext.newInstance(o.getClass());
+ Marshaller jaxbMarshaller = context.createMarshaller();
+ jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
+
+ StringWriter sw = new StringWriter();
+
+ jaxbMarshaller.marshal(o, sw);
+ 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);
+ }
+
+}
diff --git a/racevisionGame/src/main/java/visualiser/app/VisualiserInput.java b/racevisionGame/src/main/java/visualiser/app/VisualiserInput.java
index 0b8102b5..3c9370f5 100644
--- a/racevisionGame/src/main/java/visualiser/app/VisualiserInput.java
+++ b/racevisionGame/src/main/java/visualiser/app/VisualiserInput.java
@@ -1,26 +1,14 @@
package visualiser.app;
-import javafx.application.Platform;
+
import network.BinaryMessageDecoder;
import network.Exceptions.InvalidMessageException;
import network.Messages.*;
-import org.xml.sax.SAXException;
-import shared.dataInput.BoatXMLReader;
-import shared.dataInput.RaceXMLReader;
-import shared.dataInput.RegattaXMLReader;
-import shared.exceptions.InvalidBoatDataException;
-import shared.exceptions.InvalidRaceDataException;
-import shared.exceptions.InvalidRegattaDataException;
-import shared.exceptions.XMLReaderException;
-
-import javax.xml.parsers.ParserConfigurationException;
+
import java.io.DataInputStream;
import java.io.IOException;
import java.net.Socket;
import java.nio.ByteBuffer;
import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.ArrayBlockingQueue;
import static network.Utils.ByteConverter.bytesToShort;
diff --git a/racevisionGame/src/main/resources/mock/mockXML/schema/raceSchema.xsd b/racevisionGame/src/main/resources/mock/mockXML/schema/raceSchema.xsd
index 8cc15218..755722ff 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 @@