Refactored Boat class to better fit the MVC model by moving all GUI parts to BoatPolygon. Changed the way animation works so that it will work with a constantly updated set of lats and lons.

TODO - Change Mark class to no longer store XY pixel data.
TODO - Add in a timer force updates boat position if a packet has not been recieved for a while.

#story30b #story30c #implement #refactor
This commit is contained in:
Calum
2017-04-24 23:06:30 +12:00
parent b5129c5c80
commit 46037b5aea
8 changed files with 392 additions and 234 deletions
@@ -2,10 +2,7 @@ package seng302.controllers;
import javafx.animation.Animation;
import javafx.animation.KeyFrame;
import javafx.animation.KeyValue;
import javafx.animation.Timeline;
import javafx.beans.property.DoubleProperty;
import javafx.beans.property.SimpleDoubleProperty;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.fxml.FXML;
@@ -65,15 +62,15 @@ public class RaceViewController {
// }
includedCanvasController.setup(this);
includedCanvasController.setUpBoats();
initializeTimer();
includedCanvasController.initializeCanvas();
//initializeTimer();
initializeSettings();
//set wind direction!!!!!!! can't find another place to put my code --haoming
double windDirection = new ConfigParser("/config/config.xml").getWindDirection();
windDirectionText.setText(String.format("%.1f°", windDirection));
windArrowText.setRotate(windDirection);
includedCanvasController.timer.start();
}
private void initializeSettings(){