From 5108c0eaf59ffec5bd4b94767fb532ed2386d534 Mon Sep 17 00:00:00 2001 From: Fan-Wu Yang Date: Wed, 15 Mar 2017 12:33:56 +1300 Subject: [PATCH] Implemented Finish Line to show - shows a dark red line with 2 thickness - shows two rectangles at the ends of each line #story [11] --- src/main/java/seng302/Controllers/RaceController.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/seng302/Controllers/RaceController.java b/src/main/java/seng302/Controllers/RaceController.java index ec31731b..94899e37 100644 --- a/src/main/java/seng302/Controllers/RaceController.java +++ b/src/main/java/seng302/Controllers/RaceController.java @@ -30,13 +30,21 @@ public class RaceController extends Controller{ } + @Override public void initialize(URL location, ResourceBundle resources) { this.gc = raceMap.getGraphicsContext2D(); this.map = new RaceMap(32.321989, -64.866142, 32.273089, -64.814987, (int)raceMap.getWidth(), (int)raceMap.getHeight()); Coordinate boat1coord = this.map.convertGPS(32.296577, -64.854304); - System.out.println(boat1coord.getX() + " " + boat1coord.getY()); displayBoat(boat1coord, Color.AQUAMARINE); + + gc.setStroke(Color.DARKRED); + gc.setLineWidth(2); + Coordinate finishLineCoord1 = this.map.convertGPS(32.317379, -64.839291); + Coordinate finishLineCoord2 = this.map.convertGPS(32.317257, -64.836260); + gc.strokeLine(finishLineCoord1.getX(), finishLineCoord1.getY(), finishLineCoord2.getX(), finishLineCoord2.getY()); + gc.strokeRect(finishLineCoord1.getX() - 1, finishLineCoord1.getY() - 1, 3, 3); + gc.strokeRect(finishLineCoord2.getX() - 1, finishLineCoord2.getY() - 1, 3, 3); } }