Removed unused classes and imports
- Removed references to Constants class from other classes and tests - ArrowController, Constants, Regatta removed - Removed imports from various classes no longer used #story[1003]
This commit is contained in:
@@ -13,7 +13,6 @@ import javax.xml.transform.*;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.StringReader;
|
||||
import java.io.StringWriter;
|
||||
|
||||
|
||||
@@ -2,12 +2,10 @@ package seng302.Model;
|
||||
|
||||
import javafx.util.Pair;
|
||||
import org.geotools.referencing.GeodeticCalculator;
|
||||
import org.opengis.geometry.DirectPosition;
|
||||
import seng302.Constants;
|
||||
|
||||
import java.awt.geom.Point2D;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,7 +6,6 @@ import javafx.collections.ObservableList;
|
||||
import seng302.Constants;
|
||||
import seng302.DataInput.RaceDataSource;
|
||||
import seng302.MockOutput;
|
||||
import seng302.Networking.Messages.BoatLocation;
|
||||
import seng302.Networking.Messages.BoatStatus;
|
||||
import seng302.Networking.Messages.Enums.BoatStatusEnum;
|
||||
import seng302.Networking.Messages.Enums.RaceStatusEnum;
|
||||
|
||||
@@ -5,8 +5,6 @@ import org.testng.annotations.Test;
|
||||
import seng302.Exceptions.InvalidPolarFileException;
|
||||
import seng302.Model.Polars;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static org.testng.Assert.*;
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,7 +20,6 @@ import java.util.ArrayList;
|
||||
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.mockito.Matchers.*;
|
||||
import static org.mockito.Mockito.*;
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,9 +2,6 @@ package seng302.Networking.MessageDecoders;
|
||||
|
||||
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
import static seng302.Networking.Utils.ByteConverter.*;
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
package seng302.Networking.MessageDecoders;
|
||||
|
||||
import org.xml.sax.InputSource;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.StringReader;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Arrays;
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package seng302.Networking.MessageEncoders;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
import java.util.Arrays;
|
||||
|
||||
import static seng302.Networking.Utils.ByteConverter.intToBytes;
|
||||
import static seng302.Networking.Utils.ByteConverter.longToBytes;
|
||||
|
||||
@@ -4,9 +4,8 @@ package seng302.Networking.Messages;
|
||||
* Created by f123 on 21-Apr-17.
|
||||
*/
|
||||
|
||||
import SharedModel.Constants;
|
||||
import seng302.Networking.Utils.AC35UnitConverter;
|
||||
import seng302.Networking.Messages.Enums.MessageType;
|
||||
import seng302.Networking.Utils.AC35UnitConverter;
|
||||
|
||||
import static seng302.Networking.Utils.AC35UnitConverter.convertGPS;
|
||||
import static seng302.Networking.Utils.AC35UnitConverter.convertGPSToInt;
|
||||
@@ -16,6 +15,9 @@ import static seng302.Networking.Utils.AC35UnitConverter.convertGPSToInt;
|
||||
*/
|
||||
public class BoatLocation extends AC35Data {
|
||||
|
||||
//Knots x this = meters per second.
|
||||
public static final double KnotsToMetersPerSecondConversionFactor =
|
||||
0.514444;
|
||||
public static final byte Unknown = 0;
|
||||
public static final byte RacingYacht = 1;
|
||||
public static final byte CommitteeBoat = 2;
|
||||
@@ -266,7 +268,7 @@ public class BoatLocation extends AC35Data {
|
||||
*/
|
||||
public static int convertBoatSpeedDoubleToInt(double speed) {
|
||||
//Calculate meters per second.
|
||||
double metersPerSecond = speed * Constants.KnotsToMetersPerSecondConversionFactor;
|
||||
double metersPerSecond = speed * KnotsToMetersPerSecondConversionFactor;
|
||||
|
||||
//Calculate millimeters per second.
|
||||
double millimetersPerSecond = metersPerSecond * 1000.0;
|
||||
@@ -288,7 +290,7 @@ public class BoatLocation extends AC35Data {
|
||||
double metersPerSecond = speed / 1000.0;
|
||||
|
||||
//Calculate knots.
|
||||
double knots = metersPerSecond / Constants.KnotsToMetersPerSecondConversionFactor;
|
||||
double knots = metersPerSecond / KnotsToMetersPerSecondConversionFactor;
|
||||
|
||||
return knots;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package seng302.Networking.Messages;
|
||||
import seng302.Networking.Messages.Enums.MessageType;
|
||||
import seng302.Networking.Utils.AC35UnitConverter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,8 +13,6 @@ import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.zip.CRC32;
|
||||
import java.util.zip.Checksum;
|
||||
|
||||
/**
|
||||
* Created by fwy13 on 25/04/17.
|
||||
|
||||
@@ -4,9 +4,7 @@ import org.junit.Test;
|
||||
import seng302.Networking.Utils.ByteConverter;
|
||||
|
||||
import java.nio.ByteOrder;
|
||||
import java.util.Arrays;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ import seng302.Networking.MessageEncoders.XMLMessageEncoder;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
|
||||
/**
|
||||
* Created by hba56 on 20/04/17.
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
package SharedModel;
|
||||
|
||||
/**
|
||||
* Constants that are used throughout the program
|
||||
* Created by Erika on 19-Mar-17.
|
||||
*/
|
||||
public class Constants {
|
||||
//Knots x this = meters per second.
|
||||
public static final double KnotsToMetersPerSecondConversionFactor = 0.514444;
|
||||
|
||||
public static final double wakeScale = 10;
|
||||
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
package SharedModel;
|
||||
|
||||
/**
|
||||
* Created by jjg64 on 19/04/17.
|
||||
*/
|
||||
public class Regatta {
|
||||
int regattaID;
|
||||
String RegattaName;
|
||||
int raceID = 0;
|
||||
String courseName;
|
||||
double centralLatitude;
|
||||
double centralLongitude;
|
||||
double centralAltitude;
|
||||
float utcOffset;
|
||||
float magneticVariation;
|
||||
|
||||
public Regatta(int regattaID, String regattaName, String courseName, double centralLatitude, double centralLongitude, double centralAltitude, float utcOffset, float magneticVariation) {
|
||||
this.regattaID = regattaID;
|
||||
this.RegattaName = regattaName;
|
||||
this.courseName = courseName;
|
||||
this.centralLatitude = centralLatitude;
|
||||
this.centralLongitude = centralLongitude;
|
||||
this.centralAltitude = centralAltitude;
|
||||
this.utcOffset = utcOffset;
|
||||
this.magneticVariation = magneticVariation;
|
||||
}
|
||||
|
||||
public int getRegattaID() {
|
||||
return regattaID;
|
||||
}
|
||||
|
||||
public void setRegattaID(int ID) {
|
||||
this.regattaID = ID;
|
||||
}
|
||||
|
||||
public String getRegattaName() {
|
||||
return RegattaName;
|
||||
}
|
||||
|
||||
public void setRegattaName(String regattaName) {
|
||||
RegattaName = regattaName;
|
||||
}
|
||||
|
||||
public int getRaceID() {
|
||||
return raceID;
|
||||
}
|
||||
|
||||
public void setRaceID(int raceID) {
|
||||
this.raceID = raceID;
|
||||
}
|
||||
|
||||
public String getCourseName() {
|
||||
return courseName;
|
||||
}
|
||||
|
||||
public void setCourseName(String courseName) {
|
||||
this.courseName = courseName;
|
||||
}
|
||||
|
||||
public double getCentralLatitude() {
|
||||
return centralLatitude;
|
||||
}
|
||||
|
||||
public void setCentralLatitude(double centralLatitude) {
|
||||
this.centralLatitude = centralLatitude;
|
||||
}
|
||||
|
||||
public double getCentralLongitude() {
|
||||
return centralLongitude;
|
||||
}
|
||||
|
||||
public void setCentralLongitude(double centralLongitude) {
|
||||
this.centralLongitude = centralLongitude;
|
||||
}
|
||||
|
||||
public double getCentralAltitude() {
|
||||
return centralAltitude;
|
||||
}
|
||||
|
||||
public void setCentralAltitude(double centralAltitude) {
|
||||
this.centralAltitude = centralAltitude;
|
||||
}
|
||||
|
||||
public float getUtcOffset() {
|
||||
return utcOffset;
|
||||
}
|
||||
|
||||
public void setUtcOffset(float utcOffset) {
|
||||
this.utcOffset = utcOffset;
|
||||
}
|
||||
|
||||
public float getMagneticVariation() {
|
||||
return magneticVariation;
|
||||
}
|
||||
|
||||
public void setMagneticVariation(float magneticVariation) {
|
||||
this.magneticVariation = magneticVariation;
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package seng302.Controllers;
|
||||
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.layout.Pane;
|
||||
|
||||
import java.net.URL;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
/**
|
||||
* Created by Joseph on 22/05/2017.
|
||||
*/
|
||||
public class ArrowController extends Controller {
|
||||
|
||||
@Override
|
||||
public void initialize(URL location, ResourceBundle resources) {
|
||||
}
|
||||
}
|
||||
@@ -66,8 +66,6 @@ public class RaceController extends Controller {
|
||||
* @param race Race to listen to.
|
||||
*/
|
||||
public void setInfoTable(StreamedRace race) {
|
||||
//boatInfoTable.getItems().clear();
|
||||
ObservableList<Boat> startingBoats = race.getStartingBoats();
|
||||
boatInfoTable.setItems(race.getStartingBoats());
|
||||
boatTeamColumn.setCellValueFactory(cellData -> cellData.getValue().getName());
|
||||
boatSpeedColumn.setCellValueFactory(cellData -> cellData.getValue().getVelocityProp());
|
||||
@@ -155,7 +153,7 @@ public class RaceController extends Controller {
|
||||
initializeFPS();
|
||||
|
||||
// set up annotation displays
|
||||
Annotations annotations = new Annotations(annotationPane, raceMap);
|
||||
new Annotations(annotationPane, raceMap);
|
||||
|
||||
new Thread((newRace)).start();
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ import java.nio.ByteBuffer;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ArrayBlockingQueue;
|
||||
|
||||
import static seng302.Networking.Utils.ByteConverter.bytesToShort;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user