public static class TLspComplexStrokedLineStyle.Builder<B extends TLspComplexStrokedLineStyle.Builder<B>> extends ALspStyle.Builder<B> implements ILspWorldElevationStyle.Builder
TLspComplexStrokedLineStyle
instances.Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
B |
all(ALspStyle aStyle)
Sets all parameters on the builder based on the given style.
|
TLspComplexStrokedLineStyle |
build()
Builds the style with the set parameters.
|
B |
decoration(double aRelativeLocation,
ALspComplexStroke aStroke)
Positions the given stroke pattern at the given location on the line.
|
B |
decoration(double aRelativeLocation,
ELcdHorizontalAlignment aAlignment,
ALspComplexStroke aStroke)
Positions the given stroke pattern at the given location on the line.
|
B |
elevationMode(ILspWorldElevationStyle.ElevationMode aMode)
Specifies the elevation mode.
|
B |
fallback(ALspComplexStroke aStroke)
The given stroke is used when it is not possible to place an other stroke pattern
(see
decoration , regular ). |
B |
fallback(double aAnchor,
ALspComplexStroke aStroke)
The given stroke is used when it is not possible to place an other stroke pattern
(see
decoration , regular ). |
B |
haloColor(Color aColor)
Sets the halo color.
|
B |
haloThickness(float aThickness)
Sets the halo thickness in pixels.
|
B |
modulationColor(Color aColor)
Sets the color that is modulated with the stroke.
|
B |
regular(ALspComplexStroke aStroke)
Repeats the given stroke pattern along the line.
|
B |
regular(double aAnchor,
ALspComplexStroke aStroke)
Repeats the given stroke pattern along the line.
|
B |
scale(double aScaleFactor)
Sets the stroke pattern scale factor.
|
B |
scalingMode(TLspComplexStrokedLineStyle.ScalingMode aScalingMode)
Sets the scaling mode.
|
B |
sharpAngleThreshold(double aSharpAngleThreshold)
Sets the threshold which is used to determine if angles are sharp or not.
|
B |
zOrder(int aZOrder)
Sets the Z-order of this style.
|
equals, hashCode
public B zOrder(int aZOrder)
aZOrder
- the z orderthis
public B sharpAngleThreshold(double aSharpAngleThreshold)
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.
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.this
public B decoration(double aRelativeLocation, ALspComplexStroke aStroke)
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 is RIGHT
. Otherwise, this is CENTER
.
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
or ALspComplexStroke.combineWithFallbackStroking
can be used.
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.this
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
or ALspComplexStroke.combineWithFallbackStroking
can be used.
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 using CENTER
the
middle of the stroke will coincide with the specified location. When
using RIGHT
, the right of the
stroke pattern will coincide with the specified location (i.e. it
will appear left of the location). Can be null
, in which case
a default alignment is used.aStroke
- the stroke pattern.this
public B regular(ALspComplexStroke aStroke)
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.
aStroke
- the strokethis
public B regular(double aAnchor, ALspComplexStroke aStroke)
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.
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 strokethis
public B fallback(ALspComplexStroke aStroke)
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
and combineWithRegularStroking
stroke pattern wrappers.
aStroke
- the strokethis
public B fallback(double aAnchor, ALspComplexStroke aStroke)
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
and combineWithRegularStroking
stroke pattern wrappers.
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 strokethis
public B haloThickness(float aThickness)
Sets the halo thickness in pixels. Set to zero if no halo should be visible.
By default the halo is disabled.
aThickness
- the thickness in pixelsthis
haloColor(java.awt.Color)
public B haloColor(Color aColor)
Sets the halo color. This property is only used if the halo is enabled.
By default the halo color is set to white.
aColor
- the halo colorthis
IllegalArgumentException
- if aColor==null
haloThickness(float)
public B modulationColor(Color aColor)
Using a white color has no effect.
aColor
- the modulation colorthis
public B elevationMode(ILspWorldElevationStyle.ElevationMode aMode)
ILspWorldElevationStyle.Builder
elevationMode
in interface ILspWorldElevationStyle.Builder
this
public B scale(double aScaleFactor)
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.
aScaleFactor
- the scale factor.this
TLspComplexStrokedLineStyle.getScale()
public B scalingMode(TLspComplexStrokedLineStyle.ScalingMode aScalingMode)
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 using WORLD_SCALING
, it will have a length of 10
meters, so its size will vary depending on the zoom level.
See getScale()
for extra information.
aScalingMode
- the scaling modethis
TLspComplexStrokedLineStyle.getScalingMode()
,
TLspComplexStrokedLineStyle.getScale()
public B all(ALspStyle aStyle)
ALspStyle.Builder
all
in class ALspStyle.Builder<B extends TLspComplexStrokedLineStyle.Builder<B>>
aStyle
- the style to copythis
public TLspComplexStrokedLineStyle build()
ALspStyle.Builder
build
in class ALspStyle.Builder<B extends TLspComplexStrokedLineStyle.Builder<B>>