parent
d0c7cbde7d
commit
ae82d7000a
@ -0,0 +1,42 @@
|
|||||||
|
package seng202.group9.GUI;
|
||||||
|
|
||||||
|
import javafx.fxml.FXML;
|
||||||
|
import javafx.scene.control.TableView;
|
||||||
|
import javafx.scene.web.WebView;
|
||||||
|
import seng202.group9.Core.Airport;
|
||||||
|
import seng202.group9.Core.Position;
|
||||||
|
import seng202.group9.Core.Route;
|
||||||
|
import seng202.group9.Core.RoutePath;
|
||||||
|
import seng202.group9.Map.Map;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by fwy13 on 2/10/16.
|
||||||
|
*/
|
||||||
|
public class PopUpMapController extends Controller {
|
||||||
|
@FXML
|
||||||
|
WebView mapView;
|
||||||
|
Map map;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void load() {
|
||||||
|
map = new Map(mapView, new RoutePath());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void loadAirports(ArrayList<Airport> airports){
|
||||||
|
ArrayList<RoutePath> routePaths = new ArrayList<>();
|
||||||
|
for (Airport airport: airports){
|
||||||
|
routePaths.add(airport.getRoutePath());
|
||||||
|
}
|
||||||
|
map.displayAirports(routePaths);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void loadRoutes(ArrayList<Route> routes){
|
||||||
|
ArrayList<RoutePath> routePaths = new ArrayList<>();
|
||||||
|
for (Route route: routes){
|
||||||
|
routePaths.add(route.getRoutePath());
|
||||||
|
}
|
||||||
|
map.displayRoutes(routePaths);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<?import javafx.scene.web.*?>
|
||||||
|
<?import java.lang.*?>
|
||||||
|
<?import javafx.scene.layout.*?>
|
||||||
|
|
||||||
|
<GridPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8" fx:controller="seng202.group9.GUI.PopUpMapController">
|
||||||
|
<columnConstraints>
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||||
|
</columnConstraints>
|
||||||
|
<rowConstraints>
|
||||||
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||||
|
</rowConstraints>
|
||||||
|
<children>
|
||||||
|
<WebView fx:id="mapView" prefHeight="200.0" prefWidth="200.0" />
|
||||||
|
</children>
|
||||||
|
</GridPane>
|
||||||
Loading…
Reference in new issue