@@ -48,6 +48,9 @@ This file is part of the iText (R) project.
48
48
import com .itextpdf .kernel .pdf .xobject .PdfXObject ;
49
49
import com .itextpdf .layout .properties .BackgroundRepeat .BackgroundRepeatValue ;
50
50
51
+ /**
52
+ * Class to hold background-image property.
53
+ */
51
54
public class BackgroundImage {
52
55
53
56
private static final BlendMode DEFAULT_BLEND_MODE = BlendMode .NORMAL ;
@@ -84,10 +87,20 @@ public BackgroundImage(BackgroundImage backgroundImage) {
84
87
backgroundImage .getBackgroundOrigin ());
85
88
}
86
89
90
+ /**
91
+ * Gets initial image if it is instanceof {@link PdfImageXObject}, otherwise returns null.
92
+ *
93
+ * @return {@link PdfImageXObject}
94
+ */
87
95
public PdfImageXObject getImage () {
88
96
return image instanceof PdfImageXObject ? (PdfImageXObject ) image : null ;
89
97
}
90
98
99
+ /**
100
+ * Gets initial image if it is instanceof {@link PdfFormXObject}, otherwise returns null.
101
+ *
102
+ * @return {@link PdfFormXObject}
103
+ */
91
104
public PdfFormXObject getForm () {
92
105
return image instanceof PdfFormXObject ? (PdfFormXObject ) image : null ;
93
106
}
@@ -128,10 +141,20 @@ public BackgroundPosition getBackgroundPosition() {
128
141
return position ;
129
142
}
130
143
144
+ /**
145
+ * Gets linearGradientBuilder.
146
+ *
147
+ * @return {@link AbstractLinearGradientBuilder}
148
+ */
131
149
public AbstractLinearGradientBuilder getLinearGradientBuilder () {
132
150
return this .linearGradientBuilder ;
133
151
}
134
152
153
+ /**
154
+ * Returns is background specified.
155
+ *
156
+ * @return {@code true} if background is specified, otherwise false
157
+ */
135
158
public boolean isBackgroundSpecified () {
136
159
return image instanceof PdfFormXObject || image instanceof PdfImageXObject || linearGradientBuilder != null ;
137
160
}
@@ -213,6 +236,9 @@ public static class Builder {
213
236
private BackgroundBox clip = BackgroundBox .BORDER_BOX ;
214
237
private BackgroundBox origin = BackgroundBox .PADDING_BOX ;
215
238
239
+ /**
240
+ * Creates a new {@link Builder} instance.
241
+ */
216
242
public Builder () {
217
243
}
218
244
0 commit comments