Skip to content

Commit 2e7d612

Browse files
AnhelinaMiText-CI
authored andcommitted
Cover several layout properties with documentation
DEVSIX-6639 Autoported commit. Original commit hash: [fd79d9fa9]
1 parent 73f53a7 commit 2e7d612

File tree

7 files changed

+110
-1
lines changed

7 files changed

+110
-1
lines changed

itext/itext.layout/itext/layout/properties/BackgroundImage.cs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ source product.
4444
using iText.Kernel.Pdf.Xobject;
4545

4646
namespace iText.Layout.Properties {
47+
/// <summary>Class to hold background-image property.</summary>
4748
public class BackgroundImage {
4849
private static readonly BlendMode DEFAULT_BLEND_MODE = BlendMode.NORMAL;
4950

@@ -80,10 +81,28 @@ public BackgroundImage(iText.Layout.Properties.BackgroundImage backgroundImage)
8081
(), backgroundImage.GetBackgroundOrigin()) {
8182
}
8283

84+
/// <summary>
85+
/// Gets initial image if it is instanceof
86+
/// <see cref="iText.Kernel.Pdf.Xobject.PdfImageXObject"/>
87+
/// , otherwise returns null.
88+
/// </summary>
89+
/// <returns>
90+
///
91+
/// <see cref="iText.Kernel.Pdf.Xobject.PdfImageXObject"/>
92+
/// </returns>
8393
public virtual PdfImageXObject GetImage() {
8494
return image is PdfImageXObject ? (PdfImageXObject)image : null;
8595
}
8696

97+
/// <summary>
98+
/// Gets initial image if it is instanceof
99+
/// <see cref="iText.Kernel.Pdf.Xobject.PdfFormXObject"/>
100+
/// , otherwise returns null.
101+
/// </summary>
102+
/// <returns>
103+
///
104+
/// <see cref="iText.Kernel.Pdf.Xobject.PdfFormXObject"/>
105+
/// </returns>
87106
public virtual PdfFormXObject GetForm() {
88107
return image is PdfFormXObject ? (PdfFormXObject)image : null;
89108
}
@@ -157,10 +176,21 @@ public virtual BackgroundPosition GetBackgroundPosition() {
157176
return position;
158177
}
159178

179+
/// <summary>Gets linearGradientBuilder.</summary>
180+
/// <returns>
181+
///
182+
/// <see cref="iText.Kernel.Colors.Gradients.AbstractLinearGradientBuilder"/>
183+
/// </returns>
160184
public virtual AbstractLinearGradientBuilder GetLinearGradientBuilder() {
161185
return this.linearGradientBuilder;
162186
}
163187

188+
/// <summary>Returns is background specified.</summary>
189+
/// <returns>
190+
///
191+
/// <see langword="true"/>
192+
/// if background is specified, otherwise false
193+
/// </returns>
164194
public virtual bool IsBackgroundSpecified() {
165195
return image is PdfFormXObject || image is PdfImageXObject || linearGradientBuilder != null;
166196
}
@@ -246,6 +276,11 @@ public class Builder {
246276

247277
private BackgroundBox origin = BackgroundBox.PADDING_BOX;
248278

279+
/// <summary>
280+
/// Creates a new
281+
/// <see cref="Builder"/>
282+
/// instance.
283+
/// </summary>
249284
public Builder() {
250285
}
251286

itext/itext.layout/itext/layout/properties/BackgroundPosition.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,12 +257,14 @@ private static float CalculateValue(UnitValue value, float fullValue) {
257257
return value.IsPercentValue() ? (value.GetValue() / 100 * fullValue) : value.GetValue();
258258
}
259259

260+
/// <summary>A specialized enum containing positions in x-dimension (horizontal positions).</summary>
260261
public enum PositionX {
261262
LEFT,
262263
RIGHT,
263264
CENTER
264265
}
265266

267+
/// <summary>A specialized enum containing positions in y-dimension (vertical positions).</summary>
266268
public enum PositionY {
267269
TOP,
268270
BOTTOM,

itext/itext.layout/itext/layout/properties/BackgroundSize.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,17 @@ public class BackgroundSize {
4545
/// <summary>Image hsd a maximum size but not larger than the area.</summary>
4646
private bool contain;
4747

48+
/// <summary>
49+
/// Creates a new
50+
/// <see cref="BackgroundSize"/>
51+
/// instance.
52+
/// </summary>
53+
/// <remarks>
54+
/// Creates a new
55+
/// <see cref="BackgroundSize"/>
56+
/// instance.
57+
/// The "cover" and "contain" properties are not set.
58+
/// </remarks>
4859
public BackgroundSize() {
4960
cover = false;
5061
contain = false;

itext/itext.layout/itext/layout/properties/ListSymbolPosition.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ source product.
4141
4242
*/
4343
namespace iText.Layout.Properties {
44+
/// <summary>A specialized enum containing position properties for list symbols.</summary>
4445
public enum ListSymbolPosition {
4546
DEFAULT,
4647
INSIDE,

itext/itext.layout/itext/layout/properties/OverflowWrapPropertyValue.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,19 @@ You should have received a copy of the GNU Affero General Public License
2121
along with this program. If not, see <https://www.gnu.org/licenses/>.
2222
*/
2323
namespace iText.Layout.Properties {
24+
/// <summary>The possible values for the overflow wrap property.</summary>
25+
/// <remarks>
26+
/// The possible values for the overflow wrap property.
27+
/// <para />
28+
/// <see cref="ANYWHERE"/>
29+
/// and
30+
/// <see cref="BREAK_WORD"/>
31+
/// mean that long words will break if they overflow the container.
32+
/// <para />
33+
/// <see cref="NORMAL"/>
34+
/// means that long words will not break,
35+
/// even if they overflow the container.
36+
/// </remarks>
2437
public enum OverflowWrapPropertyValue {
2538
ANYWHERE,
2639
BREAK_WORD,

itext/itext.layout/itext/layout/properties/TransparentColor.cs

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,33 +45,80 @@ source product.
4545
using iText.Kernel.Pdf.Extgstate;
4646

4747
namespace iText.Layout.Properties {
48+
/// <summary>Represents a color with the specified opacity.</summary>
4849
public class TransparentColor {
4950
private Color color;
5051

5152
private float opacity;
5253

54+
/// <summary>
55+
/// Creates a new
56+
/// <see cref="TransparentColor"/>
57+
/// instance of certain fully opaque color.
58+
/// </summary>
59+
/// <param name="color">
60+
/// the
61+
/// <see cref="iText.Kernel.Colors.Color"/>
62+
/// of the created
63+
/// <see cref="TransparentColor"/>
64+
/// object
65+
/// </param>
5366
public TransparentColor(Color color) {
5467
this.color = color;
5568
this.opacity = 1f;
5669
}
5770

71+
/// <summary>
72+
/// Creates a new
73+
/// <see cref="TransparentColor"/>.
74+
/// </summary>
75+
/// <param name="color">
76+
/// the
77+
/// <see cref="iText.Kernel.Colors.Color"/>
78+
/// of the created
79+
/// <see cref="TransparentColor"/>
80+
/// object
81+
/// </param>
82+
/// <param name="opacity">
83+
/// a float defining the opacity of the color; a float between 0 and 1,
84+
/// where 1 stands for fully opaque color and 0 - for fully transparent
85+
/// </param>
5886
public TransparentColor(Color color, float opacity) {
5987
this.color = color;
6088
this.opacity = opacity;
6189
}
6290

91+
/// <summary>Gets the color.</summary>
92+
/// <returns>
93+
/// a
94+
/// <see cref="iText.Kernel.Colors.Color"/>
95+
/// </returns>
6396
public virtual Color GetColor() {
6497
return color;
6598
}
6699

100+
/// <summary>Gets the opacity of color.</summary>
101+
/// <returns>a float between 0 and 1, where 1 stands for fully opaque color and 0 - for fully transparent</returns>
67102
public virtual float GetOpacity() {
68103
return opacity;
69104
}
70105

106+
/// <summary>Sets the opacity value for <b>non-stroking</b> operations in the transparent imaging model.</summary>
107+
/// <param name="canvas">
108+
/// the
109+
/// <see cref="iText.Kernel.Pdf.Canvas.PdfCanvas"/>
110+
/// to be written to
111+
/// </param>
71112
public virtual void ApplyFillTransparency(PdfCanvas canvas) {
72113
ApplyTransparency(canvas, false);
73114
}
74115

116+
/// <summary>Sets the opacity value for <b>stroking</b> operations in the transparent imaging model.</summary>
117+
/// <param name="canvas">
118+
/// the
119+
/// <see cref="iText.Kernel.Pdf.Canvas.PdfCanvas"/>
120+
/// to be written to
121+
/// </param>
75122
public virtual void ApplyStrokeTransparency(PdfCanvas canvas) {
76123
ApplyTransparency(canvas, true);
77124
}

port-hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
30c6c9e883a50dae6adb0bfe884414f0d682cc31
1+
fd79d9fa94c2f6564df5670f97cdee1b13002413

0 commit comments

Comments
 (0)