Making the course limits change when a new xml packet is received..

#story[889]
This commit is contained in:
Kusal Ekanayake
2017-05-11 15:49:49 +12:00
parent 711f6f4c45
commit 4a75c062ce
4 changed files with 33 additions and 3 deletions
@@ -240,6 +240,17 @@ public class CanvasController {
}
}
}
checkForCourseChanges();
}
private void checkForCourseChanges() {
if (StreamParser.isNewXmlRecieved()){
System.out.println("New Canvas found");
gc.setFill(Color.SKYBLUE);
gc.fillRect(0,0, CANVAS_WIDTH, CANVAS_HEIGHT);
gc.restore();
addRaceBorder();
}
}
private void move(long id, RaceObject raceObject){
@@ -345,6 +356,7 @@ public class CanvasController {
* Calculates x and y location for every marker that fits it to the canvas the race will be drawn on.
*/
private void fitMarksToCanvas() {
StreamParser.isNewXmlRecieved();
findMinMaxPoint();
double minLonToMaxLon = scaleRaceExtremities();
calculateReferencePointLocation(minLonToMaxLon);