public static class TLspIconStyle.Builder<B extends TLspIconStyle.Builder<B>> extends ALspStyle.Builder<B> implements ILspWorldElevationStyle.Builder, ILspEffectsHintStyle.Builder
ILspWorldElevationStyle.ElevationMode.OBJECT_DEPENDENT
.
Use the icon(com.luciad.gui.ILcdIcon)
method to set a valid icon.
Example usages:
To create an icon style using an image as an icon: TLspIconStyle iconStyle = TLspIconStyle.newBuilder().icon(new TLcdImageIcon(pathToImage)).build();
To create an icon style using a symbol as an icon: TLspIconStyle iconStyle = TLspIconStyle.newBuilder().icon(new TLcdSymbol(TLcdSymbol.CIRCLE)).build();
To style objects based its properties use TLspParameterizedIconStyle
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
B |
all(ALspStyle aStyle)
Sets all builder parameters to the properties of the
provided style.
|
TLspIconStyle |
build()
Builds the icon style with the set parameters.
|
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 |
icon(ILcdIcon aIcon)
Sets the icon.
|
B |
minimumPixelSize(int aMinimumPixelSize)
Sets the minimum icon pixel size.
|
B |
modulationColor(Color aColor)
Sets the color that is modulated with the icon.
|
B |
offset(double aOffsetX,
double aOffsetY)
Sets icon offsets in 2D view coordinates.
|
B |
opacity(float aOpacity)
Sets the opacity of the modulation color.
|
B |
scale(double aScaleFactor)
Sets the scale factor.
|
B |
scalingMode(TLspIconStyle.ScalingMode aScalingMode)
Sets the scaling mode of the icons.
|
String |
toString() |
B |
useOrientation(boolean aOrientationEnabled)
Sets whether the icon should respect its orientation.
|
B |
worldSize(double aWorldSize)
Sets the icon size in meters.
|
B |
zOrder(int aZOrder)
Sets the Z-order of this style.
|
equals, hashCode
public B zOrder(int aZOrder)
aZOrder
- the z orderthis
public B icon(ILcdIcon aIcon)
null
.
Useful implementations are for example TLcdSymbol
, or
TLcdImageIcon
.aIcon
- the iconthis
public B useOrientation(boolean aOrientationEnabled)
ILcdOriented
interface. Either the geometry returned by the
ALspStyleTargetProvider
or the model object should implement
this interface. The geometry takes precedence if both objects implement
this interface. The orientation is interpreted as an azimuth.aOrientationEnabled
- a flag indicating whether or not the icon should respect its
orientationthis
public B scale(double aScaleFactor)
aScaleFactor
- the scale factorthis
public B offset(double aOffsetX, double aOffsetY)
Sets icon offsets in 2D view coordinates. This offset is applied after all other transformations have been applied. In other words: Scaling and rotation are applied first. Then this offset is done as a post-effect.
To support anchored icons, and rotations of icons around a specific point in the icon, please supply the icon(com.luciad.gui.ILcdIcon) method
with an ILcdAnchoredIcon
.
aOffsetX
- the offset in X directionaOffsetY
- the offset in Y directionthis
;icon(com.luciad.gui.ILcdIcon)
public B modulationColor(Color aColor)
Using a white color has no effect.
aColor
- the modulation colorthis
public B worldSize(double aWorldSize)
ScalingMode.WORLD_SCALING
or
ScalingMode.WORLD_SCALING_CLAMPED
.
The world size is applied to the width of the icon. I.e. when the icon is not square,
the width will correspond to this world size, but the height will not.
By default this is set to 50000m.aWorldSize
- a positive number expressing the icon size in meters.this
public B scalingMode(TLspIconStyle.ScalingMode aScalingMode)
ScalingMode.VIEW_SCALING
.aScalingMode
- a scaling modethis
public B opacity(float aOpacity)
aOpacity
- the alpha value.
Must be contained in the [0,1] interval (0 is fully transparent, 1 is fully opaque).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 minimumPixelSize(int aMinimumPixelSize)
ScalingMode.WORLD_SCALING_CLAMPED
or ScalingMode.WORLD_SCALING
.
As soon as the largest dimension (i.e. width or height) of the icon is smaller than this minimum pixel size,
the icon will be scaled to satisfy this minimum size.
By default this value is set to 0, which indicates that no minimum size will be
enforced.aMinimumPixelSize
- the minimum pixel sizethis
public B all(ALspStyle aStyle)
all
in class ALspStyle.Builder<B extends TLspIconStyle.Builder<B>>
aStyle
- the style to copythis
public TLspIconStyle build()
build
in class ALspStyle.Builder<B extends TLspIconStyle.Builder<B>>