Class IconPatternBuilder
java.lang.Object
com.luciad.layers.styles.complexstrokes.builders.IconPatternBuilder
- All Implemented Interfaces:
AutoCloseable
Creates a pattern containing an icon.
The icon must be set by calling the icon method before calling build. All other methods are optional.
- Since:
- 2023.1
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build the icon pattern as configured.void
close()
protected void
finalize()
Sets the icon to be displayed.offset
(double offset) Sets the offset of the icon, relative to the base line, in pixels.opacity
(double opacity) The opacity of the icon, determines how transparent an icon will be painted.rotateUp
(boolean rotateUp) Indicates if the icon should be flipped when it is turned upside down.The rotation angle around the center of the icon's image, specified in degrees.scale
(double scale) Sets the factor by which the icon will be scaled.
-
Method Details
-
finalize
protected void finalize() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
build
Build the icon pattern as configured.- Returns:
- the
ComplexStrokePattern
. - Throws:
IllegalStateException
- when the icon has not been set.
-
icon
Sets the icon to be displayed.May not be
null
.- Parameters:
icon
- the icon to be displayed.- Returns:
- this builder.
- Throws:
IllegalArgumentException
- icon may not benull
.
-
rotateUp
Indicates if the icon should be flipped when it is turned upside down.Defaults to false.
- Parameters:
rotateUp
- Indicates if the icon should be flipped when it is turned upside down.- Returns:
- this builder.
-
offset
Sets the offset of the icon, relative to the base line, in pixels.Defaults to
0
.- Parameters:
offset
- the offset of the icon.- Returns:
- this builder.
-
scale
Sets the factor by which the icon will be scaled.Defaults to
1
(no scaling).- Parameters:
scale
- the scale factor.- Returns:
- this builder.
- Throws:
IllegalArgumentException
- scale must be>0
.
-
opacity
The opacity of the icon, determines how transparent an icon will be painted.It needs to be specified between
0
and1
.0
indicates that the icon is painted completely transparent and1
indicates that the original opacity of the icon is used.- Parameters:
opacity
- the icon's opacity in the[0,1]
interval, defaults to 1.- Returns:
- this builder.
- Throws:
IllegalArgumentException
- opacity must be in range[0,1]
.
-
rotation
The rotation angle around the center of the icon's image, specified in degrees.Rotations are applied in a clock-wise fashion relatively to the direction of the underlying line. When
rotateUp
is set to true, the flipping occurs on the already rotated icon. The default is0
, which implies the icon is not rotated.- Parameters:
rotation
- the rotation, defaults to0
degrees.- Returns:
- this builder.
-