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)
LocationManager
initialize
initialize
in interface LocationManager
protected void initializationComplete()
initializationComplete
protected LocationStatusServiceAsync getRemoteService()
getRemoteService
LocationStatusServiceAsync
object.public void addLocationManagerInitializationCompleteEventHandler(LocationManagerInitializationCompleteEventHander handler)
addLocationManagerInitializationCompleteEventHandler
addLocationManagerInitializationCompleteEventHandler
in interface LocationManager
handler
- 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 LocationPanelSelectEventHandler
event
- a LocationPanelSelectEvent
object.public void onBoundsChanged(MapPanelBoundsChangedEvent e)
onBoundsChanged
Refresh the list of locations whenever the map panel boundaries change.onBoundsChanged
in interface MapPanelBoundsChangedEventHandler
e
- a MapPanelBoundsChangedEvent
object.public void updateLocation(LocationInfo newLocation)
LocationUpdatedRemoteEvent
and
LocationsUpdatedRemoteEvent
events.updateLocation
in interface MapRemoteEventHandler
newLocation
- a LocationInfo
object.public void updateApplication(ApplicationInfo applicationInfo)
updateApplication
Invoked by theApplicationUpdatedRemoteEvent
and
ApplicationUpdatedRemoteEvent
events.updateApplication
in interface MapRemoteEventHandler
applicationInfo
- a ApplicationInfo
object.public void removeApplication(String applicationName)
removeApplication
removeApplication
in interface MapRemoteEventHandler
applicationName
- a String
object.public void updateComplete()
UpdateCompleteRemoteEvent
event.updateComplete
in interface MapRemoteEventHandler
public void onFiltersChanged(FilterPanel.Filters filters)
onFiltersChanged
in interface FilterPanel.FiltersChangedEventHandler
public void onTagSelected(String tagName)
onTagSelected
in interface TagPanel.TagSelectedEventHandler
public void onTagCleared()
onTagCleared
onTagCleared
in interface TagPanel.TagClearedEventHandler
public Set<String> getAllApplicationNames()
Set
object.public ApplicationInfo getApplicationInfo(String name)
public LocationInfo getLocation(String locationName)
public void onGWTMarkerClicked(GWTMarkerClickedEvent event)
onGWTMarkerClicked
onGWTMarkerClicked
in interface GWTMarkerClickedEventHandler
event
- a GWTMarkerClickedEvent
object.public void onGWTMarkerInfoWindowRefresh(GWTMarkerInfoWindowRefreshEvent event)
onGWTMarkerInfoWindowRefresh
in interface GWTMarkerInfoWindowRefreshHandler
public void onStatusSelectionChanged(Status status, boolean selected)
onStatusSelectionChanged
in interface FilterPanel.StatusSelectionChangedEventHandler
public void onApplicationSelected(ApplicationSelectedEvent event)
onApplicationSelected
onApplicationSelected
in interface ApplicationSelectedEventHandler
event
- a ApplicationSelectedEvent
object.public void onApplicationDeselected(ApplicationDeselectedEvent event)
onApplicationDeselected
onApplicationDeselected
in interface ApplicationDeselectedEventHandler
event
- a ApplicationDeselectedEvent
object.public void locationClicked()
locationClicked
locationClicked
in interface LocationManager
public void applicationClicked()
applicationClicked
applicationClicked
in interface LocationManager
public 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 MapRemoteEventHandler
Copyright © 2019. All rights reserved.