Airline Summary controller code built though currently has nothing calling it and has not been tested.
parent
9912f2c3af
commit
ab21d0f25d
@ -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()));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in new issue