Class TLcdS52GXYCatalogueLayer

java.lang.Object
com.luciad.view.TLcdLayer
com.luciad.view.gxy.TLcdGXYLayer
com.luciad.format.s52.gxy.TLcdS52GXYCatalogueLayer
All Implemented Interfaces:
ILcdPropertyChangeSource, ILcdSelection<Object>, ILcdGXYEditableLabelsLayer, ILcdGXYLayer, ILcdLayer, Serializable

public class TLcdS52GXYCatalogueLayer extends TLcdGXYLayer

A layer that adds support for the specific rendering requirements of S-57 catalogues.

This layer provides support for the following features:

  • For each ENC cell contained in it, it will paint the chart scale boundaries (defined by the S-57 coverage features), as required by the S-52 specification (can be disabled)..
  • If a level is in overscale, a special pattern will be painted on that level, as required by the S-52 specification (can be disabled).
  • If a level is in underscale, a bounding box may be painted (can be disabled).
  • It ensures that for edges which are part of multiple objects, each edge is only painted once, using the line style of the object with the highest display priority.
  • Labels are painted together immediately after the objects of this layer have been painted, to prevent labels of lower levels to be painted on top of layers with a higher level (by default, labels are painted in LuciadLightspeed after all objects of all layers have been painted).

In addition, this layer will take into account which areas of the view have already been painted in the higher levels, reducing the number of cells that need to be painted (and thus loaded) in the lower levels.

This class uses S-57-specific objects, and should only be used for the visualization of S-57 models.

Note: in versions prior to V2013.1, the layer could only handle the ordered models (see TLcdS52ProductConfiguration#createOrderedModelDecoder and the ECDIS developer guide). As of V2013.1, it is no longer needed to order the models before passing them to the layer. The layer can now handle both ordered as well as non-ordered models. The TLcdLayer.getModel() method will always return the model which was set on the layer.

See Also:
  • Constructor Details

    • TLcdS52GXYCatalogueLayer

      public TLcdS52GXYCatalogueLayer(ILcdModel aS57Catalogue, List<ILcdInterval> aLevelScaleRanges)
      Deprecated.
      Use the constructor with a S-52 display settings object instead.
      Creates a new catalogue layer list which will be initialized with the given model. The given model should implement ILcdModelContainer.
      Parameters:
      aS57Catalogue - the model list to set on this layer list.
      aLevelScaleRanges - a list of scale ranges for the different ENC levels. The value at index 0 is the scale range for ENC level 1 (Overview 0), the value at index 1 the scale range for ENC level 2 (General), and so on. The maximum scale for each interval should be Double.POSITIVE_INFINITY (that is, a level can never become hidden by zooming in, unless it is covered by a more detailed level), other maximum scales values are ignored.
    • TLcdS52GXYCatalogueLayer

      public TLcdS52GXYCatalogueLayer(ILcdModel aS57Catalogue, TLcdS52DisplaySettings aDisplaySettings)
      Creates a new catalogue layer list which will be initialized with the given model. The given model should implement ILcdModelContainer.
      Parameters:
      aS57Catalogue - the model list to set on this layer list.
      aDisplaySettings - the S-52 display settings to be used.
  • Method Details

    • setFilter

      public void setFilter(ILcdFilter aFilter)
      Description copied from class: TLcdGXYLayer

      Sets the ILcdFilter to filter the Object on this ILcdLayer. Operations on this layer will only be applied to objects of the model that pass the filter. This includes painting, labeling, selection, editing, ...

      If the filter implements ILcdChangeSource, the layer will listen to changes in the filter to keep, for example, the selection up to date.

      Setting a null filter, lets all objects pass for rendering. By default the filter is null.

      The filtering performed by this filter is done inside the JVM, after the data has been queried from the model and been passed to the layer. Use the TLcdGXYLayer.setModelQueryConfiguration(TLcdModelQueryConfiguration) if you have filters which should be evaluated on the model side. For example when using a database model, this would allow the database to do the filtering.

      Overrides:
      setFilter in class TLcdGXYLayer
      Parameters:
      aFilter - the filter that accepts only those objects that should be taken into account.
      See Also:
    • setMultileveledObjectVisibilityCalculations

      public void setMultileveledObjectVisibilityCalculations(boolean aEnabled)
      Disables certain optimizations to avoid painting elements obscured by more-detailed cells.

      By default, these optimizations are enabled, and typically reduce the amount of elements to be painted by 30%. The cost of determining which elements to skip is offset by faster subsequent paints because of spatial locality.

      In the context of a WMS server however, you have multiple threads/layers handling requests of multiple users, in different areas. In this case, each layer has to build up the visibility information separately and can re-use it a lot less in subsequent requests.

      When using tiled WMS or WMTS, requests don't overlap and are typically cached on the client and/or server.

      Since:
      2019.1
    • getDisplaySettings

      public TLcdS52DisplaySettings getDisplaySettings()
      Returns the S-52 display settings object, defining how the S-57 data will be rendered.
      Returns:
      the S-52 display settings object, defining how the S-57 data will be rendered.
    • setS52Symbology

      public void setS52Symbology(ILcdS52Symbology s52Symbology)
      Sets the symbology that is required for painting. It must be set before the layer list is painted.
      Parameters:
      s52Symbology - the S-52 symbology to be used.
    • getS52Symbology

      public ILcdS52Symbology getS52Symbology()
      Returns the S-52 symbology that is used by this layer list.
      Returns:
      the S-52 symbology that is used by this layer list.
    • setPaintChartBoundaries

      public void setPaintChartBoundaries(boolean aPaintChartBoundaries)
      Flag indicating whether to paint the chart boundaries.
      Parameters:
      aPaintChartBoundaries - flag indicating whether to paint the chart boundaries.
    • isPaintChartBoundaries

      public boolean isPaintChartBoundaries()
      Returns whether to paint the chart boundaries.
      Returns:
      whether to paint the chart boundaries.
    • setPaintOverscaleIndication

      public void setPaintOverscaleIndication(boolean aPaintOverscaleIndication)
      Flag indicating whether to paint the overscale indication. Overscale indication is visualized by vertical bars, painted over the map. Note: overscale indication is part of the S-52 standard; the overscale indication color is also defined by the standard, and cannot be set via the API.
      Parameters:
      aPaintOverscaleIndication - flag indicating whether to paint the overscale indication.
    • isPaintOverscaleIndication

      public boolean isPaintOverscaleIndication()
      Returns whether to paint the overscale indication.
      Returns:
      whether to paint the overscale indication.
    • setPaintUnderscaleIndication

      public void setPaintUnderscaleIndication(boolean aPaintUnderscaleIndication)
      Flag indicating whether to paint the underscale indication. When the map scale is outside the visible scale range, the bounds of the model will be painted to indicate where the map is positioned. Note: this visualisation is not part of the S-52 standard.
      Parameters:
      aPaintUnderscaleIndication - flag indicating whether to paint the underscale indication.
    • isPaintUnderscaleIndication

      public boolean isPaintUnderscaleIndication()
      Returns whether to paint the underscale indication.
      Returns:
      whether to paint the underscale indication.
    • setUnderscaleIndicationColor

      public void setUnderscaleIndicationColor(Color aUnderscaleIndicationColor)
      Sets the color in which to paint the underscale indication.
      Parameters:
      aUnderscaleIndicationColor - the color in which to paint the underscale indication.
    • getUnderscaleIndicationColor

      public Color getUnderscaleIndicationColor()
      Returns the underscale indication color.
      Returns:
      the underscale indication color.
    • paintFromOverlaps

      protected void paintFromOverlaps(Graphics aGraphics, int aMode, ILcd2DBoundsIndexedModel a2DBoundsIndexedModel, ILcdGXYContext aGXYContext)
      Description copied from class: TLcdGXYLayer
      Paints the objects in the passed model by applying a painting function to all Object of the ILcd2DBoundsIndexedModel that interact with the view clip. The paint order is determined by the model.
      Overrides:
      paintFromOverlaps in class TLcdGXYLayer
      Parameters:
      aGraphics - the graphics to paint on
      aMode - see ILcdGXYLayer.paint.
      a2DBoundsIndexedModel - the model to paint
      aGXYContext - the ILcdGXYContext to consider for painting.
    • applyOnInteract

      public int applyOnInteract(ILcdFunction aFunction, Rectangle aBounds, boolean aStrictInteract, ILcdGXYView aGXYView)
      Description copied from class: TLcdGXYLayer
      Applies the function to (at the least) all objects that are contained (partially or completely) in the bounds of the view.

      The function shall be applied successively to all objects in the bounds as long as the function returns true for an object. This allows developers to indicate a stop condition. Note that the order in which the objects are passed to the function is not specified.

      When strict interaction is required, only objects whose representation lies within the given bounds, completely or partially, are candidates to be passed to the function. An object whose representation does not interact with the bounds should not be passed to the function. Applying non strict interaction can be useful to avoid heavy computations to determine whether an objects representation lies within the bounds.

      This method behaves similar to the paint method, and as such is allowed to omit small or invisible objects for performance reasons.

      Objects smaller than the set minimum object size may be omitted.

      Specified by:
      applyOnInteract in interface ILcdGXYLayer
      Overrides:
      applyOnInteract in class TLcdGXYLayer
      Parameters:
      aFunction - the function to apply. When the function returns false, no more objects should be passed to the function.
      aBounds - all objects who lie partially or completely in this area in the view are candidates to be passed to the function.
      aStrictInteract - if true, the ILcdFunction shall be applied only to the objects interacting with the given bounds. When false is passed, other objects may be taken into account too. When applying the function to an object consumes less time than checking whether an objects representation interacts with the bounds, non-strict interaction is generally faster.
      aGXYView - the view in whose bounds the objects representations should be in order to be passed to the function.
      Returns:
      the number of objects the function was applied on.