public static class TLspFillStyle.Builder<B extends TLspFillStyle.Builder<B>> extends ALspStyle.Builder<B> implements ILspTexturedStyle.Builder, ILspWorldElevationStyle.Builder, ILspEffectsHintStyle.Builder
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();
Modifier and Type | Method and Description |
---|---|
B |
all(ALspStyle aFillStyle)
Sets all parameters on the builder based on the given style.
|
TLspFillStyle |
build()
Builds the style with the set parameters.
|
B |
color(Color aColor)
Sets the color.
|
B |
effectsHints(ILspEffectsHintStyle.EffectsHint... aEffectsHints)
Specifies the effects hints to be added to the style.
|
B |
elevationMode(ILspWorldElevationStyle.ElevationMode aMode)
Specifies the elevation mode.
|
B |
opacity(float aOpacity)
Sets the opacity (alpha) value for the color.
|
B |
repeatTexture(boolean aRepeatTexture)
Specifies whether the texture map should be repeated (tiled) or not.
|
B |
rotateTexture(double aAlpha)
Rotates the texture.
|
B |
scaleTexture(double aSX,
double aSY,
double aSZ)
Scales the texture.
|
B |
stipplePattern(TLspFillStyle.StipplePattern aPattern)
Sets the fill stipple pattern to one of the default patterns.
|
B |
texture(RenderedImage aTexture)
Specifies the image to be used as a texture map.
|
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.
|
B |
textureIcon(ILcdIcon aTextureIcon)
Specifies an icon to create a texture map.
|
B |
textureInterpolationType(ELcdInterpolationType aInterpolationType)
Specifies whether linear or nearest neighbor interpolation should be
used for the texture.
|
B |
textureMatrix(double[] aTextureMatrix)
Specifies the 4x4 matrix that should be applied to the texture coordinates when mapping the
texture given by this style.
|
B |
textureObject(ALsp2DTextureObject aTextureObject)
Specifies the texture object to be used.
|
String |
toString() |
B |
translateTexture(double aDX,
double aDY,
double aDZ)
Translates the textures.
|
B |
zOrder(int aZOrder)
Sets the Z-order of this style.
|
equals, hashCode
public B color(Color aColor)
null
.aColor
- the colorthis
IllegalArgumentException
- if aColor==null
public B opacity(float aOpacity)
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.aOpacity
- the alpha value.
Must be contained in the [0,1] interval (0 is fully transparent, 1 is fully opaque).this
public B zOrder(int aZOrder)
aZOrder
- the z orderthis
public B texture(RenderedImage aTexture)
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)
.texture
in interface ILspTexturedStyle.Builder
aTexture
- the image to be used as a texture mapthis
textureIcon(com.luciad.gui.ILcdIcon)
public B textureObject(ALsp2DTextureObject aTextureObject)
ILspTexturedStyle.Builder
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.textureObject
in interface ILspTexturedStyle.Builder
aTextureObject
- the texture object.this
public B textureIcon(ILcdIcon aTextureIcon)
feature scale
.
This icon should never be modified. To change the texture you should create a new style with
a different icon instance.aTextureIcon
- the icon to be used to create a texture mapthis
public B textureMatrix(double[] aTextureMatrix)
ILspTexturedStyle.Builder
textureMatrix
in interface ILspTexturedStyle.Builder
aTextureMatrix
- Specifies the 4x4 matrix that should be applied to the texture coordinates when
mapping the texture given by this stylethis
ILspTexturedStyle.Builder.translateTexture(double, double, double)
,
ILspTexturedStyle.Builder.rotateTexture(double)
public B repeatTexture(boolean aRepeatTexture)
ILspTexturedStyle.Builder
repeatTexture
in interface ILspTexturedStyle.Builder
aRepeatTexture
- whether the texture map should be repeated (tiled) or notthis
public B textureInterpolationType(ELcdInterpolationType aInterpolationType)
ILspTexturedStyle.Builder
textureInterpolationType
in interface ILspTexturedStyle.Builder
aInterpolationType
- the interpolation method to use for the texture (note that CUBIC
is not currently supported)this
public B textureCoordinatesMode(ILspTexturedStyle.TextureCoordinatesMode aMode)
TLspFillStyle
uses
ILspTexturedStyle.TextureCoordinatesMode.MODEL_ABSOLUTE
.textureCoordinatesMode
in interface ILspTexturedStyle.Builder
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.this
public B translateTexture(double aDX, double aDY, double aDZ)
ILspTexturedStyle.Builder
translateTexture
in interface ILspTexturedStyle.Builder
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 translatedthis
public B scaleTexture(double aSX, double aSY, double aSZ)
ILspTexturedStyle.Builder
scaleTexture
in interface ILspTexturedStyle.Builder
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 scaledthis
public B rotateTexture(double aAlpha)
ILspTexturedStyle.Builder
rotateTexture
in interface ILspTexturedStyle.Builder
aAlpha
- the amount by which the texture is rotated, in radians.this
public B stipplePattern(TLspFillStyle.StipplePattern aPattern)
aPattern
- the fill stipple pattern. Must not be null
this
public B elevationMode(ILspWorldElevationStyle.ElevationMode aMode)
ILspWorldElevationStyle.Builder
elevationMode
in interface ILspWorldElevationStyle.Builder
this
public B effectsHints(ILspEffectsHintStyle.EffectsHint... aEffectsHints)
ILspEffectsHintStyle.Builder
effectsHints
in interface ILspEffectsHintStyle.Builder
aEffectsHints
- the effects hints to be added to the stylethis
public B all(ALspStyle aFillStyle)
ALspStyle.Builder
all
in class ALspStyle.Builder<B extends TLspFillStyle.Builder<B>>
aFillStyle
- the style to copythis
public TLspFillStyle build()
ALspStyle.Builder
build
in interface ILspTexturedStyle.Builder
build
in class ALspStyle.Builder<B extends TLspFillStyle.Builder<B>>