Implemented display a gate as a line
-method created to add a line to canvas -added points for mark, north gate, and south gate #story [12]
This commit is contained in:
@@ -29,6 +29,14 @@ public class RaceController extends Controller{
|
||||
gc.fillOval(coordinate.getX(), coordinate.getY(), 15, 15);
|
||||
}
|
||||
|
||||
public void displayLine(Coordinate coordinateA, Coordinate coordinateB, Paint paint){
|
||||
gc.setStroke(paint);
|
||||
gc.setFill(paint);
|
||||
gc.fillOval(coordinateA.getX(), coordinateA.getY(), 6, 6);
|
||||
gc.fillOval(coordinateB.getX(), coordinateB.getY(), 6, 6);
|
||||
gc.strokeLine(coordinateA.getX(), coordinateA.getY(), coordinateB.getX(), coordinateB.getY());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void initialize(URL location, ResourceBundle resources) {
|
||||
@@ -36,7 +44,15 @@ public class RaceController extends Controller{
|
||||
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());
|
||||
//System.out.println(boat1coord.getX() + " " + boat1coord.getY());
|
||||
Coordinate markCoord = this.map.convertGPS(32.293039, -64.843983);
|
||||
Coordinate southGate1 = this.map.convertGPS(32.284680, -64.850045);
|
||||
Coordinate southGate2 = this.map.convertGPS(32.280164, -64.847591);
|
||||
Coordinate northGate1 = this.map.convertGPS(32.309693, -64.835249);
|
||||
Coordinate northGate2 = this.map.convertGPS(32.308046, -64.831785);
|
||||
displayBoat(boat1coord, Color.AQUAMARINE);
|
||||
displayBoat(markCoord, Color.GOLD);
|
||||
displayLine(southGate1, southGate2, Color.DARKCYAN);
|
||||
displayLine(northGate1, northGate2, Color.DARKVIOLET);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user