Merge branch 'master' of https://eng-git.canterbury.ac.nz/seng302-2017/team-7
This commit is contained in:
@@ -19,7 +19,7 @@ public class App extends Application {
|
||||
/**
|
||||
* Entry point for running the programme
|
||||
*
|
||||
* @param args
|
||||
* @param args for starting the programme
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
@@ -28,8 +28,8 @@ public class App extends Application {
|
||||
/**
|
||||
* Loads and sets up the GUI elements
|
||||
*
|
||||
* @param primaryStage
|
||||
* @throws Exception
|
||||
* @param primaryStage Base for all scenes
|
||||
* @throws Exception Error in initialising programme
|
||||
*/
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws Exception {
|
||||
@@ -58,8 +58,8 @@ public class App extends Application {
|
||||
/**
|
||||
* Loads panes for use in the GUI
|
||||
*
|
||||
* @param fxmlName
|
||||
* @throws Exception
|
||||
* @param fxmlName name of resource fxml file
|
||||
* @throws Exception critical error in loading file
|
||||
*/
|
||||
public void loadPane(String fxmlName) throws Exception {
|
||||
FXMLLoader loader = new FXMLLoader();
|
||||
|
||||
@@ -16,7 +16,7 @@ public abstract class Controller implements Initializable {
|
||||
/**
|
||||
* Sets the parent of the application
|
||||
*
|
||||
* @param parent
|
||||
* @param parent controller
|
||||
*/
|
||||
public void setParent(App parent) {
|
||||
this.parent = parent;
|
||||
@@ -25,8 +25,8 @@ public abstract class Controller implements Initializable {
|
||||
/**
|
||||
* Sets the loads a pane into the parent.
|
||||
*
|
||||
* @param fxmlName
|
||||
* @throws Exception
|
||||
* @param fxmlName fxml resource file to be loaded
|
||||
* @throws Exception error in loading file
|
||||
*/
|
||||
public void loadPane(String fxmlName) throws Exception {
|
||||
this.parent.loadPane(fxmlName);
|
||||
@@ -35,8 +35,8 @@ public abstract class Controller implements Initializable {
|
||||
/**
|
||||
* Initialisation class that is run on start up.
|
||||
*
|
||||
* @param location
|
||||
* @param resources
|
||||
* @param location resources location
|
||||
* @param resources resources bundle
|
||||
*/
|
||||
@Override
|
||||
public abstract void initialize(URL location, ResourceBundle resources);
|
||||
|
||||
@@ -11,8 +11,8 @@ public class MainController extends Controller {
|
||||
/**
|
||||
* Main Controller for the applications will house the menu and the displayed pane.
|
||||
*
|
||||
* @param location
|
||||
* @param resources
|
||||
* @param location of resources
|
||||
* @param resources bundle
|
||||
*/
|
||||
@Override
|
||||
public void initialize(URL location, ResourceBundle resources) {
|
||||
|
||||
@@ -18,6 +18,7 @@ public class Boat {
|
||||
*
|
||||
* @param name Name of the Boat.
|
||||
* @param velocity Speed in m/s that the boat travels at.
|
||||
* @param abbrev nam abbreviation
|
||||
*/
|
||||
public Boat(String name, double velocity, String abbrev) {
|
||||
this.velocity = velocity;
|
||||
@@ -36,7 +37,7 @@ public class Boat {
|
||||
/**
|
||||
* Sets the boat name
|
||||
*
|
||||
* @param name
|
||||
* @param name of boat
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name.setValue(name);
|
||||
|
||||
@@ -33,6 +33,7 @@ public class BoatInRace extends Boat {
|
||||
* @param name Name of the boat.
|
||||
* @param velocity Speed that the boat travels.
|
||||
* @param colour Colour the boat will be displayed as on the map
|
||||
* @param abbrev of boat
|
||||
*/
|
||||
public BoatInRace(String name, double velocity, Color colour, String abbrev) {
|
||||
super(name, velocity, abbrev);
|
||||
@@ -112,7 +113,7 @@ public class BoatInRace extends Boat {
|
||||
/**
|
||||
* Sets the boat's scaled velocity
|
||||
*
|
||||
* @param velocity
|
||||
* @param velocity of boat
|
||||
*/
|
||||
public void setScaledVelocity(double velocity) {
|
||||
this.scaledVelocity = velocity;
|
||||
@@ -225,7 +226,7 @@ public class BoatInRace extends Boat {
|
||||
/**
|
||||
* Sets whether boat is finished or not
|
||||
*
|
||||
* @param bool
|
||||
* @param bool is finished value
|
||||
*/
|
||||
public void setFinished(boolean bool) {
|
||||
this.finished = bool;
|
||||
|
||||
@@ -16,10 +16,10 @@ public class ConstantVelocityRace extends Race {
|
||||
/**
|
||||
* Initialiser for a constant velocity race
|
||||
*
|
||||
* @param startingBoats
|
||||
* @param legs
|
||||
* @param controller
|
||||
* @param scaleFactor
|
||||
* @param startingBoats in race
|
||||
* @param legs in race
|
||||
* @param controller of race
|
||||
* @param scaleFactor of race
|
||||
*/
|
||||
public ConstantVelocityRace(BoatInRace[] startingBoats, ArrayList<Leg> legs, RaceController controller, int scaleFactor) {
|
||||
super(startingBoats, legs, controller, scaleFactor);
|
||||
@@ -29,8 +29,8 @@ public class ConstantVelocityRace extends Race {
|
||||
/**
|
||||
* Calculates the distance a boat has travelled and updates its current position according to this value.
|
||||
*
|
||||
* @param boat
|
||||
* @param millisecondsElapsed
|
||||
* @param boat to be updated
|
||||
* @param millisecondsElapsed since last update
|
||||
*/
|
||||
protected void updatePosition(BoatInRace boat, int millisecondsElapsed) {
|
||||
|
||||
|
||||
@@ -18,6 +18,9 @@ public class Leg {
|
||||
* Leg Initialiser
|
||||
*
|
||||
* @param name Name of the Leg
|
||||
* @param start marker
|
||||
* @param end marker
|
||||
* @param number Leg's position in race
|
||||
*/
|
||||
public Leg(String name, Marker start, Marker end, int number) {
|
||||
this.name = name;
|
||||
@@ -31,6 +34,7 @@ public class Leg {
|
||||
* Construction Method
|
||||
*
|
||||
* @param name Name of the Leg
|
||||
* @param number leg number
|
||||
*/
|
||||
public Leg(String name, int number) {
|
||||
this.name = name;
|
||||
@@ -86,8 +90,6 @@ public class Leg {
|
||||
|
||||
/**
|
||||
* Calculates the distance that the legs are in nautical miles (1.852 km).
|
||||
*
|
||||
* @return Returns the leg distance.
|
||||
*/
|
||||
public void calculateDistance() {
|
||||
|
||||
|
||||
@@ -39,6 +39,8 @@ public abstract class Race implements Runnable {
|
||||
*
|
||||
* @param boats Takes in an array of boats that are participating in the race.
|
||||
* @param legs Number of marks in order that the boats pass in order to complete the race.
|
||||
* @param controller race controller
|
||||
* @param scaleFactor for race
|
||||
*/
|
||||
public Race(BoatInRace[] boats, ArrayList<Leg> legs, RaceController controller, int scaleFactor) {
|
||||
|
||||
@@ -288,8 +290,8 @@ public abstract class Race implements Runnable {
|
||||
/**
|
||||
* Updates the boat's gps coordinates depending on time elapsed
|
||||
*
|
||||
* @param boat
|
||||
* @param millisecondsElapsed
|
||||
* @param boat to be updated
|
||||
* @param millisecondsElapsed time since last update
|
||||
*/
|
||||
protected abstract void updatePosition(BoatInRace boat, int millisecondsElapsed);
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public class ResizableRaceCanvas extends Canvas {
|
||||
/**
|
||||
* Sets the boats that are to be displayed in this race.
|
||||
*
|
||||
* @param boats
|
||||
* @param boats in race
|
||||
*/
|
||||
public void setBoats(BoatInRace[] boats) {
|
||||
this.boats = boats;
|
||||
@@ -66,7 +66,7 @@ public class ResizableRaceCanvas extends Canvas {
|
||||
/**
|
||||
* Sets the RaceMap that the RaceCanvas is to be displaying for.
|
||||
*
|
||||
* @param map
|
||||
* @param map race map
|
||||
*/
|
||||
public void setMap(RaceMap map) {
|
||||
this.map = map;
|
||||
@@ -373,7 +373,7 @@ public class ResizableRaceCanvas extends Canvas {
|
||||
/**
|
||||
* Returns the preferred width of the Canvas
|
||||
*
|
||||
* @param width
|
||||
* @param width of canvas
|
||||
* @return Returns the width of the Canvas
|
||||
*/
|
||||
@Override
|
||||
@@ -384,7 +384,7 @@ public class ResizableRaceCanvas extends Canvas {
|
||||
/**
|
||||
* Returns the preferred height of the Canvas
|
||||
*
|
||||
* @param height
|
||||
* @param height of canvas
|
||||
* @return Returns the height of the Canvas
|
||||
*/
|
||||
@Override
|
||||
|
||||
@@ -27,9 +27,9 @@ public class RaceXMLReader extends XMLReader {
|
||||
/**
|
||||
* Constractor for Race XML
|
||||
* @param filePath path of the file
|
||||
* @throws IOException
|
||||
* @throws SAXException
|
||||
* @throws ParserConfigurationException
|
||||
* @throws IOException error
|
||||
* @throws SAXException error
|
||||
* @throws ParserConfigurationException error
|
||||
*/
|
||||
public RaceXMLReader(String filePath) throws IOException, SAXException, ParserConfigurationException {
|
||||
this(filePath, true);
|
||||
@@ -39,9 +39,9 @@ public class RaceXMLReader extends XMLReader {
|
||||
* COnstructor for Race XML
|
||||
* @param filePath file path to read
|
||||
* @param read whether or not to read and store the files straight away.
|
||||
* @throws IOException
|
||||
* @throws SAXException
|
||||
* @throws ParserConfigurationException
|
||||
* @throws IOException error
|
||||
* @throws SAXException error
|
||||
* @throws ParserConfigurationException error
|
||||
*/
|
||||
public RaceXMLReader(String filePath, boolean read) throws IOException, SAXException, ParserConfigurationException {
|
||||
super(filePath);
|
||||
|
||||
Reference in New Issue
Block a user