Package com.luciad.drawing
Class ImageIcon.Builder
java.lang.Object
com.luciad.drawing.ImageIcon.Builder
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
ImageIcon
- Since:
- 2023.1
-
Constructor Details
-
Method Details
-
finalize
protected void finalize() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
build
Returns theIIcon
based on the provided images.- Returns:
- the
IIcon
based on the provided images. - Throws:
IllegalStateException
- If no images have been set.
-
addImage
@NotNull public ImageIcon.Builder addImage(@NotNull Image image, double displayScale) throws NullPointerException, IllegalArgumentException Adds anImage
to the icon builder.The anchor point is place at the center of the image.
When an image is already provided for a given display scale the last call overrides the previous image.
- Parameters:
image
- The image. Cannot benull
.displayScale
- The display scale factor for the image. Must be > 0.- Returns:
- this builder.
- Throws:
NullPointerException
- when the image is anull
value.IllegalArgumentException
- when the display scale is <= 0.
-
addImage
@NotNull public ImageIcon.Builder addImage(@NotNull Image image, double anchorX, double anchorY, double displayScale) throws NullPointerException, IllegalArgumentException Adds anImage
to the icon builder.When an image is already provided for a given display scale the last call overrides the previous image.
- Parameters:
image
- The image. Cannot benull
.anchorX
- The x coordinate of the anchor point in pixels. This must be a value in the [0, getWidth()] range.anchorY
- The y coordinate of the anchor point in pixels. This must be a value in the [0, getHeight()] range.displayScale
- The display scale factor for the image. Must be > 0.- Returns:
- this builder.
- Throws:
NullPointerException
- when the image is anull
value.IllegalArgumentException
- when the display scale is <= 0 or an invalid value is provided for the anchor point.- See Also:
-