|
|
|
|
@ -428,7 +428,7 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
|
|
|
|
double endPointDiameter = 12;
|
|
|
|
|
|
|
|
|
|
//Line.
|
|
|
|
|
drawLine(wakeFrom, wakeTo, boat.getColor(), lineWidth);
|
|
|
|
|
drawLine(wakeFrom, wakeTo, Color.DARKBLUE, lineWidth);
|
|
|
|
|
|
|
|
|
|
//Draw end-point.
|
|
|
|
|
drawCircle(wakeTo, endPointDiameter, Color.BLACK);
|
|
|
|
|
@ -712,35 +712,44 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
|
|
|
|
//Check that track points are enabled.
|
|
|
|
|
if (this.annoPath) {
|
|
|
|
|
|
|
|
|
|
gc.save();
|
|
|
|
|
List<TrackPoint> trackPoints = new ArrayList<>(boat.getTrack());
|
|
|
|
|
|
|
|
|
|
gc.setLineWidth(3);
|
|
|
|
|
if (trackPoints.size() > 2 ) {
|
|
|
|
|
|
|
|
|
|
//Apply the boat color.
|
|
|
|
|
gc.setFill(boat.getColor());
|
|
|
|
|
gc.setStroke(boat.getColor());
|
|
|
|
|
gc.save();
|
|
|
|
|
|
|
|
|
|
List<TrackPoint> trackPoints = new ArrayList<>(boat.getTrack());
|
|
|
|
|
gc.setLineWidth(3);
|
|
|
|
|
|
|
|
|
|
double[] xPoints = new double[trackPoints.size()];
|
|
|
|
|
double[] yPoints = new double[trackPoints.size()];
|
|
|
|
|
int index = 0;
|
|
|
|
|
|
|
|
|
|
//Copy trackpoint locations to x/y arrays.
|
|
|
|
|
for (TrackPoint point : trackPoints) {
|
|
|
|
|
//Draw a line between each adjacent pair of track points.
|
|
|
|
|
for (int i = 0; i < trackPoints.size() - 1; i++) {
|
|
|
|
|
|
|
|
|
|
//Convert the GPSCoordinate to a screen coordinate.
|
|
|
|
|
GraphCoordinate scaledCoordinate = this.map.convertGPS(point.getCoordinate());
|
|
|
|
|
GraphCoordinate scaledCoordinate1 = this.map.convertGPS(trackPoints.get(i).getCoordinate());
|
|
|
|
|
GraphCoordinate scaledCoordinate2 = this.map.convertGPS(trackPoints.get(i + 1).getCoordinate());
|
|
|
|
|
|
|
|
|
|
double alpha = trackPoints.get(i).getAlpha();
|
|
|
|
|
Paint fadedPaint = new Color(
|
|
|
|
|
boat.getColor().getRed(),
|
|
|
|
|
boat.getColor().getGreen(),
|
|
|
|
|
boat.getColor().getBlue(),
|
|
|
|
|
alpha );
|
|
|
|
|
|
|
|
|
|
xPoints[index] = ((double)scaledCoordinate.getX());
|
|
|
|
|
yPoints[index] = ((double)scaledCoordinate.getY());
|
|
|
|
|
//Apply the faded boat color.
|
|
|
|
|
gc.setFill(fadedPaint);
|
|
|
|
|
gc.setStroke(fadedPaint);
|
|
|
|
|
|
|
|
|
|
index++;
|
|
|
|
|
gc.strokeLine(
|
|
|
|
|
scaledCoordinate1.getX(),
|
|
|
|
|
scaledCoordinate1.getY(),
|
|
|
|
|
scaledCoordinate2.getX(),
|
|
|
|
|
scaledCoordinate2.getY() );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gc.strokePolyline(xPoints, yPoints, xPoints.length);
|
|
|
|
|
|
|
|
|
|
gc.restore();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|