Added Warning messages for no internet when loading maps

main
YaFedImYaEatIm 9 years ago
parent 809d272556
commit f07fc76a6d

@ -7,6 +7,7 @@ import javafx.collections.FXCollections;
import javafx.collections.ListChangeListener;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.scene.control.Alert;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.cell.PropertyValueFactory;
@ -38,6 +39,14 @@ public class AirportRouteMapController extends Controller{
if (!checkDataset()){
return;
}
//check if there is internet connectivity
if (!getParent().testInet("maps.google.com")){
Alert alert = new Alert(Alert.AlertType.WARNING);
alert.setTitle("No Internet Connection.");
alert.setHeaderText("Unable to Connect to Google Maps");
alert.setContentText("As we are unable to connect to Google Maps all applications which are supposed to display maps may not work as intended.");
alert.showAndWait();
}
currentDataset = getParent().getCurrentDataset();
//Sets up map.
map = new Map(mapView, new RoutePath(), airportsTable);

@ -5,6 +5,7 @@ import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.scene.control.Alert;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.cell.PropertyValueFactory;
@ -41,6 +42,14 @@ public class EquipByRouteController extends Controller{
if (!checkDataset()){
return;
}
//check if there is internet connectivity
if (!getParent().testInet("maps.google.com")){
Alert alert = new Alert(Alert.AlertType.WARNING);
alert.setTitle("No Internet Connection.");
alert.setHeaderText("Unable to Connect to Google Maps");
alert.setContentText("As we are unable to connect to Google Maps all applications which are supposed to display maps may not work as intended.");
alert.showAndWait();
}
currentDataset = getParent().getCurrentDataset();
//Sets up map.
map = new Map(mapView, new RoutePath(), equipTable);

@ -1,6 +1,7 @@
package seng202.group9.GUI;
import javafx.fxml.FXML;
import javafx.scene.control.Alert;
import javafx.scene.control.TableView;
import javafx.scene.web.WebView;
import seng202.group9.Controller.Dataset;
@ -24,6 +25,14 @@ public class PopUpAirportMapController extends Controller {
@Override
public void load() {
//check if there is internet connectivity
if (!getParent().testInet("maps.google.com")){
Alert alert = new Alert(Alert.AlertType.WARNING);
alert.setTitle("No Internet Connection.");
alert.setHeaderText("Unable to Connect to Google Maps");
alert.setContentText("As we are unable to connect to Google Maps all applications which are supposed to display maps may not work as intended.");
alert.showAndWait();
}
dataset = getParent().getCurrentDataset();
loadAirports();
}
@ -36,12 +45,4 @@ public class PopUpAirportMapController extends Controller {
}
map = new Map(mapView, routePaths, Map.loadAirports);
}
public void loadRoutes(ArrayList<Route> routes){
ArrayList<RoutePath> routePaths = new ArrayList<>();
for (Route route: routes){
routePaths.add(route.getRoutePath());
}
map.displayRoutes(routePaths);
}
}

@ -1,6 +1,7 @@
package seng202.group9.GUI;
import javafx.fxml.FXML;
import javafx.scene.control.Alert;
import javafx.scene.web.WebView;
import seng202.group9.Controller.Dataset;
import seng202.group9.Core.Route;
@ -21,6 +22,14 @@ public class PopUpRouteMapController extends Controller{
@Override
public void load() {
//check if there is internet connectivity
if (!getParent().testInet("maps.google.com")){
Alert alert = new Alert(Alert.AlertType.WARNING);
alert.setTitle("No Internet Connection.");
alert.setHeaderText("Unable to Connect to Google Maps");
alert.setContentText("As we are unable to connect to Google Maps all applications which are supposed to display maps may not work as intended.");
alert.showAndWait();
}
dataset = getParent().getCurrentDataset();
loadRoutes();
}

Loading…
Cancel
Save