Package org.spincast.plugins.watermarker
Class SpincastImageWatermarkerBuilderDefault
java.lang.Object
org.spincast.plugins.watermarker.SpincastImageWatermarkerBuilderDefault
- All Implemented Interfaces:
SpincastImageWatermarkerBuilder
public class SpincastImageWatermarkerBuilderDefault
extends Object
implements SpincastImageWatermarkerBuilder
-
Constructor Summary
ConstructorDescriptionSpincastImageWatermarkerBuilderDefault
(SpincastWatermarkerFactory spincastWatermarkerFactory) -
Method Summary
Modifier and TypeMethodDescriptionbackgroundColor
(Color color) The background color to use for the watermark.The border to add around the watermark.build()
Creates the actualSpincastImageWatermarker
.int
int
float
int
protected SpincastWatermarkerFactory
getText()
The image on the file system to use as the watermark.The image to use as the watermark.boolean
opacity
(float opacity) The opacity of the watermark.position
(SpincastWatermarkPosition position) The position where the watermark will be created on the image.position
(SpincastWatermarkPosition position, int margin) The position where the watermark will be created on the image.The text to use as the watermark.widthPercent
(int percentageWidth) The width of the watermark.
-
Constructor Details
-
SpincastImageWatermarkerBuilderDefault
@Inject public SpincastImageWatermarkerBuilderDefault(SpincastWatermarkerFactory spincastWatermarkerFactory)
-
-
Method Details
-
getSpincastWatermarkerFactory
-
getText
-
getTextColor
-
getBackgroundColor
-
getTextFont
-
getImageFilePath
-
isImageFileOnClasspath
public boolean isImageFileOnClasspath() -
getPosition
-
getMargin
public int getMargin() -
getOpacity
public float getOpacity() -
getPercentageWidth
public int getPercentageWidth() -
getBorderWidth
public int getBorderWidth() -
getBorderColor
-
text
Description copied from interface:SpincastImageWatermarkerBuilder
The text to use as the watermark. Calling this will remove any image set using#image(File)
.By default, this text is the root URL of the application (for example: "https://www.example.com").
- Specified by:
text
in interfaceSpincastImageWatermarkerBuilder
-
text
- Specified by:
text
in interfaceSpincastImageWatermarkerBuilder
-
text
- Specified by:
text
in interfaceSpincastImageWatermarkerBuilder
-
text
- Specified by:
text
in interfaceSpincastImageWatermarkerBuilder
-
text
- Specified by:
text
in interfaceSpincastImageWatermarkerBuilder
-
text
- Specified by:
text
in interfaceSpincastImageWatermarkerBuilder
-
text
- Specified by:
text
in interfaceSpincastImageWatermarkerBuilder
-
backgroundColor
Description copied from interface:SpincastImageWatermarkerBuilder
The background color to use for the watermark. This is only useful when using atext
watermark.Default to white.
You can set this to
null
to get a transparent background!- Specified by:
backgroundColor
in interfaceSpincastImageWatermarkerBuilder
-
image
Description copied from interface:SpincastImageWatermarkerBuilder
The image on the file system to use as the watermark.Calling this will remove any text set using {@link #text(String).
Empty by default.
- Specified by:
image
in interfaceSpincastImageWatermarkerBuilder
-
image
Description copied from interface:SpincastImageWatermarkerBuilder
The image to use as the watermark.Calling this will remove any text set using {@link #text(String).
Empty by default.
- Specified by:
image
in interfaceSpincastImageWatermarkerBuilder
onClasspath
- iftrue
, theimageFilePath
will be considered as a classpath path. Otherwise, the image will be taken from the file system.
-
position
Description copied from interface:SpincastImageWatermarkerBuilder
The position where the watermark will be created on the image. No margin.Defaults to .
- Specified by:
position
in interfaceSpincastImageWatermarkerBuilder
-
position
Description copied from interface:SpincastImageWatermarkerBuilder
The position where the watermark will be created on the image.Defaults to .
- Specified by:
position
in interfaceSpincastImageWatermarkerBuilder
-
opacity
Description copied from interface:SpincastImageWatermarkerBuilder
The opacity of the watermark.Between 0.0 and 1.0.
Defaults to 1.0, no transparency.
- Specified by:
opacity
in interfaceSpincastImageWatermarkerBuilder
-
widthPercent
Description copied from interface:SpincastImageWatermarkerBuilder
The width of the watermark. Must be an integer between 1 and 100.Defaults to 50.
- Specified by:
widthPercent
in interfaceSpincastImageWatermarkerBuilder
-
border
Description copied from interface:SpincastImageWatermarkerBuilder
The border to add around the watermark.Set the
widthInPixels
to 0 to prevent any border to be added.Default to a 5 pixels black border.
- Specified by:
border
in interfaceSpincastImageWatermarkerBuilder
color
- Can benull
: will be black then.
-
build
Description copied from interface:SpincastImageWatermarkerBuilder
Creates the actualSpincastImageWatermarker
.- Specified by:
build
in interfaceSpincastImageWatermarkerBuilder
-