|
|
|
@ -210,17 +210,7 @@ public class ResizableRaceCanvas extends Canvas {
|
|
|
|
|
|
|
|
|
|
|
|
displayLine(startline1, startline2, Color.GREEN);
|
|
|
|
displayLine(startline1, startline2, Color.GREEN);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
updateBoats();
|
|
|
|
if (boats != null) {
|
|
|
|
|
|
|
|
for (BoatInRace boat : boats) {
|
|
|
|
|
|
|
|
if (boat != null) {
|
|
|
|
|
|
|
|
// System.out.print("Drawing Boat At: " + boat.getCurrentPosition());
|
|
|
|
|
|
|
|
displayPoint(this.map.convertGPS(boat.getCurrentPosition()), boat.getColour());
|
|
|
|
|
|
|
|
if (raceAnno){
|
|
|
|
|
|
|
|
displayText(boat.getAbbrev(), boat.getVelocity(), this.map.convertGPS(boat.getCurrentPosition()));}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//display wind direction arrow - specify origin point and angle - angle now set to random angle
|
|
|
|
//display wind direction arrow - specify origin point and angle - angle now set to random angle
|
|
|
|
displayArrow(new GraphCoordinate((int)getWidth()-40, 40), 150);
|
|
|
|
displayArrow(new GraphCoordinate((int)getWidth()-40, 40), 150);
|
|
|
|
@ -244,13 +234,15 @@ public class ResizableRaceCanvas extends Canvas {
|
|
|
|
if (boats != null) {
|
|
|
|
if (boats != null) {
|
|
|
|
for (BoatInRace boat : boats) {
|
|
|
|
for (BoatInRace boat : boats) {
|
|
|
|
boolean finished = boat.getCurrentLeg().getName().equals("Finish") || boat.getCurrentLeg().getName().equals("DNF");
|
|
|
|
boolean finished = boat.getCurrentLeg().getName().equals("Finish") || boat.getCurrentLeg().getName().equals("DNF");
|
|
|
|
if (!finished) {
|
|
|
|
boolean isStart = boat.isStarted();
|
|
|
|
|
|
|
|
if (!finished && isStart) {
|
|
|
|
displayBoat(boat, boat.calculateHeading());
|
|
|
|
displayBoat(boat, boat.calculateHeading());
|
|
|
|
GraphCoordinate wakeFrom = this.map.convertGPS(boat.getCurrentPosition());
|
|
|
|
GraphCoordinate wakeFrom = this.map.convertGPS(boat.getCurrentPosition());
|
|
|
|
GraphCoordinate wakeTo = this.map.convertGPS(boat.getWake());
|
|
|
|
GraphCoordinate wakeTo = this.map.convertGPS(boat.getWake());
|
|
|
|
displayLine(wakeFrom, wakeTo, boat.getColour());
|
|
|
|
displayLine(wakeFrom, wakeTo, boat.getColour());
|
|
|
|
}
|
|
|
|
} else if (!isStart){
|
|
|
|
else {
|
|
|
|
displayBoat(boat, boat.calculateHeading());
|
|
|
|
|
|
|
|
} else {
|
|
|
|
displayBoat(boat, 0);
|
|
|
|
displayBoat(boat, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|