Airline Summary controller code built though currently has nothing calling it and has not been tested.
This commit is contained in:
@@ -0,0 +1,47 @@
|
|||||||
|
package seng202.group9.GUI;
|
||||||
|
|
||||||
|
import javafx.collections.FXCollections;
|
||||||
|
import javafx.fxml.FXML;
|
||||||
|
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.Airline;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by michael on 14/09/2016.
|
||||||
|
*/
|
||||||
|
public class AirlineSummaryController extends MenuController{
|
||||||
|
@FXML
|
||||||
|
private TableView<Airline> tableView;
|
||||||
|
@FXML
|
||||||
|
private TableColumn<Airline, String> columnName;
|
||||||
|
@FXML
|
||||||
|
private TableColumn<Airline, String> columnAlias;
|
||||||
|
@FXML
|
||||||
|
private TableColumn<Airline, String> columnCountry;
|
||||||
|
@FXML
|
||||||
|
private TableColumn<Airline, String> columnActive;
|
||||||
|
@FXML
|
||||||
|
private TableColumn<Airline, String> columnIATA;
|
||||||
|
|
||||||
|
private Dataset currentData = null;
|
||||||
|
|
||||||
|
App parent;
|
||||||
|
|
||||||
|
public void setApp(App parent){
|
||||||
|
this.parent = parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void loadTables() {
|
||||||
|
columnName.setCellValueFactory(new PropertyValueFactory<Airline, String>("Name"));
|
||||||
|
columnAlias.setCellValueFactory(new PropertyValueFactory<Airline, String>("Alias"));
|
||||||
|
columnCountry.setCellValueFactory(new PropertyValueFactory<Airline, String>("Country"));
|
||||||
|
columnIATA.setCellValueFactory(new PropertyValueFactory<Airline, String>("IATA"));
|
||||||
|
columnActive.setCellValueFactory(new PropertyValueFactory<Airline, String>("Active"));
|
||||||
|
currentData = this.parent.getCurrentDataset();
|
||||||
|
tableView.setItems(FXCollections.observableArrayList(currentData.getAirlines()));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -65,6 +65,16 @@ public class MenuController implements Initializable{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void viewAirlineSummary() {
|
||||||
|
try {
|
||||||
|
AirlineSummaryController summaryController = (AirlineSummaryController) parent.replaceSceneContent("airline_summary.fxml");
|
||||||
|
summaryController.setApp(parent);
|
||||||
|
summaryController.loadTables();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void setApp(App parent){
|
public void setApp(App parent){
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<?import java.lang.*?>
|
|
||||||
<?import javafx.geometry.*?>
|
|
||||||
<?import javafx.scene.control.*?>
|
|
||||||
<?import javafx.scene.layout.*?>
|
|
||||||
<?import javafx.scene.shape.*?>
|
|
||||||
<?import javafx.scene.text.*?>
|
|
||||||
<?import javafx.geometry.Insets?>
|
<?import javafx.geometry.Insets?>
|
||||||
<?import javafx.scene.control.Button?>
|
<?import javafx.scene.control.Button?>
|
||||||
<?import javafx.scene.control.ListView?>
|
|
||||||
<?import javafx.scene.control.ScrollPane?>
|
<?import javafx.scene.control.ScrollPane?>
|
||||||
<?import javafx.scene.control.TextArea?>
|
<?import javafx.scene.control.TableColumn?>
|
||||||
|
<?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?>
|
||||||
@@ -19,7 +13,7 @@
|
|||||||
<?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" xmlns:fx="http://javafx.com/fxml/1" fx:controller="seng202.group9.GUI.FlightSummaryController">
|
<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.FlightSummaryController">
|
||||||
<children>
|
<children>
|
||||||
<ScrollPane prefHeight="800.0" prefWidth="800.0">
|
<ScrollPane prefHeight="800.0" prefWidth="800.0">
|
||||||
<content>
|
<content>
|
||||||
@@ -43,11 +37,11 @@
|
|||||||
<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 layoutX="10.0" layoutY="10.0" prefHeight="200.0" prefWidth="378.0">
|
<TableView layoutX="10.0" layoutY="10.0" prefHeight="200.0" prefWidth="378.0">
|
||||||
<columns>
|
<columns>
|
||||||
<TableColumn prefWidth="75.0" text="Name" />
|
<TableColumn fx:id="columnName" text="Name" />
|
||||||
<TableColumn prefWidth="75.0" text="City" />
|
<TableColumn fx:id="columnCity" prefWidth="77.0" text="City" />
|
||||||
<TableColumn prefWidth="75.0" text="Country" />
|
<TableColumn fx:id="columnCountry" prefWidth="86.0" text="Country" />
|
||||||
<TableColumn prefWidth="75.0" text="Altitude" />
|
<TableColumn fx:id="columnIATA" prefWidth="86.0" text="IATA/FAA" />
|
||||||
<TableColumn prefWidth="75.0" text="IATA/FAA" />
|
<TableColumn fx:id="columnActive" prefWidth="46.0" text="Active" />
|
||||||
</columns>
|
</columns>
|
||||||
</TableView>
|
</TableView>
|
||||||
</children>
|
</children>
|
||||||
|
|||||||
Reference in New Issue
Block a user