|
|
|
|
@ -2,6 +2,7 @@ package visualiser.model;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javafx.scene.paint.Color;
|
|
|
|
|
import javafx.scene.paint.LinearGradient;
|
|
|
|
|
import javafx.scene.paint.Paint;
|
|
|
|
|
import javafx.scene.transform.Rotate;
|
|
|
|
|
import network.Messages.Enums.BoatStatusEnum;
|
|
|
|
|
@ -11,6 +12,7 @@ import shared.model.Mark;
|
|
|
|
|
import shared.model.RaceClock;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -171,6 +173,7 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
|
|
|
|
graphCoordinateB.getX(),
|
|
|
|
|
graphCoordinateB.getY() );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -523,15 +526,27 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
|
|
|
|
//Apply the boat color.
|
|
|
|
|
gc.setFill(boat.getColor());
|
|
|
|
|
|
|
|
|
|
double[] xPoints = new double[boat.getTrack().size()];
|
|
|
|
|
double[] yPoints = new double[boat.getTrack().size()];
|
|
|
|
|
int index = 0;
|
|
|
|
|
|
|
|
|
|
//Draw each TrackPoint.
|
|
|
|
|
for (TrackPoint point : new ArrayList<>(boat.getTrack())) {
|
|
|
|
|
|
|
|
|
|
//Convert the GPSCoordinate to a screen coordinate.
|
|
|
|
|
GraphCoordinate scaledCoordinate = this.map.convertGPS(point.getCoordinate());
|
|
|
|
|
|
|
|
|
|
//Draw a circle for the trackpoint.
|
|
|
|
|
gc.fillOval(scaledCoordinate.getX(), scaledCoordinate.getY(), point.getDiameter(), point.getDiameter());
|
|
|
|
|
xPoints[index] = ((double)scaledCoordinate.getX());
|
|
|
|
|
yPoints[index] = ((double)scaledCoordinate.getY());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
index++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gc.strokePolyline(xPoints, yPoints, xPoints.length);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|