Package org.mapfish.print.map.geotools
Class AbstractGeotoolsLayer
java.lang.Object
org.mapfish.print.map.geotools.AbstractGeotoolsLayer
- All Implemented Interfaces:
MapLayer
- Direct Known Subclasses:
AbstractFeatureSourceLayer,AbstractSingleImageLayer,AbstractTiledLayer,GeotiffLayer
The AbstractGeotoolsLayer class.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.mapfish.print.attribute.map.MapLayer
MapLayer.LayerContext, MapLayer.RenderType -
Field Summary
Fields inherited from interface org.mapfish.print.attribute.map.MapLayer
DEFAULT_SCALING -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractGeotoolsLayer(ExecutorService executorService, AbstractLayerParams params) Constructor.protectedCopy constructor. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanprotected abstract List<? extends org.geotools.map.Layer> getLayers(MfClientHttpRequestFactory httpRequestFactory, MapfishMapContext transformer, Processor.ExecutionContext context, MapLayer.LayerContext layerContext) Get theDataStoreobject that contains the data for this layer.protected final MapfishMapContextgetLayerTransformer(MapfishMapContext transformer) If the layer transformer has not been prepared yet, do it.final StringgetName()The layer name.doubleGets the opacity.prefetchResources(HttpRequestFetcher httpRequestFetcher, MfClientHttpRequestFactory clientHttpRequestFactory, MapfishMapContext transformer, Processor.ExecutionContext context, MapLayer.LayerContext layerContext) Cache any needed resources on disk.protected final voidprepareLayerRendering(MapfishMapContext transformer, Graphics2D graphics, org.geotools.map.MapContent content, org.geotools.renderer.lite.StreamingRenderer renderer, RenderingHints hints, ExecutorService executorService) final voidrender(Graphics2D graphics2D, MfClientHttpRequestFactory clientHttpRequestFactory, MapfishMapContext transformer, Processor.ExecutionContext context, MapLayer.LayerContext layerContext) Render the layer to the graphics2D object.booleanIndicate if the layer supports native rotation (e.g.tryAddLayer(MapLayer newLayer) Attempt to add the layer this layer so that both can be rendered as a single layer.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.mapfish.print.attribute.map.MapLayer
getRenderType, prepareRender
-
Constructor Details
-
AbstractGeotoolsLayer
Constructor.- Parameters:
executorService- the thread pool for doing the rendering.params- the parameters for this layer
-
AbstractGeotoolsLayer
Copy constructor.- Parameters:
other- The source.
-
-
Method Details
-
tryAddLayer
Description copied from interface:MapLayerAttempt to add the layer this layer so that both can be rendered as a single layer.For example: 2 WMS layers from the same WMS server can be combined into a single WMS layer and the map can be rendered with a single WMS request.
- Specified by:
tryAddLayerin interfaceMapLayer- Parameters:
newLayer- the layer to combine with this layer. The new layer will be rendered below the current layer.- Returns:
- If the two layers can be combined then a map layer representing the two layers will be returned. If the two layers cannot be combined then Option.absent() will be returned.
-
render
public final void render(Graphics2D graphics2D, MfClientHttpRequestFactory clientHttpRequestFactory, MapfishMapContext transformer, Processor.ExecutionContext context, MapLayer.LayerContext layerContext) Description copied from interface:MapLayerRender the layer to the graphics2D object. -
prepareLayerRendering
protected final void prepareLayerRendering(MapfishMapContext transformer, Graphics2D graphics, org.geotools.map.MapContent content, org.geotools.renderer.lite.StreamingRenderer renderer, RenderingHints hints, ExecutorService executorService) -
getOpacity
public double getOpacity()Description copied from interface:MapLayerGets the opacity.- Specified by:
getOpacityin interfaceMapLayer- Returns:
- the opacity
-
getLayers
protected abstract List<? extends org.geotools.map.Layer> getLayers(MfClientHttpRequestFactory httpRequestFactory, MapfishMapContext transformer, Processor.ExecutionContext context, MapLayer.LayerContext layerContext) Get theDataStoreobject that contains the data for this layer.- Parameters:
httpRequestFactory- the factory for making http requeststransformer- the map transformercontext- the job IDlayerContext- the context of this layer
-
supportsNativeRotation
public boolean supportsNativeRotation()Description copied from interface:MapLayerIndicate if the layer supports native rotation (e.g. WMS layers with the "angle" parameter).- Specified by:
supportsNativeRotationin interfaceMapLayer- Returns:
- True if the layer itself takes care of rotating.
-
getName
Description copied from interface:MapLayerThe layer name. -
getFailOnError
public final boolean getFailOnError() -
getLayerTransformer
If the layer transformer has not been prepared yet, do it.- Parameters:
transformer- the transformer
-
prefetchResources
public MapLayer.LayerContext prefetchResources(HttpRequestFetcher httpRequestFetcher, MfClientHttpRequestFactory clientHttpRequestFactory, MapfishMapContext transformer, Processor.ExecutionContext context, MapLayer.LayerContext layerContext) Description copied from interface:MapLayerCache any needed resources on disk.- Specified by:
prefetchResourcesin interfaceMapLayer- Parameters:
httpRequestFetcher- TODOclientHttpRequestFactory- client http request factorytransformer- transformercontext- the job IDlayerContext- the context of this layer- Returns:
- the same layer context or one with updated contextual information
-