Package com.itextpdf.layout.properties
Class BackgroundRepeat
java.lang.Object
com.itextpdf.layout.properties.BackgroundRepeat
Class to hold background-repeat property.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDefines all possible background repeat values for one axis. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a newBackgroundRepeatinstance.Creates a newBackgroundRepeatinstance based on oneBackgroundRepeatinstance.BackgroundRepeat(BackgroundRepeat.BackgroundRepeatValue xAxisRepeat, BackgroundRepeat.BackgroundRepeatValue yAxisRepeat) Creates a newBackgroundRepeatinstance based on twoBackgroundRepeatinstance. -
Method Summary
Modifier and TypeMethodDescriptionGets theBackgroundRepeat.BackgroundRepeatValuevalue for X axis.Gets theBackgroundRepeat.BackgroundRepeatValuevalue for Y axis.booleanChecks whether theBackgroundRepeat.BackgroundRepeatValue.NO_REPEATvalue is set on X axis or not.booleanChecks whether theBackgroundRepeat.BackgroundRepeatValue.NO_REPEATvalue 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 newBackgroundRepeatinstance. The axis will have the valueBackgroundRepeat.BackgroundRepeatValue.REPEAT. -
BackgroundRepeat
Creates a newBackgroundRepeatinstance based on oneBackgroundRepeatinstance.- Parameters:
-
repeat- the repeat value that will be set for for both axes
-
BackgroundRepeat
public BackgroundRepeat(BackgroundRepeat.BackgroundRepeatValue xAxisRepeat, BackgroundRepeat.BackgroundRepeatValue yAxisRepeat) Creates a newBackgroundRepeatinstance based on twoBackgroundRepeatinstance.- 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.BackgroundRepeatValuevalue for X axis.- Returns:
- the repeat value for X axis.
-
getYAxisRepeat
Gets theBackgroundRepeat.BackgroundRepeatValuevalue for Y axis.- Returns:
- the repeat value for Y axis.
-
isNoRepeatOnXAxis
public boolean isNoRepeatOnXAxis()Checks whether theBackgroundRepeat.BackgroundRepeatValue.NO_REPEATvalue is set on X axis or not.- Returns:
-
is the X axis have
BackgroundRepeat.BackgroundRepeatValue.NO_REPEATvalue
-
isNoRepeatOnYAxis
public boolean isNoRepeatOnYAxis()Checks whether theBackgroundRepeat.BackgroundRepeatValue.NO_REPEATvalue is set on Y axis or not.- Returns:
-
is the Y axis have
BackgroundRepeat.BackgroundRepeatValue.NO_REPEATvalue
-
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.BackgroundRepeatValuevalues 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
-