Package com.itextpdf.layout.properties
Class BackgroundRepeat
java.lang.Object
com.itextpdf.layout.properties.BackgroundRepeat
Class to hold background-repeat property.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Defines all possible background repeat values for one axis. -
Constructor Summary
ConstructorDescriptionCreates a newBackgroundRepeat
instance.Creates a newBackgroundRepeat
instance based on oneBackgroundRepeat
instance.BackgroundRepeat
(BackgroundRepeat.BackgroundRepeatValue xAxisRepeat, BackgroundRepeat.BackgroundRepeatValue yAxisRepeat) Creates a newBackgroundRepeat
instance based on twoBackgroundRepeat
instance. -
Method Summary
Modifier and TypeMethodDescriptionGets theBackgroundRepeat.BackgroundRepeatValue
value for X axis.Gets theBackgroundRepeat.BackgroundRepeatValue
value for Y axis.boolean
Checks whether theBackgroundRepeat.BackgroundRepeatValue.NO_REPEAT
value is set on X axis or not.boolean
Checks whether theBackgroundRepeat.BackgroundRepeatValue.NO_REPEAT
value is set on Y axis or not.prepareRectangleToDrawingAndGetWhitespace
(Rectangle imageRectangle, Rectangle backgroundArea, BackgroundSize backgroundSize) Prepares the image rectangle for drawing.
-
Constructor Details
-
BackgroundRepeat
public BackgroundRepeat()Creates a newBackgroundRepeat
instance. The axis will have the valueBackgroundRepeat.BackgroundRepeatValue.REPEAT
. -
BackgroundRepeat
Creates a newBackgroundRepeat
instance based on oneBackgroundRepeat
instance.- Parameters:
-
repeat
- the repeat value that will be set for for both axes
-
BackgroundRepeat
public BackgroundRepeat(BackgroundRepeat.BackgroundRepeatValue xAxisRepeat, BackgroundRepeat.BackgroundRepeatValue yAxisRepeat) Creates a newBackgroundRepeat
instance based on twoBackgroundRepeat
instance.- Parameters:
-
xAxisRepeat
- the repeat value that will be set for for X axis -
yAxisRepeat
- the repeat value that will be set for for Y axis
-
-
Method Details
-
getXAxisRepeat
Gets theBackgroundRepeat.BackgroundRepeatValue
value for X axis.- Returns:
- the repeat value for X axis.
-
getYAxisRepeat
Gets theBackgroundRepeat.BackgroundRepeatValue
value for Y axis.- Returns:
- the repeat value for Y axis.
-
isNoRepeatOnXAxis
public boolean isNoRepeatOnXAxis()Checks whether theBackgroundRepeat.BackgroundRepeatValue.NO_REPEAT
value is set on X axis or not.- Returns:
-
is the X axis have
BackgroundRepeat.BackgroundRepeatValue.NO_REPEAT
value
-
isNoRepeatOnYAxis
public boolean isNoRepeatOnYAxis()Checks whether theBackgroundRepeat.BackgroundRepeatValue.NO_REPEAT
value is set on Y axis or not.- Returns:
-
is the Y axis have
BackgroundRepeat.BackgroundRepeatValue.NO_REPEAT
value
-
prepareRectangleToDrawingAndGetWhitespace
public Point prepareRectangleToDrawingAndGetWhitespace(Rectangle imageRectangle, Rectangle backgroundArea, BackgroundSize backgroundSize) Prepares the image rectangle for drawing. This means that the size and position of the image rectangle will be changed to match theBackgroundRepeat.BackgroundRepeatValue
values for the axes.- Parameters:
-
imageRectangle
- the image rectangle which will be changed -
backgroundArea
- the background available area -
backgroundSize
- the image background size property - Returns:
- the necessary whitespace between backgrounds
-