Merge branch 'story30_XMLs' into splitIntoTwoModules

main
Joseph Gardner 9 years ago
commit 26380f2677

@ -0,0 +1,251 @@
<?xml version="1.0" encoding="utf-8"?>
<BoatConfig>
<Modified>2012-05-17T07:49:40+0200</Modified>
<Version>12</Version>
<Settings>
<RaceBoatType Type="AC45" />
<BoatDimension BoatLength="14.019" HullLength="13.449" />
<ZoneSize MarkZoneSize="40.347" CourseZoneSize="40.347" />
<ZoneLimits Limit1="200" Limit2="100" Limit3="40.347" Limit4="0" Limit5="-100" />
</Settings>
<BoatShapes>
<BoatShape ShapeID="0">
<Vertices>
<Vtx Seq="1" Y="0" X="-2.659" />
<Vtx Seq="2" Y="18.359" X="-2.659" />
<Vtx Seq="3" Y="18.359" X="2.659" />
<Vtx Seq="4" Y="0" X="2.659" />
</Vertices>
</BoatShape>
<BoatShape ShapeID="1">
<Vertices>
<Vtx Seq="1" Y="0" X="-1.278" />
<Vtx Seq="2" Y="8.876" X="-1.278" />
<Vtx Seq="3" Y="8.876" X="1.278" />
<Vtx Seq="4" Y="0" X="1.278" />
</Vertices>
</BoatShape>
<BoatShape ShapeID="2">
<Vertices>
<Vtx Seq="1" Y="0" X="-1.1" />
<Vtx Seq="2" Y="8.3" X="-1.1" />
<Vtx Seq="3" Y="8.3" X="1.1" />
<Vtx Seq="4" Y="0" X="1.1" />
</Vertices>
</BoatShape>
<BoatShape ShapeID="3">
<Vertices>
<Vtx Seq="1" Y="0" X="-0.75" />
<Vtx Seq="2" Y="3" X="-0.75" />
<Vtx Seq="3" Y="3" X="0.75" />
<Vtx Seq="4" Y="0" X="0.75" />
</Vertices>
</BoatShape>
<BoatShape ShapeID="4">
<Vertices>
<Vtx Seq="1" Y="0" X="-3.46" />
<Vtx Seq="2" Y="13.449" X="-3.46" />
<Vtx Seq="3" Y="14.019" X="0" />
<Vtx Seq="4" Y="13.449" X="3.46" />
<Vtx Seq="5" Y="0" X="3.46" />
</Vertices>
<Catamaran>
<Vtx Seq="1" Y="1.769" X="-2.752" />
<Vtx Seq="2" Y="0" X="-2.813" />
<Vtx Seq="3" Y="0" X="-3.34" />
<Vtx Seq="4" Y="5.351" X="-3.46" />
<Vtx Seq="5" Y="10.544" X="-3.387" />
<Vtx Seq="6" Y="13.449" X="-3.075" />
<Vtx Seq="7" Y="10.851" X="-2.793" />
<Vtx Seq="8" Y="6.669" X="-2.699" />
<Vtx Seq="9" Y="6.669" X="2.699" />
<Vtx Seq="10" Y="10.851" X="2.793" />
<Vtx Seq="11" Y="13.449" X="3.075" />
<Vtx Seq="12" Y="10.544" X="3.387" />
<Vtx Seq="13" Y="5.351" X="3.46" />
<Vtx Seq="14" Y="0" X="3.34" />
<Vtx Seq="15" Y="0" X="2.813" />
<Vtx Seq="16" Y="1.769" X="2.752" />
</Catamaran>
<Bowsprit>
<Vtx Seq="1" Y="6.669" X="-0.2" />
<Vtx Seq="2" Y="11.377" X="-0.2" />
<Vtx Seq="3" Y="14.019" X="0" />
<Vtx Seq="4" Y="11.377" X="0.2" />
<Vtx Seq="5" Y="6.669" X="0.2" />
</Bowsprit>
<Trampoline>
<Vtx Seq="1" Y="2" X="-2.699" />
<Vtx Seq="2" Y="6.438" X="-2.699" />
<Vtx Seq="3" Y="6.438" X="2.699" />
<Vtx Seq="4" Y="2" X="2.699" />
</Trampoline>
</BoatShape>
<BoatShape ShapeID="5" />
</BoatShapes>
<Boats>
<Boat Type="RC" SourceID="121" ShapeID="0" HullNum="RG01" StoweName="PRO" ShortName="PRO"
BoatName="Regardless">
<GPSposition Z="6.840" Y="7.800" X="0.000" />
<FlagPosition Z="0.000" Y="7.800" X="0.000" />
</Boat>
<Boat Type="Mark" SourceID="122" ShapeID="1" HullNum="LC05" StoweName="CON" ShortName="Constellation"
BoatName="Constellation">
<GPSposition Z="5.334" Y="3.804" X="0.000" />
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
</Boat>
<Boat Type="Mark" SourceID="123" ShapeID="1" HullNum="LC04" StoweName="MIS" ShortName="Mischief"
BoatName="Mischief">
<GPSposition Z="5.334" Y="3.804" X="0.000" />
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
</Boat>
<Boat Type="Mark" SourceID="124" ShapeID="1" HullNum="LC03" ShortName="Atalanta" BoatName="Atalanta">
<GPSposition Z="5.334" Y="3.804" X="0.000" />
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
</Boat>
<Boat SourceID="125" ShapeID="1" StoweName="VOL" HullNum="LC01" ShortName="Volunteer"
BoatName="Volunteer">
<GPSposition Z="5.334" Y="3.804" X="0.000" />
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
</Boat>
<Boat Type="Mark" SourceID="126" ShapeID="1" HullNum="LC13" StoweName="MS2" ShortName="Defender"
BoatName="Defender">
<GPSposition Z="5.334" Y="3.804" X="0.000" />
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
</Boat>
<Boat Type="Mark" SourceID="128" ShapeID="1" HullNum="LC01" ShortName="Shamrock" BoatName="Shamrock">
<GPSposition Z="5.334" Y="3.804" X="0.000" />
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
</Boat>
<Boat Type="Yacht" SourceID="101" ShapeID="4" HullNum="AC4501" StoweName="KOR" ShortName="TEAM KOREA"
BoatName="TEAM KOREA" Country="KOR">
<GPSposition Z="1.738" Y="0.625" X="0.001" />
<MastTop Z="21.496" Y="4.233" X="0.000" />
</Boat>
</Boats>
</BoatConfig>

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="visualiser" />
</profile>
</annotationProcessing>
<bytecodeTargetLevel>
<module name="visualiser" target="1.8" />
</bytecodeTargetLevel>
</component>
</project>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: com.beust:jcommander:1.64">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/beust/jcommander/1.64/jcommander-1.64.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/beust/jcommander/1.64/jcommander-1.64-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/beust/jcommander/1.64/jcommander-1.64-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: com.github.bfsmith:geotimezone:1.0.3">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/github/bfsmith/geotimezone/1.0.3/geotimezone-1.0.3.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/github/bfsmith/geotimezone/1.0.3/geotimezone-1.0.3-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/github/bfsmith/geotimezone/1.0.3/geotimezone-1.0.3-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: com.spatial4j:spatial4j:0.4.1">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/spatial4j/spatial4j/0.4.1/spatial4j-0.4.1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/spatial4j/spatial4j/0.4.1/spatial4j-0.4.1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/spatial4j/spatial4j/0.4.1/spatial4j-0.4.1-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: commons-pool:commons-pool:1.5.4">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/commons-pool/commons-pool/1.5.4/commons-pool-1.5.4.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/commons-pool/commons-pool/1.5.4/commons-pool-1.5.4-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/commons-pool/commons-pool/1.5.4/commons-pool-1.5.4-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: java3d:vecmath:1.3.2">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/java3d/vecmath/1.3.2/vecmath-1.3.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/java3d/vecmath/1.3.2/vecmath-1.3.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/java3d/vecmath/1.3.2/vecmath-1.3.2-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: javax.media:jai_core:1.1.3">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/javax/media/jai_core/1.1.3/jai_core-1.1.3.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/javax/media/jai_core/1.1.3/jai_core-1.1.3-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/javax/media/jai_core/1.1.3/jai_core-1.1.3-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: jgridshift:jgridshift:1.0">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/jgridshift/jgridshift/1.0/jgridshift-1.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/jgridshift/jgridshift/1.0/jgridshift-1.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/jgridshift/jgridshift/1.0/jgridshift-1.0-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: joda-time:joda-time:2.7">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/joda-time/joda-time/2.7/joda-time-2.7.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/joda-time/joda-time/2.7/joda-time-2.7-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/joda-time/joda-time/2.7/joda-time-2.7-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: junit:junit:4.12">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: net.java.dev.jsr-275:jsr-275:1.0-beta-2">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/net/java/dev/jsr-275/jsr-275/1.0-beta-2/jsr-275-1.0-beta-2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/net/java/dev/jsr-275/jsr-275/1.0-beta-2/jsr-275-1.0-beta-2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/net/java/dev/jsr-275/jsr-275/1.0-beta-2/jsr-275-1.0-beta-2-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.geotools:gt-metadata:9.0">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/geotools/gt-metadata/9.0/gt-metadata-9.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/geotools/gt-metadata/9.0/gt-metadata-9.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/geotools/gt-metadata/9.0/gt-metadata-9.0-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.geotools:gt-opengis:9.0">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/geotools/gt-opengis/9.0/gt-opengis-9.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/geotools/gt-opengis/9.0/gt-opengis-9.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/geotools/gt-opengis/9.0/gt-opengis-9.0-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.geotools:gt-referencing:9.0">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/geotools/gt-referencing/9.0/gt-referencing-9.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/geotools/gt-referencing/9.0/gt-referencing-9.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/geotools/gt-referencing/9.0/gt-referencing-9.0-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.hamcrest:hamcrest-core:1.3">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.mockito:mockito-all:1.9.5">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/mockito/mockito-all/1.9.5/mockito-all-1.9.5.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/mockito/mockito-all/1.9.5/mockito-all-1.9.5-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/mockito/mockito-all/1.9.5/mockito-all-1.9.5-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.testng:testng:6.11">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/testng/testng/6.11/testng-6.11.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/testng/testng/6.11/testng-6.11-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/testng/testng/6.11/testng-6.11-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.yaml:snakeyaml:1.17">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/yaml/snakeyaml/1.17/snakeyaml-1.17.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/yaml/snakeyaml/1.17/snakeyaml-1.17-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/yaml/snakeyaml/1.17/snakeyaml-1.17-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/classes" />
</component>
<component name="SvnConfiguration">
<configuration>$USER_HOME$/.subversion</configuration>
</component>
<component name="masterDetails">
<states>
<state key="ProjectJDKs.UI">
<settings>
<last-edited>1.8</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ScopeChooserConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/visualiser.iml" filepath="$PROJECT_DIR$/visualiser.iml" />
</modules>
</component>
</project>

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>

File diff suppressed because it is too large Load Diff

@ -133,7 +133,7 @@ public class RaceController extends Controller {
//Initialize save annotation array, fps listener, and annotation listeners
//timezone
RaceClock raceClock = new RaceClock(raceData.getMark());
RaceClock raceClock = new RaceClock(raceData.getZonedDateTime());
timeZone.setText(raceClock.getTimeZone());
initializeFPS();
initializeAnnotations();

@ -103,8 +103,8 @@ public class StartController extends Controller {
boatNameColumn.setCellValueFactory(cellData -> cellData.getValue().getName());
boatCodeColumn.setCellValueFactory(new PropertyValueFactory<>("abbrev"));
//timezone
raceClock = new RaceClock(raceData.getMark());
timeZoneTime.textProperty().bind(raceClock.timeProperty());
raceClock = new RaceClock(raceData.getZonedDateTime());
timeZoneTime.textProperty().bind(raceClock.timeStringProperty());
}

@ -0,0 +1,156 @@
package seng302.Mock;
import javafx.scene.paint.Color;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import seng302.XMLReader;
import javax.xml.parsers.ParserConfigurationException;
import java.io.IOException;
import java.lang.annotation.ElementType;
import java.text.ParseException;
import java.util.*;
/**
* Created by Joseph on 24/04/2017.
*/
public class BoatXMLReader extends XMLReader {
Map<Integer, StreamedBoat> streamedBoatMap = new HashMap<>();
Map<Integer, StreamedBoat> participants = new HashMap<>();
private List<Color> colours;
private static int currentColourIndex = 0;
/**
* Constructor for Boat XML Reader
* @param filePath path of the file
* @throws IOException error
* @throws SAXException error
* @throws ParserConfigurationException error
*/
public BoatXMLReader(String filePath) throws IOException, SAXException, ParserConfigurationException, ParseException {
this(filePath, false);
makeColours();
}
/**
* Constructor for Boat XML Reader
* @param filePath file path to read
* @param read whether or not to read and store the files straight away.
* @throws IOException error
* @throws SAXException error
* @throws ParserConfigurationException error
*/
public BoatXMLReader(String filePath, boolean read) throws IOException, SAXException, ParserConfigurationException, ParseException {
super(filePath);
makeColours();
if (read) {
read();
}
}
public void read() {
readSettings();
readShapes();
readBoats();
}
/**
* Reads boats settings.
* INFORMATION FROM HERE IS IGNORED FOR NOW
*/
private void readSettings() {
}
/**
* Reads different kinds of boat.
* INFORMATION FROM HERE IS IGNORED FOR NOW
*/
private void readShapes() {
}
/**
* Reads the boats in the race
*/
private void readBoats() {
Element nBoats = (Element) doc.getElementsByTagName("Boats").item(0);
for (int i = 0; i < nBoats.getChildNodes().getLength(); i++) {
Node boat = nBoats.getChildNodes().item(i);
if (boat.getNodeName().equals("Boat")) {
readSingleBoat(boat);
currentColourIndex = (currentColourIndex + 1) % colours.size();
}
}
}
/**
* Reads the information about one boat
* Ignored values: ShapeID, StoweName, HullNum, Skipper
*/
private void readSingleBoat(Node boat) {
StreamedBoat streamedBoat;
String type = "None";
int sourceID = -1;
String boatName = null;
String shortName = null;
String country = null;
if (exists(boat, "Type")) type = boat.getAttributes().getNamedItem("Type").getTextContent();
if (exists(boat, "SourceID")) sourceID = Integer.parseInt(boat.getAttributes().getNamedItem("SourceID").getTextContent());
if (exists(boat, "BoatName")) boatName = boat.getAttributes().getNamedItem("BoatName").getTextContent();
if (exists(boat, "ShortName")) shortName = boat.getAttributes().getNamedItem("ShortName").getTextContent();
if (exists(boat, "Country")) country = boat.getAttributes().getNamedItem("Country").getTextContent();
// Ignore all non participating boats
if (participants.containsKey(sourceID)) {
if (!streamedBoatMap.containsKey(sourceID)) {
if (country != null) {
streamedBoat = new StreamedBoat(sourceID, boatName, colours.get(currentColourIndex), country);
} else {
streamedBoat = new StreamedBoat(sourceID, boatName, colours.get(currentColourIndex), shortName);
}
streamedBoatMap.put(sourceID, streamedBoat);
// Override boat with new boat
participants.put(sourceID, streamedBoat);
}
for (int i = 0; i < boat.getChildNodes().getLength(); i++) {
Node GPSPosition = boat.getChildNodes().item(i);
if (GPSPosition.getNodeName().equals("GPSposition")) readBoatPositionInformation(sourceID, GPSPosition);
}
}
}
/**
* Reads the positional information about a boat
* Ignored values: FlagPosition, MastTop, Z value of GPSposition
*/
private void readBoatPositionInformation(int sourceID, Node GPSPosition) {
// TODO Get relative point before implementing. (GPSposition is based off a relative point).
}
private void makeColours() {
colours = new ArrayList<Color>(Arrays.asList(
Color.BLUEVIOLET,
Color.BLACK,
Color.RED,
Color.ORANGE,
Color.DARKOLIVEGREEN,
Color.LIMEGREEN,
Color.PURPLE,
Color.DARKGRAY,
Color.YELLOW
));
}
public void setParticipants(Map<Integer, StreamedBoat> participants) {
this.participants = participants;
}
public Map<Integer, StreamedBoat> getStreamedBoatMap() {
return streamedBoatMap;
}
}

@ -3,6 +3,7 @@ package seng302.Mock;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import seng302.RaceDataSource;
import seng302.XMLReader;
import javax.xml.parsers.ParserConfigurationException;

@ -0,0 +1,44 @@
package seng302.Mock;
import javafx.scene.paint.Color;
import seng302.GPSCoordinate;
import seng302.Model.Boat;
import seng302.Model.BoatInRace;
/**
* Created by Joseph on 24/04/2017.
*/
public class StreamedBoat extends BoatInRace {
private int sourceID;
private boolean complete;
public StreamedBoat(int sourceID, String name, Color colour, String abbrev) {
super(name, colour, abbrev);
this.sourceID = sourceID;
this.complete = true;
}
public StreamedBoat(int sourceID) {
super("None", Color.BLACK, "None");
this.sourceID = sourceID;
this.complete = false;
}
/**
* Overridden to ignore this function
* @deprecated
* @return 0
*/
public double getScaledVelocity() {
return 0;
}
/**
* Overridden to ignore this function
* @deprecated
* @param velocity of boat
*/
public void setScaledVelocity(double velocity) {
}
}

@ -0,0 +1,68 @@
package seng302.Mock;
import seng302.GPSCoordinate;
import seng302.Model.BoatInRace;
import seng302.Model.Leg;
import seng302.RaceDataSource;
import java.time.ZonedDateTime;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* Created by jjg64 on 21/04/17.
*/
public class StreamedCourse implements RaceDataSource {
StreamedCourseXMLReader streamedCourseXMLReader = null;
BoatXMLReader boatXMLReader = null;
List<GPSCoordinate> boundary = new ArrayList<>();
public StreamedCourse(StreamedCourseXMLReader streamedCourseXMLReader) {
this.streamedCourseXMLReader = streamedCourseXMLReader;
}
public StreamedCourse(BoatXMLReader boatXMLReader) {
this.boatXMLReader = boatXMLReader;
}
public void setBoatXMLReader(BoatXMLReader boatXMLReader) {
this.boatXMLReader = boatXMLReader;
if (streamedCourseXMLReader != null) {
boatXMLReader.setParticipants(streamedCourseXMLReader.getParticipants());
boatXMLReader.read();
}
}
public void setStreamedCourseXMLReader(StreamedCourseXMLReader streamedCourseXMLReader) {
this.streamedCourseXMLReader = streamedCourseXMLReader;
if (streamedCourseXMLReader != null) {
boatXMLReader.setParticipants(streamedCourseXMLReader.getParticipants());
boatXMLReader.read();
}
}
public List<BoatInRace> getBoats() {
return null;
}
public List<Leg> getLegs() {
return null;
}
public List<GPSCoordinate> getBoundary() {
return null;
}
public ZonedDateTime getZonedDateTime() {
return null;
}
public GPSCoordinate getMapTopLeft() {
return null;
}
public GPSCoordinate getMapBottomRight() {
return null;
}
}

@ -0,0 +1,163 @@
package seng302.Mock;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.xml.sax.SAXException;
import seng302.GPSCoordinate;
import seng302.XMLReader;
import javax.xml.parsers.ParserConfigurationException;
import java.io.IOException;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* Created by jjg64 on 21/04/17.
*/
public class StreamedCourseXMLReader extends XMLReader {
private static double COORDINATEPADDING = 0.0005;
private GPSCoordinate mapTopLeft, mapBottomRight;
private List<GPSCoordinate> boundary = new ArrayList<>();
private Map<Integer, StreamedBoat> participants = new HashMap<>();
Date creationTimeDate;
Date raceStartTime;
int raceID;
String raceType;
boolean postpone;
/**
* Constructor for Streamed Race XML
* @param filePath path of the file
* @throws IOException error
* @throws SAXException error
* @throws ParserConfigurationException error
*/
public StreamedCourseXMLReader(String filePath) throws IOException, SAXException, ParserConfigurationException, ParseException {
this(filePath, true);
}
/**
* Constructor for Streamed Race XML
* @param filePath file path to read
* @param read whether or not to read and store the files straight away.
* @throws IOException error
* @throws SAXException error
* @throws ParserConfigurationException error
*/
public StreamedCourseXMLReader(String filePath, boolean read) throws IOException, SAXException, ParserConfigurationException, ParseException {
super(filePath);
if (read) {
read();
}
}
private void read() throws ParseException {
readRace();
readParticipants();
readCourse();
}
private void readRace() throws ParseException {
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
Element settings = (Element) doc.getElementsByTagName("Race").item(0);
raceID = Integer.parseInt(getTextValueOfNode(settings, "RaceID"));
raceType = getTextValueOfNode(settings, "RaceType");
creationTimeDate = dateFormat.parse(getTextValueOfNode(settings, "CreationTimeDate"));
NamedNodeMap raceTimeTag = doc.getElementsByTagName("RaceStartTime").item(0).getAttributes();
raceStartTime = dateFormat.parse(raceTimeTag.getNamedItem("Time").getTextContent());
postpone = Boolean.parseBoolean(raceTimeTag.getNamedItem("Postpone").getTextContent());
}
private void readParticipants() {
Element nParticipants = (Element) doc.getElementsByTagName("Participants").item(0);
for (int i = 0; i < nParticipants.getChildNodes().getLength(); i++) {
int sourceID;
Node yacht = nParticipants.getChildNodes().item(i);
if (yacht.getNodeName().equals("Yacht")) {
if (exists(yacht, "SourceID")) {
sourceID = Integer.parseInt(yacht.getAttributes().getNamedItem("SourceID").getTextContent());
participants.put(sourceID, new StreamedBoat(sourceID));
}
}
}
}
private void readCourse() {
readCompoundMarks();
readCompoundMarkSequence();
readCourseLimit();
}
private void readCompoundMarks() {
// TODO Produce map of sequence id to compound mark nodes (in xml)
// TODO Populate list of markers
}
private void readCompoundMarkSequence() {
// TODO Produce list of legs according to mark sequence ids
}
private void readCourseLimit() {
Element nCourseLimit = (Element) doc.getElementsByTagName("CourseLimit").item(0);
for(int i = 0; i < nCourseLimit.getChildNodes().getLength(); i++) {
Node limit = nCourseLimit.getChildNodes().item(i);
if (limit.getNodeName().equals("Limit")) {
double lat = Double.parseDouble(limit.getAttributes().getNamedItem("Lat").getTextContent());
double lon = Double.parseDouble(limit.getAttributes().getNamedItem("Lon").getTextContent());
boundary.add(new GPSCoordinate(lat, lon));
}
}
double maxLatitude = boundary.stream().max(Comparator.comparingDouble(GPSCoordinate::getLatitude)).get().getLatitude() + COORDINATEPADDING;
double maxLongitude = boundary.stream().max(Comparator.comparingDouble(GPSCoordinate::getLongitude)).get().getLongitude() + COORDINATEPADDING;
double minLatitude = boundary.stream().min(Comparator.comparingDouble(GPSCoordinate::getLatitude)).get().getLatitude() + COORDINATEPADDING;
double minLongitude = boundary.stream().min(Comparator.comparingDouble(GPSCoordinate::getLongitude)).get().getLongitude() + COORDINATEPADDING;
mapTopLeft = new GPSCoordinate(minLatitude, minLongitude);
mapBottomRight = new GPSCoordinate(maxLatitude, maxLongitude);
}
public List<GPSCoordinate> getBoundary() {
return boundary;
}
public GPSCoordinate getMapTopLeft() {
return mapTopLeft;
}
public GPSCoordinate getMapBottomRight() {
return mapBottomRight;
}
public Double getPadding() {
return COORDINATEPADDING;
}
public Date getCreationTimeDate() {
return creationTimeDate;
}
public Date getRaceStartTime() {
return raceStartTime;
}
public int getRaceID() {
return raceID;
}
public String getRaceType() {
return raceType;
}
public boolean isPostpone() {
return postpone;
}
public Map<Integer, StreamedBoat> getParticipants() {
return participants;
}
}

@ -0,0 +1,56 @@
package seng302.Mock;
import javafx.collections.FXCollections;
import seng302.Controllers.RaceController;
import seng302.Model.BoatInRace;
import seng302.Model.Leg;
import seng302.Model.Race;
import seng302.RaceDataSource;
import java.util.*;
/**
* Created by jjg64 on 21/04/17.
*/
public class StreamedRace extends Race {
private RaceDataSource raceData;
public StreamedRace(RaceDataSource raceData, RaceController controller, int scaleFactor) {
super(raceData.getBoats(), raceData.getLegs(), controller, scaleFactor);
this.raceData = raceData;
}
public void initialiseBoats() {
}
/**
* Checks if the boat cannot finish the race
* @return True if boat cannot finish the race
*/
protected boolean doNotFinish() {
return false;
}
/**
* Checks the position of the boat, this updates the boats current position.
*
* @param boat Boat that the postion is to be updated for.
* @param timeElapsed Time that has elapse since the start of the the race.
* @see BoatInRace
*/
protected void checkPosition(BoatInRace boat, long timeElapsed) {
}
/**
* Updates the boat's gps coordinates
*
* @param boat to be updated
* @param millisecondsElapsed time since last update
*/
protected void updatePosition(BoatInRace boat, int millisecondsElapsed) {
}
}

@ -27,6 +27,17 @@ public class Boat {
this.name = new SimpleStringProperty(name);
}
/**
* Boat initialiser which keeps all of the information of the boat.
*
* @param name Name of the Boat.
* @param abbrev nam abbreviation
*/
public Boat(String name, String abbrev) {
this.abbrev = abbrev;
this.name = new SimpleStringProperty(name);
}
/**
* @return Name of the boat
*/

@ -17,25 +17,25 @@ import java.util.concurrent.ConcurrentLinkedQueue;
*/
public class BoatInRace extends Boat {
private Leg currentLeg;
protected Leg currentLeg;
private double scaledVelocity;
private double distanceTravelledInLeg;
private GPSCoordinate currentPosition;
private long timeFinished;
private Color colour;
private boolean finished = false;
private StringProperty currentLegName;
private boolean started = false;
private StringProperty position;
private double heading;
private Queue<TrackPoint> track = new ConcurrentLinkedQueue<>();
private long nextValidTime = 0;
private static final float BASE_TRACK_POINT_TIME_INTERVAL = 5000;
private static float trackPointTimeInterval = 5000; // every 1 seconds
private final int TRACK_POINT_LIMIT = 10;
private boolean trackVisible = true;
protected double distanceTravelledInLeg;
protected GPSCoordinate currentPosition;
protected long timeFinished;
protected Color colour;
protected boolean finished = false;
protected StringProperty currentLegName;
protected boolean started = false;
protected StringProperty position;
protected double heading;
protected Queue<TrackPoint> track = new ConcurrentLinkedQueue<>();
protected long nextValidTime = 0;
protected static final float BASE_TRACK_POINT_TIME_INTERVAL = 5000;
protected static float trackPointTimeInterval = 5000; // every 1 seconds
protected final int TRACK_POINT_LIMIT = 10;
protected boolean trackVisible = true;
/**
* Constructor method.
@ -52,6 +52,20 @@ public class BoatInRace extends Boat {
position = new SimpleStringProperty("-");
}
/**
* Constructor method.
*
* @param name Name of the boat.
* @param colour Colour the boat will be displayed as on the map
* @param abbrev of boat
*/
public BoatInRace(String name, Color colour, String abbrev) {
super(name, abbrev);
setColour(colour);
currentLegName = new SimpleStringProperty("");
position = new SimpleStringProperty("-");
}
/**
* Calculates the azimuth of the travel via map coordinates of the raceMarkers
*

@ -9,7 +9,6 @@ import java.awt.geom.Point2D;
* Created by esa46 on 29/03/17.
*/
public class Marker {
private GPSCoordinate averageGPSCoordinate;
private GPSCoordinate mark1;
private GPSCoordinate mark2;

@ -65,8 +65,8 @@ public abstract class Race implements Runnable {
public abstract void initialiseBoats();
/**
* Randomly generate number to see if boat fails
* @return True if number lower than dnfChance else false
* Checks if the boat cannot finish the race
* @return True if boat cannot finish the race
*/
protected abstract boolean doNotFinish();
@ -80,7 +80,7 @@ public abstract class Race implements Runnable {
protected abstract void checkPosition(BoatInRace boat, long timeElapsed);
/**
* Updates the boat's gps coordinates depending on time elapsed
* Updates the boat's gps coordinates
*
* @param boat to be updated
* @param millisecondsElapsed time since last update

@ -6,48 +6,62 @@ import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import seng302.GPSCoordinate;
import java.time.Duration;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
/**
* Created by Gondr on 19/04/2017.
*/
public class RaceClock {
private StringProperty time;
private DateTimeFormatter dateTimeFormatter;
private String timeZone;
private long lastTime;
private ZoneId zoneId;
private ZonedDateTime time;
private StringProperty timeString;
public RaceClock(GPSCoordinate gpsCoordinate){
public RaceClock(ZonedDateTime zonedDateTime) {
this.zoneId = zonedDateTime.getZone();
this.timeString = new SimpleStringProperty();
this.time = zonedDateTime;
}
public static ZonedDateTime getCurrentZonedDateTime(GPSCoordinate gpsCoordinate) {
TimeZoneLookup timeZoneLookup = new TimeZoneLookup();
TimeZoneResult timeZoneResult = timeZoneLookup.getTimeZone(gpsCoordinate.getLatitude(), gpsCoordinate.getLongitude());
zoneId = ZoneId.of(timeZoneResult.getResult());
LocalDateTime localDateTime = LocalDateTime.now(zoneId);
ZonedDateTime zonedDateTime = localDateTime.atZone(zoneId);
dateTimeFormatter = DateTimeFormatter.ofPattern("dd-MM HH:mm:ss z");
// System.out.println(dateTimeFormatter.format(zonedDateTime));
time = new SimpleStringProperty(dateTimeFormatter.format(zonedDateTime));
DateTimeFormatter timeZoneFormatter = DateTimeFormatter.ofPattern("z");
timeZone = timeZoneFormatter.format(zonedDateTime);
ZoneId zone = ZoneId.of(timeZoneResult.getResult());
return LocalDateTime.now(zone).atZone(zone);
}
/**
* Sets time to arbitrary zoned time.
* @param time arbitrary time with timezone.
*/
public void setTime(ZonedDateTime time) {
this.time = time;
this.timeString.set(DateTimeFormatter.ofPattern("dd-MM HH:mm:ss z").format(time));
this.lastTime = System.currentTimeMillis();
}
/**
* Updates time by duration elapsed since last update.
*/
public void updateTime() {
LocalDateTime localDateTime = LocalDateTime.now(zoneId);
ZonedDateTime zonedDateTime = localDateTime.atZone(zoneId);
time.setValue(dateTimeFormatter.format(zonedDateTime));
this.time.plus(Duration.of(System.currentTimeMillis() - this.lastTime, ChronoUnit.MILLIS));
this.lastTime = System.currentTimeMillis();
}
public String getTime() {
return time.get();
public String getTimeZone() {
return zoneId.toString();
}
public StringProperty timeProperty() {
return time;
public String getTimeString() {
return timeString.get();
}
public String getTimeZone() {
return timeZone;
public StringProperty timeStringProperty() {
return timeString;
}
}

@ -3,6 +3,7 @@ package seng302;
import seng302.Model.BoatInRace;
import seng302.Model.Leg;
import java.time.ZonedDateTime;
import java.util.List;
/**
@ -13,7 +14,7 @@ public interface RaceDataSource {
List<Leg> getLegs();
List<GPSCoordinate> getBoundary();
GPSCoordinate getMark();
ZonedDateTime getZonedDateTime();
GPSCoordinate getMapTopLeft();
GPSCoordinate getMapBottomRight();
}

@ -4,12 +4,11 @@ import javafx.scene.paint.Color;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import seng302.Model.BoatInRace;
import seng302.Model.Leg;
import seng302.Model.Marker;
import seng302.Model.*;
import javax.xml.parsers.ParserConfigurationException;
import java.io.IOException;
import java.time.ZonedDateTime;
import java.util.ArrayList;
import java.util.List;
@ -272,8 +271,8 @@ public class RaceXMLReader extends XMLReader implements RaceDataSource {
return legs;
}
public GPSCoordinate getMark() {
return mark;
public ZonedDateTime getZonedDateTime() {
return RaceClock.getCurrentZonedDateTime(mark);
}
public GPSCoordinate getStartPt1() {

@ -2,6 +2,7 @@ package seng302;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.xml.sax.SAXException;
import javax.xml.parsers.DocumentBuilder;
@ -33,6 +34,10 @@ public abstract class XMLReader {
return n.getElementsByTagName(tagName).item(0).getTextContent();
}
public boolean exists(Node node, String attribute) {
return node.getAttributes().getNamedItem(attribute) != null;
}
public String getAttribute(Element n, String attr) {
return n.getAttribute(attr);
}

@ -0,0 +1,49 @@
package seng302.Mock;
import org.junit.Before;
import org.junit.Test;
import org.xml.sax.SAXException;
import javax.xml.parsers.ParserConfigurationException;
import java.io.IOException;
import java.text.ParseException;
import java.util.HashMap;
import java.util.Map;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
/**
* Created by jjg64 on 21/04/17.
*/
public class BoatsXMLTest {
BoatXMLReader boatXMLReader;
@Before
public void setup() {
try {
boatXMLReader = new BoatXMLReader("mockXML/boatXML/boatTest.xml", false);
} catch (Exception e) {
e.printStackTrace();
//fail("Cannot find mockXML/raceXML/raceTest.xml in the resources folder");
}
}
@Test
public void testInvalidParticipant() {
Map<Integer, StreamedBoat> inputParticipants = new HashMap<>();
inputParticipants.put(420, new StreamedBoat(420));
boatXMLReader.setParticipants(inputParticipants);
boatXMLReader.read();
assertEquals(boatXMLReader.getStreamedBoatMap().size(), 0);
}
@Test
public void testValidParticipant() {
Map<Integer, StreamedBoat> inputParticipants = new HashMap<>();
inputParticipants.put(101, new StreamedBoat(101));
boatXMLReader.setParticipants(inputParticipants);
boatXMLReader.read();
assertTrue(boatXMLReader.getStreamedBoatMap().containsKey(101));
}
}

@ -16,7 +16,7 @@ public class RegattaXMLTest {
@Before
public void findFile(){
try {
regattaXMLReader = new RegattaXMLReader("mockXML/regattaXML/regattaTest.xml", false);
regattaXMLReader = new RegattaXMLReader("mockXML/regattaXML/regattaTest.xml");
} catch (Exception e) {
fail("Cannot find mockXML/regattaXML/regattaTest.xml in the resources folder");
}
@ -24,18 +24,11 @@ public class RegattaXMLTest {
@Test
public void makeRegattaTest() {
try {
regattaXMLReader = new RegattaXMLReader("mockXML/regattaXML/regattaTest.xml");
assertNotEquals(regattaXMLReader.getRegatta(), null);
} catch (Exception e) {
fail("Did not make a Regatta object");
}
}
@Test
public void correctValuesTest() {
try {
regattaXMLReader = new RegattaXMLReader("mockXML/regattaXML/regattaTest.xml");
Regatta regatta = regattaXMLReader.getRegatta();
assertEquals(regatta.getRegattaID(), 3);
assertEquals(regatta.getRegattaName(), "New Zealand Test");
@ -45,8 +38,5 @@ public class RegattaXMLTest {
assertEquals(regatta.getCentralAltitude(), 0.00, 0.00000001);
assertEquals(regatta.getUtcOffset(), 12.0, 0.001);
assertEquals(regatta.getMagneticVariation(), 14.1, 0.001);
} catch (Exception e) {
fail("Did not have the correct values");
}
}
}

@ -0,0 +1,67 @@
package seng302.Mock;
import org.junit.Before;
import org.junit.Test;
import seng302.GPSCoordinate;
import java.util.List;
import java.util.Map;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
/**
* Tests only work on the current version of mockXML/raceXML/raceTest.xml
*/
public class StreamedRaceTest {
StreamedCourseXMLReader streamedCourseXMLReader;
List<GPSCoordinate> boundary;
@Before
public void setup() {
try {
streamedCourseXMLReader = new StreamedCourseXMLReader("mockXML/raceXML/raceTest.xml", true);
boundary = streamedCourseXMLReader.getBoundary();
} catch (Exception e) {
e.printStackTrace();
//fail("Cannot find mockXML/raceXML/raceTest.xml in the resources folder");
}
}
@Test
public void testAllBoundaryPointsRead() {
assertEquals(boundary.size(), 10);
}
@Test
public void testBoundaryPointData() {
// First point
assertEquals(boundary.get(0).getLatitude(), -36.8325, 1e-6);
assertEquals(boundary.get(0).getLongitude(), 174.8325, 1e-6);
// Last point
assertEquals(boundary.get(boundary.size() - 1).getLatitude(), -36.83417, 1e-6);
assertEquals(boundary.get(boundary.size() - 1).getLongitude(), 174.84767, 1e-6);
}
@Test
public void testMapEdges() {
double maxLatitude = streamedCourseXMLReader.getMapBottomRight().getLatitude() - streamedCourseXMLReader.getPadding();
double maxLongitude = streamedCourseXMLReader.getMapBottomRight().getLongitude() - streamedCourseXMLReader.getPadding();
double minLatitude = streamedCourseXMLReader.getMapTopLeft().getLatitude() - streamedCourseXMLReader.getPadding();
double minLongitude = streamedCourseXMLReader.getMapTopLeft().getLongitude() - streamedCourseXMLReader.getPadding();
assertEquals(maxLatitude, -36.81033, 1e-6);
assertEquals(maxLongitude, 174.88217, 1e-6);
assertEquals(minLatitude, -36.83417, 1e-6);
assertEquals(minLongitude, 174.81983, 1e-6);
}
@Test
public void testParticipants() {
Map<Integer, StreamedBoat> participants = streamedCourseXMLReader.getParticipants();
assertTrue(participants.containsKey(107));
assertTrue(participants.containsKey(108));
}
}

@ -1,173 +1,18 @@
package seng302.Model;
import javafx.scene.paint.Color;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import seng302.GPSCoordinate;
import java.util.ArrayList;
import java.util.Arrays;
import org.mockito.Mock;
import seng302.RaceDataSource;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.*;
/**
* Created by esa46 on 15/03/17.
*/
public class RaceTest {
Leg START_LEG = new Leg("Start", new Marker(new GPSCoordinate(0, 0)), new Marker(new GPSCoordinate(1, 1)), 0);
Leg FINISH_LEG = new Leg("Finish", new Marker(new GPSCoordinate(1, 1)), new Marker(new GPSCoordinate(2, 2)), 0);
@Ignore
@Test
public void timerCanBeDisabled() {
BoatInRace boat1 = new BoatInRace("Test 1", 10000, Color.ALICEBLUE, "t1");
BoatInRace boat2 = new BoatInRace("Test 2", 10000, Color.BURLYWOOD, "t2");
BoatInRace[] boats = new BoatInRace[]{boat1, boat2};
ArrayList<Leg> legs = new ArrayList<>();
legs.add(START_LEG); legs.add(FINISH_LEG);
ConstantVelocityRace race = new ConstantVelocityRace(boats, legs, null, 5);
race.disableTimer();
race.setDnfChance(0);
long timeStarted = System.currentTimeMillis();
race.run();
assertTrue(System.currentTimeMillis() - timeStarted < 4000);
}
@Test
public void checkPositionUpdatesNumberFinishedBoats() {
BoatInRace finishedBoat = new BoatInRace("Test", 1000, Color.ALICEBLUE, "tt");
finishedBoat.setDistanceTravelledInLeg(500);
finishedBoat.setCurrentLeg(FINISH_LEG);
ArrayList<Leg> legs = new ArrayList<>();
legs.add(FINISH_LEG);
ConstantVelocityRace race = new ConstantVelocityRace(new BoatInRace[1], legs, null, 1);
race.setDnfChance(0);
assertEquals(race.boatsFinished, 0);
race.checkPosition(finishedBoat, 100000);
assertEquals(race.boatsFinished, 1);
assertEquals(finishedBoat.getTimeFinished(), 100000);
}
@Test
public void checkPositionDoesntUpdateNumberFinishedBoats() {
BoatInRace unFinishedBoat = new BoatInRace("Test", 10, Color.ALICEBLUE, "tt");
unFinishedBoat.setDistanceTravelledInLeg(0);
unFinishedBoat.setCurrentLeg(FINISH_LEG);
ArrayList<Leg> legs = new ArrayList<>();
legs.add(FINISH_LEG);
ConstantVelocityRace race = new ConstantVelocityRace(new BoatInRace[1], legs, null, 1);
race.setDnfChance(0);
assertEquals(race.boatsFinished, 0);
race.checkPosition(unFinishedBoat, 100);
assertEquals(race.boatsFinished, 0);
}
@Test
public void distanceTravelledBeforeUpdatingLegIsRetained() {
ArrayList<Leg> legs = new ArrayList<>();
legs.add(START_LEG);
legs.add(FINISH_LEG);
ConstantVelocityRace race = new ConstantVelocityRace(new BoatInRace[1], legs, null, 1);
race.setDnfChance(0);
BoatInRace unFinishedBoat = new BoatInRace("Test", 10, Color.ALICEBLUE, "tt");
unFinishedBoat.setDistanceTravelledInLeg(100);
unFinishedBoat.setCurrentLeg(START_LEG);
race.checkPosition(unFinishedBoat, 100);
assertEquals(unFinishedBoat.getCurrentLeg().getName(), "Finish");
assertTrue(unFinishedBoat.getDistanceTravelledInLeg() > 0);
assertTrue(unFinishedBoat.getDistanceTravelledInLeg() < 100);
}
/*@Test
//Test temporarily removed as countdown timer now uses animation timer
public void timerDelaysByHalfSecond() {
ArrayList<Leg> legs = new ArrayList<>();
legs.add(START_LEG);
ConstantVelocityRace race = new ConstantVelocityRace(new BoatInRace[1], legs, null, 1);
race.PRERACE_TIME = 500;
long timeStarted = System.currentTimeMillis();
race.countdownTimer();
//assertTrue(System.currentTimeMillis() - timeStarted > 500);
System.out.println(System.currentTimeMillis() - timeStarted);
}*/
@Test
public void scalerScalesVelocityCorrectly() {
int scaleFactor = 3;
float vel1 = 0;
float vel2 = (float) 1.999;
float vel3 = (float) 32.5;
float vel4 = 500;
BoatInRace boat1 = new BoatInRace("test", vel1, Color.ALICEBLUE, "tt");
BoatInRace boat2 = new BoatInRace("test", vel2, Color.ALICEBLUE, "tt");
BoatInRace boat3 = new BoatInRace("test", vel3, Color.ALICEBLUE, "tt");
BoatInRace boat4 = new BoatInRace("test", vel4, Color.ALICEBLUE, "tt");
BoatInRace[] boats = new BoatInRace[]{boat1, boat2, boat3, boat4};
ArrayList<Leg> legs = new ArrayList<>();
legs.add(START_LEG);
ConstantVelocityRace race = new ConstantVelocityRace(boats, legs, null, scaleFactor);
race.setDnfChance(0);
assertEquals(race.getStartingBoats().get(0).getScaledVelocity(), vel1 * scaleFactor, 1e-6);
assertEquals(race.getStartingBoats().get(1).getScaledVelocity(), vel2 * scaleFactor, 1e-6);
assertEquals(race.getStartingBoats().get(2).getScaledVelocity(), vel3 * scaleFactor, 1e-6);
assertEquals(race.getStartingBoats().get(3).getScaledVelocity(), vel4 * scaleFactor, 1e-6);
}
@Test
public void scalerScalesRaceClockTo1MinCorrectly() {
int scaleFactor = 10;
ArrayList<Leg> legs = new ArrayList<>();
legs.add(START_LEG);
ConstantVelocityRace race = new ConstantVelocityRace(new BoatInRace[5], legs, null, scaleFactor);
race.totalTimeElapsed = 6000; //6 seconds
assertTrue(race.calcTimer().equals("Race clock: 00:01:00"));
}
@Test
public void scalerScalesRaceClockHoursMinutesAndSecondsCorrectly() {
int scaleFactor = 3;
ArrayList<Leg> legs = new ArrayList<>();
legs.add(START_LEG);
ConstantVelocityRace race = new ConstantVelocityRace(new BoatInRace[5], legs, null, scaleFactor);
race.totalTimeElapsed = 3213000;
assertTrue(race.calcTimer().equals("Race clock: 02:40:39"));
}
}

@ -86,7 +86,6 @@ public class RaceXMLTest {
assertTrue(raceXMLReader.getLeewardPt2() != null);
assertTrue(raceXMLReader.getWindwardPt1() != null);
assertTrue(raceXMLReader.getWindwardPt2() != null);
assertTrue(raceXMLReader.getMark() != null);
assertTrue(raceXMLReader.getBoundary().size() == 11);
} catch (Exception e) {
e.printStackTrace();

@ -0,0 +1,251 @@
<?xml version="1.0" encoding="utf-8"?>
<BoatConfig>
<Modified>2012-05-17T07:49:40+0200</Modified>
<Version>12</Version>
<Settings>
<RaceBoatType Type="AC45" />
<BoatDimension BoatLength="14.019" HullLength="13.449" />
<ZoneSize MarkZoneSize="40.347" CourseZoneSize="40.347" />
<ZoneLimits Limit1="200" Limit2="100" Limit3="40.347" Limit4="0" Limit5="-100" />
</Settings>
<BoatShapes>
<BoatShape ShapeID="0">
<Vertices>
<Vtx Seq="1" Y="0" X="-2.659" />
<Vtx Seq="2" Y="18.359" X="-2.659" />
<Vtx Seq="3" Y="18.359" X="2.659" />
<Vtx Seq="4" Y="0" X="2.659" />
</Vertices>
</BoatShape>
<BoatShape ShapeID="1">
<Vertices>
<Vtx Seq="1" Y="0" X="-1.278" />
<Vtx Seq="2" Y="8.876" X="-1.278" />
<Vtx Seq="3" Y="8.876" X="1.278" />
<Vtx Seq="4" Y="0" X="1.278" />
</Vertices>
</BoatShape>
<BoatShape ShapeID="2">
<Vertices>
<Vtx Seq="1" Y="0" X="-1.1" />
<Vtx Seq="2" Y="8.3" X="-1.1" />
<Vtx Seq="3" Y="8.3" X="1.1" />
<Vtx Seq="4" Y="0" X="1.1" />
</Vertices>
</BoatShape>
<BoatShape ShapeID="3">
<Vertices>
<Vtx Seq="1" Y="0" X="-0.75" />
<Vtx Seq="2" Y="3" X="-0.75" />
<Vtx Seq="3" Y="3" X="0.75" />
<Vtx Seq="4" Y="0" X="0.75" />
</Vertices>
</BoatShape>
<BoatShape ShapeID="4">
<Vertices>
<Vtx Seq="1" Y="0" X="-3.46" />
<Vtx Seq="2" Y="13.449" X="-3.46" />
<Vtx Seq="3" Y="14.019" X="0" />
<Vtx Seq="4" Y="13.449" X="3.46" />
<Vtx Seq="5" Y="0" X="3.46" />
</Vertices>
<Catamaran>
<Vtx Seq="1" Y="1.769" X="-2.752" />
<Vtx Seq="2" Y="0" X="-2.813" />
<Vtx Seq="3" Y="0" X="-3.34" />
<Vtx Seq="4" Y="5.351" X="-3.46" />
<Vtx Seq="5" Y="10.544" X="-3.387" />
<Vtx Seq="6" Y="13.449" X="-3.075" />
<Vtx Seq="7" Y="10.851" X="-2.793" />
<Vtx Seq="8" Y="6.669" X="-2.699" />
<Vtx Seq="9" Y="6.669" X="2.699" />
<Vtx Seq="10" Y="10.851" X="2.793" />
<Vtx Seq="11" Y="13.449" X="3.075" />
<Vtx Seq="12" Y="10.544" X="3.387" />
<Vtx Seq="13" Y="5.351" X="3.46" />
<Vtx Seq="14" Y="0" X="3.34" />
<Vtx Seq="15" Y="0" X="2.813" />
<Vtx Seq="16" Y="1.769" X="2.752" />
</Catamaran>
<Bowsprit>
<Vtx Seq="1" Y="6.669" X="-0.2" />
<Vtx Seq="2" Y="11.377" X="-0.2" />
<Vtx Seq="3" Y="14.019" X="0" />
<Vtx Seq="4" Y="11.377" X="0.2" />
<Vtx Seq="5" Y="6.669" X="0.2" />
</Bowsprit>
<Trampoline>
<Vtx Seq="1" Y="2" X="-2.699" />
<Vtx Seq="2" Y="6.438" X="-2.699" />
<Vtx Seq="3" Y="6.438" X="2.699" />
<Vtx Seq="4" Y="2" X="2.699" />
</Trampoline>
</BoatShape>
<BoatShape ShapeID="5" />
</BoatShapes>
<Boats>
<Boat Type="RC" SourceID="121" ShapeID="0" HullNum="RG01" StoweName="PRO" ShortName="PRO"
BoatName="Regardless">
<GPSposition Z="6.840" Y="7.800" X="0.000" />
<FlagPosition Z="0.000" Y="7.800" X="0.000" />
</Boat>
<Boat Type="Mark" SourceID="122" ShapeID="1" HullNum="LC05" StoweName="CON" ShortName="Constellation"
BoatName="Constellation">
<GPSposition Z="5.334" Y="3.804" X="0.000" />
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
</Boat>
<Boat Type="Mark" SourceID="123" ShapeID="1" HullNum="LC04" StoweName="MIS" ShortName="Mischief"
BoatName="Mischief">
<GPSposition Z="5.334" Y="3.804" X="0.000" />
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
</Boat>
<Boat Type="Mark" SourceID="124" ShapeID="1" HullNum="LC03" ShortName="Atalanta" BoatName="Atalanta">
<GPSposition Z="5.334" Y="3.804" X="0.000" />
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
</Boat>
<Boat SourceID="125" ShapeID="1" StoweName="VOL" HullNum="LC01" ShortName="Volunteer"
BoatName="Volunteer">
<GPSposition Z="5.334" Y="3.804" X="0.000" />
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
</Boat>
<Boat Type="Mark" SourceID="126" ShapeID="1" HullNum="LC13" StoweName="MS2" ShortName="Defender"
BoatName="Defender">
<GPSposition Z="5.334" Y="3.804" X="0.000" />
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
</Boat>
<Boat Type="Mark" SourceID="128" ShapeID="1" HullNum="LC01" ShortName="Shamrock" BoatName="Shamrock">
<GPSposition Z="5.334" Y="3.804" X="0.000" />
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
</Boat>
<Boat Type="Yacht" SourceID="101" ShapeID="4" HullNum="AC4501" StoweName="KOR" ShortName="TEAM KOREA"
BoatName="TEAM KOREA" Country="KOR">
<GPSposition Z="1.738" Y="0.625" X="0.001" />
<MastTop Z="21.496" Y="4.233" X="0.000" />
</Boat>
</Boats>
</BoatConfig>

@ -0,0 +1,91 @@
<?xml version="1.0" encoding="utf-8"?>
<Race>
<RaceID>11080703</RaceID>
<RaceType>Match</RaceType>
<CreationTimeDate>2011-08-06T13:25:00-0000</CreationTimeDate >
<RaceStartTime Time="2011-08-06T13:30:00-0700" Postpone="false" />
<Participants>
<Yacht SourceID="107" Entry="Port" />
<Yacht SourceID="108" Entry="Stbd" />
</Participants>
<Course>
<CompoundMark CompoundMarkID="1" Name="StartLine">
<Mark SeqID="1" Name="PRO" TargetLat="-36.83" TargetLng="174.83" SourceID="101" />
<Mark SeqID="2" Name="PIN" TargetLat="-36.84" TargetLng="174.81" SourceID="102" />
</CompoundMark>
<CompoundMark CompoundMarkID="2" Name="M1">
<Mark Name="M1" TargetLat="-36.63566590" TargetLng="174.88543944" SourceID="103" />
</CompoundMark>
<CompoundMark CompoundMarkID="3" Name="M2">
<Mark Name="M2" TargetLat="-36.83" TargetLng="174.80" SourceID="102" />
</CompoundMark>
<CompoundMark CompoundMarkID="4" Name="Gate">
<Mark SeqID="1" Name="G1" TargetLat="-36.63566590" TargetLng="174.97205159" SourceID="104" />
<Mark SeqID="2" Name="G2" TargetLat="-36.64566590" TargetLng="174.98205159" SourceID="105" />
</CompoundMark>
</Course>
<CompoundMarkSequence>
<Corner SeqID="1" CompoundMarkID="1" Rounding="SP" ZoneSize="3" />
<Corner SeqID="2" CompoundMarkID="2" Rounding="Port" ZoneSize="3" />
<Corner SeqID="3" CompoundMarkID="3" Rounding="Stbd" ZoneSize="6" />
<Corner SeqID="4" CompoundMarkID="4" Rounding="PS" ZoneSize="6" />
<Corner SeqID="5" CompoundMarkID="1" Rounding="SP" ZoneSize="3"/>
</CompoundMarkSequence>
<CourseLimit>
<Limit SeqID="1" Lat="-36.8325" Lon="174.8325"/>
<Limit SeqID="2" Lat="-36.82883" Lon="174.81983"/>
<Limit SeqID="3" Lat="-36.82067" Lon="174.81983"/>
<Limit SeqID="4" Lat="-36.811" Lon="174.8265"/>
<Limit SeqID="5" Lat="-36.81033" Lon="174.83833"/>
<Limit SeqID="6" Lat="-36.81533" Lon="174.8525"/>
<Limit SeqID="7" Lat="-36.81533" Lon="174.86733"/>
<Limit SeqID="8" Lat="-36.81633" Lon="174.88217"/>
<Limit SeqID="9" Lat="-36.83383" Lon="174.87117"/>
<Limit SeqID="10" Lat="-36.83417" Lon="174.84767"/>
</CourseLimit>
</Race>
Loading…
Cancel
Save