Merge branch 'sprint4_master' into story36_boundary_fix_attempt_2
This commit is contained in:
@@ -49,6 +49,16 @@ public class App extends Application {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reads the Initial Race XML files that are necessary to run the mock.
|
||||||
|
* @param path path of the XML
|
||||||
|
* @param encoding encoding of the xml
|
||||||
|
* @return
|
||||||
|
* @throws IOException No file etc
|
||||||
|
* @throws ParserConfigurationException Issue with the XML formatting
|
||||||
|
* @throws SAXException Issue with XML formatting
|
||||||
|
* @throws TransformerException Issue with the XML format
|
||||||
|
*/
|
||||||
private String readFile(String path, Charset encoding) throws IOException, ParserConfigurationException, SAXException, TransformerException {
|
private String readFile(String path, Charset encoding) throws IOException, ParserConfigurationException, SAXException, TransformerException {
|
||||||
|
|
||||||
InputSource fXmlFile = new InputSource(getClass().getClassLoader().getResourceAsStream(path));
|
InputSource fXmlFile = new InputSource(getClass().getClassLoader().getResourceAsStream(path));
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import seng302.Model.Mark;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by cbt24 on 10/05/17.
|
* Boats Data
|
||||||
*/
|
*/
|
||||||
public interface BoatDataSource {
|
public interface BoatDataSource {
|
||||||
Map<Integer, Boat> getBoats();
|
Map<Integer, Boat> getBoats();
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import java.util.HashMap;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by cbt24 on 10/05/17.
|
* Xml Reader class for Boat XML used for the race
|
||||||
*/
|
*/
|
||||||
public class BoatXMLReader extends XMLReader implements BoatDataSource {
|
public class BoatXMLReader extends XMLReader implements BoatDataSource {
|
||||||
|
|
||||||
@@ -42,12 +42,18 @@ public class BoatXMLReader extends XMLReader implements BoatDataSource {
|
|||||||
read();
|
read();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read the XML
|
||||||
|
*/
|
||||||
public void read() {
|
public void read() {
|
||||||
readSettings();
|
readSettings();
|
||||||
readShapes();
|
readShapes();
|
||||||
readBoats();
|
readBoats();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read the Boats
|
||||||
|
*/
|
||||||
private void readBoats() {
|
private void readBoats() {
|
||||||
Element nBoats = (Element) doc.getElementsByTagName("Boats").item(0);
|
Element nBoats = (Element) doc.getElementsByTagName("Boats").item(0);
|
||||||
for (int i = 0; i < nBoats.getChildNodes().getLength(); i++) {
|
for (int i = 0; i < nBoats.getChildNodes().getLength(); i++) {
|
||||||
@@ -72,6 +78,11 @@ public class BoatXMLReader extends XMLReader implements BoatDataSource {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the node (XMl data node) is a Yacht or not
|
||||||
|
* @param boatNode Node from the XML
|
||||||
|
* @return Whether the node is a yacht node or not
|
||||||
|
*/
|
||||||
private boolean isYachtNode(Node boatNode) {
|
private boolean isYachtNode(Node boatNode) {
|
||||||
return boatNode.getAttributes().getNamedItem("Type").getTextContent().toLowerCase().equals("yacht");
|
return boatNode.getAttributes().getNamedItem("Type").getTextContent().toLowerCase().equals("yacht");
|
||||||
}
|
}
|
||||||
@@ -88,6 +99,12 @@ public class BoatXMLReader extends XMLReader implements BoatDataSource {
|
|||||||
else readMark(boatNode, sourceID, name);
|
else readMark(boatNode, sourceID, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read a Yacht Node
|
||||||
|
* @param boatNode Node to be read
|
||||||
|
* @param sourceID Source ID of the Yacht
|
||||||
|
* @param name Name of the Boat
|
||||||
|
*/
|
||||||
private void readYacht(Node boatNode, int sourceID, String name) {
|
private void readYacht(Node boatNode, int sourceID, String name) {
|
||||||
String shortName = boatNode.getAttributes().getNamedItem("ShortName").getTextContent();
|
String shortName = boatNode.getAttributes().getNamedItem("ShortName").getTextContent();
|
||||||
if (exists(boatNode, "Country")) {
|
if (exists(boatNode, "Country")) {
|
||||||
@@ -98,6 +115,12 @@ public class BoatXMLReader extends XMLReader implements BoatDataSource {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read Marker Boats
|
||||||
|
* @param boatNode Node to be read
|
||||||
|
* @param sourceID Source ID of the boat
|
||||||
|
* @param name Name of the Marker Boat
|
||||||
|
*/
|
||||||
private void readMark(Node boatNode, int sourceID, String name) {
|
private void readMark(Node boatNode, int sourceID, String name) {
|
||||||
Node nCoord = ((Element)boatNode).getElementsByTagName("GPSposition").item(0);
|
Node nCoord = ((Element)boatNode).getElementsByTagName("GPSposition").item(0);
|
||||||
double x = Double.parseDouble(nCoord.getAttributes().getNamedItem("X").getTextContent());
|
double x = Double.parseDouble(nCoord.getAttributes().getNamedItem("X").getTextContent());
|
||||||
@@ -106,11 +129,19 @@ public class BoatXMLReader extends XMLReader implements BoatDataSource {
|
|||||||
markerMap.put(sourceID, mark);
|
markerMap.put(sourceID, mark);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the boats that are going to participate in this race
|
||||||
|
* @return Dictionary of boats that are to participate in this race indexed by SourceID
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Map<Integer, Boat> getBoats() {
|
public Map<Integer, Boat> getBoats() {
|
||||||
return boatMap;
|
return boatMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the marker BOats that are participating in this race
|
||||||
|
* @return Dictionary of the Markers BOats that are in this race indexed by their Source ID.
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Map<Integer, Mark> getMarkerBoats() {
|
public Map<Integer, Mark> getMarkerBoats() {
|
||||||
return markerMap;
|
return markerMap;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import java.time.ZonedDateTime;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by connortaylorbrown on 19/04/17.
|
* Data Class for a Race
|
||||||
*/
|
*/
|
||||||
public interface RaceDataSource {
|
public interface RaceDataSource {
|
||||||
List<Boat> getBoats();
|
List<Boat> getBoats();
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import java.time.format.DateTimeFormatter;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by jjg64 on 21/04/17.
|
* XML Reader that reads in the race data required for this race
|
||||||
*/
|
*/
|
||||||
public class RaceXMLReader extends XMLReader implements RaceDataSource {
|
public class RaceXMLReader extends XMLReader implements RaceDataSource {
|
||||||
private static final double COORDINATEPADDING = 0.000;
|
private static final double COORDINATEPADDING = 0.000;
|
||||||
@@ -103,6 +103,9 @@ public class RaceXMLReader extends XMLReader implements RaceDataSource {
|
|||||||
postpone = Boolean.parseBoolean(raceTimeTag.getNamedItem("Postpone").getTextContent());
|
postpone = Boolean.parseBoolean(raceTimeTag.getNamedItem("Postpone").getTextContent());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reads in the participants for htis race
|
||||||
|
*/
|
||||||
private void readParticipants() {
|
private void readParticipants() {
|
||||||
Element nParticipants = (Element) doc.getElementsByTagName("Participants").item(0);
|
Element nParticipants = (Element) doc.getElementsByTagName("Participants").item(0);
|
||||||
nParticipants.getChildNodes().getLength();
|
nParticipants.getChildNodes().getLength();
|
||||||
@@ -166,6 +169,11 @@ public class RaceXMLReader extends XMLReader implements RaceDataSource {
|
|||||||
return marker;
|
return marker;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a mark from an Element
|
||||||
|
* @param mark Element the mark is suppose to be part of
|
||||||
|
* @return a Mark that existed in the element
|
||||||
|
*/
|
||||||
private Mark getMark(Element mark) {
|
private Mark getMark(Element mark) {
|
||||||
int sourceID = Integer.parseInt(mark.getAttribute("SourceID"));
|
int sourceID = Integer.parseInt(mark.getAttribute("SourceID"));
|
||||||
return marks.get(sourceID);
|
return marks.get(sourceID);
|
||||||
@@ -209,6 +217,9 @@ public class RaceXMLReader extends XMLReader implements RaceDataSource {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reads the boundary limits of the course
|
||||||
|
*/
|
||||||
private void readCourseLimit() {
|
private void readCourseLimit() {
|
||||||
Element nCourseLimit = (Element) doc.getElementsByTagName("CourseLimit").item(0);
|
Element nCourseLimit = (Element) doc.getElementsByTagName("CourseLimit").item(0);
|
||||||
for(int i = 0; i < nCourseLimit.getChildNodes().getLength(); i++) {
|
for(int i = 0; i < nCourseLimit.getChildNodes().getLength(); i++) {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import java.io.StringReader;
|
|||||||
import java.io.StringWriter;
|
import java.io.StringWriter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by fwy13 on 26/03/2017.
|
* Base Reader for XML Files
|
||||||
*/
|
*/
|
||||||
public abstract class XMLReader {
|
public abstract class XMLReader {
|
||||||
|
|
||||||
@@ -48,6 +48,11 @@ public abstract class XMLReader {
|
|||||||
doc.getDocumentElement().normalize();
|
doc.getDocumentElement().normalize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Alternate constructor
|
||||||
|
* @param xmlFile
|
||||||
|
* @param isWholeFile
|
||||||
|
*/
|
||||||
public XMLReader(String xmlFile, Boolean isWholeFile) {
|
public XMLReader(String xmlFile, Boolean isWholeFile) {
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -84,6 +89,12 @@ public abstract class XMLReader {
|
|||||||
return node.getAttributes().getNamedItem(attribute) != null;
|
return node.getAttributes().getNamedItem(attribute) != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the contents of the XML FILe.
|
||||||
|
* @param document
|
||||||
|
* @return
|
||||||
|
* @throws TransformerException
|
||||||
|
*/
|
||||||
public static String getContents(Document document) throws TransformerException {
|
public static String getContents(Document document) throws TransformerException {
|
||||||
DOMSource source = new DOMSource(document);
|
DOMSource source = new DOMSource(document);
|
||||||
|
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ public class MockOutput implements Runnable
|
|||||||
private String regattaXml;
|
private String regattaXml;
|
||||||
private String boatsXml;
|
private String boatsXml;
|
||||||
|
|
||||||
|
private boolean stop = false; //whether or not hte thread keeps running
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ctor.
|
* Ctor.
|
||||||
@@ -158,18 +159,25 @@ public class MockOutput implements Runnable
|
|||||||
this.messagesToSendQueue.add(messagesToSendBuffer);
|
this.messagesToSendQueue.add(messagesToSendBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sending loop of the Server
|
||||||
|
*/
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
while (true){
|
while (!stop){
|
||||||
System.out.println("Waiting for a connection...");//TEMP DEBUG REMOVE
|
System.out.println("Waiting for a connection...");//TEMP DEBUG REMOVE
|
||||||
mockSocket = serverSocket.accept();
|
mockSocket = serverSocket.accept();
|
||||||
|
|
||||||
outToVisualiser = new DataOutputStream(mockSocket.getOutputStream());
|
outToVisualiser = new DataOutputStream(mockSocket.getOutputStream());
|
||||||
|
|
||||||
|
if (boatsXml == null || regattaXml == null || raceXml == null){
|
||||||
while(boatsXml == null || regattaXml == null || raceXml == null) {
|
try {
|
||||||
|
Thread.sleep(500);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
parseXMLString(raceXml, XMLMessage.XMLTypeRace);
|
parseXMLString(raceXml, XMLMessage.XMLTypeRace);
|
||||||
@@ -205,18 +213,30 @@ public class MockOutput implements Runnable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void stop(){
|
||||||
|
stop = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the Race XML to send
|
||||||
|
* @param raceXml XML to send to the CLient
|
||||||
|
*/
|
||||||
public void setRaceXml(String raceXml) {
|
public void setRaceXml(String raceXml) {
|
||||||
this.raceXml = raceXml;
|
this.raceXml = raceXml;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the Regatta XMl to send
|
||||||
|
* @param regattaXml XML to send to CLient
|
||||||
|
*/
|
||||||
public void setRegattaXml(String regattaXml) {
|
public void setRegattaXml(String regattaXml) {
|
||||||
this.regattaXml = regattaXml;
|
this.regattaXml = regattaXml;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the Boats XML to send
|
||||||
|
* @param boatsXml XMl to send to the CLient
|
||||||
|
*/
|
||||||
public void setBoatsXml(String boatsXml) {
|
public void setBoatsXml(String boatsXml) {
|
||||||
this.boatsXml = boatsXml;
|
this.boatsXml = boatsXml;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import seng302.Networking.Messages.Enums.BoatStatusEnum;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class represents a boat during a race.
|
* Boat Model that is used to store information on the boats that are running in the race.
|
||||||
*/
|
*/
|
||||||
public class Boat {
|
public class Boat {
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import java.time.format.DateTimeFormatter;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by esa46 on 21/04/17.
|
* A Race Event, this holds all of the race's information as well as handling the connection to its clients.
|
||||||
*/
|
*/
|
||||||
public class Event {
|
public class Event {
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package seng302.Model;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a leg of a race.
|
* Leg of the race, this is what each part of the race is divided into, from mark to mark.
|
||||||
*/
|
*/
|
||||||
public class Leg {
|
public class Leg {
|
||||||
|
|
||||||
|
|||||||
@@ -379,7 +379,7 @@ public class Race implements Runnable {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
//Otherwise, the race is over!
|
//Otherwise, the race is over!
|
||||||
|
raceFinished.start();
|
||||||
setRaceStatusEnum(RaceStatusEnum.FINISHED);
|
setRaceStatusEnum(RaceStatusEnum.FINISHED);
|
||||||
this.stop();
|
this.stop();
|
||||||
}
|
}
|
||||||
@@ -402,6 +402,22 @@ public class Race implements Runnable {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Broadcast that the race has finished.
|
||||||
|
*/
|
||||||
|
protected AnimationTimer raceFinished = new AnimationTimer(){
|
||||||
|
int iters = 0;
|
||||||
|
@Override
|
||||||
|
public void handle(long now) {
|
||||||
|
RaceStatus raceStatus = new RaceStatus(System.currentTimeMillis(), raceId, 4, startTime, 0, 2300, 2, null);
|
||||||
|
mockOutput.parseRaceStatus(raceStatus);
|
||||||
|
if (iters > 500){
|
||||||
|
mockOutput.stop();
|
||||||
|
stop();
|
||||||
|
}
|
||||||
|
iters++;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialise the boats in the race.
|
* Initialise the boats in the race.
|
||||||
@@ -621,7 +637,6 @@ public class Race implements Runnable {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculates the upper and lower bounds that the boat may have in order to not go outside of the course.
|
* Calculates the upper and lower bounds that the boat may have in order to not go outside of the course.
|
||||||
* @param boat The boat to check.
|
* @param boat The boat to check.
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import static junit.framework.TestCase.assertEquals;
|
|||||||
*/
|
*/
|
||||||
public class LegTest {
|
public class LegTest {
|
||||||
|
|
||||||
private CompoundMark ORIGIN_Compound_MARKER = new CompoundMark(new Mark(1, "test mark1", new GPSCoordinate(0, 0)));
|
private CompoundMark ORIGIN_COMPOUND_MARKER = new CompoundMark(new Mark(1, "test mark1", new GPSCoordinate(0, 0)));
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void calculateDistanceHandles5nmNorth() {
|
public void calculateDistanceHandles5nmNorth() {
|
||||||
@@ -23,7 +23,7 @@ public class LegTest {
|
|||||||
calc.setDirection(0, 5 * Constants.NMToMetersConversion);
|
calc.setDirection(0, 5 * Constants.NMToMetersConversion);
|
||||||
|
|
||||||
CompoundMark endMarker = getEndMarker(calc.getDestinationGeographicPoint());
|
CompoundMark endMarker = getEndMarker(calc.getDestinationGeographicPoint());
|
||||||
Leg test = new Leg("Test", ORIGIN_Compound_MARKER, endMarker, 0);
|
Leg test = new Leg("Test", ORIGIN_COMPOUND_MARKER, endMarker, 0);
|
||||||
assertEquals(test.getDistanceNauticalMiles(), 5, 1e-8);
|
assertEquals(test.getDistanceNauticalMiles(), 5, 1e-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ public class LegTest {
|
|||||||
calc.setDirection(90, 12 * Constants.NMToMetersConversion);
|
calc.setDirection(90, 12 * Constants.NMToMetersConversion);
|
||||||
|
|
||||||
CompoundMark endMarker = getEndMarker(calc.getDestinationGeographicPoint());
|
CompoundMark endMarker = getEndMarker(calc.getDestinationGeographicPoint());
|
||||||
Leg test = new Leg("Test", ORIGIN_Compound_MARKER, endMarker, 0);
|
Leg test = new Leg("Test", ORIGIN_COMPOUND_MARKER, endMarker, 0);
|
||||||
assertEquals(test.getDistanceNauticalMiles(), 12, 1e-8);
|
assertEquals(test.getDistanceNauticalMiles(), 12, 1e-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@ public class LegTest {
|
|||||||
calc.setDirection(180, 0.5 * Constants.NMToMetersConversion);
|
calc.setDirection(180, 0.5 * Constants.NMToMetersConversion);
|
||||||
|
|
||||||
CompoundMark endMarker = getEndMarker(calc.getDestinationGeographicPoint());
|
CompoundMark endMarker = getEndMarker(calc.getDestinationGeographicPoint());
|
||||||
Leg test = new Leg("Test", ORIGIN_Compound_MARKER, endMarker, 0);
|
Leg test = new Leg("Test", ORIGIN_COMPOUND_MARKER, endMarker, 0);
|
||||||
assertEquals(test.getDistanceNauticalMiles(), 0.5, 1e-8);
|
assertEquals(test.getDistanceNauticalMiles(), 0.5, 1e-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,14 +56,14 @@ public class LegTest {
|
|||||||
calc.setDirection(-90, 0.1 * Constants.NMToMetersConversion);
|
calc.setDirection(-90, 0.1 * Constants.NMToMetersConversion);
|
||||||
|
|
||||||
CompoundMark endMarker = getEndMarker(calc.getDestinationGeographicPoint());
|
CompoundMark endMarker = getEndMarker(calc.getDestinationGeographicPoint());
|
||||||
Leg test = new Leg("Test", ORIGIN_Compound_MARKER, endMarker, 0);
|
Leg test = new Leg("Test", ORIGIN_COMPOUND_MARKER, endMarker, 0);
|
||||||
assertEquals(test.getDistanceNauticalMiles(), 0.1, 1e-8);
|
assertEquals(test.getDistanceNauticalMiles(), 0.1, 1e-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void calculateDistanceHandlesZeroDifference() {
|
public void calculateDistanceHandlesZeroDifference() {
|
||||||
|
|
||||||
Leg test = new Leg("Test", ORIGIN_Compound_MARKER, ORIGIN_Compound_MARKER, 0);
|
Leg test = new Leg("Test", ORIGIN_COMPOUND_MARKER, ORIGIN_COMPOUND_MARKER, 0);
|
||||||
assertEquals(test.getDistanceNauticalMiles(), 0, 1e-8);
|
assertEquals(test.getDistanceNauticalMiles(), 0, 1e-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,15 @@ public class XMLMessage extends AC35Data {
|
|||||||
public static int XMLTypeRace = 6;
|
public static int XMLTypeRace = 6;
|
||||||
public static int XMLTypeBoat = 7;
|
public static int XMLTypeBoat = 7;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor for an XML Message
|
||||||
|
* @param ackNumber Number for acknowledgement inherited for the AC35Data Packet
|
||||||
|
* @param timeStamp Time received
|
||||||
|
* @param xmlMsgSubType Type of XML message
|
||||||
|
* @param sequenceNumber Order that it has arrived in
|
||||||
|
* @param xmlMsgLength Length of the xml message
|
||||||
|
* @param xmlMessage XML message
|
||||||
|
*/
|
||||||
public XMLMessage(int ackNumber, long timeStamp, int xmlMsgSubType, int sequenceNumber, int xmlMsgLength, InputStream xmlMessage){
|
public XMLMessage(int ackNumber, long timeStamp, int xmlMsgSubType, int sequenceNumber, int xmlMsgLength, InputStream xmlMessage){
|
||||||
super(MessageType.XMLMESSAGE);
|
super(MessageType.XMLMESSAGE);
|
||||||
this.ackNumber = ackNumber;
|
this.ackNumber = ackNumber;
|
||||||
@@ -30,10 +39,18 @@ public class XMLMessage extends AC35Data {
|
|||||||
this.xmlMessage = xmlMessage;
|
this.xmlMessage = xmlMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the XML Message
|
||||||
|
* @return the XML message as an input stream
|
||||||
|
*/
|
||||||
public InputStream getXmlMessage() {
|
public InputStream getXmlMessage() {
|
||||||
return xmlMessage;
|
return xmlMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the type of message
|
||||||
|
* @return Gets the type of message the XML message is
|
||||||
|
*/
|
||||||
public int getXmlMsgSubType() {
|
public int getXmlMsgSubType() {
|
||||||
return xmlMsgSubType;
|
return xmlMsgSubType;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import java.net.URL;
|
|||||||
import java.util.ResourceBundle;
|
import java.util.ResourceBundle;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by cbt24 on 3/05/17.
|
* Controls the connection that the VIsualiser can connect to.
|
||||||
*/
|
*/
|
||||||
public class ConnectionController extends Controller {
|
public class ConnectionController extends Controller {
|
||||||
@FXML
|
@FXML
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import java.util.ResourceBundle;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by zwu18 on 6/05/17.
|
* Finish Screen for when the race finishs.
|
||||||
*/
|
*/
|
||||||
public class FinishController extends Controller {
|
public class FinishController extends Controller {
|
||||||
|
|
||||||
@@ -33,10 +33,10 @@ public class FinishController extends Controller {
|
|||||||
@FXML
|
@FXML
|
||||||
Label raceWinnerLabel;
|
Label raceWinnerLabel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets up the finish table
|
||||||
|
* @param boats Boats to display
|
||||||
|
*/
|
||||||
private void setFinishTable(ObservableList<Boat> boats){
|
private void setFinishTable(ObservableList<Boat> boats){
|
||||||
boatInfoTable.setItems(boats);
|
boatInfoTable.setItems(boats);
|
||||||
boatNameColumn.setCellValueFactory(cellData -> cellData.getValue().getName());
|
boatNameColumn.setCellValueFactory(cellData -> cellData.getValue().getName());
|
||||||
@@ -52,6 +52,10 @@ public class FinishController extends Controller {
|
|||||||
public void initialize(URL location, ResourceBundle resources){
|
public void initialize(URL location, ResourceBundle resources){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display the table
|
||||||
|
* @param boats boats to display on the table.
|
||||||
|
*/
|
||||||
public void enterFinish(ObservableList<Boat> boats){
|
public void enterFinish(ObservableList<Boat> boats){
|
||||||
finishWrapper.setVisible(true);
|
finishWrapper.setVisible(true);
|
||||||
setFinishTable(boats);
|
setFinishTable(boats);
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import java.net.URL;
|
|||||||
import java.util.ResourceBundle;
|
import java.util.ResourceBundle;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by fwy13 on 15/03/2017.
|
* Controller that everything is overlayed onto. This makes it so that changing scenes does not resize your stage.
|
||||||
*/
|
*/
|
||||||
public class MainController extends Controller {
|
public class MainController extends Controller {
|
||||||
@FXML private StartController startController;
|
@FXML private StartController startController;
|
||||||
|
|||||||
@@ -7,23 +7,17 @@ import javafx.fxml.FXML;
|
|||||||
import javafx.scene.chart.LineChart;
|
import javafx.scene.chart.LineChart;
|
||||||
import javafx.scene.chart.NumberAxis;
|
import javafx.scene.chart.NumberAxis;
|
||||||
import javafx.scene.chart.XYChart;
|
import javafx.scene.chart.XYChart;
|
||||||
import javafx.geometry.Pos;
|
|
||||||
import javafx.scene.control.*;
|
import javafx.scene.control.*;
|
||||||
import javafx.scene.layout.GridPane;
|
import javafx.scene.layout.GridPane;
|
||||||
import javafx.scene.paint.Color;
|
|
||||||
import javafx.scene.layout.Pane;
|
import javafx.scene.layout.Pane;
|
||||||
import javafx.scene.layout.StackPane;
|
import javafx.scene.layout.StackPane;
|
||||||
import javafx.scene.paint.Color;
|
import javafx.scene.paint.Color;
|
||||||
import javafx.scene.paint.Paint;
|
|
||||||
import seng302.Mock.StreamedRace;
|
import seng302.Mock.StreamedRace;
|
||||||
import seng302.Model.*;
|
import seng302.Model.*;
|
||||||
import seng302.VisualiserInput;
|
import seng302.VisualiserInput;
|
||||||
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Locale;
|
|
||||||
import java.util.ResourceBundle;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by fwy13 on 15/03/2017.
|
* Created by fwy13 on 15/03/2017.
|
||||||
@@ -33,34 +27,57 @@ public class RaceController extends Controller {
|
|||||||
|
|
||||||
//user saved data for annotation display
|
//user saved data for annotation display
|
||||||
private ArrayList<Boolean> presetAnno;
|
private ArrayList<Boolean> presetAnno;
|
||||||
|
private Map<String, Boolean> importantAnno;
|
||||||
|
private Map<String, Boolean> annoShownBeforeHide;
|
||||||
|
private int buttonChecked;//button currently checked allows the checkboxes to know whether or not to put it's state in history (if not hidden then store)
|
||||||
|
private int prevBtnChecked;//button to keep track of previous pressed button incase we want to check a checkbox straight from hidden we do not wish for all previous to come on.
|
||||||
|
|
||||||
|
private static String nameCheckAnno = "name";
|
||||||
|
private static String abbrevCheckAnno = "abbrev";
|
||||||
|
private static String speedCheckAnno = "speed";
|
||||||
|
private static String pathCheckAnno = "path";
|
||||||
|
private static String timeCheckAnno = "time";
|
||||||
|
|
||||||
|
private static int noBtn = 0;
|
||||||
|
private static int hideBtn = 1;
|
||||||
|
private static int showBtn = 2;
|
||||||
|
private static int partialBtn = 3;
|
||||||
|
private static int importantBtn = 4;
|
||||||
|
|
||||||
private ArrayList<Boat> startBoats;
|
private ArrayList<Boat> startBoats;
|
||||||
private Integer sparkLineNumber = 0;
|
private Integer sparkLineNumber = 0;
|
||||||
|
|
||||||
private ResizableRaceCanvas raceMap;
|
private ResizableRaceCanvas raceMap;
|
||||||
private ResizableRaceMap raceBoundaries;
|
private ResizableRaceMap raceBoundaries;
|
||||||
|
private ToggleGroup annotationGroup;
|
||||||
|
|
||||||
private ArrayList<String> colours;
|
private ArrayList<String> colours;
|
||||||
private Map<Integer, String> boatColours = new HashMap<>();
|
private Map<Integer, String> boatColours = new HashMap<>();
|
||||||
private int legNum;
|
private int legNum;
|
||||||
private RaceClock raceClock;
|
private RaceClock raceClock;
|
||||||
|
|
||||||
@FXML Pane arrow;
|
@FXML Pane arrow;
|
||||||
@FXML SplitPane race;
|
@FXML SplitPane race;
|
||||||
@FXML StackPane arrowPane;
|
@FXML StackPane arrowPane;
|
||||||
@FXML CheckBox showFPS;
|
@FXML CheckBox showFPS;
|
||||||
@FXML CheckBox showBoatPath;
|
@FXML CheckBox showBoatPath;
|
||||||
@FXML CheckBox showAnnotations;
|
|
||||||
@FXML Label timer;
|
|
||||||
@FXML Label FPS;
|
|
||||||
@FXML Label timeZone;
|
|
||||||
@FXML CheckBox showName;
|
@FXML CheckBox showName;
|
||||||
@FXML CheckBox showAbbrev;
|
@FXML CheckBox showAbbrev;
|
||||||
@FXML CheckBox showSpeed;
|
@FXML CheckBox showSpeed;
|
||||||
@FXML CheckBox showTime;
|
@FXML CheckBox showTime;
|
||||||
|
@FXML Label timer;
|
||||||
|
@FXML Label FPS;
|
||||||
|
@FXML Label timeZone;
|
||||||
@FXML Button saveAnno;
|
@FXML Button saveAnno;
|
||||||
@FXML Button showSetAnno;
|
|
||||||
@FXML TableView<Boat> boatInfoTable;
|
@FXML TableView<Boat> boatInfoTable;
|
||||||
@FXML TableColumn<Boat, String> boatPlacingColumn;
|
@FXML TableColumn<Boat, String> boatPlacingColumn;
|
||||||
@FXML TableColumn<Boat, String> boatTeamColumn;
|
@FXML TableColumn<Boat, String> boatTeamColumn;
|
||||||
@FXML TableColumn<Boat, String> boatMarkColumn;
|
@FXML TableColumn<Boat, String> boatMarkColumn;
|
||||||
@FXML TableColumn<Boat, String> boatSpeedColumn;
|
@FXML TableColumn<Boat, String> boatSpeedColumn;
|
||||||
|
@FXML RadioButton hideAnnoRBTN;
|
||||||
|
@FXML RadioButton showAnnoRBTN;
|
||||||
|
@FXML RadioButton partialAnnoRBTN;
|
||||||
|
@FXML RadioButton importantAnnoRBTN;
|
||||||
@FXML LineChart<Number, Number> sparklineChart;
|
@FXML LineChart<Number, Number> sparklineChart;
|
||||||
@FXML NumberAxis xAxis;
|
@FXML NumberAxis xAxis;
|
||||||
@FXML NumberAxis yAxis;
|
@FXML NumberAxis yAxis;
|
||||||
@@ -107,6 +124,12 @@ public class RaceController extends Controller {
|
|||||||
FPS.setVisible(false);
|
FPS.setVisible(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
//adds all radios buttons for annotations to a group
|
||||||
|
annotationGroup = new ToggleGroup();
|
||||||
|
hideAnnoRBTN.setToggleGroup(annotationGroup);
|
||||||
|
showAnnoRBTN.setToggleGroup(annotationGroup);
|
||||||
|
partialAnnoRBTN.setToggleGroup(annotationGroup);
|
||||||
|
importantAnnoRBTN.setToggleGroup(annotationGroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -223,21 +246,15 @@ public class RaceController extends Controller {
|
|||||||
new Thread((newRace)).start();
|
new Thread((newRace)).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Finish Race View
|
||||||
|
* @param boats boats there are in the race.
|
||||||
|
*/
|
||||||
public void finishRace(ObservableList<Boat> boats){
|
public void finishRace(ObservableList<Boat> boats){
|
||||||
race.setVisible(false);
|
race.setVisible(false);
|
||||||
parent.enterFinish(boats);
|
parent.enterFinish(boats);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the value for the race clock label
|
|
||||||
*
|
|
||||||
* @param time time that the label will be updated to
|
|
||||||
*/
|
|
||||||
public void setTimer(String time) {
|
|
||||||
//timer.setText(time);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the value for the fps label
|
* Set the value for the fps label
|
||||||
*
|
*
|
||||||
@@ -332,39 +349,123 @@ public class RaceController extends Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void storeCurrentAnnotationState(){
|
||||||
|
annoShownBeforeHide.put(nameCheckAnno, showName.isSelected());
|
||||||
|
annoShownBeforeHide.put(abbrevCheckAnno, showAbbrev.isSelected());
|
||||||
|
annoShownBeforeHide.put(pathCheckAnno, showBoatPath.isSelected());
|
||||||
|
annoShownBeforeHide.put(speedCheckAnno, showSpeed.isSelected());
|
||||||
|
annoShownBeforeHide.put(timeCheckAnno, showTime.isSelected());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set up boat annotations
|
* Set up boat annotations
|
||||||
*/
|
*/
|
||||||
private void initializeAnnotations() {
|
private void initializeAnnotations() {
|
||||||
presetAnno = new ArrayList<>();
|
presetAnno = new ArrayList<>();
|
||||||
//listener for annotation
|
|
||||||
showAnnotations.selectedProperty().addListener((ov, old_val, new_val) -> {
|
importantAnno = new HashMap<>();
|
||||||
raceMap.toggleAnnotations();
|
importantAnno.put(nameCheckAnno, false);
|
||||||
raceMap.update();
|
importantAnno.put(abbrevCheckAnno, false);
|
||||||
});
|
importantAnno.put(pathCheckAnno, false);
|
||||||
|
importantAnno.put(speedCheckAnno, false);
|
||||||
|
importantAnno.put(timeCheckAnno, true);
|
||||||
|
|
||||||
|
annoShownBeforeHide = new HashMap<>();
|
||||||
|
annoShownBeforeHide.put(nameCheckAnno, true);
|
||||||
|
annoShownBeforeHide.put(abbrevCheckAnno, true);
|
||||||
|
annoShownBeforeHide.put(pathCheckAnno, true);
|
||||||
|
annoShownBeforeHide.put(speedCheckAnno, true);
|
||||||
|
annoShownBeforeHide.put(timeCheckAnno, true);
|
||||||
//listener for show name in annotation
|
//listener for show name in annotation
|
||||||
showName.selectedProperty().addListener((ov, old_val, new_val) -> {
|
showName.selectedProperty().addListener((ov, old_val, new_val) -> {
|
||||||
|
if (old_val != new_val) {
|
||||||
raceMap.toggleAnnoName();
|
raceMap.toggleAnnoName();
|
||||||
|
}
|
||||||
|
if (buttonChecked != hideBtn) {
|
||||||
|
//if we are checking the box straight out of hide instead of using the radio buttons
|
||||||
|
if (prevBtnChecked == hideBtn && buttonChecked != showBtn){
|
||||||
|
storeCurrentAnnotationState();
|
||||||
|
} else {
|
||||||
|
annoShownBeforeHide.put(nameCheckAnno, showName.isSelected());
|
||||||
|
}
|
||||||
|
if (buttonChecked == noBtn) {
|
||||||
|
annotationGroup.selectToggle(showAnnoRBTN);
|
||||||
|
}
|
||||||
|
}
|
||||||
raceMap.update();
|
raceMap.update();
|
||||||
|
prevBtnChecked = noBtn;
|
||||||
});
|
});
|
||||||
//listener for show abbreviation for annotation
|
//listener for show abbreviation for annotation
|
||||||
showAbbrev.selectedProperty().addListener((ov, old_val, new_val) -> {
|
showAbbrev.selectedProperty().addListener((ov, old_val, new_val) -> {
|
||||||
|
if (old_val != new_val) {
|
||||||
raceMap.toggleAnnoAbbrev();
|
raceMap.toggleAnnoAbbrev();
|
||||||
|
}
|
||||||
|
if (buttonChecked != hideBtn) {
|
||||||
|
if (prevBtnChecked == hideBtn && buttonChecked != showBtn){
|
||||||
|
storeCurrentAnnotationState();
|
||||||
|
} else {
|
||||||
|
annoShownBeforeHide.put(abbrevCheckAnno, showAbbrev.isSelected());
|
||||||
|
}
|
||||||
|
if (buttonChecked == noBtn) {
|
||||||
|
annotationGroup.selectToggle(showAnnoRBTN);
|
||||||
|
}
|
||||||
|
}
|
||||||
raceMap.update();
|
raceMap.update();
|
||||||
|
prevBtnChecked = noBtn;
|
||||||
});
|
});
|
||||||
|
|
||||||
//listener for show boat path for annotation
|
//listener for show boat path for annotation
|
||||||
showBoatPath.selectedProperty().addListener((ov, old_val, new_val) -> {
|
showBoatPath.selectedProperty().addListener((ov, old_val, new_val) -> {
|
||||||
|
if (old_val != new_val) {
|
||||||
raceMap.toggleBoatPath();
|
raceMap.toggleBoatPath();
|
||||||
|
}
|
||||||
|
if (buttonChecked != hideBtn) {
|
||||||
|
if (prevBtnChecked == hideBtn && buttonChecked != showBtn){
|
||||||
|
storeCurrentAnnotationState();
|
||||||
|
} else {
|
||||||
|
annoShownBeforeHide.put(pathCheckAnno, showBoatPath.isSelected());
|
||||||
|
}
|
||||||
|
if (buttonChecked == noBtn) {
|
||||||
|
annotationGroup.selectToggle(showAnnoRBTN);
|
||||||
|
}
|
||||||
|
}
|
||||||
raceMap.update();
|
raceMap.update();
|
||||||
|
prevBtnChecked = noBtn;
|
||||||
});
|
});
|
||||||
//listener to show speed for annotation
|
//listener to show speed for annotation
|
||||||
showSpeed.selectedProperty().addListener((ov, old_val, new_val) -> {
|
showSpeed.selectedProperty().addListener((ov, old_val, new_val) -> {
|
||||||
|
if (old_val != new_val) {
|
||||||
raceMap.toggleAnnoSpeed();
|
raceMap.toggleAnnoSpeed();
|
||||||
|
}
|
||||||
|
if (buttonChecked != hideBtn) {
|
||||||
|
if (prevBtnChecked == hideBtn && buttonChecked != showBtn){
|
||||||
|
storeCurrentAnnotationState();
|
||||||
|
} else {
|
||||||
|
annoShownBeforeHide.put(speedCheckAnno, showSpeed.isSelected());
|
||||||
|
}
|
||||||
|
if (buttonChecked == noBtn) {
|
||||||
|
annotationGroup.selectToggle(showAnnoRBTN);
|
||||||
|
}
|
||||||
|
}
|
||||||
raceMap.update();
|
raceMap.update();
|
||||||
|
prevBtnChecked = noBtn;
|
||||||
});
|
});
|
||||||
showTime.selectedProperty().addListener((ov, old_val, new_val) -> {
|
showTime.selectedProperty().addListener((ov, old_val, new_val) -> {
|
||||||
|
if (old_val != new_val) {
|
||||||
raceMap.toggleAnnoTime();
|
raceMap.toggleAnnoTime();
|
||||||
|
}
|
||||||
|
if (buttonChecked != hideBtn) {
|
||||||
|
if (prevBtnChecked == hideBtn && buttonChecked != showBtn){
|
||||||
|
storeCurrentAnnotationState();
|
||||||
|
} else {
|
||||||
|
annoShownBeforeHide.put(timeCheckAnno, showTime.isSelected());
|
||||||
|
}
|
||||||
|
if (buttonChecked == noBtn) {
|
||||||
|
annotationGroup.selectToggle(showAnnoRBTN);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
prevBtnChecked = noBtn;
|
||||||
raceMap.update();
|
raceMap.update();
|
||||||
});
|
});
|
||||||
//listener to save currently selected annotation
|
//listener to save currently selected annotation
|
||||||
@@ -374,17 +475,63 @@ public class RaceController extends Controller {
|
|||||||
presetAnno.add(showAbbrev.isSelected());
|
presetAnno.add(showAbbrev.isSelected());
|
||||||
presetAnno.add(showSpeed.isSelected());
|
presetAnno.add(showSpeed.isSelected());
|
||||||
presetAnno.add(showBoatPath.isSelected());
|
presetAnno.add(showBoatPath.isSelected());
|
||||||
|
presetAnno.add(showTime.isSelected());
|
||||||
});
|
});
|
||||||
//listener to show saved annotation
|
//listener for hiding
|
||||||
showSetAnno.setOnAction(event -> {
|
hideAnnoRBTN.selectedProperty().addListener((ov, old_val, new_val) ->{
|
||||||
|
buttonChecked = hideBtn;
|
||||||
|
//raceMap.hideAnnotations();
|
||||||
|
showName.setSelected(false);
|
||||||
|
showAbbrev.setSelected(false);
|
||||||
|
showBoatPath.setSelected(false);
|
||||||
|
showSpeed.setSelected(false);
|
||||||
|
showTime.setSelected(false);
|
||||||
|
annotationGroup.selectToggle(hideAnnoRBTN);
|
||||||
|
raceMap.update();
|
||||||
|
buttonChecked = noBtn;
|
||||||
|
prevBtnChecked = hideBtn;
|
||||||
|
});
|
||||||
|
//listener for showing all annotations
|
||||||
|
showAnnoRBTN.selectedProperty().addListener((ov, old_val, new_val) ->{
|
||||||
|
buttonChecked = showBtn;
|
||||||
|
showName.setSelected(annoShownBeforeHide.get(nameCheckAnno));
|
||||||
|
showAbbrev.setSelected(annoShownBeforeHide.get(abbrevCheckAnno));
|
||||||
|
showBoatPath.setSelected(annoShownBeforeHide.get(pathCheckAnno));
|
||||||
|
showSpeed.setSelected(annoShownBeforeHide.get(speedCheckAnno));
|
||||||
|
showTime.setSelected(annoShownBeforeHide.get(timeCheckAnno));
|
||||||
|
raceMap.update();
|
||||||
|
buttonChecked = noBtn;
|
||||||
|
prevBtnChecked = showBtn;
|
||||||
|
});
|
||||||
|
//listener for showing all important
|
||||||
|
partialAnnoRBTN.selectedProperty().addListener((ov, old_val, new_val) ->{
|
||||||
|
buttonChecked = partialBtn;
|
||||||
|
showName.setSelected(false);
|
||||||
|
showAbbrev.setSelected(true);
|
||||||
|
showSpeed.setSelected(true);
|
||||||
|
showBoatPath.setSelected(false);
|
||||||
|
showTime.setSelected(false);
|
||||||
|
annotationGroup.selectToggle(partialAnnoRBTN);
|
||||||
|
raceMap.update();
|
||||||
|
buttonChecked = noBtn;
|
||||||
|
prevBtnChecked = partialBtn;
|
||||||
|
});
|
||||||
|
//listener for showing all important
|
||||||
|
importantAnnoRBTN.selectedProperty().addListener((ov, old_val, new_val) ->{
|
||||||
|
buttonChecked = importantBtn;
|
||||||
if (presetAnno.size() > 0) {
|
if (presetAnno.size() > 0) {
|
||||||
showName.setSelected(presetAnno.get(0));
|
showName.setSelected(presetAnno.get(0));
|
||||||
showAbbrev.setSelected(presetAnno.get(1));
|
showAbbrev.setSelected(presetAnno.get(1));
|
||||||
showSpeed.setSelected(presetAnno.get(2));
|
showSpeed.setSelected(presetAnno.get(2));
|
||||||
showBoatPath.setSelected(presetAnno.get(3));
|
showBoatPath.setSelected(presetAnno.get(3));
|
||||||
|
showTime.setSelected(presetAnno.get(4));
|
||||||
|
annotationGroup.selectToggle(importantAnnoRBTN);
|
||||||
raceMap.update();
|
raceMap.update();
|
||||||
}
|
}
|
||||||
|
buttonChecked = noBtn;
|
||||||
|
prevBtnChecked = importantBtn;
|
||||||
});
|
});
|
||||||
|
annotationGroup.selectToggle(showAnnoRBTN);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String colourToHex(Color color) {
|
private String colourToHex(Color color) {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import java.util.Observer;
|
|||||||
import java.util.ResourceBundle;
|
import java.util.ResourceBundle;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by esa46 on 6/04/17.
|
* Controller to for waiting for the race to start
|
||||||
*/
|
*/
|
||||||
public class StartController extends Controller implements Observer {
|
public class StartController extends Controller implements Observer {
|
||||||
|
|
||||||
@@ -76,6 +76,9 @@ public class StartController extends Controller implements Observer {
|
|||||||
return startWrapper;
|
return startWrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initiliases the tables that are to be shown on the pane
|
||||||
|
*/
|
||||||
private void initialiseTables() {
|
private void initialiseTables() {
|
||||||
List<Boat> boats = raceData.getBoats();
|
List<Boat> boats = raceData.getBoats();
|
||||||
ObservableList<Boat> observableBoats = FXCollections.observableArrayList(boats);
|
ObservableList<Boat> observableBoats = FXCollections.observableArrayList(boats);
|
||||||
@@ -107,6 +110,9 @@ public class StartController extends Controller implements Observer {
|
|||||||
}.start();
|
}.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the clock that displays the time of at the current race venue.
|
||||||
|
*/
|
||||||
private void setRaceClock() {
|
private void setRaceClock() {
|
||||||
raceClock = new RaceClock(raceData.getZonedDateTime());
|
raceClock = new RaceClock(raceData.getZonedDateTime());
|
||||||
|
|
||||||
@@ -120,6 +126,9 @@ public class StartController extends Controller implements Observer {
|
|||||||
raceClock.run();
|
raceClock.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the time that the race is going to start.
|
||||||
|
*/
|
||||||
private void setStartingTime() {
|
private void setStartingTime() {
|
||||||
String dateFormat = "'Starting time:' HH:mm dd/MM/YYYY";
|
String dateFormat = "'Starting time:' HH:mm dd/MM/YYYY";
|
||||||
Platform.runLater(()-> {
|
Platform.runLater(()-> {
|
||||||
@@ -135,6 +144,9 @@ public class StartController extends Controller implements Observer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set the current time, may be used to update the time on the clock.
|
||||||
|
*/
|
||||||
private void setCurrentTime() {
|
private void setCurrentTime() {
|
||||||
Platform.runLater(()->
|
Platform.runLater(()->
|
||||||
raceClock.setUTCTime(visualiserInput.getRaceStatus().getCurrentTime())
|
raceClock.setUTCTime(visualiserInput.getRaceStatus().getCurrentTime())
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by Joseph on 24/04/2017.
|
* XML Read that reads the Boats that are goign to participate in the Race
|
||||||
*/
|
*/
|
||||||
public class BoatXMLReader extends XMLReader {
|
public class BoatXMLReader extends XMLReader {
|
||||||
private final Map<Integer, StreamedBoat> streamedBoatMap = new HashMap<>();
|
private final Map<Integer, StreamedBoat> streamedBoatMap = new HashMap<>();
|
||||||
@@ -139,6 +139,10 @@ public class BoatXMLReader extends XMLReader {
|
|||||||
// TODO Get relative point before implementing. (GPSposition is based off a relative point).
|
// TODO Get relative point before implementing. (GPSposition is based off a relative point).
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the participants
|
||||||
|
* @param participants boats participating the race mapped by their source ID's
|
||||||
|
*/
|
||||||
public void setParticipants(Map<Integer, StreamedBoat> participants) {
|
public void setParticipants(Map<Integer, StreamedBoat> participants) {
|
||||||
this.participants = participants;
|
this.participants = participants;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,6 +52,13 @@ public class RegattaXMLReader extends XMLReader {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Alternate Constructor that takes in an inputstream instead
|
||||||
|
* @param xmlString Input stream of the XML
|
||||||
|
* @throws IOException Error with input
|
||||||
|
* @throws SAXException Error with XML Format
|
||||||
|
* @throws ParserConfigurationException Error with XMl contents
|
||||||
|
*/
|
||||||
public RegattaXMLReader(InputStream xmlString) throws IOException, SAXException, ParserConfigurationException {
|
public RegattaXMLReader(InputStream xmlString) throws IOException, SAXException, ParserConfigurationException {
|
||||||
super(xmlString);
|
super(xmlString);
|
||||||
read();
|
read();
|
||||||
@@ -66,6 +73,10 @@ public class RegattaXMLReader extends XMLReader {
|
|||||||
makeRegatta(attributes);
|
makeRegatta(attributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extracts the information from the attributes
|
||||||
|
* @param attributes attributes to extract information form.
|
||||||
|
*/
|
||||||
private void makeRegatta(Element attributes) {
|
private void makeRegatta(Element attributes) {
|
||||||
this.regattaID = Integer.parseInt(getTextValueOfNode(attributes, "RegattaID"));
|
this.regattaID = Integer.parseInt(getTextValueOfNode(attributes, "RegattaID"));
|
||||||
this.regattaName = getTextValueOfNode(attributes, "RegattaName");
|
this.regattaName = getTextValueOfNode(attributes, "RegattaName");
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package seng302.Mock;
|
|||||||
import seng302.Model.Boat;
|
import seng302.Model.Boat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by Joseph on 24/04/2017.
|
* Boats that are been received.
|
||||||
*/
|
*/
|
||||||
public class StreamedBoat extends Boat {
|
public class StreamedBoat extends Boat {
|
||||||
private final int sourceID;
|
private final int sourceID;
|
||||||
@@ -13,6 +13,12 @@ public class StreamedBoat extends Boat {
|
|||||||
this.velocity = 0;
|
this.velocity = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* COnstructor
|
||||||
|
* @param sourceID ID of the BOat
|
||||||
|
* @param name Name of the Boat
|
||||||
|
* @param abbrev Boat's name shortened.
|
||||||
|
*/
|
||||||
public StreamedBoat(int sourceID, String name, String abbrev) {
|
public StreamedBoat(int sourceID, String name, String abbrev) {
|
||||||
super(name, abbrev);
|
super(name, abbrev);
|
||||||
this.sourceID = sourceID;
|
this.sourceID = sourceID;
|
||||||
@@ -20,9 +26,7 @@ public class StreamedBoat extends Boat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public StreamedBoat(int sourceID) {
|
public StreamedBoat(int sourceID) {
|
||||||
super("None", "None");
|
this(sourceID, "None", "None");
|
||||||
this.sourceID = sourceID;
|
|
||||||
this.init();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getSourceID() {
|
public int getSourceID() {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import java.util.List;
|
|||||||
import java.util.Observable;
|
import java.util.Observable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by jjg64 on 21/04/17.
|
* COurse that the is being received.
|
||||||
*/
|
*/
|
||||||
public class StreamedCourse extends Observable implements RaceDataSource {
|
public class StreamedCourse extends Observable implements RaceDataSource {
|
||||||
private StreamedCourseXMLReader streamedCourseXMLReader = null;
|
private StreamedCourseXMLReader streamedCourseXMLReader = null;
|
||||||
@@ -21,6 +21,10 @@ public class StreamedCourse extends Observable implements RaceDataSource {
|
|||||||
|
|
||||||
public StreamedCourse() {}
|
public StreamedCourse() {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read and set the new XML that has been received.
|
||||||
|
* @param boatXMLReader new XMl of the boats.
|
||||||
|
*/
|
||||||
public void setBoatXMLReader(BoatXMLReader boatXMLReader) {
|
public void setBoatXMLReader(BoatXMLReader boatXMLReader) {
|
||||||
this.boatXMLReader = boatXMLReader;
|
this.boatXMLReader = boatXMLReader;
|
||||||
if (streamedCourseXMLReader != null && boatXMLReader != null) {
|
if (streamedCourseXMLReader != null && boatXMLReader != null) {
|
||||||
@@ -36,6 +40,10 @@ public class StreamedCourse extends Observable implements RaceDataSource {
|
|||||||
return streamedCourseXMLReader;
|
return streamedCourseXMLReader;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read and sets the new Course that has been received
|
||||||
|
* @param streamedCourseXMLReader COurse XML that has been received
|
||||||
|
*/
|
||||||
public void setStreamedCourseXMLReader(StreamedCourseXMLReader streamedCourseXMLReader) {
|
public void setStreamedCourseXMLReader(StreamedCourseXMLReader streamedCourseXMLReader) {
|
||||||
this.streamedCourseXMLReader = streamedCourseXMLReader;
|
this.streamedCourseXMLReader = streamedCourseXMLReader;
|
||||||
if (streamedCourseXMLReader != null && boatXMLReader != null) {
|
if (streamedCourseXMLReader != null && boatXMLReader != null) {
|
||||||
@@ -44,6 +52,10 @@ public class StreamedCourse extends Observable implements RaceDataSource {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reads and sets the new Regatta that has been received
|
||||||
|
* @param regattaXMLReader Regatta XMl that has been received.
|
||||||
|
*/
|
||||||
public void setRegattaXMLReader(RegattaXMLReader regattaXMLReader) {
|
public void setRegattaXMLReader(RegattaXMLReader regattaXMLReader) {
|
||||||
this.regattaXMLReader = regattaXMLReader;
|
this.regattaXMLReader = regattaXMLReader;
|
||||||
setChanged();
|
setChanged();
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import java.time.format.DateTimeFormatter;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by jjg64 on 21/04/17.
|
* XML Read for the Course that is being received
|
||||||
*/
|
*/
|
||||||
public class StreamedCourseXMLReader extends XMLReader {
|
public class StreamedCourseXMLReader extends XMLReader {
|
||||||
private static final double COORDINATEPADDING = 0.000;
|
private static final double COORDINATEPADDING = 0.000;
|
||||||
@@ -95,6 +95,9 @@ public class StreamedCourseXMLReader extends XMLReader {
|
|||||||
postpone = Boolean.parseBoolean(raceTimeTag.getNamedItem("Postpone").getTextContent());
|
postpone = Boolean.parseBoolean(raceTimeTag.getNamedItem("Postpone").getTextContent());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reads the participants of the race.
|
||||||
|
*/
|
||||||
private void readParticipants() {
|
private void readParticipants() {
|
||||||
Element nParticipants = (Element) doc.getElementsByTagName("Participants").item(0);
|
Element nParticipants = (Element) doc.getElementsByTagName("Participants").item(0);
|
||||||
nParticipants.getChildNodes().getLength();
|
nParticipants.getChildNodes().getLength();
|
||||||
@@ -159,12 +162,22 @@ public class StreamedCourseXMLReader extends XMLReader {
|
|||||||
return marker;
|
return marker;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extracts the GPS Coordinates from a XMl Element
|
||||||
|
* @param mark Element to Extract from
|
||||||
|
* @return the GPS coordinate that it reflects
|
||||||
|
*/
|
||||||
private GPSCoordinate getCoordinate(Element mark) {
|
private GPSCoordinate getCoordinate(Element mark) {
|
||||||
double lat = Double.parseDouble(mark.getAttribute("TargetLat"));
|
double lat = Double.parseDouble(mark.getAttribute("TargetLat"));
|
||||||
double lon = Double.parseDouble(mark.getAttribute("TargetLng"));
|
double lon = Double.parseDouble(mark.getAttribute("TargetLng"));
|
||||||
return new GPSCoordinate(lat,lon);
|
return new GPSCoordinate(lat,lon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extracts the SourceID from a XML ELement
|
||||||
|
* @param mark Element to Extract from
|
||||||
|
* @return the Source ID of the Extracted Element.
|
||||||
|
*/
|
||||||
private int getSourceId(Element mark) {
|
private int getSourceId(Element mark) {
|
||||||
String sourceId = mark.getAttribute("SourceID");
|
String sourceId = mark.getAttribute("SourceID");
|
||||||
if (sourceId.isEmpty()){
|
if (sourceId.isEmpty()){
|
||||||
@@ -210,6 +223,9 @@ public class StreamedCourseXMLReader extends XMLReader {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reads the course boundary limitations of the course recieved.
|
||||||
|
*/
|
||||||
private void readCourseLimit() {
|
private void readCourseLimit() {
|
||||||
Element nCourseLimit = (Element) doc.getElementsByTagName("CourseLimit").item(0);
|
Element nCourseLimit = (Element) doc.getElementsByTagName("CourseLimit").item(0);
|
||||||
for(int i = 0; i < nCourseLimit.getChildNodes().getLength(); i++) {
|
for(int i = 0; i < nCourseLimit.getChildNodes().getLength(); i++) {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import seng302.VisualiserInput;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by jjg64 on 21/04/17.
|
* The Class used to view the race streamed.
|
||||||
*/
|
*/
|
||||||
public class StreamedRace implements Runnable {
|
public class StreamedRace implements Runnable {
|
||||||
private final VisualiserInput visualiserInput;
|
private final VisualiserInput visualiserInput;
|
||||||
@@ -196,9 +196,6 @@ public class StreamedRace implements Runnable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handle(long arg0) {
|
public void handle(long arg0) {
|
||||||
if (boatsFinished < startingBoats.size()) {
|
|
||||||
boatsFinished = 0;
|
|
||||||
//controller.updateSparkline(startingBoats);
|
|
||||||
totalTimeElapsed = System.currentTimeMillis() - timeRaceStarted;
|
totalTimeElapsed = System.currentTimeMillis() - timeRaceStarted;
|
||||||
|
|
||||||
for (Boat boat : startingBoats) {
|
for (Boat boat : startingBoats) {
|
||||||
@@ -206,9 +203,6 @@ public class StreamedRace implements Runnable {
|
|||||||
updatePosition(boat, Math.round(1000 / lastFPS) > 20 ? 15 : Math.round(1000 / lastFPS));
|
updatePosition(boat, Math.round(1000 / lastFPS) > 20 ? 15 : Math.round(1000 / lastFPS));
|
||||||
checkPosition(boat, totalTimeElapsed);
|
checkPosition(boat, totalTimeElapsed);
|
||||||
}
|
}
|
||||||
if (boat.isFinished()){
|
|
||||||
boatsFinished++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
for (Marker mark: boatMarkers){
|
for (Marker mark: boatMarkers){
|
||||||
if (mark != null){
|
if (mark != null){
|
||||||
@@ -216,8 +210,7 @@ public class StreamedRace implements Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//System.out.println(boatsFinished + ":" + startingBoats.size());
|
//System.out.println(boatsFinished + ":" + startingBoats.size());
|
||||||
|
if (visualiserInput.getRaceStatus().isFinished()){
|
||||||
} else {
|
|
||||||
controller.finishRace(startingBoats);
|
controller.finishRace(startingBoats);
|
||||||
stop();
|
stop();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
|||||||
private RaceMap map;
|
private RaceMap map;
|
||||||
private List<Boat> boats;
|
private List<Boat> boats;
|
||||||
private List<Marker> boatMarkers;
|
private List<Marker> boatMarkers;
|
||||||
private boolean raceAnno = true;
|
|
||||||
private boolean annoName = true;
|
private boolean annoName = true;
|
||||||
private boolean annoAbbrev = true;
|
private boolean annoAbbrev = true;
|
||||||
private boolean annoSpeed = true;
|
private boolean annoSpeed = true;
|
||||||
@@ -263,12 +262,6 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Toggle the raceAnno value
|
|
||||||
*/
|
|
||||||
public void toggleAnnotations() {
|
|
||||||
raceAnno = !raceAnno;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Toggle name display in annotation
|
* Toggle name display in annotation
|
||||||
@@ -324,7 +317,6 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
|||||||
displayBoat(boat, 0, boatColours.get(sourceID));
|
displayBoat(boat, 0, boatColours.get(sourceID));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (raceAnno) {
|
|
||||||
if (Duration.between(boat.getTimeSinceLastMark(), raceClock.getTime()).getSeconds() < 0) {
|
if (Duration.between(boat.getTimeSinceLastMark(), raceClock.getTime()).getSeconds() < 0) {
|
||||||
boat.setTimeSinceLastMark(raceClock.getTime());
|
boat.setTimeSinceLastMark(raceClock.getTime());
|
||||||
}
|
}
|
||||||
@@ -334,7 +326,6 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draws all track points for a given boat. Colour is set by boat, opacity by track point.
|
* Draws all track points for a given boat. Colour is set by boat, opacity by track point.
|
||||||
@@ -343,7 +334,7 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
|||||||
* @see seng302.Model.TrackPoint
|
* @see seng302.Model.TrackPoint
|
||||||
*/
|
*/
|
||||||
private void drawTrack(Boat boat, Color colour) {
|
private void drawTrack(Boat boat, Color colour) {
|
||||||
if (annoPath && raceAnno) {
|
if (annoPath) {
|
||||||
for (TrackPoint point : boat.getTrack()) {
|
for (TrackPoint point : boat.getTrack()) {
|
||||||
GraphCoordinate scaledCoordinate = this.map.convertGPS(point.getCoordinate());
|
GraphCoordinate scaledCoordinate = this.map.convertGPS(point.getCoordinate());
|
||||||
gc.setFill(new Color(colour.getRed(), colour.getGreen(), colour.getBlue(), point.getAlpha()));
|
gc.setFill(new Color(colour.getRed(), colour.getGreen(), colour.getBlue(), point.getAlpha()));
|
||||||
@@ -352,6 +343,9 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* makes colours
|
||||||
|
*/
|
||||||
private void makeColours() {
|
private void makeColours() {
|
||||||
colours = new ArrayList<>(Arrays.asList(
|
colours = new ArrayList<>(Arrays.asList(
|
||||||
Color.BLUEVIOLET,
|
Color.BLUEVIOLET,
|
||||||
|
|||||||
@@ -17,6 +17,10 @@ public class ResizableRaceMap extends ResizableCanvas {
|
|||||||
private double[] xpoints = {};
|
private double[] xpoints = {};
|
||||||
private double[] ypoints = {};
|
private double[] ypoints = {};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
* @param raceData Race which it is taking its information to be displayed from
|
||||||
|
*/
|
||||||
public ResizableRaceMap(RaceDataSource raceData){
|
public ResizableRaceMap(RaceDataSource raceData){
|
||||||
super();
|
super();
|
||||||
raceBoundaries = raceData.getBoundary();
|
raceBoundaries = raceData.getBoundary();
|
||||||
@@ -29,9 +33,14 @@ public class ResizableRaceMap extends ResizableCanvas {
|
|||||||
//draw();
|
//draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the map race that it is auppost to be viewing.
|
||||||
|
* @param map
|
||||||
|
*/
|
||||||
private void setMap(RaceMap map) {
|
private void setMap(RaceMap map) {
|
||||||
this.map = map;
|
this.map = map;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draw boundary of the race.
|
* Draw boundary of the race.
|
||||||
*/
|
*/
|
||||||
@@ -46,6 +55,9 @@ public class ResizableRaceMap extends ResizableCanvas {
|
|||||||
gc.fillPolygon(xpoints, ypoints, xpoints.length);
|
gc.fillPolygon(xpoints, ypoints, xpoints.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the coordinately of the race boundaries
|
||||||
|
*/
|
||||||
private void setRaceBoundCoordinates() {
|
private void setRaceBoundCoordinates() {
|
||||||
xpoints = new double[this.raceBoundaries.size()];
|
xpoints = new double[this.raceBoundaries.size()];
|
||||||
ypoints = new double[this.raceBoundaries.size()];
|
ypoints = new double[this.raceBoundaries.size()];
|
||||||
@@ -56,6 +68,9 @@ public class ResizableRaceMap extends ResizableCanvas {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Draw update for the canvas
|
||||||
|
*/
|
||||||
public void draw(){
|
public void draw(){
|
||||||
|
|
||||||
double width = getWidth();
|
double width = getWidth();
|
||||||
|
|||||||
@@ -26,16 +26,20 @@
|
|||||||
<panes>
|
<panes>
|
||||||
<TitledPane animated="false" text="Annotation Control">
|
<TitledPane animated="false" text="Annotation Control">
|
||||||
<content>
|
<content>
|
||||||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="240.0" prefWidth="200.0">
|
<AnchorPane minHeight="0.0" minWidth="0.0">
|
||||||
<children>
|
<children>
|
||||||
<CheckBox fx:id="showBoatPath" mnemonicParsing="false" selected="true" text="Show Boat Paths" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="104.0" />
|
<CheckBox fx:id="showName" layoutY="39.0" mnemonicParsing="false" selected="true" text="Show Boat Name" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="0.0" />
|
||||||
<CheckBox fx:id="showAnnotations" layoutX="-2.0" layoutY="14.0" mnemonicParsing="false" selected="true" text="Show Annotations" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="0.0" />
|
<CheckBox fx:id="showAbbrev" layoutY="61.0" mnemonicParsing="false" selected="true" text="Show Boat Abbreviation" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="25.0" />
|
||||||
<CheckBox fx:id="showName" layoutY="39.0" mnemonicParsing="false" selected="true" text="Show Boat Name" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="26.0" />
|
<CheckBox fx:id="showSpeed" layoutY="90.0" mnemonicParsing="false" selected="true" text="Show Boat Speed" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="50.0" />
|
||||||
<CheckBox fx:id="showAbbrev" layoutY="61.0" mnemonicParsing="false" selected="true" text="Show Boat Abbreviation" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="52.0" />
|
<CheckBox fx:id="showBoatPath" mnemonicParsing="false" selected="true" text="Show Boat Paths" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="75.0" />
|
||||||
<CheckBox fx:id="showSpeed" layoutY="90.0" mnemonicParsing="false" selected="true" text="Show Boat Speed" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="78.0" />
|
<CheckBox fx:id="showTime" mnemonicParsing="false" selected="true" text="Show Boat Leg Time" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="100.0" />
|
||||||
<CheckBox fx:id="showTime" mnemonicParsing="false" selected="true" text="Show Boat Leg Time" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="130.0" />
|
<Separator prefWidth="200.0" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="125.0" />
|
||||||
<Button fx:id="saveAnno" layoutX="11.0" layoutY="106.0" maxWidth="154.0" mnemonicParsing="false" prefWidth="154.0" text="Save Annotation" AnchorPane.topAnchor="160.0" />
|
<Label text="Annotations" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="130.0" />
|
||||||
<Button fx:id="showSetAnno" layoutX="11.0" layoutY="139.0" mnemonicParsing="false" text="Show Set Annotation" AnchorPane.topAnchor="190.0" />
|
<RadioButton fx:id="hideAnnoRBTN" mnemonicParsing="false" text="Hidden" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="155.0" />
|
||||||
|
<RadioButton fx:id="showAnnoRBTN" mnemonicParsing="false" text="Visible" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="180.0" />
|
||||||
|
<RadioButton fx:id="partialAnnoRBTN" mnemonicParsing="false" text="Partial" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="205.0" />
|
||||||
|
<RadioButton fx:id="importantAnnoRBTN" mnemonicParsing="false" text="Important" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="230.0" />
|
||||||
|
<Button fx:id="saveAnno" layoutX="11.0" layoutY="106.0" maxWidth="154.0" mnemonicParsing="false" prefWidth="154.0" text="Save Important Annotations" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="255.0" />
|
||||||
</children>
|
</children>
|
||||||
</AnchorPane>
|
</AnchorPane>
|
||||||
</content>
|
</content>
|
||||||
|
|||||||
Reference in New Issue
Block a user