Class TLspComplexStrokedLineStyle.Builder<B extends TLspComplexStrokedLineStyle.Builder<B>>
- All Implemented Interfaces:
ILspWorldElevationStyle.Builder
- Enclosing class:
TLspComplexStrokedLineStyle
TLspComplexStrokedLineStyle
instances.- Since:
- 2013.1
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSets all parameters on the builder based on the given style.build()
Builds the style with the set parameters.decoration
(double aRelativeLocation, ELcdHorizontalAlignment aAlignment, ALspComplexStroke aStroke) Positions the given stroke pattern at the given location on the line.decoration
(double aRelativeLocation, ALspComplexStroke aStroke) Positions the given stroke pattern at the given location on the line.Specifies the elevation mode.fallback
(double aAnchor, ALspComplexStroke aStroke) The given stroke is used when it is not possible to place an other stroke pattern (seedecoration
,regular
).fallback
(ALspComplexStroke aStroke) The given stroke is used when it is not possible to place an other stroke pattern (seedecoration
,regular
).Sets the halo color.haloThickness
(float aThickness) Sets the halo thickness in pixels.modulationColor
(Color aColor) Sets the color that is modulated with the stroke.regular
(double aAnchor, ALspComplexStroke aStroke) Repeats the given stroke pattern along the line.regular
(ALspComplexStroke aStroke) Repeats the given stroke pattern along the line.scale
(double aScaleFactor) Sets the stroke pattern scale factor.scalingMode
(TLspComplexStrokedLineStyle.ScalingMode aScalingMode) Sets the scaling mode.sharpAngleThreshold
(double aSharpAngleThreshold) Sets the threshold which is used to determine if angles are sharp or not.zOrder
(int aZOrder) Sets the Z-order of this style.Methods inherited from class com.luciad.view.lightspeed.style.ALspStyle.Builder
equals, hashCode
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
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
-
sharpAngleThreshold
Sets the threshold which is used to determine if angles are sharp or not. It is interpreted as an angle in degrees between two line segments. In the context of complex stroking, sharp corners are handled differently than non-sharp corners.
In general, a non-sharp corner is handled as if there is no corner at all. This means that any stroke can just be painted along the corner. A side effect of this is that strokes may be deformed. This deformation will be small for corners that are close to 180 degrees wide (i.e. for line segments that are almost parallel). The deformation can become quite large for sharper corners though, so care should be taken when adjusting this value.
On the other hand when a corner is considered sharp, strokes will not be deformed, but may be dropped instead.
This setting is for example useful when complex strokes use a uniform shape and color. An example of a usage is when painting an airspace border using a rectangular stroke along the length of the line. In that case, the threshold can be set to 0.
When multiple complex stroked styles are used for the same objects, the largest threshold value is chosen.
The default is
155.0
degrees.- Parameters:
aSharpAngleThreshold
- the threshold which is used to determine if angles are sharp or not. Expressed in degrees. This value should lie between 0 and 180 degrees.- Returns:
this
-
decoration
Positions the given stroke pattern at the given location on the line. A default alignment is used: for stroke patterns at the start of the line, this is
LEFT
, for stroke patterns at the end of the line, this isRIGHT
. Otherwise, this isCENTER
.Note that it is possible to add multiple stroke patterns at the same location. In that case, the strokes will be appended.
If it is required to combine decorations with the underlying regular of fallback stroke,
ALspComplexStroke.combineWithRegularStroking
orALspComplexStroke.combineWithFallbackStroking
can be used.- Parameters:
aRelativeLocation
- the location where the given stroke will be positioned. This location is a relative position on the stroked line. It is a value in the [0, 1] interval, where 0 means the start of the line and 1 means the end of the line.aStroke
- the stroke pattern.- Returns:
this
-
decoration
public B decoration(double aRelativeLocation, ELcdHorizontalAlignment aAlignment, ALspComplexStroke aStroke) Positions the given stroke pattern at the given location on the line. The given alignment is used.
Note that it is possible to add multiple stroke patterns at the same location. In that case, the strokes will be appended.
If it is required to combine decorations with the underlying regular of fallback stroke,
ALspComplexStroke.combineWithRegularStroking
orALspComplexStroke.combineWithFallbackStroking
can be used.- Parameters:
aRelativeLocation
- the location where the given stroke will be positioned. This location is a relative position on the stroked line. It is a value in the [0, 1] interval, where 0 means the start of the line and 1 means the end of the line.aAlignment
- determines how the stroke pattern is aligned to the location. For example, when usingCENTER
the middle of the stroke will coincide with the specified location. When usingRIGHT
, the right of the stroke pattern will coincide with the specified location (i.e. it will appear left of the location). Can benull
, in which case a default alignment is used.aStroke
- the stroke pattern.- Returns:
this
-
regular
Repeats the given stroke pattern along the line. A regular stroke is painted where no other
decoration
strokes are painted. The pattern is anchored to the start of the line. Note that it is possible to add multiple regular strokes.Some strokes have influence over whether the regular stroke is painted or not, or where it is painted. For more information, see the
combineWithRegularStroking
stroke pattern wrapper.- Parameters:
aStroke
- the stroke- Returns:
this
-
regular
Repeats the given stroke pattern along the line. A regular stroke is painted where no other
decoration
strokes are painted. The pattern is anchored to the given location on the line. Note that it is possible to add multiple regular strokes.Some strokes have influence over whether the regular stroke is painted or not, or where it is painted. For more information, see the
combineWithRegularStroking
stroke pattern wrapper.- Parameters:
aAnchor
- the location to which to anchor the repeating pattern. This location is a relative position on the stroked line. It is a value in the [0, 1] interval, where 0 means the start of the line and 1 means the end of the line.aStroke
- the stroke- Returns:
this
-
fallback
The given stroke is used when it is not possible to place an other stroke pattern (see
decoration
,regular
). This can happen for example when a line segment is too curved, or when other stroke patterns are dropped because they don't have enough space. It is typically a simple line pattern, using the same color or thickness as the other, more complex, pattern.The given fallback stroke is repeated along the line. The pattern is anchored to the start of the line. Note that only one fallback stroke can be used at the same time. When calling this method a second time, the fallback stroke will be replaced. Also note that the stroke pattern in a fallback stroke can be cut off, e.g. when reaching the end of the line, instead of being omitted.
Some strokes have influence over whether the fallback stroke is painted or not, or where it is painted. For more information, see the
combineWithFallbackStroking
andcombineWithRegularStroking
stroke pattern wrappers.- Parameters:
aStroke
- the stroke- Returns:
this
-
fallback
The given stroke is used when it is not possible to place an other stroke pattern (see
decoration
,regular
). This can happen for example when a line segment is too curved, or when other stroke patterns are dropped because they don't have enough space. It is typically a simple line pattern, using the same color or thickness as the other, more complex, pattern.The given fallback stroke is repeated along the line. The pattern is anchored to the given location on the line. Note that only one fallback stroke can be used at the same time. When calling this method a second time, the fallback stroke will be replaced. Also note that the stroke pattern in a fallback stroke can be cut off, e.g. when reaching the end of the line, instead of being omitted.
Some strokes have influence over whether the fallback stroke is painted or not, or where it is painted. For more information, see the
combineWithFallbackStroking
andcombineWithRegularStroking
stroke pattern wrappers.- Parameters:
aAnchor
- the location to which to anchor the repeating pattern. This location is a relative position on the stroked line. It is a value in the [0, 1] interval, where 0 means the start of the line and 1 means the end of the line.aStroke
- the stroke- Returns:
this
-
haloThickness
Sets the halo thickness in pixels. Set to zero if no halo should be visible.
By default the halo is disabled.
- Parameters:
aThickness
- the thickness in pixels- Returns:
this
- See Also:
-
haloColor
Sets the halo color. This property is only used if the halo is enabled.
By default the halo color is set to white.
- Parameters:
aColor
- the halo color- Returns:
this
- Throws:
IllegalArgumentException
-if aColor==null
- See Also:
-
modulationColor
Sets the color that is modulated with the stroke. For example using a stroke with gray-scale colors and a red modulation color will result in a resulting stroke painted with red hues. The alpha value of the color is also used to determine the opacity of the stroke. This is the most efficient way to make your objects transparent with this style.Using a white color has no effect.
- Parameters:
aColor
- the modulation color- Returns:
this
- Since:
- 2016.1
-
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
-
scale
Sets the stroke pattern scale factor. For example, when a scale factor is 2, the size of the stroke patterns is doubled.
See
getScale()
for extra information.- Parameters:
aScaleFactor
- the scale factor.- Returns:
this
- See Also:
-
scalingMode
Sets the scaling mode. The scaling mode defines how lengths, widths and heights of stroke patterns are interpreted. For example when using
VIEW_SCALING
, a rectangular stroke pattern with a length of 10 will always have a length of 10 pixels. When usingWORLD_SCALING
, it will have a length of 10 meters, so its size will vary depending on the zoom level.See
getScale()
for extra information.- Parameters:
aScalingMode
- the scaling mode- Returns:
this
- See Also:
-
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 TLspComplexStrokedLineStyle.Builder<B>>
- Parameters:
aStyle
- the style to copy- Returns:
this
-
build
Description copied from class:ALspStyle.Builder
Builds the style with the set parameters.- Specified by:
build
in classALspStyle.Builder<B extends TLspComplexStrokedLineStyle.Builder<B>>
- Returns:
- the resulting style
-