public class MapView extends ViewWithMenu
Modifier and Type | Field and Description |
---|---|
private javafx.scene.layout.AnchorPane |
anchorpane |
private javafx.scene.layout.AnchorPane |
anchorPane
The view container
|
private javafx.scene.control.Button |
clearFiltersButton |
private static int |
CLOSE_BUTTON_HEIGHT |
private com.jfoenix.controls.JFXSlider |
distanceSlider |
private com.jfoenix.controls.JFXDrawer |
drawer |
private static java.lang.String |
FILTER_MENU_FXML
The fxml resource for the filter menu
|
private javafx.scene.control.Button |
filterButton |
private javafx.scene.layout.VBox |
filterMenuBox |
private javafx.scene.control.Button |
filterMenuButton |
private javafx.scene.control.CheckBox |
fridayCheckBox |
private static java.lang.String |
MAP_FXML
The fxml resource for the view
|
private MapComponent |
mapComponent |
private MapController |
mapController |
private javafx.scene.control.CheckBox |
mondayCheckBox |
private javafx.scene.control.CheckBox |
publicHolidayCheckBox |
private javafx.scene.control.CheckBox |
saturdayCheckBox |
private com.jfoenix.controls.JFXTextField |
shopNameField |
private java.util.List<Shop> |
shops |
private static int |
STACK_PANE_WIDTH |
private com.jfoenix.controls.JFXChipView<Product> |
stockContainer |
private javafx.scene.control.CheckBox |
sundayCheckBox |
private javafx.scene.control.CheckBox |
thursdayCheckBox |
private com.jfoenix.controls.JFXTimePicker |
timePicker |
private javafx.scene.control.CheckBox |
tuesdayCheckBox |
private javafx.scene.web.WebView |
webView
The webView containing the map
|
private javafx.scene.control.CheckBox |
wednesdayCheckBox |
Constructor and Description |
---|
MapView(MapController controller,
javafx.scene.Scene scene)
Initializes the view, creates the map Component and the filter menu
|
Modifier and Type | Method and Description |
---|---|
void |
acknowledgeControllerTourReady(Position start,
Position end)
Tells the Controller that the map is ready to display the Best Tour
|
private void |
clearAllFiltersFields()
Resets all filters to default
|
void |
clearFiltersOnMap()
Re-displays all the shops on the map
|
private java.lang.String |
createShopMarkerContent(Shop shop)
Creates the marker content for the shop, e.g. create a String containing
HTML that shows the shop name and its schedule.
|
void |
exportShopArticles(int shopId)
Allows the user to export the articles of a shop
|
void |
filterShops(java.util.List<Shop> shopsToKeep)
Filters the shops markers on the map
|
private java.util.List<Day> |
getSelectedDays()
Gets all the days that the user has selected
|
java.util.List<Shop> |
getShops()
Gets all the shops displayed in the view
|
private Time |
getTimeFromPicker()
Gets the time that the user has selected
|
Position |
getUserPosition() |
javafx.scene.web.WebView |
getWebView()
Gets the webView in which the map is displayed
|
void |
hideFilterMenu() |
void |
importShopArticles(int shopId)
Allows the user to import articles in a shop
|
void |
removeBestTourPositions()
Removes the start and end markers for a best tour
|
private void |
setBestTourPaneStyle(javafx.scene.layout.StackPane stackPane,
javafx.scene.control.Accordion accordion,
javafx.scene.control.Button closeButton)
Sets the style of the pane of the best tour.
|
private void |
setupFilterMenu()
Sets up all the UI element for the filter menu
|
private void |
setupMap()
Sets up the map: it creates all the markers for the shops, adds them to
the map and then shows the map.
|
void |
showBestTour(BestTour bestTour)
Show a best tour on the map
|
private void |
showBestTourPane(java.util.List<GroceryList> groceryLists)
Creates the pane used to show the user which article of a grocery list
he has to buy in each shop
|
private void |
showBestTourRoute(java.util.List<Position> path)
Shows the User the route he has to take for a best tour
|
void |
showNoBestTourError() |
void |
showUnexpectedError() |
void |
updateUserPosition(double latitude,
double longitude)
Updates the current position of the user
|
createMenu, disableHelpButton, enableHelpButton, getHeader, onEditProfileClick, onHelpClick, onLogoutClick, onMyGroceryListsClick, onMyRecipesClick, onShowMapClick
showDatabaseConnectionError, showDataBaseInternalError
private static final java.lang.String MAP_FXML
private static final java.lang.String FILTER_MENU_FXML
private static final int STACK_PANE_WIDTH
private static final int CLOSE_BUTTON_HEIGHT
private MapController mapController
private javafx.scene.layout.AnchorPane anchorpane
private javafx.scene.control.Button filterMenuButton
private com.jfoenix.controls.JFXDrawer drawer
private javafx.scene.control.Button filterButton
private javafx.scene.control.Button clearFiltersButton
private javafx.scene.layout.VBox filterMenuBox
private com.jfoenix.controls.JFXTextField shopNameField
private com.jfoenix.controls.JFXChipView<Product> stockContainer
private com.jfoenix.controls.JFXSlider distanceSlider
private com.jfoenix.controls.JFXTimePicker timePicker
private javafx.scene.control.CheckBox mondayCheckBox
private javafx.scene.control.CheckBox tuesdayCheckBox
private javafx.scene.control.CheckBox wednesdayCheckBox
private javafx.scene.control.CheckBox thursdayCheckBox
private javafx.scene.control.CheckBox fridayCheckBox
private javafx.scene.control.CheckBox saturdayCheckBox
private javafx.scene.control.CheckBox sundayCheckBox
private javafx.scene.control.CheckBox publicHolidayCheckBox
private javafx.scene.web.WebView webView
private javafx.scene.layout.AnchorPane anchorPane
private MapComponent mapComponent
private java.util.List<Shop> shops
public MapView(MapController controller, javafx.scene.Scene scene)
controller
- The MapControllerscene
- The Scene in which the view will be createdprivate void setupMap()
private void setupFilterMenu()
private java.lang.String createShopMarkerContent(Shop shop)
shop
- private java.util.List<Day> getSelectedDays()
private Time getTimeFromPicker()
private void clearAllFiltersFields()
public void updateUserPosition(double latitude, double longitude)
latitude
- His new latitudelongitude
- His new longitudepublic void exportShopArticles(int shopId)
shopId
- The shop from which the articles should be exportedpublic void importShopArticles(int shopId)
shopId
- The shop in which the articles should be importedpublic void showBestTour(BestTour bestTour)
bestTour
- The best tour that has to be shownprivate void showBestTourPane(java.util.List<GroceryList> groceryLists)
groceryLists
- private void showBestTourRoute(java.util.List<Position> path)
path
- private void setBestTourPaneStyle(javafx.scene.layout.StackPane stackPane, javafx.scene.control.Accordion accordion, javafx.scene.control.Button closeButton)
stackPane
- accordion
- closeButton
- public java.util.List<Shop> getShops()
public javafx.scene.web.WebView getWebView()
public Position getUserPosition()
public void acknowledgeControllerTourReady(Position start, Position end)
start
- The start position of the best tourend
- The end position of the best tourpublic void showNoBestTourError()
public void showUnexpectedError()
public void removeBestTourPositions()
public void filterShops(java.util.List<Shop> shopsToKeep)
shopsToKeep
- The shops that should remain on the mappublic void hideFilterMenu()
public void clearFiltersOnMap()