Skip to content

Commit 6f7b7ae

Browse files
ars18wrwiText-CI
authored andcommitted
Cover pattern and shading related constants with javadocs
DEVSIX-5011 Autoported commit. Original commit hash: [0cbf75948]
1 parent 2845f72 commit 6f7b7ae

File tree

4 files changed

+231
-1
lines changed

4 files changed

+231
-1
lines changed

itext/itext.kernel/itext/kernel/pdf/canvas/PdfCanvasConstants.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,16 @@ private LineJoinStyle() {
178178
public const int BEVEL = 2;
179179
}
180180

181+
/// <summary>Rule for determining which points lie inside a path.</summary>
181182
public class FillingRule {
182183
private FillingRule() {
183184
}
184185

185186
// This private constructor will prevent the instantiation of this class
187+
/// <summary>The nonzero winding number rule.</summary>
186188
public const int NONZERO_WINDING = 1;
187189

190+
/// <summary>The even-odd winding number rule.</summary>
188191
public const int EVEN_ODD = 2;
189192
}
190193
}

itext/itext.kernel/itext/kernel/pdf/colorspace/PdfPattern.cs

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,16 @@ namespace iText.Kernel.Pdf.Colorspace {
5757
/// For mor information see paragraph 8.7 in ISO-32000-1.
5858
/// </remarks>
5959
public abstract class PdfPattern : PdfObjectWrapper<PdfDictionary> {
60+
/// <summary>
61+
/// Wraps the passed
62+
/// <see cref="iText.Kernel.Pdf.PdfDictionary"/>
63+
/// </summary>
64+
/// <param name="pdfObject">
65+
/// the
66+
/// <see cref="iText.Kernel.Pdf.PdfDictionary"/>
67+
/// that represent Pattern
68+
/// </param>
69+
/// <returns>new wrapper instance.</returns>
6070
protected internal PdfPattern(PdfDictionary pdfObject)
6171
: base(pdfObject) {
6272
}
@@ -206,34 +216,82 @@ public Tiling(PdfStream pdfObject)
206216
: base(pdfObject) {
207217
}
208218

219+
/// <summary>Creates a new Tiling Pattern instance.</summary>
220+
/// <remarks>
221+
/// Creates a new Tiling Pattern instance.
222+
/// By default the pattern will be colored.
223+
/// </remarks>
224+
/// <param name="width">the width of the pattern cell's bounding box</param>
225+
/// <param name="height">the height of the pattern cell's bounding box</param>
209226
public Tiling(float width, float height)
210227
: this(width, height, true) {
211228
}
212229

230+
/// <summary>Creates a new Tiling Pattern instance.</summary>
231+
/// <param name="width">the width of the pattern cell's bounding box</param>
232+
/// <param name="height">the height of the pattern cell's bounding box</param>
233+
/// <param name="colored">defines whether the Tiling Pattern will be colored or not</param>
213234
public Tiling(float width, float height, bool colored)
214235
: this(new Rectangle(width, height), colored) {
215236
}
216237

238+
/// <summary>Creates a new Tiling instance.</summary>
239+
/// <remarks>
240+
/// Creates a new Tiling instance.
241+
/// By default the pattern will be colored.
242+
/// </remarks>
243+
/// <param name="bbox">the pattern cell's bounding box</param>
217244
public Tiling(Rectangle bbox)
218245
: this(bbox, true) {
219246
}
220247

248+
/// <summary>Creates a new Tiling instance.</summary>
249+
/// <param name="bbox">the pattern cell's bounding box</param>
250+
/// <param name="colored">defines whether the Tiling Pattern will be colored or not</param>
221251
public Tiling(Rectangle bbox, bool colored)
222252
: this(bbox, bbox.GetWidth(), bbox.GetHeight(), colored) {
223253
}
224254

255+
/// <summary>Creates a new Tiling Pattern instance.</summary>
256+
/// <remarks>
257+
/// Creates a new Tiling Pattern instance.
258+
/// By default the pattern will be colored.
259+
/// </remarks>
260+
/// <param name="width">the width of the pattern cell's bounding box</param>
261+
/// <param name="height">the height of the pattern cell's bounding box</param>
262+
/// <param name="xStep">the desired horizontal space between pattern cells</param>
263+
/// <param name="yStep">the desired vertical space between pattern cells</param>
225264
public Tiling(float width, float height, float xStep, float yStep)
226265
: this(width, height, xStep, yStep, true) {
227266
}
228267

268+
/// <summary>Creates a new Tiling Pattern instance.</summary>
269+
/// <param name="width">the width of the pattern cell's bounding box</param>
270+
/// <param name="height">the height of the pattern cell's bounding box</param>
271+
/// <param name="xStep">the desired horizontal space between pattern cells</param>
272+
/// <param name="yStep">the desired vertical space between pattern cells</param>
273+
/// <param name="colored">defines whether the Tiling Pattern will be colored or not</param>
229274
public Tiling(float width, float height, float xStep, float yStep, bool colored)
230275
: this(new Rectangle(width, height), xStep, yStep, colored) {
231276
}
232277

278+
/// <summary>Creates a new Tiling instance.</summary>
279+
/// <remarks>
280+
/// Creates a new Tiling instance.
281+
/// By default the pattern will be colored.
282+
/// </remarks>
283+
/// <param name="bbox">the pattern cell's bounding box</param>
284+
/// <param name="xStep">the desired horizontal space between pattern cells</param>
285+
/// <param name="yStep">the desired vertical space between pattern cells</param>
233286
public Tiling(Rectangle bbox, float xStep, float yStep)
234287
: this(bbox, xStep, yStep, true) {
235288
}
236289

290+
/// <summary>Creates a new Tiling instance.</summary>
291+
/// <param name="bbox">the pattern cell's bounding box</param>
292+
/// <param name="xStep">the desired horizontal space between pattern cells</param>
293+
/// <param name="yStep">the desired vertical space between pattern cells</param>
294+
/// <param name="colored">defines whether the Tiling Pattern will be colored or not</param>
237295
public Tiling(Rectangle bbox, float xStep, float yStep, bool colored)
238296
: base(new PdfStream()) {
239297
GetPdfObject().Put(PdfName.Type, PdfName.Pattern);
@@ -318,24 +376,32 @@ public virtual void SetBBox(Rectangle bbox) {
318376
SetModified();
319377
}
320378

379+
/// <summary>Gets the desired horizontal space between pattern cells</summary>
380+
/// <returns>the desired horizontal space between pattern cells</returns>
321381
public virtual float GetXStep() {
322382
return GetPdfObject().GetAsNumber(PdfName.XStep).FloatValue();
323383
}
324384

385+
/// <summary>Sets the desired horizontal space between pattern cells</summary>
325386
public virtual void SetXStep(float xStep) {
326387
GetPdfObject().Put(PdfName.XStep, new PdfNumber(xStep));
327388
SetModified();
328389
}
329390

391+
/// <summary>Gets the desired vertical space between pattern cells</summary>
392+
/// <returns>the desired vertical space between pattern cells</returns>
330393
public virtual float GetYStep() {
331394
return GetPdfObject().GetAsNumber(PdfName.YStep).FloatValue();
332395
}
333396

397+
/// <summary>Sets the desired vertical space between pattern cells</summary>
334398
public virtual void SetYStep(float yStep) {
335399
GetPdfObject().Put(PdfName.YStep, new PdfNumber(yStep));
336400
SetModified();
337401
}
338402

403+
/// <summary>Gets the Tiling Pattern's resources</summary>
404+
/// <returns>the Tiling Pattern's resources</returns>
339405
public virtual PdfResources GetResources() {
340406
if (this.resources == null) {
341407
PdfDictionary resourcesDict = GetPdfObject().GetAsDictionary(PdfName.Resources);
@@ -355,27 +421,84 @@ public override void Flush() {
355421
}
356422
}
357423

424+
/// <summary>
425+
/// Shading pattern provides a smooth transition between colors across an area to be painted,
426+
/// independent of the resolution of any particular output device and without specifying
427+
/// the number of steps in the color transition.
428+
/// </summary>
429+
/// <remarks>
430+
/// Shading pattern provides a smooth transition between colors across an area to be painted,
431+
/// independent of the resolution of any particular output device and without specifying
432+
/// the number of steps in the color transition. Patterns of this type are described
433+
/// by pattern dictionaries with a pattern type of 2.
434+
/// </remarks>
358435
public class Shading : PdfPattern {
436+
/// <summary>
437+
/// Creates new instance from the
438+
/// <see cref="iText.Kernel.Pdf.PdfStream"/>
439+
/// object.
440+
/// </summary>
441+
/// <remarks>
442+
/// Creates new instance from the
443+
/// <see cref="iText.Kernel.Pdf.PdfStream"/>
444+
/// object.
445+
/// This stream should have PatternType equals to 2.
446+
/// </remarks>
447+
/// <param name="pdfObject">
448+
/// the
449+
/// <see cref="iText.Kernel.Pdf.PdfStream"/>
450+
/// that represents Shading Pattern.
451+
/// </param>
359452
public Shading(PdfDictionary pdfObject)
360453
: base(pdfObject) {
361454
}
362455

456+
/// <summary>Creates a new instance of Shading Pattern.</summary>
457+
/// <param name="shading">
458+
/// the
459+
/// <see cref="PdfShading"/>
460+
/// that specifies the details of a particular
461+
/// gradient fill
462+
/// </param>
363463
public Shading(PdfShading shading)
364464
: base(new PdfDictionary()) {
365465
GetPdfObject().Put(PdfName.Type, PdfName.Pattern);
366466
GetPdfObject().Put(PdfName.PatternType, new PdfNumber(2));
367467
GetPdfObject().Put(PdfName.Shading, shading.GetPdfObject());
368468
}
369469

470+
/// <summary>
471+
/// Gets the dictionary of the pattern's
472+
/// <see cref="PdfShading"/>
473+
/// </summary>
474+
/// <returns>
475+
/// the dictionary of the pattern's
476+
/// <see cref="PdfShading"/>
477+
/// </returns>
370478
public virtual PdfDictionary GetShading() {
371479
return (PdfDictionary)GetPdfObject().Get(PdfName.Shading);
372480
}
373481

482+
/// <summary>
483+
/// Sets the
484+
/// <see cref="PdfShading"/>
485+
/// that specifies the details of a particular gradient fill
486+
/// </summary>
487+
/// <param name="shading">
488+
/// the
489+
/// <see cref="PdfShading"/>
490+
/// that specifies the details of a particular gradient fill
491+
/// </param>
374492
public virtual void SetShading(PdfShading shading) {
375493
GetPdfObject().Put(PdfName.Shading, shading.GetPdfObject());
376494
SetModified();
377495
}
378496

497+
/// <summary>Sets the dictionary which specifies the details of a particular gradient fill</summary>
498+
/// <param name="shading">
499+
/// the dictionary of the pattern's
500+
/// <see cref="PdfShading"/>
501+
/// </param>
379502
public virtual void SetShading(PdfDictionary shading) {
380503
GetPdfObject().Put(PdfName.Shading, shading);
381504
SetModified();

0 commit comments

Comments
 (0)