Fixed pull merge Errors
This commit is contained in:
Binary file not shown.
@@ -33,20 +33,20 @@ public class App extends Application
|
||||
private VBox mainContainer = null;
|
||||
private Session session = null;
|
||||
private MenuController menuController = null;
|
||||
|
||||
public static void main( String[] args )
|
||||
{
|
||||
launch(args);
|
||||
}
|
||||
|
||||
public static void main( String[] args )
|
||||
{
|
||||
launch(args);
|
||||
}
|
||||
|
||||
public Stage getPrimaryStage() {
|
||||
return primaryStage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts the application
|
||||
* @param primaryStage main "stage" of the program
|
||||
*/
|
||||
* Starts the application
|
||||
* @param primaryStage main "stage" of the program
|
||||
*/
|
||||
@Override
|
||||
public void start(Stage primaryStage) {
|
||||
this.primaryStage = primaryStage;
|
||||
|
||||
@@ -29,6 +29,7 @@ public class Dataset {
|
||||
private LinkedHashMap<Integer, FlightPath> flightPathDictionary;//key path id
|
||||
private LinkedHashMap<String, Country> countryDictionary;//key name
|
||||
private LinkedHashMap<String, City> cityDictionary;//key city name
|
||||
private LinkedHashMap<Integer, FlightPoint> flightPointDictionary;//key point id
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -50,6 +51,7 @@ public class Dataset {
|
||||
this.countryDictionary = new LinkedHashMap<String, Country>();;
|
||||
this.cityDictionary = new LinkedHashMap<String, City>();;
|
||||
this.flightPathDictionary = new LinkedHashMap<Integer, FlightPath>();
|
||||
this.flightPointDictionary = new LinkedHashMap<Integer, FlightPoint>();
|
||||
if (action == getExisting){
|
||||
updateDataset();
|
||||
//after this make connections. ie filling in the country.cities airports.routes etc
|
||||
@@ -670,7 +672,7 @@ public class Dataset {
|
||||
}
|
||||
stmt.close();
|
||||
stmt = c.createStatement();
|
||||
//ADDED
|
||||
|
||||
String firstPt = flightPointsToImport.get(0).getName();
|
||||
String lastPt = flightPointsToImport.get(flightPointsToImport.size() - 1).getName();
|
||||
FlightPath flightPathToAdd = new FlightPath(firstPt, lastPt);
|
||||
@@ -680,7 +682,7 @@ public class Dataset {
|
||||
stmt.execute(insertFlightPathQuery);
|
||||
stmt.close();
|
||||
stmt = c.createStatement();
|
||||
int flightPathId = 0;
|
||||
int flightPathId = 1;
|
||||
String getLastestIndex = "SELECT * FROM `sqlite_sequence` WHERE `name` = \"" + this.name.replace("\"", "\"\"") +
|
||||
"_Flight_Path\" LIMIT 1;";
|
||||
ResultSet lastestIdResult = stmt.executeQuery(getLastestIndex);
|
||||
@@ -691,9 +693,9 @@ public class Dataset {
|
||||
lastestIdResult.close();
|
||||
stmt = c.createStatement();
|
||||
flightPathToAdd.setID(flightPathId);
|
||||
//ADDED
|
||||
|
||||
String insertFlightPointQuery = "INSERT INTO `" + this.name + "_Flight_Points` (`Index_ID`, `Name`, `Type`," +
|
||||
" `Altitude`, `Latitude`, `Longitude`, `Order`) VALUES ";
|
||||
" `Altitude`, `Latitude`, `Longitude`) VALUES ";
|
||||
int numOfFlights = 0;
|
||||
for (int i = 0; i < flightPointsToImport.size(); i ++){
|
||||
String flightPointIdentifier = flightPointsToImport.get(i).getType() + flightPointsToImport.get(i).getName() +
|
||||
@@ -706,17 +708,18 @@ public class Dataset {
|
||||
double flightLatitude = flightPointsToImport.get(i).getLatitude();
|
||||
double flightLongitude = flightPointsToImport.get(i).getLongitude();
|
||||
//insert import into database
|
||||
if (numOfFlights > 0){
|
||||
if (numOfFlights > 0) {
|
||||
insertFlightPointQuery += ",";
|
||||
}
|
||||
insertFlightPointQuery += "(" + flightPathId +", \""+ flightName +"\", \"" + flightType + "\", "+ flightAltitude + ", " +
|
||||
"" + flightLatitude + ", " + flightLongitude + ", "+numOfFlights+")";
|
||||
"" + flightLatitude + ", " + flightLongitude + ")";
|
||||
flightPointsToImport.get(i).setID(nextID);
|
||||
flightPointsToImport.get(i).setIndexID(flightPathId);
|
||||
//add data to dataset array.
|
||||
//this is placed after incase the database messes up
|
||||
flightPathToAdd.addFlightPoint(flightPointsToImport.get(i));
|
||||
//routeDictionary.put(routeIdentifier, flightsToImport.get(i));
|
||||
flightPointDictionary.put(nextID, flightPointsToImport.get(i));
|
||||
nextID++;
|
||||
numOfFlights++;
|
||||
//}
|
||||
@@ -756,7 +759,6 @@ public class Dataset {
|
||||
//create Airline country link
|
||||
for (Airline airline: airlines){
|
||||
airlineByIATA.put(airline.getIATA(), airline);
|
||||
//System.out.println(airline.getAlias());
|
||||
airline.setRoutes(new ArrayList<Route>());
|
||||
airline.setCountry(countryDictionary.get(airline.getCountryName()));
|
||||
Country country = countryDictionary.get(airline.getCountryName());
|
||||
@@ -1226,21 +1228,21 @@ public class Dataset {
|
||||
c = DriverManager.getConnection("jdbc:sqlite:res/userdb.db");
|
||||
|
||||
stmt = c.createStatement();
|
||||
String flightPointIDQuery = "SELECT * FROM `sqlite_sequence` WHERE `name` = \""+this.name.replace("\"", "\"\"")+"_Flight_Points\" LIMIT 1;";
|
||||
ResultSet pointIDRes= stmt.executeQuery(flightPointIDQuery);
|
||||
while (pointIDRes.next()){
|
||||
String flightPointIDQuery = "SELECT * FROM `sqlite_sequence` WHERE `name` = \"" + this.name + "_Flight_Points\" LIMIT 1;";
|
||||
ResultSet pointIDRes = stmt.executeQuery(flightPointIDQuery);
|
||||
while (pointIDRes.next()) {
|
||||
pointID = Integer.parseInt(pointIDRes.getString("seq"));
|
||||
}
|
||||
stmt.close();
|
||||
|
||||
stmt = c.createStatement();
|
||||
String insertFlightPointQuery = "INSERT INTO `" + this.name + "_Flight_Points` (`Index_ID`, `Name`, `Type`," +
|
||||
" `Altitude`, `Latitude`, `Longitude`, `Heading`, `Tot_Dist`, `Leg_Dist`, `Via`, `Order`) VALUES ";
|
||||
" `Altitude`, `Latitude`, `Longitude`, `Heading`, `Tot_Dist`, `Leg_Dist`, `Via`) VALUES ";
|
||||
String flightType = type.replace("\"", "\"\"");
|
||||
String flightName = name.replace("\"", "\"\"");
|
||||
insertFlightPointQuery += "(" + id +", \""+ flightName +"\", \"" + flightType + "\", "+ altitudeVal + ", " +
|
||||
"" + latitudeVal + ", " + longitudeVal + ", " + headingVal + ", " + totalDistVal + ", " + legDistVal +
|
||||
", \"" + via + "\", "+index+")";
|
||||
", \"" + via + "\")";
|
||||
stmt.execute(insertFlightPointQuery);
|
||||
stmt.close();
|
||||
//move all the points after this forward
|
||||
@@ -1368,14 +1370,10 @@ public class Dataset {
|
||||
try {
|
||||
Class.forName("org.sqlite.JDBC");
|
||||
c = DriverManager.getConnection("jdbc:sqlite:res/userdb.db");
|
||||
//System.out.println(airline.getID());
|
||||
String deleteQuery = "DELETE FROM `"+this.name+"_Airline` WHERE `Airline_ID` = " + airline.getID() + ";";
|
||||
String deleteQuery = "DELETE FROM `" + this.name + "_Airline` WHERE `Airline_ID` = " + airline.getID() + ";";
|
||||
stmt = c.createStatement();
|
||||
//System.out.println("Airline deleted");
|
||||
stmt.execute(deleteQuery);
|
||||
//System.out.println("Airline deleted");
|
||||
stmt.close();
|
||||
//System.out.println("Airline deleted");
|
||||
stmt = c.createStatement();
|
||||
//check if number of countries that contain airlines > 0 else delete the country
|
||||
String countCountry = "SELECT COUNT(*) FROM `"+this.name+"_Airline` JOIN `"+this.name+"_Country` ON" +
|
||||
@@ -1603,6 +1601,11 @@ public class Dataset {
|
||||
System.exit(0);
|
||||
}
|
||||
flightPath.getFlightPoints().remove(flightPoint);
|
||||
try {
|
||||
flightPointDictionary.remove(flightPoint.getID());
|
||||
} catch (DataException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1694,6 +1697,15 @@ public class Dataset {
|
||||
return flightPathDictionary;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns a flightpoint dictionary with the flights that are associated with this dataset.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public LinkedHashMap<Integer, FlightPoint> getFlightPointDictionary() {
|
||||
return flightPointDictionary;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns a Country Dictionary with the COuntries that are associated with this dataset.
|
||||
* @return
|
||||
@@ -1742,7 +1754,7 @@ public class Dataset {
|
||||
EntryParser parser = new EntryParser();
|
||||
parser.parseAirline(name, alias, IATA,ICAO, callsign, country, active);
|
||||
airline.setName(name);
|
||||
airline.setAlias(name);
|
||||
airline.setAlias(alias);
|
||||
airline.setIATA(IATA);
|
||||
airline.setICAO(ICAO);
|
||||
airline.setCallSign(callsign);
|
||||
@@ -1754,7 +1766,7 @@ public class Dataset {
|
||||
Class.forName("org.sqlite.JDBC");
|
||||
c = DriverManager.getConnection("jdbc:sqlite:res/userdb.db");
|
||||
stmt = c.createStatement();
|
||||
String query = "UPDATE `"+this.name+"_Airline` SET `Name` = \""+airline.getName().replace("\"", "\"\"")+"\", `Alias` = \""+airline.getActive().replace("\"", "\"\"")+"\", " +
|
||||
String query = "UPDATE `"+this.name+"_Airline` SET `Name` = \""+airline.getName().replace("\"", "\"\"")+"\", `Alias` = \""+airline.getAlias().replace("\"", "\"\"")+"\", " +
|
||||
"`IATA` = \""+airline.getIATA().replace("\"", "\"\"")+"\", `ICAO` = \""+airline.getICAO().replace("\"", "\"\"")+"\" , `Callsign` = \""+airline.getCallSign().replace("\"", "\"\"")+"\", " +
|
||||
"`Country` = \""+airline.getCountryName().replace("\"", "\"\"")+"\", `Active` = \""+airline.getActive().replace("\"", "\"\"")+"\" WHERE `Airline_ID` = "+airline.getID();
|
||||
stmt.execute(query);
|
||||
@@ -1808,10 +1820,18 @@ public class Dataset {
|
||||
EntryParser parser = new EntryParser();
|
||||
Airport newAirport = parser.parseAirport(name, city, country, IATA_FFA, ICAO, lat, lng, alt, timezone, DST, olson);
|
||||
airport.setName(name);
|
||||
airport.setCityName(city);
|
||||
//airport.getCity().setName(city);
|
||||
airport.setCountryName(country);
|
||||
//airport.getCountry().setName(country);
|
||||
airport.setIATA_FFA(IATA_FFA);
|
||||
airport.setICAO(ICAO);
|
||||
airport.setLatitude(newAirport.getLatitude());
|
||||
airport.setLongitude(newAirport.getLongitude());
|
||||
airport.setAltitude(newAirport.getAltitude());
|
||||
airport.getCity().setTimezone(Double.parseDouble(timezone));
|
||||
airport.getCountry().setDST(DST);
|
||||
airport.getCity().setTimeOlson(olson);
|
||||
|
||||
Connection c = null;
|
||||
Statement stmt = null;
|
||||
@@ -1924,10 +1944,10 @@ public class Dataset {
|
||||
Class.forName("org.sqlite.JDBC");
|
||||
c = DriverManager.getConnection("jdbc:sqlite:res/userdb.db");
|
||||
stmt = c.createStatement();
|
||||
String query = "UPDATE `"+this.name+"_Routes` SET `Airline` = \""+route.getAirlineName().replace("\"", "\"\"")+"\", " +
|
||||
"`Source_Airport` = \""+route.getDepartureAirport().replace("\"", "\"\"")+"\", `Destination_Airport` = \""+route.getArrivalAirport().replace("\"", "\"\"")+"\", " +
|
||||
"`Codeshare` = \""+route.getCode().replace("\"", "\"\"")+"\", `Stops` = "+route.getStops()+", `Equipment` = \""+route.getEquipment().replace("\"", "\"\"")+"\" " +
|
||||
"WHERE `Route_ID` = "+route.getID();
|
||||
String query = "UPDATE `" + this.name + "_Routes` SET `Airline` = \"" + route.getAirlineName().replace("\"", "\"\"") + "\", " +
|
||||
"`Source_Airport` = \"" + route.getDepartureAirport().replace("\"", "\"\"") + "\", `Destination_Airport` = \"" + route.getArrivalAirport().replace("\"", "\"\"") + "\", " +
|
||||
"`Codeshare` = \"" + route.getCode().replace("\"", "\"\"") + "\", `Stops` = " + route.getStops() + ", `Equipment` = \"" + route.getEquipment().replace("\"", "\"\"") + "\" " +
|
||||
"WHERE `Route_ID` = " + route.getID();
|
||||
stmt.execute(query);
|
||||
stmt.close();
|
||||
c.close();
|
||||
@@ -1962,14 +1982,14 @@ public class Dataset {
|
||||
* @param longitude
|
||||
* @throws DataException
|
||||
*/
|
||||
public void editFlight(FlightPoint flightPoint, String name, String type, String altitude, String latitude, String longitude) throws DataException{
|
||||
public void editFlight(FlightPoint flightPoint, String name, String type, String altitude, String latitude, String longitude) throws DataException {
|
||||
EntryParser entryParser = new EntryParser();
|
||||
FlightPoint flightPoint1 = entryParser.parsePoint(name, type, altitude, latitude, longitude);
|
||||
flightPoint.setName(flightPoint1.getName());
|
||||
flightPoint.setType(flightPoint1.getType());
|
||||
flightPoint.setAltitude(flightPoint1.getAltitude());
|
||||
flightPoint.setLatitude(flightPoint1.getLatitude());
|
||||
flightPoint.setLongitude(flightPoint1.getLongitude());
|
||||
FlightPoint parsedFlightPoint = entryParser.parsePoint(name, type, altitude, latitude, longitude);
|
||||
flightPoint.setName(parsedFlightPoint.getName());
|
||||
flightPoint.setType(parsedFlightPoint.getType());
|
||||
flightPoint.setAltitude(parsedFlightPoint.getAltitude());
|
||||
flightPoint.setLatitude(parsedFlightPoint.getLatitude());
|
||||
flightPoint.setLongitude(parsedFlightPoint.getLongitude());
|
||||
|
||||
|
||||
Connection c = null;
|
||||
@@ -2003,7 +2023,7 @@ public class Dataset {
|
||||
System.err.println( e.getClass().getName() + ": " + e.getMessage() );
|
||||
}
|
||||
flightPath.setDepartureAirport(flightPoint.getName());
|
||||
}else if (indexOf == flightPath.getFlightPoints().size() - 1){
|
||||
} else if (indexOf == flightPath.getFlightPoints().size() - 1) {
|
||||
try {
|
||||
stmt = c.createStatement();
|
||||
String query = "UPDATE `"+this.name+"_Flight_Path` SET `Destination_Airport` = \""+flightPoint.getName().replace("\"", "\"\"")+"\" " +
|
||||
@@ -2015,7 +2035,7 @@ public class Dataset {
|
||||
}
|
||||
flightPath.setArrivalAirport(flightPoint.getName());
|
||||
}
|
||||
updateFlightPointInfo(flightPath);
|
||||
|
||||
createDataLinks();
|
||||
}
|
||||
|
||||
|
||||
@@ -132,18 +132,26 @@ public class EntryParser {
|
||||
}
|
||||
|
||||
public FlightPoint parsePoint(String name, String type, String altitude, String latitude, String longitude) throws DataException{
|
||||
//(airport) name (first and last point)
|
||||
//name
|
||||
name = name.toUpperCase();
|
||||
if (!isLetter(name)) {
|
||||
throw new DataException("Airport ICAO code must contain only letters");
|
||||
}
|
||||
if (name.length() != 4) {
|
||||
throw new DataException("Aiport ICAO code must be of length four");
|
||||
throw new DataException("ICAO code must contain only letters");
|
||||
}
|
||||
//type
|
||||
type = type.toUpperCase();
|
||||
if (!type.equals("APT") && !type.equals("VOR") && !type.equals("FIX") && !type.equals("NDB") && !type.equals("LATLON")){
|
||||
throw new DataException("Type of flight must be either APT, VOR, FIX, NDB or LATLON");
|
||||
}
|
||||
//altitude
|
||||
double alt;
|
||||
try{
|
||||
alt = Double.parseDouble(altitude);
|
||||
}catch (NumberFormatException e){
|
||||
throw new DataException ("Altitude must be a number");
|
||||
}
|
||||
if (alt < 0 || alt > 50000){
|
||||
throw new DataException("Altitude must be between 0 and 50000ft inclusive.");
|
||||
}
|
||||
//latitude
|
||||
double lat;
|
||||
try{
|
||||
@@ -164,13 +172,7 @@ public class EntryParser {
|
||||
if (lng > 180 || lng < -180){
|
||||
throw new DataException("Longitude must be between -180 and 180 inclusive.");
|
||||
}
|
||||
//altitude
|
||||
double alt;
|
||||
try{
|
||||
alt = Double.parseDouble(altitude);
|
||||
}catch (NumberFormatException e){
|
||||
throw new DataException ("Altitude must be a number");
|
||||
}
|
||||
|
||||
FlightPoint parseSuccess = new FlightPoint(type, name, alt, lat, lng);
|
||||
return parseSuccess;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,9 @@ public enum SceneCode {
|
||||
FLIGHT_RAW_DATA("flight_raw_data.fxml"), AIRPORT_ANALYSER("airport_analyser.fxml"), ROUTE_ANALYSER("route_analyser.fxml"),
|
||||
AIRPORT_DIST_CALC("airport_dist_calc.fxml"), AIRLINE_ADD("airline_add_form.fxml"), AIRLINE_FILTER("airline_filter_form.fxml"),
|
||||
AIRPORT_ADD("airport_add_form.fxml"), AIRPORT_FILTER("airport_filter_form.fxml"), ROUTE_ADD("route_add_form.fxml"),
|
||||
ROUTE_FILTER("route_filter_form.fxml");
|
||||
ROUTE_FILTER("route_filter_form.fxml"), AIRLINE_EDIT("airline_edit_form.fxml"), AIRPORT_EDIT("airport_edit_form.fxml"),
|
||||
ROUTE_EDIT("route_edit_form.fxml"), FLIGHT_EDITOR("flight_editor_form.fxml");
|
||||
|
||||
|
||||
private String filePath;
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@ package seng202.group9.Controller;
|
||||
import javafx.collections.ObservableList;
|
||||
import seng202.group9.Core.Airline;
|
||||
|
||||
import seng202.group9.Core.FlightPoint;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
|
||||
@@ -12,10 +14,18 @@ import java.util.HashMap;
|
||||
*/
|
||||
public class Session implements Serializable {
|
||||
private SceneCode sceneDisplayed;
|
||||
|
||||
private int currentFlightPointID;
|
||||
private int currentFlightPathID;
|
||||
private HashMap<Integer, String> filteredAirlines;
|
||||
private HashMap<Integer, String> filteredAirports;
|
||||
private HashMap<Integer, String> filteredRoutes;
|
||||
|
||||
private String airlineToEdit;
|
||||
private String airportToEdit;
|
||||
private String routeToEdit;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor for a new session
|
||||
*/
|
||||
@@ -71,4 +81,61 @@ public class Session implements Serializable {
|
||||
public HashMap<Integer, String> getFilteredRoutes() {
|
||||
return filteredRoutes;
|
||||
}
|
||||
|
||||
|
||||
public void setAirlineToEdit(String name) {
|
||||
this.airlineToEdit = name;
|
||||
}
|
||||
|
||||
public String getAirlineToEdit() {
|
||||
return airlineToEdit;
|
||||
}
|
||||
|
||||
public String getAirportToEdit() {
|
||||
return airportToEdit;
|
||||
}
|
||||
|
||||
public void setAirportToEdit(String airport) {
|
||||
this.airportToEdit = airport;
|
||||
}
|
||||
|
||||
public String getRouteToEdit() {
|
||||
return routeToEdit;
|
||||
}
|
||||
|
||||
public void setRouteToEdit(String route) {
|
||||
this.routeToEdit = route;
|
||||
}
|
||||
|
||||
/**
|
||||
* sets the current flight point
|
||||
* @param currentFlightPointID
|
||||
*/
|
||||
public void setCurrentFlightPointID(int currentFlightPointID) {
|
||||
this.currentFlightPointID = currentFlightPointID;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the current flight point
|
||||
* @return
|
||||
*/
|
||||
public int getCurrentFlightPointID() {
|
||||
return currentFlightPointID;
|
||||
}
|
||||
/**
|
||||
* sets the current flight point
|
||||
* @param currentFlightPathID
|
||||
*/
|
||||
public void setCurrentFlightPathtID(int currentFlightPathID) {
|
||||
this.currentFlightPathID = currentFlightPathID;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the current flight point
|
||||
* @return
|
||||
*/
|
||||
public int getCurrentFlightPathID() {
|
||||
return currentFlightPathID;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -216,4 +216,4 @@ public class FlightPath {
|
||||
flightPoints.get(i).setHeading((int)heading);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package seng202.group9.GUI;
|
||||
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.Alert;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.stage.Stage;
|
||||
import seng202.group9.Controller.DataException;
|
||||
import seng202.group9.Controller.Dataset;
|
||||
import seng202.group9.Controller.EntryParser;
|
||||
import seng202.group9.Controller.Session;
|
||||
import seng202.group9.Core.Airline;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* Created by Sunguin on 2016/09/24.
|
||||
*/
|
||||
public class AirlineEditController extends Controller {
|
||||
//Setting up text fields for editing data
|
||||
@FXML
|
||||
private TextField airlNameEdit;
|
||||
@FXML
|
||||
private TextField airlAliasEdit;
|
||||
@FXML
|
||||
private TextField airlIATAEdit;
|
||||
@FXML
|
||||
private TextField airlICAOEdit;
|
||||
@FXML
|
||||
private TextField airlCallsignEdit;
|
||||
@FXML
|
||||
private TextField airlCountryEdit;
|
||||
@FXML
|
||||
private TextField airlActiveEdit;
|
||||
@FXML
|
||||
private Button applyButton;
|
||||
|
||||
private Dataset theDataSet = null;
|
||||
private Session currentSession = null;
|
||||
|
||||
private Airline toEdit = null;
|
||||
|
||||
public void editAirline() {
|
||||
try {
|
||||
EntryParser parser = new EntryParser();
|
||||
parser.parseAirline(airlNameEdit.getText(), airlAliasEdit.getText(), airlIATAEdit.getText(),
|
||||
airlICAOEdit.getText(), airlCallsignEdit.getText(), airlCountryEdit.getText(), airlActiveEdit.getText());
|
||||
theDataSet.editAirline(toEdit, airlNameEdit.getText(), airlAliasEdit.getText(), airlIATAEdit.getText(),
|
||||
airlICAOEdit.getText(), airlCallsignEdit.getText(), airlCountryEdit.getText(), airlActiveEdit.getText());
|
||||
|
||||
Alert alert = new Alert(Alert.AlertType.INFORMATION);
|
||||
alert.setTitle("Airline Edit Successful");
|
||||
alert.setHeaderText("Airline data edited!");
|
||||
alert.setContentText("Your airline data has been successfully edited.");
|
||||
alert.showAndWait();
|
||||
|
||||
Stage stage = (Stage) applyButton.getScene().getWindow();
|
||||
stage.close();
|
||||
} catch (DataException e) {
|
||||
System.err.println("RIP Harambe: " + e.getMessage() + "IT WAS TOO SOON");
|
||||
}
|
||||
}
|
||||
|
||||
public void load() {
|
||||
theDataSet = getParent().getCurrentDataset();
|
||||
currentSession = getParent().getSession();
|
||||
|
||||
toEdit = theDataSet.getAirlineDictionary().get(currentSession.getAirlineToEdit());
|
||||
|
||||
airlNameEdit.setText(toEdit.getName());
|
||||
airlAliasEdit.setText(toEdit.getAlias());
|
||||
airlIATAEdit.setText(toEdit.getIATA());
|
||||
airlICAOEdit.setText(toEdit.getICAO());
|
||||
airlCallsignEdit.setText(toEdit.getCallSign());
|
||||
airlCountryEdit.setText(toEdit.getCountryName());
|
||||
airlActiveEdit.setText(toEdit.getActive());
|
||||
}
|
||||
}
|
||||
@@ -81,14 +81,17 @@ public class AirlineRDController extends Controller {
|
||||
*/
|
||||
public void openFilter() {
|
||||
createPopUpStage(SceneCode.AIRLINE_FILTER, 600, 370);
|
||||
ArrayList<Airline> d = new ArrayList();
|
||||
for(int i = 0; i < theDataSet.getAirlines().size(); i++) {
|
||||
if (currentSession.getFilteredAirlines().containsValue(theDataSet.getAirlines().get(i).getName())
|
||||
&& currentSession.getFilteredAirlines().containsKey(i)) {
|
||||
d.add(theDataSet.getAirlines().get(i));
|
||||
|
||||
if (currentSession.getFilteredAirlines() != null) {
|
||||
ArrayList<Airline> d = new ArrayList();
|
||||
for (int i = 0; i < theDataSet.getAirlines().size(); i++) {
|
||||
if (currentSession.getFilteredAirlines().containsValue(theDataSet.getAirlines().get(i).getName())
|
||||
&& currentSession.getFilteredAirlines().containsKey(i)) {
|
||||
d.add(theDataSet.getAirlines().get(i));
|
||||
}
|
||||
}
|
||||
tableViewAirlineRD.setItems(FXCollections.observableArrayList(d));
|
||||
}
|
||||
tableViewAirlineRD.setItems(FXCollections.observableArrayList(d));
|
||||
}
|
||||
|
||||
|
||||
@@ -104,7 +107,6 @@ public class AirlineRDController extends Controller {
|
||||
alert.setTitle("Airline Delete Confirmation");
|
||||
alert.setHeaderText("You are about to delete some data.");
|
||||
alert.setContentText("Are you sure you want to delete the selected airline(s)?");
|
||||
//alert.showAndWait();
|
||||
Optional<ButtonType> result = alert.showAndWait();
|
||||
Airline air = null;
|
||||
if (result.isPresent() && result.get() == ButtonType.OK) {
|
||||
@@ -116,6 +118,16 @@ public class AirlineRDController extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
public void editAirline() {
|
||||
Airline toEdit = tableViewAirlineRD.getSelectionModel().getSelectedItem();
|
||||
currentSession.setAirlineToEdit(toEdit.getName());
|
||||
createPopUpStage(SceneCode.AIRLINE_EDIT, 600, 370);
|
||||
|
||||
System.out.println(toEdit.getName() + "," + toEdit.getAlias() + "," + toEdit.getIATA() + "," + toEdit.getICAO()
|
||||
+ "," + toEdit.getCallSign() + "," + toEdit.getCountryName() + "," + toEdit.getActive());
|
||||
|
||||
tableViewAirlineRD.refresh();
|
||||
}
|
||||
|
||||
/**
|
||||
* Analyses the current data and creates a graph based on the data.
|
||||
|
||||
@@ -3,6 +3,7 @@ package seng202.group9.GUI;
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.Alert;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.ComboBox;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.stage.Stage;
|
||||
@@ -37,7 +38,7 @@ public class AirportAddController extends Controller {
|
||||
@FXML
|
||||
private TextField airpTzAdd;
|
||||
@FXML
|
||||
private TextField addButton;
|
||||
private Button addButton;
|
||||
|
||||
//Set an empty Dataset to be assigned later
|
||||
private Dataset theDataSet = null;
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
package seng202.group9.GUI;
|
||||
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.Alert;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.stage.Stage;
|
||||
import seng202.group9.Controller.DataException;
|
||||
import seng202.group9.Controller.Dataset;
|
||||
import seng202.group9.Controller.EntryParser;
|
||||
import seng202.group9.Controller.Session;
|
||||
import seng202.group9.Core.Airport;
|
||||
|
||||
/**
|
||||
* Created by Sunguin on 2016/09/24.
|
||||
*/
|
||||
public class AirportEditController extends Controller {
|
||||
//Setting up text fields for adding data
|
||||
@FXML
|
||||
private TextField airpNameEdit;
|
||||
@FXML
|
||||
private TextField airpCityEdit;
|
||||
@FXML
|
||||
private TextField airpCountryEdit;
|
||||
@FXML
|
||||
private TextField airpIATAFAAEdit;
|
||||
@FXML
|
||||
private TextField airpICAOEdit;
|
||||
@FXML
|
||||
private TextField airpLatitudeEdit;
|
||||
@FXML
|
||||
private TextField airpLongitudeEdit;
|
||||
@FXML
|
||||
private TextField airpAltitudeEdit;
|
||||
@FXML
|
||||
private TextField airpTimezoneEdit;
|
||||
@FXML
|
||||
private TextField airpDSTEdit;
|
||||
@FXML
|
||||
private TextField airpTzEdit;
|
||||
@FXML
|
||||
private Button editButton;
|
||||
|
||||
//Set an empty Dataset to be assigned later
|
||||
private Dataset theDataSet = null;
|
||||
|
||||
private Session currentSession = null;
|
||||
|
||||
private Airport toEdit = null;
|
||||
|
||||
public void editAirport() {
|
||||
try {
|
||||
EntryParser parser = new EntryParser();
|
||||
parser.parseAirport(airpNameEdit.getText(), airpCityEdit.getText(), airpCountryEdit.getText(), airpIATAFAAEdit.getText(),
|
||||
airpICAOEdit.getText(), airpLatitudeEdit.getText(), airpLongitudeEdit.getText(), airpAltitudeEdit.getText(),
|
||||
airpTimezoneEdit.getText(), airpDSTEdit.getText(), airpTzEdit.getText());
|
||||
theDataSet.editAirport(toEdit, airpNameEdit.getText(), airpCityEdit.getText(), airpCountryEdit.getText(), airpIATAFAAEdit.getText(),
|
||||
airpICAOEdit.getText(), airpLatitudeEdit.getText(), airpLongitudeEdit.getText(), airpAltitudeEdit.getText(),
|
||||
airpTimezoneEdit.getText(), airpDSTEdit.getText(), airpTzEdit.getText());
|
||||
|
||||
Alert alert = new Alert(Alert.AlertType.INFORMATION);
|
||||
alert.setTitle("Airport Edit Successful");
|
||||
alert.setHeaderText("Airport data edited!");
|
||||
alert.setContentText("Your airport data has been successfully edited.");
|
||||
alert.showAndWait();
|
||||
|
||||
Stage stage = (Stage) editButton.getScene().getWindow();
|
||||
stage.close();
|
||||
} catch (DataException e) {
|
||||
System.err.println("RIP Harambe: " + e.getMessage() + "IT WAS TOO SOON");
|
||||
}
|
||||
}
|
||||
|
||||
public void load() {
|
||||
theDataSet = getParent().getCurrentDataset();
|
||||
currentSession = getParent().getSession();
|
||||
|
||||
toEdit = theDataSet.getAirportDictionary().get(currentSession.getAirportToEdit());
|
||||
|
||||
airpNameEdit.setText(toEdit.getName());
|
||||
airpCityEdit.setText(toEdit.getCityName());
|
||||
airpCountryEdit.setText(toEdit.getCountryName());
|
||||
airpIATAFAAEdit.setText(toEdit.getIATA_FFA());
|
||||
airpICAOEdit.setText(toEdit.getICAO());
|
||||
airpLatitudeEdit.setText(Double.toString(toEdit.getLatitude()));
|
||||
airpLongitudeEdit.setText(Double.toString(toEdit.getLongitude()));
|
||||
airpAltitudeEdit.setText(Double.toString(toEdit.getAltitude()));
|
||||
airpTimezoneEdit.setText(Double.toString(toEdit.getTimezone()));
|
||||
airpDSTEdit.setText(toEdit.getDST());
|
||||
airpTzEdit.setText(toEdit.getTz());
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,6 @@ import javafx.collections.ObservableList;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.control.cell.PropertyValueFactory;
|
||||
import seng202.group9.Controller.AirportFilter;
|
||||
import seng202.group9.Controller.Dataset;
|
||||
import seng202.group9.Controller.SceneCode;
|
||||
import seng202.group9.Controller.Session;
|
||||
@@ -89,14 +88,17 @@ public class AirportRDController extends Controller{
|
||||
|
||||
public void openFilter() {
|
||||
createPopUpStage(SceneCode.AIRPORT_FILTER, 600, 480);
|
||||
ArrayList<Airport> d = new ArrayList();
|
||||
for(int i = 0; i < theDataSet.getAirports().size(); i++) {
|
||||
if (currentSession.getFilteredAirports().containsValue(theDataSet.getAirports().get(i).getName())
|
||||
&& currentSession.getFilteredAirports().containsKey(i)) {
|
||||
d.add(theDataSet.getAirports().get(i));
|
||||
|
||||
if (currentSession.getFilteredAirports() != null) {
|
||||
ArrayList<Airport> d = new ArrayList();
|
||||
for (int i = 0; i < theDataSet.getAirports().size(); i++) {
|
||||
if (currentSession.getFilteredAirports().containsValue(theDataSet.getAirports().get(i).getName())
|
||||
&& currentSession.getFilteredAirports().containsKey(i)) {
|
||||
d.add(theDataSet.getAirports().get(i));
|
||||
}
|
||||
}
|
||||
tableViewAirportRD.setItems(FXCollections.observableArrayList(d));
|
||||
}
|
||||
tableViewAirportRD.setItems(FXCollections.observableArrayList(d));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -127,6 +129,17 @@ public class AirportRDController extends Controller{
|
||||
}
|
||||
}
|
||||
|
||||
public void editAirport() {
|
||||
Airport toEdit = tableViewAirportRD.getSelectionModel().getSelectedItem();
|
||||
currentSession.setAirportToEdit(toEdit.getName());
|
||||
createPopUpStage(SceneCode.AIRPORT_EDIT, 600, 480);
|
||||
|
||||
// System.out.println(toEdit.getName() + "," + toEdit.getCity() + "," + toEdit.getCountry() + "," + toEdit.getIATA_FFA()
|
||||
// + "," + toEdit.getICAO() + "," + toEdit.getLatitude() + "," + toEdit.getLongitude() + "," + toEdit.getAltitude()
|
||||
// + "," + toEdit.getTimezone() + "," + toEdit.getDST() + "," + toEdit.getTz());
|
||||
|
||||
tableViewAirportRD.refresh();
|
||||
}
|
||||
|
||||
/**
|
||||
* Analyses the current data and creates a graph based on the data.
|
||||
|
||||
@@ -113,4 +113,4 @@ public abstract class Controller implements Initializable{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package seng202.group9.GUI;
|
||||
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.Alert;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.stage.Stage;
|
||||
import seng202.group9.Controller.Dataset;
|
||||
import seng202.group9.Controller.Session;
|
||||
import seng202.group9.Core.FlightPoint;
|
||||
|
||||
/**
|
||||
* Controller for the Flights Edit Point Pop up Scene.
|
||||
* Created by Liam Beckett on 23/09/2016.
|
||||
*/
|
||||
public class FlightEditorController extends Controller{
|
||||
//Setting up text fields for adding data
|
||||
@FXML
|
||||
TextField fNameEdit;
|
||||
@FXML
|
||||
TextField fTypeEdit;
|
||||
@FXML
|
||||
TextField fAltitudeEdit;
|
||||
@FXML
|
||||
TextField fLatitudeEdit;
|
||||
@FXML
|
||||
TextField fLongitudeEdit;
|
||||
@FXML
|
||||
private Button flightEditButton;
|
||||
|
||||
//Set an empty Dataset to be assigned later
|
||||
private Dataset theDataSet = null;
|
||||
|
||||
/**
|
||||
* Edits a single flight entry in the database.
|
||||
* Takes in values from the field the user right clicked.
|
||||
* @see Dataset
|
||||
*/
|
||||
public void editFlight() {
|
||||
//Data is pre-loaded into the text fields and any accepted changes will be implemented.
|
||||
//Otherwise an error message will pop up with what is wrong with edit
|
||||
try {
|
||||
Session session = getParent().getSession();
|
||||
int flightPointID = session.getCurrentFlightPointID();
|
||||
|
||||
theDataSet.editFlight(
|
||||
theDataSet.getFlightPointDictionary().get(flightPointID),
|
||||
fNameEdit.getText(),
|
||||
fTypeEdit.getText(),
|
||||
fAltitudeEdit.getText(),
|
||||
fLatitudeEdit.getText(),
|
||||
fLongitudeEdit.getText()
|
||||
);
|
||||
session.setCurrentFlightPointID(flightPointID);
|
||||
|
||||
fNameEdit.clear();
|
||||
fTypeEdit.clear();
|
||||
fAltitudeEdit.clear();
|
||||
fLatitudeEdit.clear();
|
||||
fLongitudeEdit.clear();
|
||||
|
||||
Alert alert = new Alert(Alert.AlertType.INFORMATION);
|
||||
alert.setTitle("Flight Path Edit Successful");
|
||||
alert.setHeaderText("Flight Point Edited!");
|
||||
alert.setContentText("Your flight point has been updated in the database.");
|
||||
alert.showAndWait();
|
||||
|
||||
Stage stage = (Stage) flightEditButton.getScene().getWindow();
|
||||
stage.close();
|
||||
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
Alert alert = new Alert(Alert.AlertType.ERROR);
|
||||
alert.setTitle("Flight Data Error");
|
||||
alert.setHeaderText("Error editing a flight point.");
|
||||
alert.setContentText(e.getMessage());
|
||||
alert.showAndWait();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Loader which is used to load the selected information into the text fields for editing.
|
||||
*/
|
||||
public void load() {
|
||||
theDataSet = getParent().getCurrentDataset();
|
||||
|
||||
Session session = getParent().getSession();
|
||||
int flightPointID = session.getCurrentFlightPointID();
|
||||
FlightPoint flightPoint = theDataSet.getFlightPointDictionary().get(flightPointID);
|
||||
|
||||
fNameEdit.setText(flightPoint.getName());
|
||||
fTypeEdit.setText(flightPoint.getType());
|
||||
fAltitudeEdit.setText(Double.toString(flightPoint.getAltitude()));
|
||||
fLatitudeEdit.setText(Double.toString(flightPoint.getLatitude()));
|
||||
fLongitudeEdit.setText(Double.toString(flightPoint.getLongitude()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@ import javafx.scene.control.cell.PropertyValueFactory;
|
||||
import javafx.scene.input.MouseEvent;
|
||||
import seng202.group9.Controller.DataException;
|
||||
import seng202.group9.Controller.Dataset;
|
||||
import seng202.group9.Controller.SceneCode;
|
||||
import seng202.group9.Controller.Session;
|
||||
import seng202.group9.Core.FlightPath;
|
||||
import seng202.group9.Core.FlightPoint;
|
||||
|
||||
@@ -20,7 +22,6 @@ import java.util.LinkedHashMap;
|
||||
* Controller for the Flights Raw Data Scene.
|
||||
* Created by Liam Beckett on 13/09/2016.
|
||||
*/
|
||||
|
||||
public class FlightRDController extends Controller {
|
||||
|
||||
private Dataset theDataSet = null;
|
||||
@@ -143,8 +144,6 @@ public class FlightRDController extends Controller {
|
||||
* Will take the inputs from the text fields and adds the point to the current flight path.
|
||||
*/
|
||||
public void addFlightPoint() {
|
||||
ArrayList<FlightPath> flightPaths;
|
||||
flightPaths = theDataSet.getFlightPaths();
|
||||
|
||||
try {
|
||||
theDataSet.addFlightPointToPath(currentPathId,
|
||||
@@ -167,14 +166,12 @@ public class FlightRDController extends Controller {
|
||||
flightLegDistBox.clear();
|
||||
flightTotDistBox.clear();
|
||||
|
||||
ArrayList<FlightPoint> flightPoints = flightPaths.get(currentPathIndex).getFlight();
|
||||
flightTableView.setItems(FXCollections.observableArrayList(flightPoints));
|
||||
updateTable(currentPathIndex);
|
||||
} catch ( Exception e ) {
|
||||
Alert alert = new Alert(Alert.AlertType.ERROR);
|
||||
alert.setTitle("Flight Point Data Error");
|
||||
alert.setHeaderText("Error adding a custom flight point entry.");
|
||||
alert.setContentText(e.getMessage());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -203,7 +200,7 @@ public class FlightRDController extends Controller {
|
||||
pathID = toDelete.getIndex();
|
||||
} catch (DataException e) {
|
||||
e.printStackTrace();
|
||||
System.out.println("Point is Undeletable as the Index ID is not set.");
|
||||
System.err.println("Point is Undeletable as the Index ID is not set.");
|
||||
return;
|
||||
}
|
||||
LinkedHashMap<Integer, FlightPath> flightPathDict = theDataSet.getFlightPathDictionary();
|
||||
@@ -212,12 +209,27 @@ public class FlightRDController extends Controller {
|
||||
|
||||
currentPathIndex = theDataSet.getFlightPaths().indexOf(theDataSet.getFlightPathDictionary().get(pathID));
|
||||
|
||||
ArrayList<FlightPath> flightPaths;
|
||||
flightPaths = theDataSet.getFlightPaths();
|
||||
ArrayList<FlightPoint> flightPoints = flightPaths.get(currentPathIndex).getFlight();
|
||||
flightTableView.setItems(FXCollections.observableArrayList(flightPoints));
|
||||
updateTable(currentPathIndex);
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the pop up for the edit data scene and updates the table when the window is closed.
|
||||
*/
|
||||
public void editPoint() {
|
||||
FlightPoint toEdit = flightTableView.getSelectionModel().getSelectedItem();
|
||||
try {
|
||||
Session session = getParent().getSession();
|
||||
session.setCurrentFlightPointID(toEdit.getID());
|
||||
session.setCurrentFlightPathtID(currentPathId);
|
||||
} catch (DataException e) {
|
||||
e.printStackTrace();
|
||||
System.err.println("Point is Uneditable as the Index ID is not set.");
|
||||
return;
|
||||
}
|
||||
createPopUpStage(SceneCode.FLIGHT_EDITOR, 600, 289);
|
||||
updateTable(currentPathIndex);
|
||||
|
||||
}
|
||||
/**
|
||||
* Removes the selected path from the list view of paths and from the database.
|
||||
*/
|
||||
@@ -234,10 +246,22 @@ public class FlightRDController extends Controller {
|
||||
flightPathListView();
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the table so that when the database is changed (deleted or edited) it still shows the correct data values.
|
||||
* @param currentPathIndex The index of the current path in the Path array list.
|
||||
*/
|
||||
private void updateTable(int currentPathIndex) {
|
||||
ArrayList<FlightPath> flightPaths;
|
||||
flightPaths = theDataSet.getFlightPaths();
|
||||
ArrayList<FlightPoint> flightPoints = flightPaths.get(currentPathIndex).getFlight();
|
||||
flightTableView.setItems(FXCollections.observableArrayList(flightPoints));
|
||||
flightTableView.refresh();
|
||||
}
|
||||
|
||||
/**
|
||||
* Will link to the flight analyser when implemented.
|
||||
*/
|
||||
public void flightAnalyser(){
|
||||
private void flightAnalyser(){
|
||||
JOptionPane.showMessageDialog(null, "This is not Implemented yet");
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
package seng202.group9.GUI;
|
||||
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.Alert;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.stage.Stage;
|
||||
import seng202.group9.Controller.DataException;
|
||||
import seng202.group9.Controller.Dataset;
|
||||
import seng202.group9.Controller.EntryParser;
|
||||
import seng202.group9.Controller.Session;
|
||||
import seng202.group9.Core.Route;
|
||||
|
||||
/**
|
||||
* Created by Sunguin on 2016/09/24.
|
||||
*/
|
||||
public class RouteEditController extends Controller {
|
||||
@FXML
|
||||
private TextField rAirlineEdit;
|
||||
@FXML
|
||||
private TextField rSourceEdit;
|
||||
@FXML
|
||||
private TextField rDestEdit;
|
||||
@FXML
|
||||
private TextField rCodeshareEdit;
|
||||
@FXML
|
||||
private TextField rStopsEdit;
|
||||
@FXML
|
||||
private TextField rEquipmentEdit;
|
||||
@FXML
|
||||
private Button editButton;
|
||||
|
||||
private Dataset theDataSet = null;
|
||||
|
||||
private Session currentSession = null;
|
||||
|
||||
private Route toEdit = null;
|
||||
|
||||
public void editRoute() {
|
||||
try {
|
||||
EntryParser parser = new EntryParser();
|
||||
parser.parseRoute(rAirlineEdit.getText(), rSourceEdit.getText(), rDestEdit.getText(), rCodeshareEdit.getText(),
|
||||
rStopsEdit.getText(), rEquipmentEdit.getText());
|
||||
theDataSet.editRoute(toEdit, rAirlineEdit.getText(), rSourceEdit.getText(), rDestEdit.getText(), rCodeshareEdit.getText(),
|
||||
rStopsEdit.getText(), rEquipmentEdit.getText());
|
||||
|
||||
Alert alert = new Alert(Alert.AlertType.INFORMATION);
|
||||
alert.setTitle("Route Edit Successful");
|
||||
alert.setHeaderText("Route data edited!");
|
||||
alert.setContentText("Your route data has been successfully edited.");
|
||||
alert.showAndWait();
|
||||
|
||||
Stage stage = (Stage) editButton.getScene().getWindow();
|
||||
stage.close();
|
||||
} catch (DataException e) {
|
||||
System.err.println("RIP Harambe: " + e.getMessage() + "IT WAS TOO SOON");
|
||||
}
|
||||
}
|
||||
|
||||
public void load() {
|
||||
theDataSet = getParent().getCurrentDataset();
|
||||
currentSession = getParent().getSession();
|
||||
|
||||
toEdit = theDataSet.getRouteDictionary().get(currentSession.getRouteToEdit());
|
||||
|
||||
rAirlineEdit.setText(toEdit.getAirlineName());
|
||||
rSourceEdit.setText(toEdit.getDepartureAirport());
|
||||
rDestEdit.setText(toEdit.getArrivalAirport());
|
||||
rCodeshareEdit.setText(toEdit.getCode());
|
||||
rStopsEdit.setText(Integer.toString(toEdit.getStops()));
|
||||
rEquipmentEdit.setText(toEdit.getEquipment());
|
||||
}
|
||||
}
|
||||
@@ -78,14 +78,16 @@ public class RouteRDController extends Controller {
|
||||
|
||||
public void openFilter() {
|
||||
createPopUpStage(SceneCode.ROUTE_FILTER, 600, 330);
|
||||
ArrayList<Route> d = new ArrayList();
|
||||
for(int i = 0; i < theDataSet.getRoutes().size(); i++) {
|
||||
if (currentSession.getFilteredRoutes().containsValue(theDataSet.getRoutes().get(i).getAirlineName())
|
||||
&& currentSession.getFilteredRoutes().containsKey(i)) {
|
||||
d.add(theDataSet.getRoutes().get(i));
|
||||
if (currentSession.getFilteredRoutes() != null) {
|
||||
ArrayList<Route> d = new ArrayList();
|
||||
for (int i = 0; i < theDataSet.getRoutes().size(); i++) {
|
||||
if (currentSession.getFilteredRoutes().containsValue(theDataSet.getRoutes().get(i).getAirlineName())
|
||||
&& currentSession.getFilteredRoutes().containsKey(i)) {
|
||||
d.add(theDataSet.getRoutes().get(i));
|
||||
}
|
||||
}
|
||||
tableViewRouteRD.setItems(FXCollections.observableArrayList(d));
|
||||
}
|
||||
tableViewRouteRD.setItems(FXCollections.observableArrayList(d));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -112,6 +114,18 @@ public class RouteRDController extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
public void editRoute() {
|
||||
Route toEdit = tableViewRouteRD.getSelectionModel().getSelectedItem();
|
||||
currentSession.setRouteToEdit(toEdit.getAirlineName() + toEdit.getDepartureAirport() + toEdit.getArrivalAirport() +
|
||||
toEdit.getCode() + toEdit.getStops() + toEdit.getEquipment());
|
||||
createPopUpStage(SceneCode.ROUTE_EDIT, 600, 330);
|
||||
|
||||
// System.out.println(toEdit.getName() + "," + toEdit.getCity() + "," + toEdit.getCountry() + "," + toEdit.getIATA_FFA()
|
||||
// + "," + toEdit.getICAO() + "," + toEdit.getLatitude() + "," + toEdit.getLongitude() + "," + toEdit.getAltitude()
|
||||
// + "," + toEdit.getTimezone() + "," + toEdit.getDST() + "," + toEdit.getTz());
|
||||
|
||||
tableViewRouteRD.refresh();
|
||||
}
|
||||
|
||||
/**
|
||||
* Analyses the current data and creates a graph based on the data.
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.TextField?>
|
||||
<?import javafx.scene.layout.ColumnConstraints?>
|
||||
<?import javafx.scene.layout.GridPane?>
|
||||
<?import javafx.scene.layout.RowConstraints?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
|
||||
<GridPane hgap="10.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="370.0" prefWidth="600.0" vgap="10.0" xmlns="http://javafx.com/javafx/8.0.60" xmlns:fx="http://javafx.com/fxml/1" fx:controller="seng202.group9.GUI.AirlineEditController">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="280.0" minWidth="10.0" prefWidth="125.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="515.0" minWidth="10.0" prefWidth="445.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints maxHeight="30.0" minHeight="0.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30.0" minHeight="4.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<padding>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||
</padding>
|
||||
<children>
|
||||
<Label text="Edit Airline" GridPane.columnSpan="2" GridPane.halignment="CENTER" GridPane.valignment="TOP">
|
||||
<font>
|
||||
<Font size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<Label text="Name" GridPane.halignment="LEFT" GridPane.rowIndex="1">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
<Label text="Alias" GridPane.halignment="LEFT" GridPane.rowIndex="2">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
<Label text="IATA" GridPane.halignment="LEFT" GridPane.rowIndex="3">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
<Label text="ICAO" GridPane.halignment="LEFT" GridPane.rowIndex="4">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
<Label text="Callsign" GridPane.halignment="LEFT" GridPane.rowIndex="5">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
<Label text="Country" GridPane.halignment="LEFT" GridPane.rowIndex="6">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
<Label text="Active" GridPane.halignment="LEFT" GridPane.rowIndex="7">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
<Button fx:id="applyButton" mnemonicParsing="false" onAction="#editAirline" text="Apply Conditions" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="8" />
|
||||
<TextField fx:id="airlNameEdit" prefHeight="31.0" prefWidth="432.0" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="1" />
|
||||
<TextField fx:id="airlAliasEdit" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="2" />
|
||||
<TextField fx:id="airlIATAEdit" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="3" />
|
||||
<TextField fx:id="airlICAOEdit" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="4" />
|
||||
<TextField fx:id="airlCallsignEdit" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="5" />
|
||||
<TextField fx:id="airlCountryEdit" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="6" />
|
||||
<TextField fx:id="airlActiveEdit" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="7" />
|
||||
</children>
|
||||
</GridPane>
|
||||
@@ -49,6 +49,7 @@
|
||||
<contextMenu>
|
||||
<ContextMenu>
|
||||
<items>
|
||||
<MenuItem mnemonicParsing="false" onAction="#editAirline" text="Edit" />
|
||||
<MenuItem mnemonicParsing="false" onAction="#deleteAirline" text="Delete" />
|
||||
</items>
|
||||
</ContextMenu>
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.TextField?>
|
||||
<?import javafx.scene.layout.ColumnConstraints?>
|
||||
<?import javafx.scene.layout.GridPane?>
|
||||
<?import javafx.scene.layout.RowConstraints?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
|
||||
<GridPane hgap="10.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="480.0" prefWidth="600.0" vgap="10.0" xmlns="http://javafx.com/javafx/8.0.60" xmlns:fx="http://javafx.com/fxml/1" fx:controller="seng202.group9.GUI.AirportEditController">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="280.0" minWidth="10.0" prefWidth="125.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="515.0" minWidth="10.0" prefWidth="445.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints maxHeight="30.0" minHeight="0.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30.0" minHeight="4.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<padding>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||
</padding>
|
||||
<children>
|
||||
<Label text="Edit Airport" GridPane.columnSpan="2" GridPane.halignment="CENTER" GridPane.valignment="TOP">
|
||||
<font>
|
||||
<Font size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<Label text="Name*" GridPane.halignment="LEFT" GridPane.rowIndex="1">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
<Label text="City*" GridPane.halignment="LEFT" GridPane.rowIndex="2">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
<Label text="Country*" GridPane.halignment="LEFT" GridPane.rowIndex="3">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
<Label text="IATA/FAA" GridPane.halignment="LEFT" GridPane.rowIndex="4">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
<Label text="ICAO" GridPane.halignment="LEFT" GridPane.rowIndex="5">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
<Label text="Latitude*" GridPane.halignment="LEFT" GridPane.rowIndex="6">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
<Label text="Longitude*" GridPane.halignment="LEFT" GridPane.rowIndex="7">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
<Button fx:id="editButton" mnemonicParsing="false" onAction="#editAirport" text="Edit Airport" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="12" />
|
||||
<TextField fx:id="airpNameEdit" prefHeight="31.0" prefWidth="432.0" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="1" />
|
||||
<TextField fx:id="airpCityEdit" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="2" />
|
||||
<TextField fx:id="airpCountryEdit" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="3" />
|
||||
<TextField fx:id="airpIATAFAAEdit" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="4" />
|
||||
<TextField fx:id="airpICAOEdit" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="5" />
|
||||
<TextField fx:id="airpLatitudeEdit" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="6" />
|
||||
<Label prefHeight="21.0" prefWidth="117.0" text="* = required field" GridPane.columnSpan="2" GridPane.halignment="LEFT" GridPane.rowIndex="12">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" left="15.0" top="15.0" />
|
||||
</GridPane.margin></Label>
|
||||
<TextField fx:id="airpLongitudeEdit" GridPane.columnIndex="1" GridPane.rowIndex="7" />
|
||||
<TextField fx:id="airpAltitudeEdit" GridPane.columnIndex="1" GridPane.rowIndex="8" />
|
||||
<TextField fx:id="airpTimezoneEdit" GridPane.columnIndex="1" GridPane.rowIndex="9" />
|
||||
<TextField fx:id="airpDSTEdit" GridPane.columnIndex="1" GridPane.rowIndex="10" />
|
||||
<TextField fx:id="airpTzEdit" GridPane.columnIndex="1" GridPane.rowIndex="11" />
|
||||
<Label text="Altitude*" GridPane.halignment="LEFT" GridPane.rowIndex="8">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
<Label text="Timezone*" GridPane.halignment="LEFT" GridPane.rowIndex="9">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
<Label text="DST" GridPane.halignment="LEFT" GridPane.rowIndex="10">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
<Label text="Time Olson" GridPane.halignment="LEFT" GridPane.rowIndex="11">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
</children>
|
||||
</GridPane>
|
||||
@@ -39,6 +39,7 @@
|
||||
<contextMenu>
|
||||
<ContextMenu>
|
||||
<items>
|
||||
<MenuItem mnemonicParsing="false" onAction="#editAirport" text="Edit" />
|
||||
<MenuItem mnemonicParsing="false" onAction="#deleteAirport" text="Delete" />
|
||||
</items>
|
||||
</ContextMenu>
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.TextField?>
|
||||
<?import javafx.scene.layout.ColumnConstraints?>
|
||||
<?import javafx.scene.layout.GridPane?>
|
||||
<?import javafx.scene.layout.RowConstraints?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
|
||||
<GridPane hgap="10.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="289.0" prefWidth="600.0" vgap="10.0" xmlns="http://javafx.com/javafx/8.0.65" xmlns:fx="http://javafx.com/fxml/1" fx:controller="seng202.group9.GUI.FlightEditorController">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="280.0" minWidth="10.0" prefWidth="168.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="515.0" minWidth="10.0" prefWidth="402.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints maxHeight="30.0" minHeight="0.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30.0" minHeight="4.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<padding>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||
</padding>
|
||||
<children>
|
||||
<Label text="Edit Flight Point" GridPane.columnSpan="2" GridPane.halignment="CENTER" GridPane.valignment="TOP">
|
||||
<font>
|
||||
<Font size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<Label text="Name" GridPane.halignment="LEFT" GridPane.rowIndex="1">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
<Label text="Type" GridPane.halignment="LEFT" GridPane.rowIndex="2">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
<Label text="Altitude" GridPane.halignment="LEFT" GridPane.rowIndex="3">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
<Label text="Latitude" GridPane.halignment="LEFT" GridPane.rowIndex="4">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
<Label text="Longitude" GridPane.halignment="LEFT" GridPane.rowIndex="5">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
<Button fx:id="flightEditButton" mnemonicParsing="false" onAction="#editFlight" text="Edit Flight" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="6" />
|
||||
<TextField fx:id="fNameEdit" prefHeight="31.0" prefWidth="432.0" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="1" />
|
||||
<TextField fx:id="fTypeEdit" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="2" />
|
||||
<TextField fx:id="fAltitudeEdit" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="3" />
|
||||
<TextField fx:id="fLatitudeEdit" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="4" />
|
||||
<TextField fx:id="fLongitudeEdit" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="5" />
|
||||
</children>
|
||||
</GridPane>
|
||||
@@ -153,6 +153,7 @@
|
||||
<contextMenu>
|
||||
<ContextMenu>
|
||||
<items>
|
||||
<MenuItem mnemonicParsing="false" onAction="#editPoint" text="Edit" />
|
||||
<MenuItem mnemonicParsing="false" onAction="#deletePoint" text="Delete" />
|
||||
</items>
|
||||
</ContextMenu>
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.TextField?>
|
||||
<?import javafx.scene.layout.ColumnConstraints?>
|
||||
<?import javafx.scene.layout.GridPane?>
|
||||
<?import javafx.scene.layout.RowConstraints?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
|
||||
<GridPane hgap="10.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="330.0" prefWidth="600.0" vgap="10.0" xmlns="http://javafx.com/javafx/8.0.60" xmlns:fx="http://javafx.com/fxml/1" fx:controller="seng202.group9.GUI.RouteEditController">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="280.0" minWidth="10.0" prefWidth="168.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="515.0" minWidth="10.0" prefWidth="402.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints maxHeight="30.0" minHeight="0.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30.0" minHeight="4.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<padding>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||
</padding>
|
||||
<children>
|
||||
<Label text="Edit Route" GridPane.columnSpan="2" GridPane.halignment="CENTER" GridPane.valignment="TOP">
|
||||
<font>
|
||||
<Font size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<Label text="Airline*" GridPane.halignment="LEFT" GridPane.rowIndex="1">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
<Label text="Source Airport*" GridPane.halignment="LEFT" GridPane.rowIndex="2">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
<Label text="Desintation Airport*" GridPane.halignment="LEFT" GridPane.rowIndex="3">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
<Label text="Codeshare" GridPane.halignment="LEFT" GridPane.rowIndex="4">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
<Label text="Stops" GridPane.halignment="LEFT" GridPane.rowIndex="5">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
<Label text="Equipment" GridPane.halignment="LEFT" GridPane.rowIndex="6">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
<Button fx:id="editButton" mnemonicParsing="false" onAction="#editRoute" text="Edit Route" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="7" />
|
||||
<TextField fx:id="rAirlineEdit" prefHeight="31.0" prefWidth="432.0" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="1" />
|
||||
<TextField fx:id="rSourceEdit" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="2" />
|
||||
<TextField fx:id="rDestEdit" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="3" />
|
||||
<TextField fx:id="rCodeshareEdit" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="4" />
|
||||
<TextField fx:id="rStopsEdit" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="5" />
|
||||
<TextField fx:id="rEquipmentEdit" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="6" />
|
||||
<Label text="* = required field" GridPane.halignment="LEFT" GridPane.rowIndex="7">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />
|
||||
</GridPane.margin></Label>
|
||||
</children>
|
||||
</GridPane>
|
||||
@@ -39,6 +39,7 @@
|
||||
<contextMenu>
|
||||
<ContextMenu>
|
||||
<items>
|
||||
<MenuItem mnemonicParsing="false" onAction="#editRoute" text="Edit" />
|
||||
<MenuItem mnemonicParsing="false" onAction="#deleteRoute" text="Delete" />
|
||||
</items>
|
||||
</ContextMenu>
|
||||
|
||||
Reference in New Issue
Block a user