Package uk.ac.rdg.resc.godiva.client
Class Godiva
- java.lang.Object
-
- uk.ac.rdg.resc.godiva.client.BaseWmsClient
-
- uk.ac.rdg.resc.godiva.client.Godiva
-
- All Implemented Interfaces:
com.google.gwt.core.client.EntryPoint,org.gwtopenmaps.openlayers.client.event.EventListener,org.gwtopenmaps.openlayers.client.event.MapMoveListener,org.gwtopenmaps.openlayers.client.event.MapZoomListener,AviExportHandler,ElevationSelectionHandler,GodivaActionsHandler,LayerSelectionHandler,PaletteSelectionHandler,TimeDateSelectionHandler,ErrorHandler
public class Godiva extends BaseWmsClient implements AviExportHandler
This is a concrete implementation ofBaseWmsClientfor a client which handles a single WMS layer at a time- Author:
- Guy Griffiths
-
-
Field Summary
Fields Modifier and Type Field Description protected AnimationButtonanimprotected StringcurrentLayerExtentprotected com.google.gwt.user.client.ui.AnchordocLinkprotected booleandownloadableprotected com.google.gwt.user.client.ui.Anchoremailprotected com.google.gwt.user.client.ui.PushButtoninfoButtonprotected com.google.gwt.user.client.ui.AnchorkmzLinkprotected LayerSelectorIFlayerSelectorprotected com.google.gwt.user.client.ui.ImageloadingImageprotected com.google.gwt.user.client.ui.Imagelogoprotected com.google.gwt.user.client.ui.Anchorpermalinkprotected booleanpermalinkingprotected CaseInsensitiveParameterMappermalinkParamsMapprotected booleanprofilesSupportedprotected booleanqueryableprotected com.google.gwt.user.client.ui.Anchorscreenshotprotected booleantimeseriesSupportedprotected GodivaStateInfowidgetCollectionprotected static StringWMS_LAYER_IDprotected com.google.gwt.user.client.ui.PushButtonzoomToLayerExtents-
Fields inherited from class uk.ac.rdg.resc.godiva.client.BaseWmsClient
dateTimeDetailsLoaded, docHref, layerDetailsLoaded, mapArea, mapHeight, mapWidth, minMaxDetailsLoaded, nearestTime, proxyUrl
-
-
Constructor Summary
Constructors Constructor Description Godiva()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidanimationStarted(String times, String fps)This is called when an animation is started.voidanimationStopped()Called when the animation is stopped.protected voidavailableTimesLoaded(String layerId, List<String> availableTimes, String nearestTime)This is called once a list of available times has been loadedvoiddisableWidgets()Called to disable widgets.voidenableWidgets()Called to enable widgets.StringgetAviUrl(String times, String frameRate)Returns the URL to fetch an AVI file.protected StringgetCurrentTime()Returns the "current" time.protected ElevationSelectorIFgetElevationSelector()Gets a new elevation selector.protected LayerSelectorIFgetLayerSelector()Gets a new layer selector.protected com.google.gwt.user.client.ui.WidgetgetLayout()Gets the layout.protected com.google.gwt.user.client.ui.ImagegetLogo()This is something that will almost certainly be changed for custom clients, so put it in a method which can be overriddenprotected PaletteSelectorIFgetPaletteSelector(LayerSelectorIF wmsUrlProvider, DialogBoxWithCloseButton.CentrePosIF localCentre)Gets a new palette selector.protected TimeSelectorIFgetTimeSelector()Gets a new time selector.protected GodivaStateInfogetWidgetCollection(String layerId)Gets theGodivaStateInfofor the specified layerprotected voidinit()This gets called once the page has loaded.protected voidlayerDetailsLoaded(LayerDetails layerDetails)This is called once a layer's details have been loaded.protected voidloadingFinished()This is called when all loading processes have finishedprotected voidloadingStarted()This is called when a loading process startsprotected voidmenuLoaded(LayerMenuItem menuTree)voidonMapMove(org.gwtopenmaps.openlayers.client.event.MapMoveListener.MapMoveEvent eventObject)voidonMapZoom(org.gwtopenmaps.openlayers.client.event.MapZoomListener.MapZoomEvent eventObject)protected voidrequestAndPopulateMenu()Requests the layer menu from the server.protected voidrequestLayerDetails(String wmsUrl, String layerId, String currentTime, boolean autoZoomAndPalette)Request details about a particular layer.voidsetOpacity(String layerId, float opacity)Called when the opacity of a layer is setprotected voidsetUnitConverter(UnitConverter converter)Overrides the parent method using the single-WMS layer.voidupdateLinksEtc()Updates the links (KMZ, screenshot, email, permalink...)protected voidupdateMap(MapArea mapArea, String layerUpdated)This is where the map should be updated.-
Methods inherited from class uk.ac.rdg.resc.godiva.client.BaseWmsClient
autoAdjustPalette, dateSelected, datetimeSelected, elevationSelected, getMapArea, getMapHeight, getMapWidth, getUrlFromGetArgs, getWmsRequestUrl, handleCustomParams, handleError, initWithDefaults, invalidJson, layerDeselected, layerSelected, logScaleChanged, maybeRequestAutoRange, onModuleLoad, paletteChanged, populateWidgets, rangeLoaded, refreshLayerList, scaleRangeChanged, setLoading, setUnitConverter, updateMapBase
-
-
-
-
Field Detail
-
WMS_LAYER_ID
protected static final String WMS_LAYER_ID
- See Also:
- Constant Field Values
-
layerSelector
protected LayerSelectorIF layerSelector
-
widgetCollection
protected GodivaStateInfo widgetCollection
-
infoButton
protected com.google.gwt.user.client.ui.PushButton infoButton
-
logo
protected com.google.gwt.user.client.ui.Image logo
-
loadingImage
protected com.google.gwt.user.client.ui.Image loadingImage
-
permalinking
protected boolean permalinking
-
permalinkParamsMap
protected CaseInsensitiveParameterMap permalinkParamsMap
-
kmzLink
protected com.google.gwt.user.client.ui.Anchor kmzLink
-
permalink
protected com.google.gwt.user.client.ui.Anchor permalink
-
email
protected com.google.gwt.user.client.ui.Anchor email
-
screenshot
protected com.google.gwt.user.client.ui.Anchor screenshot
-
docLink
protected com.google.gwt.user.client.ui.Anchor docLink
-
anim
protected AnimationButton anim
-
queryable
protected boolean queryable
-
downloadable
protected boolean downloadable
-
timeseriesSupported
protected boolean timeseriesSupported
-
profilesSupported
protected boolean profilesSupported
-
currentLayerExtent
protected String currentLayerExtent
-
zoomToLayerExtents
protected com.google.gwt.user.client.ui.PushButton zoomToLayerExtents
-
-
Method Detail
-
init
protected void init()
Description copied from class:BaseWmsClientThis gets called once the page has loaded. Subclasses should use for initializing any widgets, and setting the layout. If this is not implemented, a blank page will be displayed- Specified by:
initin classBaseWmsClient
-
getWidgetCollection
protected GodivaStateInfo getWidgetCollection(String layerId)
Description copied from class:BaseWmsClientGets theGodivaStateInfofor the specified layer- Specified by:
getWidgetCollectionin classBaseWmsClient- Parameters:
layerId- The WMS layer ID- Returns:
- The state information, usually in the form of widgets
-
requestAndPopulateMenu
protected void requestAndPopulateMenu()
Requests the layer menu from the server. When the menu is returned, menuLoaded will be called- Specified by:
requestAndPopulateMenuin classBaseWmsClient
-
availableTimesLoaded
protected void availableTimesLoaded(String layerId, List<String> availableTimes, String nearestTime)
Description copied from class:BaseWmsClientThis is called once a list of available times has been loaded- Specified by:
availableTimesLoadedin classBaseWmsClient- Parameters:
layerId- the layer for which times have been loadedavailableTimes- aListof available timesnearestTime- the nearest time to the current time (for e.g. auto selection)
-
updateMap
protected void updateMap(MapArea mapArea, String layerUpdated)
Description copied from class:BaseWmsClientThis is where the map should be updated. It gets called when all details have been loaded and we actually want to update the map. Clients should handle this in the appropriate way, which will almost certainly involve a call to mapArea.addLayer(...)- Specified by:
updateMapin classBaseWmsClient- Parameters:
mapArea- The map area which can be updatedlayerUpdated- The ID of the layer which we are viewing
-
loadingStarted
protected void loadingStarted()
Description copied from class:BaseWmsClientThis is called when a loading process starts- Specified by:
loadingStartedin classBaseWmsClient
-
loadingFinished
protected void loadingFinished()
Description copied from class:BaseWmsClientThis is called when all loading processes have finished- Specified by:
loadingFinishedin classBaseWmsClient
-
getCurrentTime
protected String getCurrentTime()
Description copied from class:BaseWmsClientReturns the "current" time. The definition of current may depend on exactly what the client does. This is the time used when requesting layer details from the server - i.e. the time to which the "nearestTime" will refer- Specified by:
getCurrentTimein classBaseWmsClient- Returns:
- A string representation of the current time
-
enableWidgets
public void enableWidgets()
Description copied from interface:GodivaActionsHandlerCalled to enable widgets. This allows control of which widgets are available when e.g. animation is happening- Specified by:
enableWidgetsin interfaceGodivaActionsHandler
-
disableWidgets
public void disableWidgets()
Description copied from interface:GodivaActionsHandlerCalled to disable widgets. This allows control of which widgets are available when e.g. animation is happening- Specified by:
disableWidgetsin interfaceGodivaActionsHandler
-
getAviUrl
public String getAviUrl(String times, String frameRate)
Description copied from interface:AviExportHandlerReturns the URL to fetch an AVI file. This depends on the timesteps and frame rate required (all other data can be obtained from the current state (GodivaStateInfo)- Specified by:
getAviUrlin interfaceAviExportHandler- Parameters:
times- A string representing the desired timesframeRate- The frame rate, in frames-per-second- Returns:
- A URL which will lead to an AVI file containing an animation
-
animationStarted
public void animationStarted(String times, String fps)
Description copied from interface:AviExportHandlerThis is called when an animation is started. We provide the times and FPS so that the implementation can call getAviUrl if required (for example to set a link to the AVI when an animation is started as an overlay)- Specified by:
animationStartedin interfaceAviExportHandler
-
animationStopped
public void animationStopped()
Description copied from interface:AviExportHandlerCalled when the animation is stopped.- Specified by:
animationStoppedin interfaceAviExportHandler
-
setOpacity
public void setOpacity(String layerId, float opacity)
Description copied from interface:PaletteSelectionHandlerCalled when the opacity of a layer is set- Specified by:
setOpacityin interfacePaletteSelectionHandler- Parameters:
layerId- The layer to set the opacity ofopacity- The opacity as a float ranging from 0-1
-
layerDetailsLoaded
protected void layerDetailsLoaded(LayerDetails layerDetails)
Description copied from class:BaseWmsClientThis is called once a layer's details have been loaded. By default this will just populate the widgets associated with this layer, but subclasses may want to override this method to implement custom behaviour before/after populating the widgets- Overrides:
layerDetailsLoadedin classBaseWmsClient- Parameters:
layerDetails- the details received from the server
-
onMapMove
public void onMapMove(org.gwtopenmaps.openlayers.client.event.MapMoveListener.MapMoveEvent eventObject)
- Specified by:
onMapMovein interfaceorg.gwtopenmaps.openlayers.client.event.MapMoveListener- Overrides:
onMapMovein classBaseWmsClient
-
onMapZoom
public void onMapZoom(org.gwtopenmaps.openlayers.client.event.MapZoomListener.MapZoomEvent eventObject)
- Specified by:
onMapZoomin interfaceorg.gwtopenmaps.openlayers.client.event.MapZoomListener- Overrides:
onMapZoomin classBaseWmsClient
-
requestLayerDetails
protected void requestLayerDetails(String wmsUrl, String layerId, String currentTime, boolean autoZoomAndPalette)
Description copied from class:BaseWmsClientRequest details about a particular layer. Once loaded, layerDetailsLoaded will be called.- Overrides:
requestLayerDetailsin classBaseWmsClient- Parameters:
wmsUrl- the base URL of the WMS server containing the layer detailslayerId- the ID of the layer whose details are desiredcurrentTime- the time we want to know the closest available time to. Can be nullautoZoomAndPalette- true if we want to zoom to extents and possibly auto-adjust palette once the details have been loaded. Note that this will only auto-adjust the palette if the conditions are right
-
setUnitConverter
protected void setUnitConverter(UnitConverter converter)
Overrides the parent method using the single-WMS layer. Subclasses should use this to set aUnitConverter- Parameters:
converter- TheUnitConverterto use for the WMS layer
-
updateLinksEtc
public void updateLinksEtc()
Updates the links (KMZ, screenshot, email, permalink...)- Specified by:
updateLinksEtcin interfaceGodivaActionsHandler
-
menuLoaded
protected void menuLoaded(LayerMenuItem menuTree)
-
getLogo
protected com.google.gwt.user.client.ui.Image getLogo()
This is something that will almost certainly be changed for custom clients, so put it in a method which can be overridden
-
getPaletteSelector
protected PaletteSelectorIF getPaletteSelector(LayerSelectorIF wmsUrlProvider, DialogBoxWithCloseButton.CentrePosIF localCentre)
Gets a new palette selector. This method is used in the construction of the Godiva interface and is only called once.- Parameters:
wmsUrlProvider- ALayerSelectorIFwhich provides the currently selected WMS URL- Returns:
- A new instance of a
PaletteSelectorIF
-
getTimeSelector
protected TimeSelectorIF getTimeSelector()
Gets a new time selector. This method is used in the construction of the Godiva interface and is only called once.- Returns:
- A new instance of a
TimeSelectorIF
-
getElevationSelector
protected ElevationSelectorIF getElevationSelector()
Gets a new elevation selector. This method is used in the construction of the Godiva interface and is only called once.- Returns:
- A new instance of an
ElevationSelectorIF
-
getLayerSelector
protected LayerSelectorIF getLayerSelector()
Gets a new layer selector. This method is used in the construction of the Godiva interface and is only called once.- Returns:
- A new instance of a
LayerSelectorIF
-
getLayout
protected com.google.gwt.user.client.ui.Widget getLayout()
Gets the layout. This should return a top-level object which contains the entire page, since this is what gets added to the main window as the layout
-
-