|
|
|
@ -19,9 +19,11 @@ import seng202.group9.Core.RoutePath;
|
|
|
|
import seng202.group9.Map.Map;
|
|
|
|
import seng202.group9.Map.Map;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Controller for the Airline summary scene.
|
|
|
|
* Created by michael on 14/09/2016.
|
|
|
|
* Created by michael on 14/09/2016.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public class AirlineSummaryController extends Controller{
|
|
|
|
public class AirlineSummaryController extends Controller{
|
|
|
|
|
|
|
|
//links the fxml to the controller.
|
|
|
|
@FXML
|
|
|
|
@FXML
|
|
|
|
private TableView<Airline> tableView;
|
|
|
|
private TableView<Airline> tableView;
|
|
|
|
@FXML
|
|
|
|
@FXML
|
|
|
|
@ -37,11 +39,16 @@ public class AirlineSummaryController extends Controller{
|
|
|
|
@FXML
|
|
|
|
@FXML
|
|
|
|
private TableColumn<Airline, String> columnIATA;
|
|
|
|
private TableColumn<Airline, String> columnIATA;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Holds data used for the table.
|
|
|
|
private Dataset currentData = null;
|
|
|
|
private Dataset currentData = null;
|
|
|
|
|
|
|
|
|
|
|
|
private Map map;
|
|
|
|
private Map map;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Loads initial state of the scene.
|
|
|
|
|
|
|
|
*/
|
|
|
|
public void load() {
|
|
|
|
public void load() {
|
|
|
|
|
|
|
|
//Fills the table.
|
|
|
|
columnName.setCellValueFactory(new PropertyValueFactory<Airline, String>("Name"));
|
|
|
|
columnName.setCellValueFactory(new PropertyValueFactory<Airline, String>("Name"));
|
|
|
|
columnAlias.setCellValueFactory(new PropertyValueFactory<Airline, String>("Alias"));
|
|
|
|
columnAlias.setCellValueFactory(new PropertyValueFactory<Airline, String>("Alias"));
|
|
|
|
columnCountry.setCellValueFactory(new PropertyValueFactory<Airline, String>("CountryName"));
|
|
|
|
columnCountry.setCellValueFactory(new PropertyValueFactory<Airline, String>("CountryName"));
|
|
|
|
@ -49,6 +56,7 @@ public class AirlineSummaryController extends Controller{
|
|
|
|
columnActive.setCellValueFactory(new PropertyValueFactory<Airline, String>("Active"));
|
|
|
|
columnActive.setCellValueFactory(new PropertyValueFactory<Airline, String>("Active"));
|
|
|
|
currentData = getParent().getCurrentDataset();
|
|
|
|
currentData = getParent().getCurrentDataset();
|
|
|
|
tableView.setItems(FXCollections.observableArrayList(currentData.getAirlines()));
|
|
|
|
tableView.setItems(FXCollections.observableArrayList(currentData.getAirlines()));
|
|
|
|
|
|
|
|
//Sets up map.
|
|
|
|
map = new Map(mapView, new RoutePath());
|
|
|
|
map = new Map(mapView, new RoutePath());
|
|
|
|
tableView.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<Airline>() {
|
|
|
|
tableView.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<Airline>() {
|
|
|
|
public void changed(ObservableValue<? extends Airline> observable, Airline oldValue, Airline newValue) {
|
|
|
|
public void changed(ObservableValue<? extends Airline> observable, Airline oldValue, Airline newValue) {
|
|
|
|
@ -63,15 +71,30 @@ public class AirlineSummaryController extends Controller{
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Changes the scene to the Airline raw data scene.
|
|
|
|
|
|
|
|
*/
|
|
|
|
public void airlineRawDataButton() {
|
|
|
|
public void airlineRawDataButton() {
|
|
|
|
replaceSceneContent(SceneCode.AIRLINE_RAW_DATA);
|
|
|
|
replaceSceneContent(SceneCode.AIRLINE_RAW_DATA);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Changes the scene to the Flight summary scene.
|
|
|
|
|
|
|
|
*/
|
|
|
|
public void flightSummaryButton() {
|
|
|
|
public void flightSummaryButton() {
|
|
|
|
replaceSceneContent(SceneCode.FLIGHT_SUMMARY);
|
|
|
|
replaceSceneContent(SceneCode.FLIGHT_SUMMARY);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Changes the scene to the Airport summary scene.
|
|
|
|
|
|
|
|
*/
|
|
|
|
public void airportSummaryButton() {
|
|
|
|
public void airportSummaryButton() {
|
|
|
|
replaceSceneContent(SceneCode.AIRPORT_SUMMARY);
|
|
|
|
replaceSceneContent(SceneCode.AIRPORT_SUMMARY);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Changes the scene to the Route summary scene.
|
|
|
|
|
|
|
|
*/
|
|
|
|
public void routeSummaryButton() {
|
|
|
|
public void routeSummaryButton() {
|
|
|
|
replaceSceneContent(SceneCode.ROUTE_SUMMARY);
|
|
|
|
replaceSceneContent(SceneCode.ROUTE_SUMMARY);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|