Skip to content

Commit cec7145

Browse files
AnhelinaMiText-CI
authored andcommitted
Cover several layout classes with documentation
DEVSIX-6675 Autoported commit. Original commit hash: [2237853e4]
1 parent 64c3630 commit cec7145

File tree

14 files changed

+180
-3
lines changed

14 files changed

+180
-3
lines changed

itext/itext.layout/itext/layout/element/AbstractElement.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,11 @@ public virtual T SetPageNumber(int pageNumber) {
181181
return (T)(Object)this;
182182
}
183183

184+
/// <summary>Creates new renderer instance.</summary>
185+
/// <returns>
186+
/// new
187+
/// <see cref="iText.Layout.Renderer.IRenderer"/>
188+
/// </returns>
184189
protected internal abstract IRenderer MakeNewRenderer();
185190
}
186191
}

itext/itext.layout/itext/layout/element/Cell.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,15 @@ protected internal override IRenderer MakeNewRenderer() {
243243
return new CellRenderer(this);
244244
}
245245

246+
/// <summary>Updates cell indexes.</summary>
247+
/// <param name="row">the number of the row to update</param>
248+
/// <param name="col">the number of the col to update</param>
249+
/// <param name="numberOfColumns">to evaluate new colspan</param>
250+
/// <returns>
251+
/// this
252+
/// <see cref="Cell"/>
253+
/// with updated fields
254+
/// </returns>
246255
protected internal virtual iText.Layout.Element.Cell UpdateCellIndexes(int row, int col, int numberOfColumns
247256
) {
248257
this.row = row;

itext/itext.layout/itext/layout/element/FlexContainer.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,17 @@ source product.
4343
using iText.Layout.Renderer;
4444

4545
namespace iText.Layout.Element {
46+
/// <summary>
47+
/// A
48+
/// <see cref="FlexContainer"/>
49+
/// represents a container of the flex objects.
50+
/// </summary>
4651
internal class FlexContainer : Div {
52+
/// <summary>
53+
/// Creates new
54+
/// <see cref="FlexContainer"/>
55+
/// instance.
56+
/// </summary>
4757
public FlexContainer()
4858
: base() {
4959
}

itext/itext.layout/itext/layout/element/IBlockElement.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ source product.
4141
4242
*/
4343
namespace iText.Layout.Element {
44+
/// <summary>This class represents a block layout element with special margins, tabbing, and alignment.</summary>
45+
/// <remarks>
46+
/// This class represents a block layout element with special margins, tabbing, and alignment.
47+
/// An
48+
/// <see cref="IBlockElement"/>
49+
/// will try to take up as much horizontal space as available to it
50+
/// on the canvas or page. The concept is comparable to the block element in HTML.
51+
/// </remarks>
4452
public interface IBlockElement : IAbstractElement {
4553
}
4654
}

itext/itext.layout/itext/layout/element/TabStop.cs

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,30 +128,80 @@ public TabStop(float tabPosition, TabAlignment tabAlignment, ILineDrawer tabLead
128128
this.tabAnchor = '.';
129129
}
130130

131+
/// <summary>Returns the position of a tab stop.</summary>
132+
/// <returns>tabPosition, measured in absolute points</returns>
131133
public virtual float GetTabPosition() {
132134
return tabPosition;
133135
}
134136

137+
/// <summary>
138+
/// Returns the alignment of a tab stop, which defines the way the textual content
139+
/// should be positioned in regard to this tab stop.
140+
/// </summary>
141+
/// <returns>
142+
/// a
143+
/// <see cref="iText.Layout.Properties.TabAlignment"/>
144+
/// value
145+
/// </returns>
135146
public virtual TabAlignment GetTabAlignment() {
136147
return tabAlignment;
137148
}
138149

150+
/// <summary>
151+
/// Sets the alignment, which defines the way the textual content
152+
/// should be positioned in regard to this tab stop.
153+
/// </summary>
154+
/// <param name="tabAlignment">
155+
/// a
156+
/// <see cref="iText.Layout.Properties.TabAlignment"/>
157+
/// value
158+
/// </param>
139159
public virtual void SetTabAlignment(TabAlignment tabAlignment) {
140160
this.tabAlignment = tabAlignment;
141161
}
142162

163+
/// <summary>Returns the anchor of a tab stop.</summary>
164+
/// <returns>
165+
/// a
166+
/// <see cref="char?"/>
167+
/// value
168+
/// </returns>
143169
public virtual char? GetTabAnchor() {
144170
return tabAnchor;
145171
}
146172

173+
/// <summary>Sets the anchor of a tab stop.</summary>
174+
/// <param name="tabAnchor">
175+
/// a
176+
/// <see cref="char?"/>
177+
/// value
178+
/// </param>
147179
public virtual void SetTabAnchor(char? tabAnchor) {
148180
this.tabAnchor = tabAnchor;
149181
}
150182

183+
/// <summary>
184+
/// Returns the tab leader of a tab stop, which defines a pattern that
185+
/// should be repeated until the TabStop is reached.
186+
/// </summary>
187+
/// <returns>
188+
/// a
189+
/// <see cref="iText.Kernel.Pdf.Canvas.Draw.ILineDrawer"/>
190+
/// value, a pattern drawing object
191+
/// </returns>
151192
public virtual ILineDrawer GetTabLeader() {
152193
return tabLeader;
153194
}
154195

196+
/// <summary>
197+
/// Sets the tab leader of a tab stop, which defines a pattern that
198+
/// should be repeated until the TabStop is reached.
199+
/// </summary>
200+
/// <param name="tabLeader">
201+
/// a
202+
/// <see cref="iText.Kernel.Pdf.Canvas.Draw.ILineDrawer"/>
203+
/// value
204+
/// </param>
155205
public virtual void SetTabLeader(ILineDrawer tabLeader) {
156206
this.tabLeader = tabLeader;
157207
}

itext/itext.layout/itext/layout/element/Table.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,6 +1103,12 @@ private static UnitValue[] NormalizeColumnWidths(int numberOfColumns) {
11031103
return normalized;
11041104
}
11051105

1106+
/// <summary>Returns the list of all row groups.</summary>
1107+
/// <returns>
1108+
/// a list of a
1109+
/// <see cref="RowRange"/>
1110+
/// which holds the row numbers of a section of a table
1111+
/// </returns>
11061112
protected internal virtual IList<Table.RowRange> GetRowGroups() {
11071113
int lastRowWeCanFlush = currentColumn == columnWidths.Length ? currentRow : currentRow - 1;
11081114
int[] cellBottomRows = new int[columnWidths.Length];

itext/itext.layout/itext/layout/hyphenation/HyphenationConstants.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ source product.
4343
using System;
4444

4545
namespace iText.Layout.Hyphenation {
46+
/// <summary>Class containing constants to be used in hyphenation on layout level.</summary>
4647
public class HyphenationConstants {
4748
public const String HYPHENATION_DEFAULT_RESOURCE = "iText.Hyph.";
4849
}

itext/itext.layout/itext/layout/hyphenation/TernaryTreeIterator.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ public Item(TernaryTreeIterator _enclosing, char p, char c) {
8282
this.child = c;
8383
}
8484

85+
/// <summary>Construct item.</summary>
86+
/// <param name="i">
87+
/// an
88+
/// <see cref="Item"/>
89+
/// </param>
8590
public Item(TernaryTreeIterator _enclosing, TernaryTreeIterator.Item i) {
8691
this._enclosing = _enclosing;
8792
this.parent = i.parent;

itext/itext.layout/itext/layout/renderer/AreaBreakRenderer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ source product.
4949

5050
namespace iText.Layout.Renderer {
5151
/// <summary>
52-
/// Renderer object for the
52+
/// Renderer for the
5353
/// <see cref="iText.Layout.Element.AreaBreak"/>
5454
/// layout element.
5555
/// </summary>
5656
/// <remarks>
57-
/// Renderer object for the
57+
/// Renderer for the
5858
/// <see cref="iText.Layout.Element.AreaBreak"/>
5959
/// layout element. Will terminate the
6060
/// current content area and initialize a new one.

itext/itext.layout/itext/layout/renderer/BlockRenderer.cs

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,14 @@ source product.
6060
using iText.Layout.Tagging;
6161

6262
namespace iText.Layout.Renderer {
63+
/// <summary>Represents a renderer for block elements.</summary>
6364
public abstract class BlockRenderer : AbstractRenderer {
65+
/// <summary>Creates a BlockRenderer from its corresponding layout object.</summary>
66+
/// <param name="modelElement">
67+
/// the
68+
/// <see cref="iText.Layout.Element.IElement"/>
69+
/// which this object should manage
70+
/// </param>
6471
protected internal BlockRenderer(IElement modelElement)
6572
: base(modelElement) {
6673
}
@@ -514,6 +521,13 @@ public override Rectangle GetOccupiedAreaBBox() {
514521
return bBox;
515522
}
516523

524+
/// <summary>Creates a split renderer.</summary>
525+
/// <param name="layoutResult">the result of content layouting</param>
526+
/// <returns>
527+
/// a new
528+
/// <see cref="AbstractRenderer"/>
529+
/// instance
530+
/// </returns>
517531
protected internal virtual AbstractRenderer CreateSplitRenderer(int layoutResult) {
518532
AbstractRenderer splitRenderer = (AbstractRenderer)GetNextRenderer();
519533
splitRenderer.parent = parent;
@@ -524,6 +538,13 @@ protected internal virtual AbstractRenderer CreateSplitRenderer(int layoutResult
524538
return splitRenderer;
525539
}
526540

541+
/// <summary>Creates an overflow renderer.</summary>
542+
/// <param name="layoutResult">the result of content layouting</param>
543+
/// <returns>
544+
/// a new
545+
/// <see cref="AbstractRenderer"/>
546+
/// instance
547+
/// </returns>
527548
protected internal virtual AbstractRenderer CreateOverflowRenderer(int layoutResult) {
528549
AbstractRenderer overflowRenderer = (AbstractRenderer)GetNextRenderer();
529550
overflowRenderer.parent = parent;
@@ -571,6 +592,10 @@ internal virtual AbstractRenderer[] CreateSplitAndOverflowRenderers(int childPos
571592
return new AbstractRenderer[] { splitRenderer, overflowRenderer };
572593
}
573594

595+
/// <summary>
596+
/// This method applies vertical alignment for the occupied area
597+
/// of the renderer and its children renderers.
598+
/// </summary>
574599
protected internal virtual void ApplyVerticalAlignment() {
575600
VerticalAlignment? verticalAlignment = this.GetProperty<VerticalAlignment?>(Property.VERTICAL_ALIGNMENT);
576601
if (verticalAlignment == null || verticalAlignment == VerticalAlignment.TOP || childRenderers.IsEmpty()) {
@@ -619,6 +644,14 @@ protected internal virtual void ApplyVerticalAlignment() {
619644
}
620645
}
621646

647+
/// <summary>
648+
/// This method rotates content of the renderer and
649+
/// calculates correct occupied area for the rotated element.
650+
/// </summary>
651+
/// <param name="layoutBox">
652+
/// a
653+
/// <see cref="iText.Kernel.Geom.Rectangle"/>
654+
/// </param>
622655
protected internal virtual void ApplyRotationLayout(Rectangle layoutBox) {
623656
float angle = (float)this.GetPropertyAsFloat(Property.ROTATION_ANGLE);
624657
float x = occupiedArea.GetBBox().GetX();
@@ -702,6 +735,12 @@ protected internal virtual AffineTransform CreateRotationTransformInsideOccupied
702735
return rotationTransform;
703736
}
704737

738+
/// <summary>This method starts rotation for the renderer if rotation angle property is specified.</summary>
739+
/// <param name="canvas">
740+
/// the
741+
/// <see cref="iText.Kernel.Pdf.Canvas.PdfCanvas"/>
742+
/// to draw on
743+
/// </param>
705744
protected internal virtual void BeginRotationIfApplied(PdfCanvas canvas) {
706745
float? angle = this.GetPropertyAsFloat(Property.ROTATION_ANGLE);
707746
if (angle != null) {
@@ -717,6 +756,12 @@ protected internal virtual void BeginRotationIfApplied(PdfCanvas canvas) {
717756
}
718757
}
719758

759+
/// <summary>This method ends rotation for the renderer if applied.</summary>
760+
/// <param name="canvas">
761+
/// the
762+
/// <see cref="iText.Kernel.Pdf.Canvas.PdfCanvas"/>
763+
/// to draw on
764+
/// </param>
720765
protected internal virtual void EndRotationIfApplied(PdfCanvas canvas) {
721766
float? angle = this.GetPropertyAsFloat(Property.ROTATION_ANGLE);
722767
if (angle != null && HasOwnProperty(Property.ROTATION_INITIAL_HEIGHT)) {

0 commit comments

Comments
 (0)