Merge branch 'master' into submission
# Conflicts: # mock/src/main/java/seng302/Model/Race.java # mock/src/test/java/seng302/Model/RaceTest.java # visualiser/src/main/java/seng302/Model/ResizableRaceCanvas.java
This commit is contained in:
@@ -4,10 +4,10 @@ package seng302.Model;
|
||||
import eu.hansolo.medusa.Gauge;
|
||||
import eu.hansolo.medusa.GaugeBuilder;
|
||||
import javafx.scene.layout.Pane;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.scene.paint.Color;
|
||||
import javafx.scene.paint.Paint;
|
||||
import javafx.scene.transform.Rotate;
|
||||
import seng302.GPSCoordinate;
|
||||
import seng302.GraphCoordinate;
|
||||
import seng302.Mock.StreamedCourse;
|
||||
import seng302.RaceDataSource;
|
||||
@@ -25,6 +25,7 @@ import java.util.List;
|
||||
public class ResizableRaceCanvas extends ResizableCanvas {
|
||||
private RaceMap map;
|
||||
private List<Boat> boats;
|
||||
private List<Marker> boatMarkers;
|
||||
private boolean raceAnno = true;
|
||||
private boolean annoName = true;
|
||||
private boolean annoAbbrev = true;
|
||||
@@ -32,7 +33,6 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
||||
private boolean annoPath = true;
|
||||
private List<Color> colours;
|
||||
private final List<Marker> markers;
|
||||
double[] xpoints = {}, ypoints = {};
|
||||
private final RaceDataSource raceData;
|
||||
private Gauge arrow;
|
||||
|
||||
@@ -60,6 +60,16 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
||||
this.boats = boats;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the boat markers that are to be displayed in this race.
|
||||
*
|
||||
* @param boatMarkers in race
|
||||
*/
|
||||
public void setBoatMarkers(ObservableList<Marker> boatMarkers) {
|
||||
this.boatMarkers = boatMarkers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the RaceMap that the RaceCanvas is to be displaying for.
|
||||
*
|
||||
@@ -69,22 +79,6 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
||||
this.map = map;
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the mark of a race as a circle.
|
||||
*
|
||||
* @param graphCoordinate Latitude and Longitude in GraphCoordinate that it
|
||||
* is to be displayed as.
|
||||
* @param paint Colour the mark is to be coloured.
|
||||
* @see GraphCoordinate
|
||||
* @see Color
|
||||
* @see Paint
|
||||
*/
|
||||
public void displayMark(GraphCoordinate graphCoordinate, Paint paint) {
|
||||
double d = 25;
|
||||
this.gc.setFill(paint);
|
||||
gc.fillOval(graphCoordinate.getX() - (d / 2), graphCoordinate.getY() - (d / 2), d, d);
|
||||
}
|
||||
|
||||
private void displayBoat(Boat boat, double angle, Color colour) {
|
||||
if (boat.getCurrentPosition() != null) {
|
||||
GraphCoordinate pos = this.map.convertGPS(boat.getCurrentPosition());
|
||||
@@ -257,19 +251,6 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws a boat at a certain GPSCoordinate
|
||||
*
|
||||
* @param colour Colour to colour boat.
|
||||
* @param gpsCoordinates GPScoordinate that the boat is to be drawn at.
|
||||
* @see GPSCoordinate
|
||||
* @see Color
|
||||
*/
|
||||
public void drawBoat(Color colour, GPSCoordinate gpsCoordinates) {
|
||||
GraphCoordinate graphCoordinate = this.map.convertGPS(gpsCoordinates);
|
||||
displayPoint(graphCoordinate, colour);
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle the raceAnno value
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user