public class DefaultLocationManager extends Object implements LocationManager, RemotePollerPresenter
This class implements both LocationManager (the model portion of
the webapp) and RemotePollerPresenter (the controller portion of
the webapp code). It is responsible for maintaining the knowledgebase of
Location objects and responding to events triggered when:
Location instances are added or m_updatedIf this class ever grows too large, we can split it into separate model and controller classes.
| Modifier and Type | Class and Description |
|---|---|
class |
DefaultLocationManager.ApplicationUpdater |
class |
DefaultLocationManager.LocationUpdater |
LOCATION_EVENT_DOMAIN| Constructor and Description |
|---|
DefaultLocationManager(com.google.gwt.event.shared.HandlerManager eventBus,
ApplicationView view,
LocationStatusServiceAsync remoteService,
de.novanic.eventservice.client.event.RemoteEventService remoteEventService,
CommandExecutor commandExecutor)
Constructor for DefaultLocationManager.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addLocationManagerInitializationCompleteEventHandler(LocationManagerInitializationCompleteEventHander handler)
addLocationManagerInitializationCompleteEventHandler
|
void |
applicationClicked()
applicationClicked
|
protected void |
displayDialog(String title,
String contents)
displayDialog
|
void |
fitMapToLocations()
fitMapToLocations
|
Set<String> |
getAllApplicationNames()
Fetch a list of all application names.
|
Set<String> |
getAllLocationNames()
getAllLocationNames
|
ApplicationInfo |
getApplicationInfo(String name) |
LocationInfo |
getLocation(String locationName) |
static String |
getLocationInfoDetails(LocationInfo locationInfo,
LocationDetails locationDetails)
getLocationInfoDetails
|
List<LocationInfo> |
getLocationsForLocationPanel()
TODO: Figure out if this public function is necessary or if we can get
by just responding to incoming events.
|
protected LocationStatusServiceAsync |
getRemoteService()
getRemoteService
|
protected void |
initializationComplete()
initializationComplete
|
void |
initialize(Set<Status> statuses)
initialize
|
void |
locationClicked()
locationClicked
|
void |
onApplicationDeselected(ApplicationDeselectedEvent event)
onApplicationDeselected
|
void |
onApplicationSelected(ApplicationSelectedEvent event)
onApplicationSelected
|
void |
onBoundsChanged(MapPanelBoundsChangedEvent e)
onBoundsChanged
|
void |
onFiltersChanged(FilterPanel.Filters filters) |
void |
onGWTMarkerClicked(GWTMarkerClickedEvent event)
onGWTMarkerClicked
|
void |
onGWTMarkerInfoWindowRefresh(GWTMarkerInfoWindowRefreshEvent event) |
void |
onLocationSelected(LocationPanelSelectEvent event)
onLocationSelected
|
void |
onStatusSelectionChanged(Status status,
boolean selected) |
void |
onTagCleared()
onTagCleared
|
void |
onTagSelected(String tagName) |
void |
removeApplication(String applicationName)
removeApplication
|
void |
reportError(String errorMessage,
Throwable throwable) |
void |
updateApplication(ApplicationInfo applicationInfo)
updateApplication
|
void |
updateComplete()
Invoked by the
UpdateCompleteRemoteEvent event. |
void |
updateLocation(LocationInfo newLocation)
This action is used to respond to server-side events when a location is updated.
|
void |
updateLocations(Collection<LocationInfo> locations) |
public DefaultLocationManager(com.google.gwt.event.shared.HandlerManager eventBus,
ApplicationView view,
LocationStatusServiceAsync remoteService,
de.novanic.eventservice.client.event.RemoteEventService remoteEventService,
CommandExecutor commandExecutor)
Constructor for DefaultLocationManager.
eventBus - a HandlerManager object.view - mapPanel - a MapPanel object.panel - a SplitLayoutPanel object.locationPanel - a LocationPanel object.public void initialize(Set<Status> statuses)
LocationManagerinitialize
initialize in interface LocationManagerprotected void initializationComplete()
initializationComplete
protected LocationStatusServiceAsync getRemoteService()
getRemoteService
LocationStatusServiceAsync object.public void addLocationManagerInitializationCompleteEventHandler(LocationManagerInitializationCompleteEventHander handler)
addLocationManagerInitializationCompleteEventHandler
addLocationManagerInitializationCompleteEventHandler in interface LocationManagerhandler - a LocationManagerInitializationCompleteEventHander object.public Set<String> getAllLocationNames()
getAllLocationNames
Set object.public void fitMapToLocations()
fitMapToLocations
public List<LocationInfo> getLocationsForLocationPanel()
ArrayList object.public void onLocationSelected(LocationPanelSelectEvent event)
onLocationSelected
Handler triggered when a user clicks on a specific location record.onLocationSelected in interface LocationPanelSelectEventHandlerevent - a LocationPanelSelectEvent object.public void onBoundsChanged(MapPanelBoundsChangedEvent e)
onBoundsChanged
Refresh the list of locations whenever the map panel boundaries change.onBoundsChanged in interface MapPanelBoundsChangedEventHandlere - a MapPanelBoundsChangedEvent object.public void updateLocation(LocationInfo newLocation)
LocationUpdatedRemoteEvent and
LocationsUpdatedRemoteEvent events.updateLocation in interface MapRemoteEventHandlernewLocation - a LocationInfo object.public void updateApplication(ApplicationInfo applicationInfo)
updateApplication
Invoked by theApplicationUpdatedRemoteEvent and
ApplicationUpdatedRemoteEvent events.updateApplication in interface MapRemoteEventHandlerapplicationInfo - a ApplicationInfo object.public void removeApplication(String applicationName)
removeApplication
removeApplication in interface MapRemoteEventHandlerapplicationName - a String object.public void updateComplete()
UpdateCompleteRemoteEvent event.updateComplete in interface MapRemoteEventHandlerpublic void onFiltersChanged(FilterPanel.Filters filters)
onFiltersChanged in interface FilterPanel.FiltersChangedEventHandlerpublic void onTagSelected(String tagName)
onTagSelected in interface TagPanel.TagSelectedEventHandlerpublic void onTagCleared()
onTagCleared
onTagCleared in interface TagPanel.TagClearedEventHandlerpublic Set<String> getAllApplicationNames()
Set object.public ApplicationInfo getApplicationInfo(String name)
public LocationInfo getLocation(String locationName)
public void onGWTMarkerClicked(GWTMarkerClickedEvent event)
onGWTMarkerClicked
onGWTMarkerClicked in interface GWTMarkerClickedEventHandlerevent - a GWTMarkerClickedEvent object.public void onGWTMarkerInfoWindowRefresh(GWTMarkerInfoWindowRefreshEvent event)
onGWTMarkerInfoWindowRefresh in interface GWTMarkerInfoWindowRefreshHandlerpublic void onStatusSelectionChanged(Status status, boolean selected)
onStatusSelectionChanged in interface FilterPanel.StatusSelectionChangedEventHandlerpublic void onApplicationSelected(ApplicationSelectedEvent event)
onApplicationSelected
onApplicationSelected in interface ApplicationSelectedEventHandlerevent - a ApplicationSelectedEvent object.public void onApplicationDeselected(ApplicationDeselectedEvent event)
onApplicationDeselected
onApplicationDeselected in interface ApplicationDeselectedEventHandlerevent - a ApplicationDeselectedEvent object.public void locationClicked()
locationClicked
locationClicked in interface LocationManagerpublic void applicationClicked()
applicationClicked
applicationClicked in interface LocationManagerpublic static String getLocationInfoDetails(LocationInfo locationInfo, LocationDetails locationDetails)
getLocationInfoDetails
locationInfo - a LocationInfo object.locationDetails - a LocationDetails object.String object.public void updateLocations(Collection<LocationInfo> locations)
updateLocations in interface MapRemoteEventHandlerCopyright © 2020. All rights reserved.