commit
cd1c505dc6
Binary file not shown.
@ -0,0 +1,104 @@
|
||||
package seng202.group9.GUI;
|
||||
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.Alert;
|
||||
import javafx.scene.control.TableColumn;
|
||||
import javafx.scene.control.TableView;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.control.cell.PropertyValueFactory;
|
||||
import seng202.group9.Controller.App;
|
||||
import seng202.group9.Controller.Dataset;
|
||||
import seng202.group9.Core.Airline;
|
||||
|
||||
/**
|
||||
* Created by Sunguin on 2016/09/13.
|
||||
*/
|
||||
public class AirlineRDController extends MenuController {
|
||||
|
||||
@FXML
|
||||
private TableView<Airline> tableView;
|
||||
@FXML
|
||||
private TableColumn<Airline, String> airlIDcol;
|
||||
@FXML
|
||||
private TableColumn<Airline, String> airlNamecol;
|
||||
@FXML
|
||||
private TableColumn<Airline, String> airlAliascol;
|
||||
@FXML
|
||||
private TableColumn<Airline, String> airlIATAcol;
|
||||
@FXML
|
||||
private TableColumn<Airline, String> airlICAOcol;
|
||||
@FXML
|
||||
private TableColumn<Airline, String> airlCallsigncol;
|
||||
@FXML
|
||||
private TableColumn<Airline, String> airlCountrycol;
|
||||
@FXML
|
||||
private TableColumn<Airline, String> airlActivecol;
|
||||
@FXML
|
||||
private TextField airlNameBox;
|
||||
@FXML
|
||||
private TextField airlAliasBox;
|
||||
@FXML
|
||||
private TextField airlIATABox;
|
||||
@FXML
|
||||
private TextField airlICAOBox;
|
||||
@FXML
|
||||
private TextField airlCallsignBox;
|
||||
@FXML
|
||||
private TextField airlCountryBox;
|
||||
@FXML
|
||||
private TextField airlActiveBox;
|
||||
|
||||
|
||||
App parent;
|
||||
|
||||
public void setApp(App parent){
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
private Dataset theDataSet = null;
|
||||
|
||||
public void loadTables() {
|
||||
airlIDcol.setCellValueFactory(new PropertyValueFactory<Airline, String>("ID"));
|
||||
airlNamecol.setCellValueFactory(new PropertyValueFactory<Airline, String>("Name"));
|
||||
airlAliascol.setCellValueFactory(new PropertyValueFactory<Airline, String>("Alias"));
|
||||
//Need to check IATA and ICAO
|
||||
airlIATAcol.setCellValueFactory(new PropertyValueFactory<Airline, String>("ICAO"));
|
||||
airlICAOcol.setCellValueFactory(new PropertyValueFactory<Airline, String>("IATA"));
|
||||
airlCallsigncol.setCellValueFactory(new PropertyValueFactory<Airline, String>("CallSign"));
|
||||
airlCountrycol.setCellValueFactory(new PropertyValueFactory<Airline, String>("Country"));
|
||||
airlActivecol.setCellValueFactory(new PropertyValueFactory<Airline, String>("Active"));
|
||||
|
||||
theDataSet = this.parent.getCurrentDataset();
|
||||
tableView.setItems(FXCollections.observableArrayList(theDataSet.getAirlines()));
|
||||
}
|
||||
|
||||
//Dummy function to test the add button.
|
||||
//Will edit when ID is added automatically.
|
||||
public void addAirlineSingle() {
|
||||
try {
|
||||
theDataSet.addAirline(
|
||||
airlNameBox.getText(),
|
||||
airlAliasBox.getText(),
|
||||
airlIATABox.getText(),
|
||||
airlICAOBox.getText(),
|
||||
airlCallsignBox.getText(),
|
||||
airlCountryBox.getText(),
|
||||
airlActiveBox.getText());
|
||||
airlNameBox.clear();
|
||||
airlAliasBox.clear();
|
||||
airlIATABox.clear();
|
||||
airlICAOBox.clear();
|
||||
airlCallsignBox.clear();
|
||||
airlCountryBox.clear();
|
||||
airlActiveBox.clear();
|
||||
tableView.setItems(FXCollections.observableArrayList(theDataSet.getAirlines()));
|
||||
} catch ( Exception e ) {
|
||||
Alert alert = new Alert(Alert.AlertType.ERROR);
|
||||
alert.setTitle("Airline Data Error");
|
||||
alert.setHeaderText("Error adding a custom airline entry.");
|
||||
alert.setContentText(e.getMessage());
|
||||
alert.showAndWait();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,151 @@
|
||||
package seng202.group9.GUI;
|
||||
|
||||
import javafx.beans.InvalidationListener;
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.collections.ListChangeListener;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.control.cell.PropertyValueFactory;
|
||||
import javafx.util.Callback;
|
||||
import seng202.group9.Controller.App;
|
||||
import seng202.group9.Controller.Dataset;
|
||||
import seng202.group9.Core.Airport;
|
||||
import seng202.group9.Core.City;
|
||||
import seng202.group9.Core.Country;
|
||||
|
||||
|
||||
/**
|
||||
* Created by Sunguin on 2016/09/13.
|
||||
*/
|
||||
public class AirportRDController extends MenuController{
|
||||
|
||||
@FXML
|
||||
private TableView<Airport> tableViewAirportRD;
|
||||
@FXML
|
||||
private TableColumn<Airport, String> airpIDcol;
|
||||
@FXML
|
||||
private TableColumn<Airport, String> airpNamecol;
|
||||
@FXML
|
||||
private TableColumn<Airport, String> airpCitycol;
|
||||
@FXML
|
||||
private TableColumn<Airport, String> airpCountrycol;
|
||||
@FXML
|
||||
private TableColumn<Airport, String> airpIATAFFAcol;
|
||||
@FXML
|
||||
private TableColumn<Airport, String> airpICAOcol;
|
||||
@FXML
|
||||
private TableColumn<Airport, String> airpLatitudecol;
|
||||
@FXML
|
||||
private TableColumn<Airport, String> airpLongitudecol;
|
||||
@FXML
|
||||
private TableColumn<Airport, String> airpAltitudecol;
|
||||
@FXML
|
||||
private TableColumn<Airport, City> airpTimezonecol;
|
||||
@FXML
|
||||
private TableColumn<Airport, Country> airpDSTcol;
|
||||
@FXML
|
||||
private TableColumn<Airport, City> airpTzcol;
|
||||
|
||||
@FXML
|
||||
private TextField airpNameBox;
|
||||
@FXML
|
||||
private TextField airpCityBox;
|
||||
@FXML
|
||||
private TextField airpCountryBox;
|
||||
@FXML
|
||||
private TextField airpIATAFFABox;
|
||||
@FXML
|
||||
private TextField airpICAOBox;
|
||||
@FXML
|
||||
private TextField airpLatitudeBox;
|
||||
@FXML
|
||||
private TextField airpLongitudeBox;
|
||||
@FXML
|
||||
private TextField airpAltitudeBox;
|
||||
@FXML
|
||||
private TextField airpTimezoneBox;
|
||||
@FXML
|
||||
private TextField airpDSTBox;
|
||||
@FXML
|
||||
private TextField airpTzBox;
|
||||
|
||||
|
||||
private Dataset theDataSet = null;
|
||||
|
||||
App parent;
|
||||
|
||||
public void setApp(App parent){
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public void loadTables() {
|
||||
airpIDcol.setCellValueFactory(new PropertyValueFactory<Airport, String>("ID"));
|
||||
airpNamecol.setCellValueFactory(new PropertyValueFactory<Airport, String>("Name"));
|
||||
airpCitycol.setCellValueFactory(new PropertyValueFactory<Airport, String>("City"));
|
||||
airpCountrycol.setCellValueFactory(new PropertyValueFactory<Airport, String>("Country"));
|
||||
airpIATAFFAcol.setCellValueFactory(new PropertyValueFactory<Airport, String>("IATA_FFA"));
|
||||
airpICAOcol.setCellValueFactory(new PropertyValueFactory<Airport, String>("ICAO"));
|
||||
airpLatitudecol.setCellValueFactory(new PropertyValueFactory<Airport, String>("Latitude"));
|
||||
airpLongitudecol.setCellValueFactory(new PropertyValueFactory<Airport, String>("Longitude"));
|
||||
airpAltitudecol.setCellValueFactory(new PropertyValueFactory<Airport, String>("Altitude"));
|
||||
airpTimezonecol.setCellValueFactory(new PropertyValueFactory<Airport, City>("Timezone"));
|
||||
airpDSTcol.setCellValueFactory(new PropertyValueFactory<Airport, Country>("DST"));
|
||||
airpTzcol.setCellValueFactory(new PropertyValueFactory<Airport, City>("Tz"));
|
||||
|
||||
// airpTimezonecol.setCellFactory(new Callback<TableColumn<Airport, String>, TableCell<Airport, City>>() {
|
||||
//
|
||||
// @Override
|
||||
// public TableCell<Airport, City> call(TableColumn<Airport, City> param) {
|
||||
// TableCell<Airport, City> timeZoneCell = new TableCell<Airport, City>() {
|
||||
// @Override
|
||||
// protected void updateItem(City timezone, boolean empty) {
|
||||
// if (timezone != null) {
|
||||
// Label timeZoneLabel = new Label(timezone.getTimeOlson());
|
||||
// setGraphic(timeZoneLabel);
|
||||
// }
|
||||
// }
|
||||
// };
|
||||
//
|
||||
// return timeZoneCell;
|
||||
// }
|
||||
// });
|
||||
theDataSet = this.parent.getCurrentDataset();
|
||||
tableViewAirportRD.setItems(FXCollections.observableArrayList(theDataSet.getAirports()));
|
||||
}
|
||||
|
||||
public void addAirportSingle() {
|
||||
try {
|
||||
theDataSet.addAirport(
|
||||
airpNameBox.getText(),
|
||||
airpCityBox.getText(),
|
||||
airpCountryBox.getText(),
|
||||
airpIATAFFABox.getText(),
|
||||
airpICAOBox.getText(),
|
||||
airpLatitudeBox.getText(),
|
||||
airpLongitudeBox.getText(),
|
||||
airpAltitudeBox.getText(),
|
||||
airpTimezoneBox.getText(),
|
||||
airpDSTBox.getText(),
|
||||
airpTzBox.getText());
|
||||
airpCityBox.clear();
|
||||
airpCountryBox.clear();
|
||||
airpIATAFFABox.clear();
|
||||
airpICAOBox.clear();
|
||||
airpLatitudeBox.clear();
|
||||
airpLongitudeBox.clear();
|
||||
airpAltitudeBox.clear();
|
||||
airpTimezoneBox.clear();
|
||||
airpDSTBox.clear();
|
||||
airpTzBox.clear();
|
||||
tableViewAirportRD.setItems(FXCollections.observableArrayList(theDataSet.getAirports()));
|
||||
} catch ( Exception e ) {
|
||||
Alert alert = new Alert(Alert.AlertType.ERROR);
|
||||
alert.setTitle("Airline Data Error");
|
||||
alert.setHeaderText("Error adding a custom airport entry.");
|
||||
alert.setContentText(e.getMessage());
|
||||
alert.showAndWait();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package seng202.group9.GUI;
|
||||
|
||||
import seng202.group9.Controller.App;
|
||||
|
||||
/**
|
||||
* Created by Sunguin on 2016/09/14.
|
||||
*/
|
||||
public class RouteRDController extends MenuController {
|
||||
App parent;
|
||||
|
||||
public void setApp(App parent){
|
||||
this.parent = parent;
|
||||
}
|
||||
}
|
||||
@ -1,71 +1,103 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.*?>
|
||||
<?import javafx.scene.text.*?>
|
||||
<?import javafx.scene.paint.*?>
|
||||
<?import javafx.geometry.*?>
|
||||
<?import javafx.scene.effect.*?>
|
||||
<?import javafx.scene.shape.*?>
|
||||
<?import java.lang.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.ListView?>
|
||||
<?import javafx.scene.control.ScrollPane?>
|
||||
<?import javafx.scene.control.TableColumn?>
|
||||
<?import javafx.scene.control.TableView?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?import javafx.scene.layout.ColumnConstraints?>
|
||||
<?import javafx.scene.layout.GridPane?>
|
||||
<?import javafx.scene.layout.Pane?>
|
||||
<?import javafx.scene.layout.RowConstraints?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
<?import javafx.scene.text.Text?>
|
||||
|
||||
<VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="seng202.group9.GUI.FlightRawDataController">
|
||||
<VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/8.0.65" xmlns:fx="http://javafx.com/fxml/1" fx:controller="seng202.group9.GUI.FlightRawDataController">
|
||||
<children>
|
||||
<AnchorPane prefHeight="371.0" prefWidth="600.0">
|
||||
<children>
|
||||
<HBox prefHeight="300.0" prefWidth="583.0">
|
||||
<ScrollPane hbarPolicy="NEVER" prefHeight="603.0" prefWidth="751.0" vbarPolicy="NEVER">
|
||||
<content>
|
||||
<AnchorPane prefHeight="371.0" prefWidth="600.0">
|
||||
<children>
|
||||
<AnchorPane prefHeight="300.0" prefWidth="330.0">
|
||||
<GridPane prefHeight="600.0" prefWidth="800.0">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints maxHeight="193.0" minHeight="10.0" prefHeight="33.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="193.0" minHeight="10.0" prefHeight="73.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="504.0" minHeight="10.0" prefHeight="434.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="62.0" minHeight="10.0" prefHeight="62.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<Pane layoutY="-6.0" prefHeight="60.0" prefWidth="274.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="309.0" AnchorPane.topAnchor="0.0">
|
||||
<GridPane GridPane.rowIndex="2">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="393.0" minWidth="10.0" prefWidth="176.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="651.0" minWidth="10.0" prefWidth="624.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<Text layoutX="15.0" layoutY="40.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Flight Raw Data">
|
||||
<font>
|
||||
<Font size="29.0" />
|
||||
</font>
|
||||
</Text>
|
||||
</children>
|
||||
</Pane>
|
||||
<Pane layoutY="52.0" prefHeight="240.0" prefWidth="583.0" AnchorPane.bottomAnchor="0.0">
|
||||
<children>
|
||||
<Pane layoutX="15.0" prefHeight="220.0" prefWidth="120.0">
|
||||
<Pane prefHeight="434.0" prefWidth="304.0">
|
||||
<children>
|
||||
<ScrollBar layoutX="100.0" orientation="VERTICAL" prefHeight="240.0" prefWidth="17.0" />
|
||||
<ListView prefHeight="240.0" prefWidth="100.0" />
|
||||
<Group layoutX="60.0" layoutY="31.0" />
|
||||
<ListView fx:id="flightPathListView" layoutX="25.0" layoutY="27.0" prefHeight="384.0" prefWidth="125.0" />
|
||||
<Label layoutX="31.0" layoutY="4.0" text="Flight Path File(s)">
|
||||
<font>
|
||||
<Font size="15.0" />
|
||||
</font>
|
||||
</Label>
|
||||
</children>
|
||||
</Pane>
|
||||
<ScrollPane layoutX="141.0" prefHeight="240.0" prefWidth="430.0">
|
||||
<content>
|
||||
<TableView prefHeight="238.0" prefWidth="750.0">
|
||||
<GridPane prefHeight="473.0" prefWidth="650.0" GridPane.columnIndex="1">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="617.0" minWidth="10.0" prefWidth="607.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="318.0" minWidth="10.0" prefWidth="43.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints maxHeight="414.0" minHeight="10.0" prefHeight="374.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="137.0" minHeight="1.0" prefHeight="60.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<Pane GridPane.rowIndex="1">
|
||||
<children>
|
||||
<Button layoutX="540.0" layoutY="10.0" mnemonicParsing="false" text="Analyse" GridPane.rowIndex="1" />
|
||||
</children>
|
||||
</Pane>
|
||||
<TableView fx:id="flightTableView">
|
||||
<columns>
|
||||
<TableColumn prefWidth="75.0" text="ID" />
|
||||
<TableColumn prefWidth="75.0" text="Type" />
|
||||
<TableColumn prefWidth="75.0" text="Via" />
|
||||
<TableColumn prefWidth="75.0" text="Altitude" />
|
||||
<TableColumn prefWidth="75.0" text="Latitude" />
|
||||
<TableColumn prefWidth="75.0" text="Longitude" />
|
||||
<TableColumn prefWidth="75.0" text="Leg Dist" />
|
||||
<TableColumn prefWidth="75.0" text="Tot Dist" />
|
||||
<TableColumn prefWidth="75.0" text="Heading (True)" />
|
||||
<TableColumn prefWidth="75.0" text="Name" />
|
||||
<TableColumn fx:id="flightIdCol" prefWidth="75.0" text="ID" />
|
||||
<TableColumn fx:id="flightNameCol" prefWidth="100.0" text="Name" />
|
||||
<TableColumn fx:id="flightTypeCol" prefWidth="75.0" text="Type" />
|
||||
<TableColumn fx:id="flightViaCol" prefWidth="100.0" text="Via" />
|
||||
<TableColumn fx:id="flightAltitudeCol" prefWidth="75.0" text="Altitude" />
|
||||
<TableColumn fx:id="flightLatCol" prefWidth="100.0" text="Latitude" />
|
||||
<TableColumn fx:id="flightLongCol" prefWidth="100.0" text="Longitude" />
|
||||
<TableColumn fx:id="flightHeadCol" prefWidth="100.0" text="Heading" />
|
||||
<TableColumn fx:id="flightLegDisCol" prefWidth="75.0" text="Leg Dist" />
|
||||
<TableColumn fx:id="flightTotDisCol" prefWidth="75.0" text="Tot Dist" />
|
||||
</columns>
|
||||
</TableView>
|
||||
</content>
|
||||
</ScrollPane>
|
||||
</children>
|
||||
</GridPane>
|
||||
</children>
|
||||
</GridPane>
|
||||
<Pane prefHeight="135.0" prefWidth="400.0" GridPane.rowIndex="1">
|
||||
<children>
|
||||
<Text layoutX="24.0" layoutY="45.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Flight Raw Data">
|
||||
<font>
|
||||
<Font size="48.0" />
|
||||
</font>
|
||||
</Text>
|
||||
</children>
|
||||
<padding>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||
</padding>
|
||||
</Pane>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</GridPane>
|
||||
</children>
|
||||
</HBox>
|
||||
<ScrollBar layoutX="583.0" orientation="VERTICAL" prefHeight="371.0" prefWidth="17.0" />
|
||||
<Button layoutX="501.0" layoutY="315.0" mnemonicParsing="false" text="Analyse" />
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</AnchorPane>
|
||||
</content>
|
||||
</ScrollPane>
|
||||
</children>
|
||||
</VBox>
|
||||
|
||||
Loading…
Reference in new issue