Class AbstractGeotoolsLayer

java.lang.Object
org.mapfish.print.map.geotools.AbstractGeotoolsLayer
All Implemented Interfaces:
MapLayer
Direct Known Subclasses:
AbstractFeatureSourceLayer, AbstractSingleImageLayer, AbstractTiledLayer, GeotiffLayer

public abstract class AbstractGeotoolsLayer extends Object implements MapLayer
The AbstractGeotoolsLayer class.
  • Constructor Details

    • AbstractGeotoolsLayer

      protected AbstractGeotoolsLayer(ExecutorService executorService, AbstractLayerParams params)
      Constructor.
      Parameters:
      executorService - the thread pool for doing the rendering.
      params - the parameters for this layer
    • AbstractGeotoolsLayer

      protected AbstractGeotoolsLayer(AbstractGeotoolsLayer other)
      Copy constructor.
      Parameters:
      other - The source.
  • Method Details

    • tryAddLayer

      public final Optional<MapLayer> tryAddLayer(MapLayer newLayer)
      Description copied from interface: MapLayer
      Attempt 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:
      tryAddLayer in interface MapLayer
      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: MapLayer
      Render the layer to the graphics2D object.
      Specified by:
      render in interface MapLayer
      Parameters:
      graphics2D - the graphics object.
      clientHttpRequestFactory - The factory to use for making http requests.
      transformer - the map transformer containing the map bounds and size.
      context - the job ID
      layerContext - the context of this layer
    • 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: MapLayer
      Gets the opacity.
      Specified by:
      getOpacity in interface MapLayer
      Returns:
      the opacity
    • getLayers

      protected abstract List<? extends org.geotools.map.Layer> getLayers(MfClientHttpRequestFactory httpRequestFactory, MapfishMapContext transformer, Processor.ExecutionContext context, MapLayer.LayerContext layerContext) throws Exception
      Get the DataStore object that contains the data for this layer.
      Parameters:
      httpRequestFactory - the factory for making http requests
      transformer - the map transformer
      context - the job ID
      layerContext - the context of this layer
      Throws:
      Exception
    • supportsNativeRotation

      public boolean supportsNativeRotation()
      Description copied from interface: MapLayer
      Indicate if the layer supports native rotation (e.g. WMS layers with the "angle" parameter).
      Specified by:
      supportsNativeRotation in interface MapLayer
      Returns:
      True if the layer itself takes care of rotating.
    • getName

      public final String getName()
      Description copied from interface: MapLayer
      The layer name.
      Specified by:
      getName in interface MapLayer
    • getFailOnError

      public final boolean getFailOnError()
    • getLayerTransformer

      protected final MapfishMapContext getLayerTransformer(MapfishMapContext transformer)
      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: MapLayer
      Cache any needed resources on disk.
      Specified by:
      prefetchResources in interface MapLayer
      Parameters:
      httpRequestFetcher - TODO
      clientHttpRequestFactory - client http request factory
      transformer - transformer
      context - the job ID
      layerContext - the context of this layer
      Returns:
      the same layer context or one with updated contextual information