Class TLcdSLDGraphic.Builder<T>
- Enclosing class:
TLcdSLDGraphic
- Since:
- 2012.1
-
Method Summary
Modifier and TypeMethodDescriptionaddExternalGraphic
(String aHref) Adds an external graphic based on the specified link.addInlineExternalGraphic
(String aFileName) Adds a binary image file.addInlineSVGMark
(String aFileName) Creates and adds a mark graphic by loading an SVG from file.addMark
(TLcdSLDMark aMark) Adds a mark which will be used for the graphicsCreates a mark graphic based on a 'well known name'.Creates a mark graphic based on a 'well known name'.anchorPoint
(TLcdSLDAnchorPoint aAnchorPoint) Sets the anchor point for this graphic.Builds the graphic with the set parameters.opacity
(double aOpacity) Sets a fixed opacity for this graphic.opacity
(ILcdOGCExpression aOpacityExpression) Sets the opacity expression for this graphic.rotation
(double aRotationInDegrees) Sets a fixed rotation for this graphic.rotation
(ILcdOGCExpression aRotationExpression) Sets a rotation expression for this graphic.size
(double aSize) Sets a fixed size for this graphic.size
(ILcdOGCExpression aSize) Sets a size expression for this graphic.
-
Method Details
-
size
Sets a fixed size for this graphic. The default interpretation of this size is in pixels. But the unit of measure of the symbolizer can be set to define a world size.
This method must not be called when
size(ILcdOGCExpression)
has already been called.- Parameters:
aSize
- A size in pixels or in a world unit such as meters. Size must be greater than zero- Returns:
- This builder.
-
size
Sets a size expression for this graphic. The default interpretation of this size is in pixels. But the unit of measure of the symbolizer can be set to define a world size.
This method must not be called when
size(double)
has already been called.- Parameters:
aSize
- An expression that evaluates to a size in pixels or in a world unit such as meters. Must not benull
- Returns:
- This builder.
-
rotation
Sets a fixed rotation for this graphic. The interpretation of this rotation is in degrees.
This method must not be called when
rotation(ILcdOGCExpression)
has already been called.- Parameters:
aRotationInDegrees
- The rotation in degrees- Returns:
- This builder
-
rotation
Sets a rotation expression for this graphic. The expression should evaluate to a number (decimals are possible). The rotation is expressed in degrees.
This method must not be called when
rotation(double)
has already been called.- Parameters:
aRotationExpression
- An expression that evaluates to a rotation in degrees. Must not benull
- Returns:
- This builder
-
opacity
Sets a fixed opacity for this graphic. The opacity should be between 0.0 and 1.0
This method must not be called when
opacity(ILcdOGCExpression)
has already been called.- Parameters:
aOpacity
- The opacity value.- Returns:
- This builder
-
opacity
Sets the opacity expression for this graphic. The expression should evaluate to a decimal number between 0 and 1.
This method must not be called when
opacity(double)
has already been called.- Parameters:
aOpacityExpression
- An expression that evaluates to an opacity in decimals. Must not benull
- Returns:
- This builder
-
anchorPoint
Sets the anchor point for this graphic.
The anchor point defines the location of this graphic, relative to its bounds. The default anchor point is [0.5, 0.5], indicating that the graphic is centered within the bounds of the graphic.
- Parameters:
aAnchorPoint
- The anchor point for this graphic. Must not benull
- Returns:
- This builder
- Since:
- 2022.1
- See Also:
-
addExternalGraphic
Adds an external graphic based on the specified link. The file format is derived from the link, 'image/png' is used as a fallback if this fails.- Parameters:
aHref
- A link that can be resolved to an image. Must not benull
- Returns:
- this builder
-
addInlineExternalGraphic
Adds a binary image file. The format will be derived from the extension, png will be used if this fails. The loaded image icon will be stored as base64 encoded binary content, so without any reference to the original file name.- Parameters:
aFileName
- The name of a file containing pixel data in a recognized file format. Must not benull
- Returns:
- this builder
-
addInlineSVGMark
Creates and adds a mark graphic by loading an SVG from file. When encoding the graphic, the SVG will be encoded inline directly, without referencing the original file name.- Parameters:
aFileName
- The SVG filename. Must not benull
- Returns:
- this builder
-
addMark
Creates a mark graphic based on a 'well known name'. The possible well known names are available in
TLcdSLDMark
.For example:
mark( TLcdSLDMark.CIRCLE, Color.green, Color.blue );
- Parameters:
aWellKnownName
- A well known name for aTLcdSLDMark
. Must not benull
aLineColor
- The line color of the mark. Must not benull
aFillColor
- The fill color of the mark. Must not benull
- Returns:
- this builder
-
addMark
public TLcdSLDGraphic.Builder<T> addMark(String aWellKnownName, Color aLineColor, Color aFillColor, double aOpacity) Creates a mark graphic based on a 'well known name'. The possible well known names are available in
TLcdSLDMark
.For example:
mark( TLcdSLDMark.CIRCLE, Color.green, Color.blue, 0.5 );
- Parameters:
aWellKnownName
- A well known name for aTLcdSLDMark
. Must not benull
aLineColor
- The line color of the mark. Must not benull
aFillColor
- The fill color of the mark. Must not benull
aOpacity
- the opacity. Must be between 0 and 1.- Returns:
- this builder
-
addMark
Adds a mark which will be used for the graphics- Parameters:
aMark
- The mark- Returns:
- This builder
-
buildGraphic
Builds the graphic with the set parameters.
This method can only be called once. When you used the builder to build an instance, the builder is no longer valid and should be thrown away.
- Returns:
- the resulting graphic
-