Merge remote-tracking branch 'origin/master'
# Conflicts: # src/main/java/seng202/group9/GUI/FlightSummaryController.java
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package seng202.group9.GUI;
|
||||
|
||||
import javafx.beans.value.ChangeListener;
|
||||
import javafx.beans.value.ObservableValue;
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.event.EventHandler;
|
||||
@@ -8,10 +10,13 @@ import javafx.fxml.Initializable;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.ListView;
|
||||
import javafx.scene.input.MouseEvent;
|
||||
import javafx.scene.web.WebView;
|
||||
import seng202.group9.Controller.App;
|
||||
import seng202.group9.Controller.Dataset;
|
||||
import seng202.group9.Controller.SceneCode;
|
||||
import seng202.group9.Core.FlightPath;
|
||||
import seng202.group9.Core.RoutePath;
|
||||
import seng202.group9.Map.Map;
|
||||
import seng202.group9.Core.FlightPoint;
|
||||
|
||||
import java.net.URL;
|
||||
@@ -25,6 +30,12 @@ import java.util.ResourceBundle;
|
||||
public class FlightSummaryController extends Controller {
|
||||
|
||||
private Dataset theDataSet = null;
|
||||
|
||||
@FXML
|
||||
private Button flightRawData;
|
||||
private Map map;
|
||||
@FXML
|
||||
private WebView mapView;
|
||||
private int currentPathId = 0;
|
||||
private int currentPathIndex = 0;
|
||||
|
||||
@@ -99,6 +110,16 @@ public class FlightSummaryController extends Controller {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (theDataSet.getFlightPaths().size() > 0){
|
||||
map = new Map(mapView, theDataSet.getFlightPaths().get(0).getRoutePath());
|
||||
}else{
|
||||
map = new Map(mapView, new RoutePath());
|
||||
}
|
||||
flightPathListView.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<String>() {
|
||||
public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
|
||||
map.displayRoute(theDataSet.getFlightPaths().get(flightPathListView.getSelectionModel().getSelectedIndices().get(0)).getRoutePath());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user