Class ParallelLinePatternBuilder
java.lang.Object
com.luciad.layers.styles.complexstrokes.builders.ParallelLinePatternBuilder
- All Implemented Interfaces:
AutoCloseable
Creates a pattern with a line segment shape that is parallel to the base line.
- Since:
- 2023.1
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build the parallel line pattern as configured.void
close()
protected void
finalize()
fixedLength
(double fixedLength) Set the length of the pattern in pixels.lineColor
(android.graphics.Color color) Sets the line color.lineWidth
(double lineWidth) Sets the line width.offset
(double offset) Sets the offset of the line, relative to the base line, in pixels.relativeLength
(double relativeLength) Set the length of the pattern relative to the length of the entire line, as a value between0
and1
.
-
Method Details
-
finalize
protected void finalize() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
build
Build the parallel line pattern as configured.- Returns:
- the
ComplexStrokePattern
.
-
fixedLength
@NotNull public ParallelLinePatternBuilder fixedLength(double fixedLength) throws IllegalArgumentException Set the length of the pattern in pixels.The length cannot be both fixed and relative, if both methods are used, only the last one affects the result.
If no length is set, a 10 pixel fixed length will be used as default.
- Parameters:
fixedLength
- the length in pixels.- Returns:
- this builder.
- Throws:
IllegalArgumentException
- fixedLength must be>=0
.
-
relativeLength
@NotNull public ParallelLinePatternBuilder relativeLength(double relativeLength) throws IllegalArgumentException Set the length of the pattern relative to the length of the entire line, as a value between0
and1
.The length cannot be both fixed and relative, if both methods are used, only the last one affects the result.
If no length is set, a 10 pixel fixed length will be used as default.
- Parameters:
relativeLength
- a value in[0,1]
.- Returns:
- this builder.
- Throws:
IllegalArgumentException
- relativeLength must be in range[0,1]
.
-
offset
Sets the offset of the line, relative to the base line, in pixels.- Parameters:
offset
- the offset in pixels. Defaults to0
.- Returns:
- this builder.
-
lineWidth
@NotNull public ParallelLinePatternBuilder lineWidth(double lineWidth) throws IllegalArgumentException Sets the line width.- Parameters:
lineWidth
- the line's width, defaults to1
.- Returns:
- this builder.
- Throws:
IllegalArgumentException
- lineWidth must be>0
.
-
lineColor
Sets the line color.- Parameters:
color
- the line's color, defaults to black.- Returns:
- this builder.
-