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
ConstructorsConstructorDescriptionSpincastImageWatermarkerBuilderDefault(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.intintfloatintprotected SpincastWatermarkerFactorygetText()The image on the file system to use as the watermark.The image to use as the watermark.booleanopacity(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:SpincastImageWatermarkerBuilderThe 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:
textin interfaceSpincastImageWatermarkerBuilder
-
text
- Specified by:
textin interfaceSpincastImageWatermarkerBuilder
-
text
- Specified by:
textin interfaceSpincastImageWatermarkerBuilder
-
text
- Specified by:
textin interfaceSpincastImageWatermarkerBuilder
-
text
- Specified by:
textin interfaceSpincastImageWatermarkerBuilder
-
text
- Specified by:
textin interfaceSpincastImageWatermarkerBuilder
-
text
- Specified by:
textin interfaceSpincastImageWatermarkerBuilder
-
backgroundColor
Description copied from interface:SpincastImageWatermarkerBuilderThe background color to use for the watermark. This is only useful when using atextwatermark.Default to white.
You can set this to
nullto get a transparent background!- Specified by:
backgroundColorin interfaceSpincastImageWatermarkerBuilder
-
image
Description copied from interface:SpincastImageWatermarkerBuilderThe 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:
imagein interfaceSpincastImageWatermarkerBuilder
-
image
Description copied from interface:SpincastImageWatermarkerBuilderThe image to use as the watermark.Calling this will remove any text set using {@link #text(String).
Empty by default.
- Specified by:
imagein interfaceSpincastImageWatermarkerBuilderonClasspath- iftrue, theimageFilePathwill be considered as a classpath path. Otherwise, the image will be taken from the file system.
-
position
Description copied from interface:SpincastImageWatermarkerBuilderThe position where the watermark will be created on the image. No margin.Defaults to .
- Specified by:
positionin interfaceSpincastImageWatermarkerBuilder
-
position
Description copied from interface:SpincastImageWatermarkerBuilderThe position where the watermark will be created on the image.Defaults to .
- Specified by:
positionin interfaceSpincastImageWatermarkerBuilder
-
opacity
Description copied from interface:SpincastImageWatermarkerBuilderThe opacity of the watermark.Between 0.0 and 1.0.
Defaults to 1.0, no transparency.
- Specified by:
opacityin interfaceSpincastImageWatermarkerBuilder
-
widthPercent
Description copied from interface:SpincastImageWatermarkerBuilderThe width of the watermark. Must be an integer between 1 and 100.Defaults to 50.
- Specified by:
widthPercentin interfaceSpincastImageWatermarkerBuilder
-
border
Description copied from interface:SpincastImageWatermarkerBuilderThe border to add around the watermark.Set the
widthInPixelsto 0 to prevent any border to be added.Default to a 5 pixels black border.
- Specified by:
borderin interfaceSpincastImageWatermarkerBuildercolor- Can benull: will be black then.
-
build
Description copied from interface:SpincastImageWatermarkerBuilderCreates the actualSpincastImageWatermarker.- Specified by:
buildin interfaceSpincastImageWatermarkerBuilder
-