diff --git a/src/main/kotlin/application/controller/MenuBarController.kt b/src/main/kotlin/application/controller/MenuBarController.kt index 84dfe7d..6d94861 100644 --- a/src/main/kotlin/application/controller/MenuBarController.kt +++ b/src/main/kotlin/application/controller/MenuBarController.kt @@ -7,6 +7,7 @@ import application.model.observableVessel import javafx.event.EventHandler import javafx.fxml.FXML import javafx.fxml.Initializable +import javafx.scene.control.Alert import javafx.scene.control.CheckMenuItem import javafx.scene.control.MenuBar import javafx.scene.control.MenuItem @@ -52,10 +53,17 @@ class MenuBarController : Initializable { val window = menuBar.scene.window val file = fileChooser.showOpenDialog(window) try { + if (file.extension != "csv") { + val alert = Alert(Alert.AlertType.WARNING) + alert.title = "Warning Alert" + alert.headerText = "Wrong file format." + alert.contentText = "Please choose à .csv file." + alert.showAndWait() + } val vessels = createVesselCollection(file) observableVessel.vessels.clear() observableVessel.vessels = vessels - } catch (ignore: IllegalStateException){ + } catch (ignore: IllegalStateException) { } } diff --git a/src/main/kotlin/map/MapDisplayer.kt b/src/main/kotlin/map/MapDisplayer.kt index 859acc9..e1be20b 100644 --- a/src/main/kotlin/map/MapDisplayer.kt +++ b/src/main/kotlin/map/MapDisplayer.kt @@ -88,7 +88,6 @@ fun displayHeatMapOnMap(map: LeafletMapView) { map.execScript("heatLayer.addLatLng([${message.latitude}, ${message.longitude}]);") } } - } fun displayHeatMapOnMap(map: LeafletMapView, selectedMMSI: Int) {