Implemented the list view of the different paths in the database. Currently only displays the names without any response when clicked. Also made slight adjustments to the summary and raw data Flight GUIs

This commit is contained in:
Liam Beckett
2016-09-15 10:14:33 +12:00
parent 9912f2c3af
commit f212be8dbd
6 changed files with 71 additions and 27 deletions
@@ -1,9 +1,16 @@
package seng202.group9.GUI;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.ListView;
import seng202.group9.Controller.App;
import seng202.group9.Controller.Dataset;
import seng202.group9.Core.FlightPath;
import java.net.URL;
import java.util.ArrayList;
import java.util.ResourceBundle;
/**
@@ -11,12 +18,37 @@ import java.util.ResourceBundle;
*/
public class FlightSummaryController implements Initializable {
App parent;
private Dataset theDataSet = null;
App parent;
public void setApp(App parent){
this.parent = parent;
}
@FXML
ListView<String> flightPathListView;
final ObservableList<String> flightList = FXCollections.observableArrayList();
public void flightPathListView() {
try {
theDataSet = this.parent.getCurrentDataset();
ArrayList<FlightPath> flightPaths = new ArrayList();
flightPaths = theDataSet.getFlightPaths();
for(int i = 0; i<flightPaths.size(); i++ ){
int pathID = flightPaths.get(i).getID();
String pathSource = flightPaths.get(i).departsFrom();
String pathDestin = flightPaths.get(i).arrivesAt();
String flightPathDisplayName = Integer.toString(pathID) + "_" + pathSource + "_" + pathDestin;
flightList.add(flightPathDisplayName);
}
flightPathListView.setItems(flightList);
} catch (Exception e) {
e.printStackTrace();
}
}
public void initialize(URL arg0, ResourceBundle arg1) {
// TODO Auto-generated method stub