Added Warning messages for no internet when loading maps
This commit is contained in:
@@ -7,6 +7,7 @@ import javafx.collections.FXCollections;
|
|||||||
import javafx.collections.ListChangeListener;
|
import javafx.collections.ListChangeListener;
|
||||||
import javafx.collections.ObservableList;
|
import javafx.collections.ObservableList;
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
|
import javafx.scene.control.Alert;
|
||||||
import javafx.scene.control.TableColumn;
|
import javafx.scene.control.TableColumn;
|
||||||
import javafx.scene.control.TableView;
|
import javafx.scene.control.TableView;
|
||||||
import javafx.scene.control.cell.PropertyValueFactory;
|
import javafx.scene.control.cell.PropertyValueFactory;
|
||||||
@@ -38,6 +39,14 @@ public class AirportRouteMapController extends Controller{
|
|||||||
if (!checkDataset()){
|
if (!checkDataset()){
|
||||||
return;
|
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();
|
currentDataset = getParent().getCurrentDataset();
|
||||||
//Sets up map.
|
//Sets up map.
|
||||||
map = new Map(mapView, new RoutePath(), airportsTable);
|
map = new Map(mapView, new RoutePath(), airportsTable);
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import javafx.beans.value.ObservableValue;
|
|||||||
import javafx.collections.FXCollections;
|
import javafx.collections.FXCollections;
|
||||||
import javafx.collections.ObservableList;
|
import javafx.collections.ObservableList;
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
|
import javafx.scene.control.Alert;
|
||||||
import javafx.scene.control.TableColumn;
|
import javafx.scene.control.TableColumn;
|
||||||
import javafx.scene.control.TableView;
|
import javafx.scene.control.TableView;
|
||||||
import javafx.scene.control.cell.PropertyValueFactory;
|
import javafx.scene.control.cell.PropertyValueFactory;
|
||||||
@@ -41,6 +42,14 @@ public class EquipByRouteController extends Controller{
|
|||||||
if (!checkDataset()){
|
if (!checkDataset()){
|
||||||
return;
|
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();
|
currentDataset = getParent().getCurrentDataset();
|
||||||
//Sets up map.
|
//Sets up map.
|
||||||
map = new Map(mapView, new RoutePath(), equipTable);
|
map = new Map(mapView, new RoutePath(), equipTable);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package seng202.group9.GUI;
|
package seng202.group9.GUI;
|
||||||
|
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
|
import javafx.scene.control.Alert;
|
||||||
import javafx.scene.control.TableView;
|
import javafx.scene.control.TableView;
|
||||||
import javafx.scene.web.WebView;
|
import javafx.scene.web.WebView;
|
||||||
import seng202.group9.Controller.Dataset;
|
import seng202.group9.Controller.Dataset;
|
||||||
@@ -24,6 +25,14 @@ public class PopUpAirportMapController extends Controller {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void load() {
|
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();
|
dataset = getParent().getCurrentDataset();
|
||||||
loadAirports();
|
loadAirports();
|
||||||
}
|
}
|
||||||
@@ -36,12 +45,4 @@ public class PopUpAirportMapController extends Controller {
|
|||||||
}
|
}
|
||||||
map = new Map(mapView, routePaths, Map.loadAirports);
|
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;
|
package seng202.group9.GUI;
|
||||||
|
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
|
import javafx.scene.control.Alert;
|
||||||
import javafx.scene.web.WebView;
|
import javafx.scene.web.WebView;
|
||||||
import seng202.group9.Controller.Dataset;
|
import seng202.group9.Controller.Dataset;
|
||||||
import seng202.group9.Core.Route;
|
import seng202.group9.Core.Route;
|
||||||
@@ -21,6 +22,14 @@ public class PopUpRouteMapController extends Controller{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void load() {
|
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();
|
dataset = getParent().getCurrentDataset();
|
||||||
loadRoutes();
|
loadRoutes();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user