|
|
|
|
@ -84,17 +84,19 @@ public class ResizableRaceCanvas extends Canvas {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void displayBoat(Boat boat, double angle, Color colour) {
|
|
|
|
|
GraphCoordinate pos = this.map.convertGPS(boat.getCurrentPosition());
|
|
|
|
|
Paint paint = colour;
|
|
|
|
|
|
|
|
|
|
double[] x = {pos.getX() - 6, pos.getX(), pos.getX() + 6};
|
|
|
|
|
double[] y = {pos.getY() + 12, pos.getY() - 12, pos.getY() + 12};
|
|
|
|
|
gc.setFill(paint);
|
|
|
|
|
|
|
|
|
|
gc.save();
|
|
|
|
|
rotate(angle, pos.getX(), pos.getY());
|
|
|
|
|
gc.fillPolygon(x, y, 3);
|
|
|
|
|
gc.restore();
|
|
|
|
|
if (boat.getCurrentPosition() != null) {
|
|
|
|
|
GraphCoordinate pos = this.map.convertGPS(boat.getCurrentPosition());
|
|
|
|
|
Paint paint = colour;
|
|
|
|
|
|
|
|
|
|
double[] x = {pos.getX() - 6, pos.getX(), pos.getX() + 6};
|
|
|
|
|
double[] y = {pos.getY() + 12, pos.getY() - 12, pos.getY() + 12};
|
|
|
|
|
gc.setFill(paint);
|
|
|
|
|
|
|
|
|
|
gc.save();
|
|
|
|
|
rotate(angle, pos.getX(), pos.getY());
|
|
|
|
|
gc.fillPolygon(x, y, 3);
|
|
|
|
|
gc.restore();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|