Minor updates to the GUI files for both raw data and summary Flight pages. Implemented the loading of data into tables for flight raw data.

main
Liam Beckett 9 years ago
parent 399d1eb069
commit 208621650e

@ -86,13 +86,13 @@ public class App extends Application
} catch (DataException e) {
e.printStackTrace();
}
*/
try {
System.out.println(currentDataset.importFlight("res/Samples/NZCH-WSSS.csv"));
} catch (DataException e) {
e.printStackTrace();
}
*/
}
/**

@ -1,20 +1,49 @@
package seng202.group9.GUI;
import javafx.collections.FXCollections;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.cell.PropertyValueFactory;
import seng202.group9.Controller.App;
import seng202.group9.Controller.Dataset;
import seng202.group9.Core.FlightPath;
import seng202.group9.Core.FlightPoint;
import java.net.URL;
import java.util.ArrayList;
import java.util.ResourceBundle;
/**
* Controller for the Flights Raw Data Scene.
* Created by Liam Beckett on 13/09/2016.
*/
public class FlightRawDataController implements Initializable {
//TableColumn<>
@FXML
private TableView<FlightPoint> flightTableView;
@FXML
private TableColumn<FlightPoint, String> flightIdCol;
@FXML
private TableColumn<FlightPoint, String> flightNameCol;
@FXML
private TableColumn<FlightPoint, String> flightTypeCol;
@FXML
private TableColumn<FlightPoint, String> flightViaCol;
@FXML
private TableColumn<FlightPoint, String> flightAltitudeCol;
@FXML
private TableColumn<FlightPoint, String> flightLatCol;
@FXML
private TableColumn<FlightPoint, String> flightLongCol;
@FXML
private TableColumn<FlightPoint, String> flightHeadCol;
@FXML
private TableColumn<FlightPoint, String> flightLegDisCol;
@FXML
private TableColumn<FlightPoint, String> flightTotDisCol;
private Dataset theDataSet = null;
App parent;
@ -24,9 +53,30 @@ public class FlightRawDataController implements Initializable {
this.parent = parent;
}
//public void loadTables() {
public void loadTables() {
flightIdCol.setCellValueFactory(new PropertyValueFactory<FlightPoint, String>("ID"));
flightNameCol.setCellValueFactory(new PropertyValueFactory<FlightPoint, String>("Name"));
flightTypeCol.setCellValueFactory(new PropertyValueFactory<FlightPoint, String>("Type"));
flightViaCol.setCellValueFactory(new PropertyValueFactory<FlightPoint, String>("Via"));
flightAltitudeCol.setCellValueFactory(new PropertyValueFactory<FlightPoint, String>("Altitude"));
flightLatCol.setCellValueFactory(new PropertyValueFactory<FlightPoint, String>("Latitude"));
flightLongCol.setCellValueFactory(new PropertyValueFactory<FlightPoint, String>("Longitude"));
flightHeadCol.setCellValueFactory(new PropertyValueFactory<FlightPoint, String>("Heading"));
flightLegDisCol.setCellValueFactory(new PropertyValueFactory<FlightPoint, String>("Leg_Dist"));
flightTotDisCol.setCellValueFactory(new PropertyValueFactory<FlightPoint, String>("Tot_Dist"));
//}
theDataSet = this.parent.getCurrentDataset();
// try{
// System.out.println(theDataSet.importAirline("res/Samples/Airlines.txt"));
// } catch (DataException e){
// e.printStackTrace();
// }
ArrayList<FlightPath> flightPaths = new ArrayList();
flightPaths = theDataSet.getFlightPaths();
int firstID = flightPaths.get(0).getID();
ArrayList<FlightPoint> flightPoints = flightPaths.get(0).getFlight();
flightTableView.setItems(FXCollections.observableArrayList(flightPoints));
}
public void initialize(URL arg0, ResourceBundle arg1) {

@ -68,6 +68,7 @@ public class MenuController implements Initializable{
FlightRawDataController rawDataController = (FlightRawDataController)
parent.replaceSceneContent("flight_raw_data.fxml");
rawDataController.setApp(parent);
rawDataController.loadTables();
} catch (Exception e) {
e.printStackTrace();
}

@ -2,6 +2,7 @@
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.ListView?>
<?import javafx.scene.control.ScrollPane?>
<?import javafx.scene.layout.AnchorPane?>
@ -33,17 +34,25 @@
<children>
<GridPane GridPane.rowIndex="1">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="237.0" minWidth="10.0" prefWidth="217.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="268.0" minWidth="10.0" prefWidth="267.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="237.0" minWidth="10.0" prefWidth="168.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="316.0" minWidth="10.0" prefWidth="316.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="172.0" minHeight="0.0" prefHeight="44.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="461.0" minHeight="10.0" prefHeight="454.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Pane prefHeight="400.0" prefWidth="150.0" GridPane.rowIndex="1">
<Pane prefHeight="461.0" prefWidth="175.0" GridPane.rowIndex="1">
<children>
<ListView layoutX="20.0" layoutY="31.0" prefHeight="400.0" prefWidth="177.0" />
<ListView layoutX="20.0" layoutY="-1.0" prefHeight="432.0" prefWidth="125.0">
<padding>
<Insets top="20.0" />
</padding></ListView>
<Label layoutX="32.0" layoutY="4.0" text="Flight Path Files">
<font>
<Font size="15.0" />
</font>
</Label>
</children>
</Pane>
<Pane prefHeight="60.0" prefWidth="330.0">
@ -57,7 +66,7 @@
</Pane>
<Pane prefHeight="934.0" prefWidth="474.0" GridPane.columnIndex="1" GridPane.rowIndex="1">
<children>
<Rectangle arcHeight="5.0" arcWidth="5.0" fill="#0d93e0" height="400.0" layoutX="5.0" layoutY="31.0" smooth="false" stroke="BLACK" strokeType="INSIDE" strokeWidth="0.0" width="257.0" />
<Rectangle arcHeight="5.0" arcWidth="5.0" fill="#0d93e0" height="432.0" layoutX="5.0" layoutY="-1.0" smooth="false" stroke="BLACK" strokeType="INSIDE" strokeWidth="0.0" width="305.0" />
</children>
<padding>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />

@ -1,16 +1,22 @@
<?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.geometry.Insets?>
<?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="600.0" prefWidth="800.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>
<ScrollPane hbarPolicy="NEVER" prefHeight="603.0" prefWidth="751.0" vbarPolicy="ALWAYS">
<content>
@ -29,8 +35,8 @@
<children>
<GridPane GridPane.rowIndex="2">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="393.0" minWidth="10.0" prefWidth="150.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="651.0" minWidth="10.0" prefWidth="650.0" />
<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" />
@ -38,11 +44,16 @@
<children>
<Pane prefHeight="434.0" prefWidth="304.0">
<children>
<ListView layoutX="25.0" prefHeight="411.0" prefWidth="100.0">
<ListView layoutX="25.0" prefHeight="411.0" prefWidth="125.0">
<padding>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
<Insets top="20.0" />
</padding>
</ListView>
<Label layoutX="36.0" layoutY="4.0" text="Flight Path Files">
<font>
<Font size="15.0" />
</font>
</Label>
</children>
</Pane>
<GridPane prefHeight="473.0" prefWidth="650.0" GridPane.columnIndex="1">
@ -55,29 +66,25 @@
<RowConstraints maxHeight="137.0" minHeight="1.0" prefHeight="60.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<ScrollPane prefHeight="292.0" prefWidth="650.0">
<content>
<TableView>
<columns>
<TableColumn prefWidth="75.0" text="ID" />
<TableColumn prefWidth="100.0" text="Name" />
<TableColumn prefWidth="75.0" text="Type" />
<TableColumn prefWidth="100.0" text="Via" />
<TableColumn prefWidth="75.0" text="Altitude" />
<TableColumn prefWidth="100.0" text="Latitude" />
<TableColumn prefWidth="100.0" text="Longitude" />
<TableColumn prefWidth="100.0" text="Heading" />
<TableColumn prefWidth="75.0" text="Leg Dist" />
<TableColumn prefWidth="75.0" text="Tot Dist" />
</columns>
</TableView>
</content>
</ScrollPane>
<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 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>
</children>
</GridPane>
</children>

Loading…
Cancel
Save