Class TLcdSLDGraphic.Builder<T>

java.lang.Object
com.luciad.ogc.sld.model.TLcdSLDGraphic.Builder<T>
Enclosing class:
TLcdSLDGraphic

public static class TLcdSLDGraphic.Builder<T> extends Object
A builder for SLD graphics.
Since:
2012.1
  • Method Details

    • size

      public TLcdSLDGraphic.Builder<T> size(double aSize)

      Sets a fixed size for this graphic. The default interpretation of this size is in pixels. But the unit of measure of the symbolizer can be set to define a world size.

      This method must not be called when size(ILcdOGCExpression) has already been called.

      Parameters:
      aSize - A size in pixels or in a world unit such as meters. Size must be greater than zero
      Returns:
      This builder.
    • size

      Sets a size expression for this graphic. The default interpretation of this size is in pixels. But the unit of measure of the symbolizer can be set to define a world size.

      This method must not be called when size(double) has already been called.

      Parameters:
      aSize - An expression that evaluates to a size in pixels or in a world unit such as meters. Must not be null
      Returns:
      This builder.
    • rotation

      public TLcdSLDGraphic.Builder<T> rotation(double aRotationInDegrees)

      Sets a fixed rotation for this graphic. The interpretation of this rotation is in degrees.

      This method must not be called when rotation(ILcdOGCExpression) has already been called.

      Parameters:
      aRotationInDegrees - The rotation in degrees
      Returns:
      This builder
    • rotation

      public TLcdSLDGraphic.Builder<T> rotation(ILcdOGCExpression aRotationExpression)

      Sets a rotation expression for this graphic. The expression should evaluate to a number (decimals are possible). The rotation is expressed in degrees.

      This method must not be called when rotation(double) has already been called.

      Parameters:
      aRotationExpression - An expression that evaluates to a rotation in degrees. Must not be null
      Returns:
      This builder
    • opacity

      public TLcdSLDGraphic.Builder<T> opacity(double aOpacity)

      Sets a fixed opacity for this graphic. The opacity should be between 0.0 and 1.0

      This method must not be called when opacity(ILcdOGCExpression) has already been called.

      Parameters:
      aOpacity - The opacity value.
      Returns:
      This builder
    • opacity

      public TLcdSLDGraphic.Builder<T> opacity(ILcdOGCExpression aOpacityExpression)

      Sets the opacity expression for this graphic. The expression should evaluate to a decimal number between 0 and 1.

      This method must not be called when opacity(double) has already been called.

      Parameters:
      aOpacityExpression - An expression that evaluates to an opacity in decimals. Must not be null
      Returns:
      This builder
    • anchorPoint

      public TLcdSLDGraphic.Builder<T> anchorPoint(TLcdSLDAnchorPoint aAnchorPoint)

      Sets the anchor point for this graphic.

      The anchor point defines the location of this graphic, relative to its bounds. The default anchor point is [0.5, 0.5], indicating that the graphic is centered within the bounds of the graphic.

      Parameters:
      aAnchorPoint - The anchor point for this graphic. Must not be null
      Returns:
      This builder
      Since:
      2022.1
      See Also:
    • addExternalGraphic

      public TLcdSLDGraphic.Builder<T> addExternalGraphic(String aHref)
      Adds an external graphic based on the specified link. The file format is derived from the link, 'image/png' is used as a fallback if this fails.
      Parameters:
      aHref - A link that can be resolved to an image. Must not be null
      Returns:
      this builder
    • addInlineExternalGraphic

      public TLcdSLDGraphic.Builder<T> addInlineExternalGraphic(String aFileName)
      Adds a binary image file. The format will be derived from the extension, png will be used if this fails. The loaded image icon will be stored as base64 encoded binary content, so without any reference to the original file name.
      Parameters:
      aFileName - The name of a file containing pixel data in a recognized file format. Must not be null
      Returns:
      this builder
    • addInlineSVGMark

      public TLcdSLDGraphic.Builder<T> addInlineSVGMark(String aFileName)
      Creates and adds a mark graphic by loading an SVG from file. When encoding the graphic, the SVG will be encoded inline directly, without referencing the original file name.
      Parameters:
      aFileName - The SVG filename. Must not be null
      Returns:
      this builder
    • addMark

      public TLcdSLDGraphic.Builder<T> addMark(String aWellKnownName, Color aLineColor, Color aFillColor)

      Creates a mark graphic based on a 'well known name'. The possible well known names are available in TLcdSLDMark.

      For example:

       mark( TLcdSLDMark.CIRCLE, Color.green, Color.blue );
       
      Parameters:
      aWellKnownName - A well known name for a TLcdSLDMark. Must not be null
      aLineColor - The line color of the mark. Must not be null
      aFillColor - The fill color of the mark. Must not be null
      Returns:
      this builder
    • addMark

      public TLcdSLDGraphic.Builder<T> addMark(String aWellKnownName, Color aLineColor, Color aFillColor, double aOpacity)

      Creates a mark graphic based on a 'well known name'. The possible well known names are available in TLcdSLDMark.

      For example:

       mark( TLcdSLDMark.CIRCLE, Color.green, Color.blue, 0.5 );
       
      Parameters:
      aWellKnownName - A well known name for a TLcdSLDMark. Must not be null
      aLineColor - The line color of the mark. Must not be null
      aFillColor - The fill color of the mark. Must not be null
      aOpacity - the opacity. Must be between 0 and 1.
      Returns:
      this builder
    • addMark

      public TLcdSLDGraphic.Builder<T> addMark(TLcdSLDMark aMark)
      Adds a mark which will be used for the graphics
      Parameters:
      aMark - The mark
      Returns:
      This builder
    • buildGraphic

      public T buildGraphic()

      Builds the graphic with the set parameters.

      This method can only be called once. When you used the builder to build an instance, the builder is no longer valid and should be thrown away.

      Returns:
      the resulting graphic