Class TLspFillStyle.Builder<B extends TLspFillStyle.Builder<B>>

java.lang.Object
com.luciad.view.lightspeed.style.ALspStyle.Builder<B>
com.luciad.view.lightspeed.style.TLspFillStyle.Builder<B>
All Implemented Interfaces:
ILspEffectsHintStyle.Builder, ILspTexturedStyle.Builder, ILspWorldElevationStyle.Builder
Enclosing class:
TLspFillStyle

public static class TLspFillStyle.Builder<B extends TLspFillStyle.Builder<B>> extends ALspStyle.Builder<B> implements ILspTexturedStyle.Builder, ILspWorldElevationStyle.Builder, ILspEffectsHintStyle.Builder
Builder used to create fill styles.

The builder by default constructs a fill style with a transparent green color that uses ILspWorldElevationStyle.ElevationMode.OBJECT_DEPENDENT.

Example usages:

To create a transparent green fill style for a shape:
TLspFillStyle whiteNotDraped = TLspFillStyle.newBuilder().build();

To create a red fill style for a shape that is always painted on the terrain:
TLspFillStyle redDraped = TLspFillStyle.newBuilder().color(Color.red).elevationMode(ON_TERRAIN).build();

To create a transparent blue fill style with one of the default stipple patterns for a shape that is always painted on the terrain:
TLspFillStyle transparentBlueStippledDraped = TLspFillStyle.newBuilder().color(new Color(0f,0f,1f,0.5f)).stipplePattern(StipplePatterns.HALF_TONE).elevationMode(ON_TERRAIN).build();

Since:
2012.0
  • Method Details

    • color

      public B color(Color aColor)
      Sets the color. Should not be null.
      Parameters:
      aColor - the color
      Returns:
      this
      Throws:
      IllegalArgumentException - if aColor==null
    • opacity

      public B opacity(float aOpacity)
      Sets the opacity (alpha) value for the color.

      This is a convenience method: One could equally well use the color(...) method. However, this method leaves the RGB values intact and only modifies the alpha value. Note that, the other way around, the color(...) method does override the set alpha value.

      Parameters:
      aOpacity - the alpha value. Must be contained in the [0,1] interval (0 is fully transparent, 1 is fully opaque).
      Returns:
      this
    • zOrder

      public B zOrder(int aZOrder)
      Sets the Z-order of this style. Styles should be painted from lowest to highest Z-order.

      Increasing the number of different Z-orders can negatively impact painting performance. By default, it is set to 0.

      Parameters:
      aZOrder - the z order
      Returns:
      this
    • texture

      public B texture(RenderedImage aTexture)
      Specifies the image to be used as a texture map. A new texture will be created for the specified image. For reusing an existing texture ILspTexturedStyle.Builder.textureObject(ALsp2DTextureObject) can be used.

      This image should never be modified. To change the texture you should create a new style with a different image instance.

      If a texture object was set via ILspTexturedStyle.Builder.textureObject(ALsp2DTextureObject) before calling this, it will be replaced by a texture created from the image. To add a texture that is better suited for high-quality printing, see textureIcon(com.luciad.gui.ILcdIcon).

      Specified by:
      texture in interface ILspTexturedStyle.Builder
      Parameters:
      aTexture - the image to be used as a texture map
      Returns:
      this
      See Also:
    • textureObject

      public B textureObject(ALsp2DTextureObject aTextureObject)
      Description copied from interface: ILspTexturedStyle.Builder
      Specifies the texture object to be used. This can be used to reuse already existing textures. When a new texture needs to be created for an image ILspTexturedStyle.Builder.texture(RenderedImage) can be used.

      To change the texture you should create a new style with a different texture object instance.

      If an image to be used as a texture was set via ILspTexturedStyle.Builder.texture(RenderedImage) before calling this, it will be replaced by this texture.

      Specified by:
      textureObject in interface ILspTexturedStyle.Builder
      Parameters:
      aTextureObject - the texture object.
      Returns:
      this
    • textureIcon

      public B textureIcon(ILcdIcon aTextureIcon)
      Specifies an icon to create a texture map. Usually a texture icon is preferred over a RenderedImage because it has better results when printing at high resolutions. This type of texture is also affected by the view's feature scale.

      This icon should never be modified. To change the texture you should create a new style with a different icon instance.

      Parameters:
      aTextureIcon - the icon to be used to create a texture map
      Returns:
      this
    • textureMatrix

      public B textureMatrix(double[] aTextureMatrix)
      Description copied from interface: ILspTexturedStyle.Builder
      Specifies the 4x4 matrix that should be applied to the texture coordinates when mapping the texture given by this style. This can be used to scale, rotate or otherwise transform the texture.

      This matrix will override any previously set transformation. This interface also provides a number of convenience methods to specify common texture coordinate transformations.

      Specified by:
      textureMatrix in interface ILspTexturedStyle.Builder
      Parameters:
      aTextureMatrix - Specifies the 4x4 matrix that should be applied to the texture coordinates when mapping the texture given by this style
      Returns:
      this
      See Also:
    • repeatTexture

      public B repeatTexture(boolean aRepeatTexture)
      Description copied from interface: ILspTexturedStyle.Builder
      Specifies whether the texture map should be repeated (tiled) or not.
      Specified by:
      repeatTexture in interface ILspTexturedStyle.Builder
      Parameters:
      aRepeatTexture - whether the texture map should be repeated (tiled) or not
      Returns:
      this
    • textureInterpolationType

      public B textureInterpolationType(ELcdInterpolationType aInterpolationType)
      Description copied from interface: ILspTexturedStyle.Builder
      Specifies whether linear or nearest neighbor interpolation should be used for the texture. The default is linear.
      Specified by:
      textureInterpolationType in interface ILspTexturedStyle.Builder
      Parameters:
      aInterpolationType - the interpolation method to use for the texture (note that CUBIC is not currently supported)
      Returns:
      this
    • textureCoordinatesMode

      public B textureCoordinatesMode(ILspTexturedStyle.TextureCoordinatesMode aMode)
      Specifies whether the texture coordinates computed to apply the texture map should be relative to the bounds of the object or not. In the former case, the map is scaled and offset such that it fills the bounds (in model coordinates) of the object. In the latter case, the model coordinates of the object are used as texture coordinates unmodified.

      By default, TLspFillStyle uses ILspTexturedStyle.TextureCoordinatesMode.MODEL_ABSOLUTE.

      Specified by:
      textureCoordinatesMode in interface ILspTexturedStyle.Builder
      Parameters:
      aMode - specifies whether the texture coordinates computed to apply the texture map should be relative to the bounds of the object or correspond to the object's model coordinates.
      Returns:
      this
    • translateTexture

      public B translateTexture(double aDX, double aDY, double aDZ)
      Description copied from interface: ILspTexturedStyle.Builder
      Translates the textures.
      Specified by:
      translateTexture in interface ILspTexturedStyle.Builder
      Parameters:
      aDX - amount by which the x-coordinates of the texture are translated
      aDY - amount by which the y-coordinates of the texture are translated
      aDZ - amount by which the z-coordinates of the texture are translated
      Returns:
      this
    • scaleTexture

      public B scaleTexture(double aSX, double aSY, double aSZ)
      Description copied from interface: ILspTexturedStyle.Builder
      Scales the texture.
      Specified by:
      scaleTexture in interface ILspTexturedStyle.Builder
      Parameters:
      aSX - amount by which the x-coordinates of the texture are scaled
      aSY - amount by which the x-coordinates of the texture are scaled
      aSZ - amount by which the x-coordinates of the texture are scaled
      Returns:
      this
    • rotateTexture

      public B rotateTexture(double aAlpha)
      Description copied from interface: ILspTexturedStyle.Builder
      Rotates the texture.
      Specified by:
      rotateTexture in interface ILspTexturedStyle.Builder
      Parameters:
      aAlpha - the amount by which the texture is rotated, in radians.
      Returns:
      this
    • stipplePattern

      public B stipplePattern(TLspFillStyle.StipplePattern aPattern)
      Sets the fill stipple pattern to one of the default patterns.
      Parameters:
      aPattern - the fill stipple pattern. Must not be null
      Returns:
      this
    • elevationMode

      public B elevationMode(ILspWorldElevationStyle.ElevationMode aMode)
      Description copied from interface: ILspWorldElevationStyle.Builder
      Specifies the elevation mode. The default mode depends on the specific implementation.
      Specified by:
      elevationMode in interface ILspWorldElevationStyle.Builder
      Parameters:
      aMode -
      Returns:
      this
    • effectsHints

      public B effectsHints(ILspEffectsHintStyle.EffectsHint... aEffectsHints)
      Description copied from interface: ILspEffectsHintStyle.Builder
      Specifies the effects hints to be added to the style.
      Specified by:
      effectsHints in interface ILspEffectsHintStyle.Builder
      Parameters:
      aEffectsHints - the effects hints to be added to the style
      Returns:
      this
    • all

      public B all(ALspStyle aFillStyle)
      Description copied from class: ALspStyle.Builder
      Sets all parameters on the builder based on the given style.

      This is useful for example to create a new style that has almost all properties equal to another style.

      Specified by:
      all in class ALspStyle.Builder<B extends TLspFillStyle.Builder<B>>
      Parameters:
      aFillStyle - the style to copy
      Returns:
      this
    • build

      public TLspFillStyle build()
      Description copied from class: ALspStyle.Builder
      Builds the style with the set parameters.
      Specified by:
      build in interface ILspTexturedStyle.Builder
      Specified by:
      build in class ALspStyle.Builder<B extends TLspFillStyle.Builder<B>>
      Returns:
      the resulting style
    • toString

      public String toString()
      Overrides:
      toString in class Object