Changed GUI
This commit is contained in:
@@ -23,7 +23,7 @@ import seng202.group9.GUI.MenuController;
|
|||||||
*/
|
*/
|
||||||
public class App extends Application
|
public class App extends Application
|
||||||
{
|
{
|
||||||
private ArrayList<Dataset> Datasets = new ArrayList<Dataset>();
|
private ArrayList<Dataset> datasets = new ArrayList<Dataset>();
|
||||||
private Dataset currentDataset = null;
|
private Dataset currentDataset = null;
|
||||||
private Stage primaryStage = null;
|
private Stage primaryStage = null;
|
||||||
private VBox mainContainer;
|
private VBox mainContainer;
|
||||||
@@ -75,14 +75,12 @@ public class App extends Application
|
|||||||
}catch (DataException e){
|
}catch (DataException e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
//testout single airline adding
|
//testout single airline adding
|
||||||
try {
|
try {
|
||||||
currentDataset.addAirline("Dota2", "Valve", "D2", "DOT", "Defence of the Ancients", "Steam", "Y");
|
currentDataset.addAirline("Dota2", "Valve", "D2", "DOT", "Defence of the Ancients", "Steam", "Y");
|
||||||
}catch (DataException e){
|
}catch (DataException e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
//testing out airport parser
|
//testing out airport parser
|
||||||
try {
|
try {
|
||||||
System.out.println(currentDataset.importAirport("res/Samples/Airports.txt"));
|
System.out.println(currentDataset.importAirport("res/Samples/Airports.txt"));
|
||||||
@@ -136,4 +134,9 @@ public class App extends Application
|
|||||||
public Dataset getCurrentDataset(){
|
public Dataset getCurrentDataset(){
|
||||||
return currentDataset;
|
return currentDataset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void deleteDataset(Dataset dataset){
|
||||||
|
dataset.deleteDataset();
|
||||||
|
datasets.remove(dataset);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1016,6 +1016,242 @@ public class Dataset {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is called in conjunction to the App deleteDataset DO NOT CALL UNLESS THROUGH APP.DELETEDATASET
|
||||||
|
*/
|
||||||
|
public void deleteDataset(){
|
||||||
|
//drop the tables
|
||||||
|
Connection c = null;
|
||||||
|
Statement stmt = null;
|
||||||
|
try {
|
||||||
|
Class.forName("org.sqlite.JDBC");
|
||||||
|
c = DriverManager.getConnection("jdbc:sqlite:res/userdb.db");
|
||||||
|
String[] tablesToDrop = {"_Airline", "_Airport", "_City", "_Country", "_Routes", "_Flight_Path", "_Flight_Points"};
|
||||||
|
for (int i = 0; i < tablesToDrop.length; i++){
|
||||||
|
stmt = c.createStatement();
|
||||||
|
String dropTableStatment = "DROP TABLE `"+this.name+tablesToDrop[i]+"`";
|
||||||
|
stmt.execute(dropTableStatment);
|
||||||
|
stmt.close();
|
||||||
|
}
|
||||||
|
stmt = c.createStatement();
|
||||||
|
String deleteDatasetEntry = "DELETE FROM `Datasets` WHERE `Dataset_Name` = \""+this.name+"\"";
|
||||||
|
stmt.execute(deleteDatasetEntry);
|
||||||
|
stmt.close();
|
||||||
|
c.close();
|
||||||
|
} catch ( Exception e ) {
|
||||||
|
System.err.println( e.getClass().getName() + ": " + e.getMessage() );
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* deletes an airline from the dataset.
|
||||||
|
* @param airline
|
||||||
|
*/
|
||||||
|
public void deleteAirline(Airline airline){
|
||||||
|
//drop the entries
|
||||||
|
Connection c = null;
|
||||||
|
Statement stmt = null;
|
||||||
|
try {
|
||||||
|
Class.forName("org.sqlite.JDBC");
|
||||||
|
c = DriverManager.getConnection("jdbc:sqlite:res/userdb.db");
|
||||||
|
String deleteQuery = "DELETE FROM `"+this.name+"_Airline` WHERE `Airline_ID` = " + airline.getID() + ";";
|
||||||
|
stmt = c.createStatement();
|
||||||
|
stmt.execute(deleteQuery);
|
||||||
|
stmt.close();
|
||||||
|
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" +
|
||||||
|
" `"+this.name+"_Country`.`Country_Name` = `"+this.name+"_Airline`.`Country`" +
|
||||||
|
" WHERE `"+this.name+"_Airline`.`Country` = \""+airline.getCountry().getName().replace("\"", "\"\"")+"\"";
|
||||||
|
ResultSet countCountryRes = stmt.executeQuery(countCountry);
|
||||||
|
int countryCount = 0;
|
||||||
|
while (countCountryRes.next()){
|
||||||
|
countryCount += countCountryRes.getInt("COUNT(*)");
|
||||||
|
}
|
||||||
|
countCountryRes.close();
|
||||||
|
stmt.close();
|
||||||
|
//check if number of counties that contain airports > 0 else delete the country
|
||||||
|
String countCountryA = "SELECT COUNT(*) FROM `"+this.name+"_Airport` JOIN `"+this.name+"_Country` ON" +
|
||||||
|
" `"+this.name+"_Country`.`Country_Name` = `"+this.name+"_Airport`.`Country`" +
|
||||||
|
" WHERE `"+this.name+"_Airport`.`Country` = \""+airline.getCountry().getName().replace("\"", "\"\"")+"\"";
|
||||||
|
countCountryRes = stmt.executeQuery(countCountryA);
|
||||||
|
while (countCountryRes.next()){
|
||||||
|
countryCount += countCountryRes.getInt("COUNT(*)");
|
||||||
|
}
|
||||||
|
countCountryRes.close();
|
||||||
|
stmt.close();
|
||||||
|
//delete country if there are no matches
|
||||||
|
if (countryCount == 0){
|
||||||
|
stmt = c.createStatement();
|
||||||
|
String deleteCountry = "DELETE FROM `"+this.name+"_Country` WHERE `Country_Name` = \""+airline.getCountry().getName()+"\"";
|
||||||
|
stmt.execute(deleteCountry);
|
||||||
|
stmt.close();
|
||||||
|
}
|
||||||
|
c.close();
|
||||||
|
} catch ( Exception e ) {
|
||||||
|
System.err.println( e.getClass().getName() + ": " + e.getMessage() );
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
airlines.remove(airline);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void deleteAirline(int index){
|
||||||
|
deleteAirline(airlines.get(index));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* deletes an airport from the dataset.
|
||||||
|
* @param airport
|
||||||
|
*/
|
||||||
|
public void deleteAirport(Airport airport){
|
||||||
|
//drop the entries
|
||||||
|
Connection c = null;
|
||||||
|
Statement stmt = null;
|
||||||
|
try {
|
||||||
|
Class.forName("org.sqlite.JDBC");
|
||||||
|
c = DriverManager.getConnection("jdbc:sqlite:res/userdb.db");
|
||||||
|
String deleteQuery = "DELETE FROM `"+this.name+"_Airport` WHERE `Airport_ID` = " + airport.getID() + ";";
|
||||||
|
stmt = c.createStatement();
|
||||||
|
stmt.execute(deleteQuery);
|
||||||
|
stmt.close();
|
||||||
|
//check if number of countries that contain airports and airlines > 0 else delete the country
|
||||||
|
String countCountry = "SELECT COUNT(*) FROM `"+this.name+"_Airport` JOIN `"+this.name+"_Country` ON" +
|
||||||
|
" `"+this.name+"_Country`.`Country_Name` = `"+this.name+"_Airport`.`Country`" +
|
||||||
|
" WHERE `"+this.name+"_Airport`.`Country` = \""+airport.getCountry().getName().replace("\"", "\"\"")+"\"";
|
||||||
|
ResultSet countCountryRes = stmt.executeQuery(countCountry);
|
||||||
|
int countryCount = 0;
|
||||||
|
while (countCountryRes.next()){
|
||||||
|
countryCount = countCountryRes.getInt("COUNT(*)");
|
||||||
|
}
|
||||||
|
countCountryRes.close();
|
||||||
|
stmt.close();
|
||||||
|
//check if number of countries that contain airlines > 0 else delete the country
|
||||||
|
String countCountryA = "SELECT COUNT(*) FROM `"+this.name+"_Airline` JOIN `"+this.name+"_Country` ON" +
|
||||||
|
" `"+this.name+"_Country`.`Country_Name` = `"+this.name+"_Airline`.`Country`" +
|
||||||
|
" WHERE `"+this.name+"_Airline`.`Country` = \""+airport.getCountry().getName().replace("\"", "\"\"")+"\"";
|
||||||
|
ResultSet countCountryResA = stmt.executeQuery(countCountry);
|
||||||
|
while (countCountryResA.next()){
|
||||||
|
countryCount += countCountryResA.getInt("COUNT(*)");
|
||||||
|
}
|
||||||
|
countCountryResA.close();
|
||||||
|
stmt.close();
|
||||||
|
//delete country if no matches
|
||||||
|
if (countryCount == 0){
|
||||||
|
stmt = c.createStatement();
|
||||||
|
String deleteCountry = "DELETE FROM `"+this.name+"_Country` WHERE `Country_Name` = \""+airport.getCountry().getName()+"\"";
|
||||||
|
stmt.execute(deleteCountry);
|
||||||
|
stmt.close();
|
||||||
|
}
|
||||||
|
//cehck if number cities that contain airports > 0 else delete the city
|
||||||
|
String countCity = "SELECT COUNT(*) FROM `"+this.name+"_Airport` JOIN `"+this.name+"_City` ON" +
|
||||||
|
" `"+this.name+"_City`.`City_Name` = `"+this.name+"_Airport`.`City`" +
|
||||||
|
" WHERE `"+this.name+"_Airport`.`City` = \""+airport.getCityName().replace("\"", "\"\"")+"\"";
|
||||||
|
ResultSet countCityRes = stmt.executeQuery(countCity);
|
||||||
|
int cityCount = 0;
|
||||||
|
while (countCityRes.next()){
|
||||||
|
cityCount = countCityRes.getInt("COUNT(*)");
|
||||||
|
}
|
||||||
|
countCountryRes.close();
|
||||||
|
stmt.close();
|
||||||
|
//delete country if no matches
|
||||||
|
if (cityCount == 0){
|
||||||
|
stmt = c.createStatement();
|
||||||
|
String deleteCity = "DELETE FROM `"+this.name+"_City` WHERE `City_Name` = \""+airport.getCityName()+"\"";
|
||||||
|
stmt.execute(deleteCity);
|
||||||
|
stmt.close();
|
||||||
|
}
|
||||||
|
c.close();
|
||||||
|
} catch ( Exception e ) {
|
||||||
|
System.err.println( e.getClass().getName() + ": " + e.getMessage() );
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
airports.remove(airport);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void deleteAirport(int index){
|
||||||
|
deleteAirport(airports.get(index));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* deletes an route from the dataset.
|
||||||
|
* @param route
|
||||||
|
*/
|
||||||
|
public void deleteRoute(Route route){
|
||||||
|
//drop the entries
|
||||||
|
Connection c = null;
|
||||||
|
Statement stmt = null;
|
||||||
|
try {
|
||||||
|
Class.forName("org.sqlite.JDBC");
|
||||||
|
c = DriverManager.getConnection("jdbc:sqlite:res/userdb.db");
|
||||||
|
String deleteQuery = "DELETE FROM `"+this.name+"_Routes` WHERE `Route_ID` = " + route.getID() + ";";
|
||||||
|
stmt = c.createStatement();
|
||||||
|
stmt.execute(deleteQuery);
|
||||||
|
c.close();
|
||||||
|
} catch ( Exception e ) {
|
||||||
|
System.err.println( e.getClass().getName() + ": " + e.getMessage() );
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
routes.remove(route);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void deleteRoute(int index){
|
||||||
|
deleteRoute(routes.get(index));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* deletes an airline from the dataset.
|
||||||
|
* @param flightPath
|
||||||
|
*/
|
||||||
|
public void deleteFlightPath(FlightPath flightPath){
|
||||||
|
//delete all flight points with the id
|
||||||
|
while(flightPath.getFlightPoints().size() > 0){
|
||||||
|
deleteFlightPoint(flightPath.getFlightPoints().get(0), flightPath);
|
||||||
|
}
|
||||||
|
//drop the entries
|
||||||
|
Connection c = null;
|
||||||
|
Statement stmt = null;
|
||||||
|
try {
|
||||||
|
Class.forName("org.sqlite.JDBC");
|
||||||
|
c = DriverManager.getConnection("jdbc:sqlite:res/userdb.db");
|
||||||
|
String deleteQuery = "DELETE FROM `"+this.name+"_Flight_Path` WHERE `Path_ID` = " + flightPath.getID() + ";";
|
||||||
|
stmt = c.createStatement();
|
||||||
|
stmt.execute(deleteQuery);
|
||||||
|
c.close();
|
||||||
|
} catch ( Exception e ) {
|
||||||
|
System.err.println( e.getClass().getName() + ": " + e.getMessage() );
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
flightPaths.remove(flightPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void deleteFlightPath(int index){
|
||||||
|
deleteFlightPath(flightPaths.get(index));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* deletes an airline from the dataset.
|
||||||
|
* @param flightPoint
|
||||||
|
*/
|
||||||
|
public void deleteFlightPoint(FlightPoint flightPoint, FlightPath flightPath){
|
||||||
|
//drop the tables
|
||||||
|
Connection c = null;
|
||||||
|
Statement stmt = null;
|
||||||
|
try {
|
||||||
|
Class.forName("org.sqlite.JDBC");
|
||||||
|
c = DriverManager.getConnection("jdbc:sqlite:res/userdb.db");
|
||||||
|
String deleteQuery = "DELETE FROM `"+this.name+"_Flight_Points` WHERE `Point_ID` = " + flightPoint.getID() + ";";
|
||||||
|
stmt = c.createStatement();
|
||||||
|
stmt.execute(deleteQuery);
|
||||||
|
c.close();
|
||||||
|
} catch ( Exception e ) {
|
||||||
|
System.err.println( e.getClass().getName() + ": " + e.getMessage() );
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
flightPath.getFlightPoints().remove(flightPoint);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void deleteFlightPoint(int pathIndex, int pointIndex){
|
||||||
|
deleteFlightPoint(flightPaths.get(pathIndex).getFlightPoints().get(pointIndex), flightPaths.get(pathIndex));
|
||||||
|
}
|
||||||
|
|
||||||
public ArrayList<Airline> getAirlines() {
|
public ArrayList<Airline> getAirlines() {
|
||||||
return airlines;
|
return airlines;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ public class FlightPoint {
|
|||||||
public FlightPoint(String type, String name, double altitude, double latitude, double longitude){
|
public FlightPoint(String type, String name, double altitude, double latitude, double longitude){
|
||||||
//extra calculations will have to be used to find heading, legdistance and total distance. If necessary
|
//extra calculations will have to be used to find heading, legdistance and total distance. If necessary
|
||||||
//Type 1 file the file the lecturers gave us
|
//Type 1 file the file the lecturers gave us
|
||||||
|
//indexID = flight path ID
|
||||||
|
//ID = unique Auto Increment value
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.ID = -1;
|
this.ID = -1;
|
||||||
this.indexID = -1;
|
this.indexID = -1;
|
||||||
|
|||||||
@@ -43,5 +43,48 @@ public class AirlineSummaryController extends MenuController{
|
|||||||
currentData = this.parent.getCurrentDataset();
|
currentData = this.parent.getCurrentDataset();
|
||||||
tableView.setItems(FXCollections.observableArrayList(currentData.getAirlines()));
|
tableView.setItems(FXCollections.observableArrayList(currentData.getAirlines()));
|
||||||
}
|
}
|
||||||
|
public void airlineRawDataButton() {
|
||||||
|
try {
|
||||||
|
AirlineRDController rawDataController = (AirlineRDController)
|
||||||
|
parent.replaceSceneContent("airline_raw_data.fxml");
|
||||||
|
rawDataController.setApp(parent);
|
||||||
|
rawDataController.loadTables();
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void flightSummaryButton() {
|
||||||
|
try {
|
||||||
|
FlightSummaryController summaryController = (FlightSummaryController)
|
||||||
|
parent.replaceSceneContent("flight_data_summary.fxml");
|
||||||
|
summaryController.setApp(parent);
|
||||||
|
summaryController.flightPathListView();
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void airportSummaryButton() {
|
||||||
|
try {
|
||||||
|
AirportSummaryController summaryController = (AirportSummaryController)
|
||||||
|
parent.replaceSceneContent("airport_summary.fxml");
|
||||||
|
summaryController.setApp(parent);
|
||||||
|
summaryController.loadTables();
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void routeSummaryButton() {
|
||||||
|
try {
|
||||||
|
RouteSummaryController summaryController = (RouteSummaryController)
|
||||||
|
parent.replaceSceneContent("routes_summary.fxml");
|
||||||
|
summaryController.setApp(parent);
|
||||||
|
summaryController.loadTables();
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,5 +44,48 @@ public class AirportSummaryController extends MenuController{
|
|||||||
currentData = this.parent.getCurrentDataset();
|
currentData = this.parent.getCurrentDataset();
|
||||||
tableView.setItems(FXCollections.observableArrayList(currentData.getAirports()));
|
tableView.setItems(FXCollections.observableArrayList(currentData.getAirports()));
|
||||||
}
|
}
|
||||||
|
public void airportRawDataButton() {
|
||||||
|
try {
|
||||||
|
AirportRDController rawDataController = (AirportRDController)
|
||||||
|
parent.replaceSceneContent("airport_raw_data.fxml");
|
||||||
|
rawDataController.setApp(parent);
|
||||||
|
rawDataController.loadTables();
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void flightSummaryButton() {
|
||||||
|
try {
|
||||||
|
FlightSummaryController summaryController = (FlightSummaryController)
|
||||||
|
parent.replaceSceneContent("flight_data_summary.fxml");
|
||||||
|
summaryController.setApp(parent);
|
||||||
|
summaryController.flightPathListView();
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void routeSummaryButton() {
|
||||||
|
try {
|
||||||
|
RouteSummaryController summaryController = (RouteSummaryController)
|
||||||
|
parent.replaceSceneContent("routes_summary.fxml");
|
||||||
|
summaryController.setApp(parent);
|
||||||
|
summaryController.loadTables();
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void airlineSummaryButton() {
|
||||||
|
try {
|
||||||
|
AirlineSummaryController summaryController = (AirlineSummaryController)
|
||||||
|
parent.replaceSceneContent("airline_summary.fxml");
|
||||||
|
summaryController.setApp(parent);
|
||||||
|
summaryController.loadTables();
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -76,6 +76,40 @@ public class FlightSummaryController implements Initializable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void airportSummaryButton() {
|
||||||
|
try {
|
||||||
|
AirportSummaryController summaryController = (AirportSummaryController)
|
||||||
|
parent.replaceSceneContent("airport_summary.fxml");
|
||||||
|
summaryController.setApp(parent);
|
||||||
|
summaryController.loadTables();
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void routeSummaryButton() {
|
||||||
|
try {
|
||||||
|
RouteSummaryController summaryController = (RouteSummaryController)
|
||||||
|
parent.replaceSceneContent("routes_summary.fxml");
|
||||||
|
summaryController.setApp(parent);
|
||||||
|
summaryController.loadTables();
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void airlineSummaryButton() {
|
||||||
|
try {
|
||||||
|
AirlineSummaryController summaryController = (AirlineSummaryController)
|
||||||
|
parent.replaceSceneContent("airline_summary.fxml");
|
||||||
|
summaryController.setApp(parent);
|
||||||
|
summaryController.loadTables();
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void initialize(URL arg0, ResourceBundle arg1) {
|
public void initialize(URL arg0, ResourceBundle arg1) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
|||||||
@@ -43,5 +43,49 @@ public class RouteSummaryController extends MenuController{
|
|||||||
currentData = this.parent.getCurrentDataset();
|
currentData = this.parent.getCurrentDataset();
|
||||||
tableView.setItems(FXCollections.observableArrayList(currentData.getRoutes()));
|
tableView.setItems(FXCollections.observableArrayList(currentData.getRoutes()));
|
||||||
}
|
}
|
||||||
|
public void routeRawDataButton() {
|
||||||
|
try {
|
||||||
|
RouteRDController rawDataController = (RouteRDController)
|
||||||
|
parent.replaceSceneContent("route_raw_data.fxml");
|
||||||
|
rawDataController.setApp(parent);
|
||||||
|
rawDataController.loadTables();
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void flightSummaryButton() {
|
||||||
|
try {
|
||||||
|
FlightSummaryController summaryController = (FlightSummaryController)
|
||||||
|
parent.replaceSceneContent("flight_data_summary.fxml");
|
||||||
|
summaryController.setApp(parent);
|
||||||
|
summaryController.flightPathListView();
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void airportSummaryButton() {
|
||||||
|
try {
|
||||||
|
AirportSummaryController summaryController = (AirportSummaryController)
|
||||||
|
parent.replaceSceneContent("airport_summary.fxml");
|
||||||
|
summaryController.setApp(parent);
|
||||||
|
summaryController.loadTables();
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void airlineSummaryButton() {
|
||||||
|
try {
|
||||||
|
AirlineSummaryController summaryController = (AirlineSummaryController)
|
||||||
|
parent.replaceSceneContent("airline_summary.fxml");
|
||||||
|
summaryController.setApp(parent);
|
||||||
|
summaryController.loadTables();
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,17 +1,17 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<?import javafx.geometry.Insets?>
|
<?import javafx.geometry.Insets?>
|
||||||
<?import javafx.scene.control.Button?>
|
<?import javafx.scene.control.Button?>
|
||||||
<?import javafx.scene.control.ScrollPane?>
|
<?import javafx.scene.control.ScrollPane?>
|
||||||
<?import javafx.scene.control.TableColumn?>
|
<?import javafx.scene.control.TableColumn?>
|
||||||
<?import javafx.scene.control.TableView?>
|
<?import javafx.scene.control.TableView?>
|
||||||
<?import javafx.scene.layout.AnchorPane?>
|
<?import javafx.scene.layout.AnchorPane?>
|
||||||
<?import javafx.scene.layout.HBox?>
|
<?import javafx.scene.layout.HBox?>
|
||||||
<?import javafx.scene.layout.Pane?>
|
<?import javafx.scene.layout.Pane?>
|
||||||
<?import javafx.scene.layout.VBox?>
|
<?import javafx.scene.layout.VBox?>
|
||||||
<?import javafx.scene.shape.Rectangle?>
|
<?import javafx.scene.shape.Rectangle?>
|
||||||
<?import javafx.scene.text.Font?>
|
<?import javafx.scene.text.Font?>
|
||||||
<?import javafx.scene.text.Text?>
|
<?import javafx.scene.text.Text?>
|
||||||
|
|
||||||
<VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="800.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/8.0.45" xmlns:fx="http://javafx.com/fxml/1" fx:controller="seng202.group9.GUI.AirlineSummaryController">
|
<VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="800.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/8.0.45" xmlns:fx="http://javafx.com/fxml/1" fx:controller="seng202.group9.GUI.AirlineSummaryController">
|
||||||
<children>
|
<children>
|
||||||
@@ -34,16 +34,18 @@
|
|||||||
</Pane>
|
</Pane>
|
||||||
<Pane layoutY="52.0" prefHeight="240.0" prefWidth="480.0" AnchorPane.bottomAnchor="0.0">
|
<Pane layoutY="52.0" prefHeight="240.0" prefWidth="480.0" AnchorPane.bottomAnchor="0.0">
|
||||||
<children>
|
<children>
|
||||||
<Pane layoutX="25.0" layoutY="10.0" prefHeight="220.0" prefWidth="120.0" />
|
<Pane layoutX="25.0" layoutY="10.0" prefHeight="220.0" prefWidth="120.0">
|
||||||
<TableView fx:id="tableView" layoutX="10.0" layoutY="10.0" prefHeight="200.0" prefWidth="378.0">
|
<children>
|
||||||
<columns>
|
<TableView fx:id="tableView" prefHeight="200.0" prefWidth="378.0">
|
||||||
<TableColumn fx:id="columnName" text="Name" />
|
<columns>
|
||||||
<TableColumn fx:id="columnAlias" prefWidth="77.0" text="Alias" />
|
<TableColumn fx:id="columnName" maxWidth="100.0" prefWidth="50.0" text="Name" />
|
||||||
<TableColumn fx:id="columnCountry" prefWidth="86.0" text="Country" />
|
<TableColumn fx:id="columnAlias" prefWidth="77.0" text="Alias" />
|
||||||
<TableColumn fx:id="columnIATA" prefWidth="86.0" text="IATA/FAA" />
|
<TableColumn fx:id="columnCountry" prefWidth="86.0" text="Country" />
|
||||||
<TableColumn fx:id="columnActive" prefWidth="46.0" text="Active" />
|
<TableColumn fx:id="columnIATA" prefWidth="86.0" text="IATA/FAA" />
|
||||||
</columns>
|
<TableColumn fx:id="columnActive" prefWidth="46.0" text="Active" />
|
||||||
</TableView>
|
</columns>
|
||||||
|
</TableView>
|
||||||
|
</children></Pane>
|
||||||
</children>
|
</children>
|
||||||
<padding>
|
<padding>
|
||||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||||
@@ -54,24 +56,24 @@
|
|||||||
<AnchorPane prefHeight="300.0" prefWidth="253.0">
|
<AnchorPane prefHeight="300.0" prefWidth="253.0">
|
||||||
<children>
|
<children>
|
||||||
<Pane layoutY="200.0" prefHeight="100.0" prefWidth="253.0">
|
<Pane layoutY="200.0" prefHeight="100.0" prefWidth="253.0">
|
||||||
<children>
|
<children>
|
||||||
<Button layoutX="20.0" layoutY="14.0" mnemonicParsing="false" prefHeight="25.0" prefWidth="65.0" text="Airports">
|
<Button layoutX="20.0" layoutY="14.0" mnemonicParsing="false" onAction="#airportSummaryButton" prefHeight="25.0" prefWidth="65.0" text="Airports">
|
||||||
<font>
|
<font>
|
||||||
<Font size="12.0" />
|
<Font size="12.0" />
|
||||||
</font>
|
</font>
|
||||||
</Button>
|
</Button>
|
||||||
<Button layoutX="94.0" layoutY="14.0" mnemonicParsing="false" prefHeight="25.0" prefWidth="65.0" text="Routes">
|
<Button layoutX="94.0" layoutY="14.0" mnemonicParsing="false" onAction="#routeSummaryButton" prefHeight="25.0" prefWidth="65.0" text="Routes">
|
||||||
<font>
|
<font>
|
||||||
<Font size="12.0" />
|
<Font size="12.0" />
|
||||||
</font>
|
</font>
|
||||||
</Button>
|
</Button>
|
||||||
<Button layoutX="169.0" layoutY="14.0" mnemonicParsing="false" prefHeight="25.0" prefWidth="65.0" text="Flights">
|
<Button layoutX="169.0" layoutY="14.0" mnemonicParsing="false" onAction="#flightSummaryButton" prefHeight="25.0" prefWidth="65.0" text="Flights">
|
||||||
<font>
|
<font>
|
||||||
<Font size="12.0" />
|
<Font size="12.0" />
|
||||||
</font>
|
</font>
|
||||||
</Button>
|
</Button>
|
||||||
<Button layoutX="20.0" layoutY="61.0" mnemonicParsing="false" prefHeight="25.0" prefWidth="214.0" text="Airline Raw Data" />
|
<Button layoutX="20.0" layoutY="61.0" mnemonicParsing="false" onAction="#airlineRawDataButton" prefHeight="25.0" prefWidth="214.0" text="Airline Raw Data" />
|
||||||
</children>
|
</children>
|
||||||
<padding>
|
<padding>
|
||||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||||
</padding>
|
</padding>
|
||||||
@@ -91,4 +93,4 @@
|
|||||||
</content>
|
</content>
|
||||||
</ScrollPane>
|
</ScrollPane>
|
||||||
</children>
|
</children>
|
||||||
</VBox>
|
</VBox>
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
<children>
|
<children>
|
||||||
<TableView fx:id="tableView" layoutX="10.0" layoutY="10.0" prefHeight="200.0" prefWidth="378.0">
|
<TableView fx:id="tableView" layoutX="10.0" layoutY="10.0" prefHeight="200.0" prefWidth="378.0">
|
||||||
<columns>
|
<columns>
|
||||||
<TableColumn fx:id="columnName" prefWidth="75.0" text="Name" />
|
<TableColumn fx:id="columnName" maxWidth="150.0" prefWidth="75.0" text="Name" />
|
||||||
<TableColumn fx:id="columnCity" prefWidth="75.0" text="City" />
|
<TableColumn fx:id="columnCity" prefWidth="75.0" text="City" />
|
||||||
<TableColumn fx:id="columnCountry" prefWidth="75.0" text="Country" />
|
<TableColumn fx:id="columnCountry" prefWidth="75.0" text="Country" />
|
||||||
<TableColumn fx:id="columnAltitude" prefWidth="75.0" text="Altitude" />
|
<TableColumn fx:id="columnAltitude" prefWidth="75.0" text="Altitude" />
|
||||||
@@ -58,22 +58,22 @@
|
|||||||
<children>
|
<children>
|
||||||
<Pane layoutY="200.0" prefHeight="100.0" prefWidth="253.0">
|
<Pane layoutY="200.0" prefHeight="100.0" prefWidth="253.0">
|
||||||
<children>
|
<children>
|
||||||
<Button layoutX="20.0" layoutY="14.0" mnemonicParsing="false" prefHeight="25.0" prefWidth="65.0" text="Routes">
|
<Button layoutX="20.0" layoutY="14.0" mnemonicParsing="false" onAction="#airlineSummaryButton" prefHeight="25.0" prefWidth="65.0" text="Airline">
|
||||||
<font>
|
<font>
|
||||||
<Font size="12.0" />
|
<Font size="12.0" />
|
||||||
</font>
|
</font>
|
||||||
</Button>
|
</Button>
|
||||||
<Button layoutX="94.0" layoutY="14.0" mnemonicParsing="false" prefHeight="25.0" prefWidth="65.0" text="Airlines">
|
<Button layoutX="94.0" layoutY="14.0" mnemonicParsing="false" onAction="#routeSummaryButton" prefHeight="25.0" prefWidth="65.0" text="Routes">
|
||||||
<font>
|
<font>
|
||||||
<Font size="12.0" />
|
<Font size="12.0" />
|
||||||
</font>
|
</font>
|
||||||
</Button>
|
</Button>
|
||||||
<Button layoutX="169.0" layoutY="14.0" mnemonicParsing="false" prefHeight="25.0" prefWidth="65.0" text="Flights">
|
<Button layoutX="169.0" layoutY="14.0" mnemonicParsing="false" onAction="#flightSummaryButton" prefHeight="25.0" prefWidth="65.0" text="Flights">
|
||||||
<font>
|
<font>
|
||||||
<Font size="12.0" />
|
<Font size="12.0" />
|
||||||
</font>
|
</font>
|
||||||
</Button>
|
</Button>
|
||||||
<Button layoutX="20.0" layoutY="61.0" mnemonicParsing="false" prefHeight="25.0" prefWidth="214.0" text="Airport Raw Data" />
|
<Button layoutX="20.0" layoutY="61.0" mnemonicParsing="false" onAction="#airportRawDataButton" prefHeight="25.0" prefWidth="214.0" text="Airport Raw Data" />
|
||||||
</children>
|
</children>
|
||||||
<padding>
|
<padding>
|
||||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||||
@@ -94,4 +94,4 @@
|
|||||||
</content>
|
</content>
|
||||||
</ScrollPane>
|
</ScrollPane>
|
||||||
</children>
|
</children>
|
||||||
</VBox>
|
</VBox>
|
||||||
|
|||||||
@@ -83,24 +83,24 @@
|
|||||||
</rowConstraints>
|
</rowConstraints>
|
||||||
<children>
|
<children>
|
||||||
<Pane prefHeight="160.0" prefWidth="295.0" GridPane.rowIndex="1">
|
<Pane prefHeight="160.0" prefWidth="295.0" GridPane.rowIndex="1">
|
||||||
<children>
|
<children>
|
||||||
<Button layoutX="33.0" layoutY="82.0" mnemonicParsing="false" prefHeight="25.0" prefWidth="65.0" text="Airports">
|
<Button layoutX="20.0" layoutY="14.0" mnemonicParsing="false" onAction="#airportSummaryButton" prefHeight="25.0" prefWidth="65.0" text="Airports">
|
||||||
<font>
|
<font>
|
||||||
<Font size="12.0" />
|
<Font size="12.0" />
|
||||||
</font>
|
</font>
|
||||||
</Button>
|
</Button>
|
||||||
<Button layoutX="126.0" layoutY="81.0" mnemonicParsing="false" prefHeight="25.0" prefWidth="65.0" text="Routes">
|
<Button layoutX="94.0" layoutY="14.0" mnemonicParsing="false" onAction="#airlineSummaryButton" prefHeight="25.0" prefWidth="65.0" text="Airlines">
|
||||||
<font>
|
<font>
|
||||||
<Font size="12.0" />
|
<Font size="12.0" />
|
||||||
</font>
|
</font>
|
||||||
</Button>
|
</Button>
|
||||||
<Button layoutX="218.0" layoutY="81.0" mnemonicParsing="false" prefHeight="25.0" prefWidth="65.0" text="Airlines">
|
<Button layoutX="169.0" layoutY="14.0" mnemonicParsing="false" onAction="#routeSummaryButton" prefHeight="25.0" prefWidth="65.0" text="Routes">
|
||||||
<font>
|
<font>
|
||||||
<Font size="12.0" />
|
<Font size="12.0" />
|
||||||
</font>
|
</font>
|
||||||
</Button>
|
</Button>
|
||||||
<Button layoutX="33.0" layoutY="129.0" mnemonicParsing="false" onAction="#handleRawDataButton" prefHeight="25.0" prefWidth="250.0" text="Flight Raw Data" />
|
<Button layoutX="20.0" layoutY="61.0" mnemonicParsing="false" onAction="#handleRawDataButton" prefHeight="25.0" prefWidth="214.0" text="Flights Raw Data" />
|
||||||
</children>
|
</children>
|
||||||
<padding>
|
<padding>
|
||||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||||
</padding>
|
</padding>
|
||||||
|
|||||||
@@ -38,11 +38,11 @@
|
|||||||
<children>
|
<children>
|
||||||
<TableView fx:id="tableView" prefHeight="200.0" prefWidth="378.0">
|
<TableView fx:id="tableView" prefHeight="200.0" prefWidth="378.0">
|
||||||
<columns>
|
<columns>
|
||||||
<TableColumn fx:id="columnAirline" prefWidth="75.0" text="Airline" />
|
<TableColumn fx:id="columnAirline" prefWidth="89.0" text="Airline" />
|
||||||
<TableColumn fx:id="columnDepart" prefWidth="75.0" text="Depart" />
|
<TableColumn fx:id="columnDepart" prefWidth="80.99998474121094" text="Depart" />
|
||||||
<TableColumn fx:id="columnArrive" prefWidth="75.0" text="Arrive" />
|
<TableColumn fx:id="columnArrive" prefWidth="67.0" text="Arrive" />
|
||||||
<TableColumn fx:id="columnStops" prefWidth="75.0" text="Stops" />
|
<TableColumn fx:id="columnStops" prefWidth="72.0" text="Stops" />
|
||||||
<TableColumn fx:id="columnEquipment" prefWidth="75.0" text="Equipment" />
|
<TableColumn fx:id="columnEquipment" prefWidth="66.0" text="Equipment" />
|
||||||
</columns>
|
</columns>
|
||||||
</TableView>
|
</TableView>
|
||||||
</children>
|
</children>
|
||||||
@@ -58,22 +58,22 @@
|
|||||||
<children>
|
<children>
|
||||||
<Pane layoutY="200.0" prefHeight="100.0" prefWidth="253.0">
|
<Pane layoutY="200.0" prefHeight="100.0" prefWidth="253.0">
|
||||||
<children>
|
<children>
|
||||||
<Button layoutX="20.0" layoutY="14.0" mnemonicParsing="false" prefHeight="25.0" prefWidth="65.0" text="Airports">
|
<Button layoutX="20.0" layoutY="14.0" mnemonicParsing="false" onAction="#airportSummaryButton" prefHeight="25.0" prefWidth="65.0" text="Airports">
|
||||||
<font>
|
<font>
|
||||||
<Font size="12.0" />
|
<Font size="12.0" />
|
||||||
</font>
|
</font>
|
||||||
</Button>
|
</Button>
|
||||||
<Button layoutX="94.0" layoutY="14.0" mnemonicParsing="false" prefHeight="25.0" prefWidth="65.0" text="Airlines">
|
<Button layoutX="94.0" layoutY="14.0" mnemonicParsing="false" onAction="#airlineSummaryButton" prefHeight="25.0" prefWidth="65.0" text="Airlines">
|
||||||
<font>
|
<font>
|
||||||
<Font size="12.0" />
|
<Font size="12.0" />
|
||||||
</font>
|
</font>
|
||||||
</Button>
|
</Button>
|
||||||
<Button layoutX="169.0" layoutY="14.0" mnemonicParsing="false" prefHeight="25.0" prefWidth="65.0" text="Flights">
|
<Button layoutX="169.0" layoutY="14.0" mnemonicParsing="false" onAction="#flightSummaryButton" prefHeight="25.0" prefWidth="65.0" text="Flights">
|
||||||
<font>
|
<font>
|
||||||
<Font size="12.0" />
|
<Font size="12.0" />
|
||||||
</font>
|
</font>
|
||||||
</Button>
|
</Button>
|
||||||
<Button layoutX="20.0" layoutY="61.0" mnemonicParsing="false" prefHeight="25.0" prefWidth="214.0" text="Routes Raw Data" />
|
<Button layoutX="20.0" layoutY="61.0" mnemonicParsing="false" onAction="#routeRawDataButton" prefHeight="25.0" prefWidth="214.0" text="Routes Raw Data" />
|
||||||
</children>
|
</children>
|
||||||
<padding>
|
<padding>
|
||||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||||
@@ -94,4 +94,4 @@
|
|||||||
</content>
|
</content>
|
||||||
</ScrollPane>
|
</ScrollPane>
|
||||||
</children>
|
</children>
|
||||||
</VBox>
|
</VBox>
|
||||||
|
|||||||
Reference in New Issue
Block a user