Package com.luciad.view.lightspeed.style
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 Summary
Modifier and TypeMethodDescriptionSets all parameters on the builder based on the given style.build()
Builds the style with the set parameters.Sets the color.effectsHints
(ILspEffectsHintStyle.EffectsHint... aEffectsHints) Specifies the effects hints to be added to the style.Specifies the elevation mode.opacity
(float aOpacity) Sets the opacity (alpha) value for the color.repeatTexture
(boolean aRepeatTexture) Specifies whether the texture map should be repeated (tiled) or not.rotateTexture
(double aAlpha) Rotates the texture.scaleTexture
(double aSX, double aSY, double aSZ) Scales the texture.stipplePattern
(TLspFillStyle.StipplePattern aPattern) Sets the fill stipple pattern to one of the default patterns.texture
(RenderedImage aTexture) Specifies the image to be used as a texture map.Specifies whether the texture coordinates computed to apply the texture map should be relative to the bounds of the object or not.textureIcon
(ILcdIcon aTextureIcon) Specifies an icon to create a texture map.textureInterpolationType
(ELcdInterpolationType aInterpolationType) Specifies whether linear or nearest neighbor interpolation should be used for the texture.textureMatrix
(double[] aTextureMatrix) Specifies the 4x4 matrix that should be applied to the texture coordinates when mapping the texture given by this style.textureObject
(ALsp2DTextureObject aTextureObject) Specifies the texture object to be used.toString()
translateTexture
(double aDX, double aDY, double aDZ) Translates the textures.zOrder
(int aZOrder) Sets the Z-order of this style.Methods inherited from class com.luciad.view.lightspeed.style.ALspStyle.Builder
equals, hashCode
-
Method Details
-
color
Sets the color. Should not benull
.- Parameters:
aColor
- the color- Returns:
this
- Throws:
IllegalArgumentException
-if aColor==null
-
opacity
Sets the opacity (alpha) value for the color. This is a convenience method: One could equally well use thecolor(...)
method. However, this method leaves the RGB values intact and only modifies the alpha value. Note that, the other way around, thecolor(...)
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
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
Specifies the image to be used as a texture map. A new texture will be created for the specified image. For reusing an existing textureILspTexturedStyle.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 viaILspTexturedStyle.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, seetextureIcon(com.luciad.gui.ILcdIcon)
.- Specified by:
texture
in interfaceILspTexturedStyle.Builder
- Parameters:
aTexture
- the image to be used as a texture map- Returns:
this
- See Also:
-
textureObject
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 imageILspTexturedStyle.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 viaILspTexturedStyle.Builder.texture(RenderedImage)
before calling this, it will be replaced by this texture.- Specified by:
textureObject
in interfaceILspTexturedStyle.Builder
- Parameters:
aTextureObject
- the texture object.- Returns:
this
-
textureIcon
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'sfeature 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
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 interfaceILspTexturedStyle.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
Description copied from interface:ILspTexturedStyle.Builder
Specifies whether the texture map should be repeated (tiled) or not.- Specified by:
repeatTexture
in interfaceILspTexturedStyle.Builder
- Parameters:
aRepeatTexture
- whether the texture map should be repeated (tiled) or not- Returns:
this
-
textureInterpolationType
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 interfaceILspTexturedStyle.Builder
- Parameters:
aInterpolationType
- the interpolation method to use for the texture (note thatCUBIC
is not currently supported)- Returns:
this
-
textureCoordinatesMode
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
usesILspTexturedStyle.TextureCoordinatesMode.MODEL_ABSOLUTE
.- Specified by:
textureCoordinatesMode
in interfaceILspTexturedStyle.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
Description copied from interface:ILspTexturedStyle.Builder
Translates the textures.- Specified by:
translateTexture
in interfaceILspTexturedStyle.Builder
- Parameters:
aDX
- amount by which the x-coordinates of the texture are translatedaDY
- amount by which the y-coordinates of the texture are translatedaDZ
- amount by which the z-coordinates of the texture are translated- Returns:
this
-
scaleTexture
Description copied from interface:ILspTexturedStyle.Builder
Scales the texture.- Specified by:
scaleTexture
in interfaceILspTexturedStyle.Builder
- Parameters:
aSX
- amount by which the x-coordinates of the texture are scaledaSY
- amount by which the x-coordinates of the texture are scaledaSZ
- amount by which the x-coordinates of the texture are scaled- Returns:
this
-
rotateTexture
Description copied from interface:ILspTexturedStyle.Builder
Rotates the texture.- Specified by:
rotateTexture
in interfaceILspTexturedStyle.Builder
- Parameters:
aAlpha
- the amount by which the texture is rotated, in radians.- Returns:
this
-
stipplePattern
Sets the fill stipple pattern to one of the default patterns.- Parameters:
aPattern
- the fill stipple pattern. Must not benull
- Returns:
this
-
elevationMode
Description copied from interface:ILspWorldElevationStyle.Builder
Specifies the elevation mode. The default mode depends on the specific implementation.- Specified by:
elevationMode
in interfaceILspWorldElevationStyle.Builder
- Parameters:
aMode
-- Returns:
this
-
effectsHints
Description copied from interface:ILspEffectsHintStyle.Builder
Specifies the effects hints to be added to the style.- Specified by:
effectsHints
in interfaceILspEffectsHintStyle.Builder
- Parameters:
aEffectsHints
- the effects hints to be added to the style- Returns:
this
-
all
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 classALspStyle.Builder<B extends TLspFillStyle.Builder<B>>
- Parameters:
aFillStyle
- the style to copy- Returns:
this
-
build
Description copied from class:ALspStyle.Builder
Builds the style with the set parameters.- Specified by:
build
in interfaceILspTexturedStyle.Builder
- Specified by:
build
in classALspStyle.Builder<B extends TLspFillStyle.Builder<B>>
- Returns:
- the resulting style
-
toString
-