Skip to content

Commit 22b28c2

Browse files
committed
Add missing documentation to several layout classes
DEVSIX-6640
1 parent f3771f1 commit 22b28c2

File tree

8 files changed

+83
-10
lines changed

8 files changed

+83
-10
lines changed

layout/src/main/java/com/itextpdf/layout/borders/Border.java

+9
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,15 @@ public enum Side {
445445
NONE, TOP, RIGHT, BOTTOM, LEFT
446446
}
447447

448+
/**
449+
* Gets a {@link Point} in which two lines intersect.
450+
*
451+
* @param lineBeg a {@link Point} which defines some point on the first line
452+
* @param lineEnd a {@link Point} which defines another point on the first line
453+
* @param clipLineBeg a {@link Point} which defines some point on the second line
454+
* @param clipLineEnd a {@link Point} which defines another point on the second line
455+
* @return the intersection {@link Point}
456+
*/
448457
protected Point getIntersectionPoint(Point lineBeg, Point lineEnd, Point clipLineBeg, Point clipLineEnd) {
449458
double A1 = lineBeg.getY() - lineEnd.getY(), A2 = clipLineBeg.getY() - clipLineEnd.getY();
450459
double B1 = lineEnd.getX() - lineBeg.getX(), B2 = clipLineEnd.getX() - clipLineBeg.getX();

layout/src/main/java/com/itextpdf/layout/borders/GrooveBorder.java

+3
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ This file is part of the iText (R) project.
4848
import com.itextpdf.kernel.colors.DeviceGray;
4949
import com.itextpdf.kernel.colors.DeviceRgb;
5050

51+
/**
52+
* Represents a {@link Border3D} with a groove effect being applied.
53+
*/
5154
public class GrooveBorder extends Border3D {
5255

5356
/**

layout/src/main/java/com/itextpdf/layout/borders/InsetBorder.java

+3
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ This file is part of the iText (R) project.
4848
import com.itextpdf.kernel.colors.DeviceGray;
4949
import com.itextpdf.kernel.colors.DeviceRgb;
5050

51+
/**
52+
* Represents a {@link Border3D} with an inset effect being applied.
53+
*/
5154
public class InsetBorder extends Border3D {
5255

5356
/**

layout/src/main/java/com/itextpdf/layout/borders/OutsetBorder.java

+3
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ This file is part of the iText (R) project.
4848
import com.itextpdf.kernel.colors.DeviceGray;
4949
import com.itextpdf.kernel.colors.DeviceRgb;
5050

51+
/**
52+
* Represents a {@link Border3D} with an outset effect being applied.
53+
*/
5154
public class OutsetBorder extends Border3D {
5255

5356
/**

layout/src/main/java/com/itextpdf/layout/borders/RidgeBorder.java

+3
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ This file is part of the iText (R) project.
4848
import com.itextpdf.kernel.colors.DeviceGray;
4949
import com.itextpdf.kernel.colors.DeviceRgb;
5050

51+
/**
52+
* Represents a {@link Border3D} with a ridge effect being applied.
53+
*/
5154
public class RidgeBorder extends Border3D {
5255

5356
/**

layout/src/main/java/com/itextpdf/layout/element/Div.java

+14
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,25 @@ public AccessibilityProperties getAccessibilityProperties() {
102102
return tagProperties;
103103
}
104104

105+
/**
106+
* Defines whether the {@link Div} should occupy all the space left in the available area
107+
* in case it is the last element in this area.
108+
*
109+
* @param fillArea defines whether the available area should be filled
110+
* @return this {@link Div}
111+
*/
105112
public Div setFillAvailableArea(boolean fillArea) {
106113
setProperty(Property.FILL_AVAILABLE_AREA, fillArea);
107114
return this;
108115
}
109116

117+
/**
118+
* Defines whether the {@link Div} should occupy all the space left in the available area
119+
* in case the area has been split and it is the last element in the split part of this area.
120+
*
121+
* @param fillAreaOnSplit defines whether the available area should be filled
122+
* @return this {@link Div}
123+
*/
110124
public Div setFillAvailableAreaOnSplit(boolean fillAreaOnSplit) {
111125
setProperty(Property.FILL_AVAILABLE_AREA_ON_SPLIT, fillAreaOnSplit);
112126
return this;

layout/src/main/java/com/itextpdf/layout/element/Paragraph.java

+16-10
Original file line numberDiff line numberDiff line change
@@ -92,37 +92,43 @@ public Paragraph(Text text) {
9292
}
9393

9494
/**
95-
* Adds a piece of text to the Paragraph
95+
* Adds a piece of text to this {@link Paragraph}.
9696
*
9797
* @param text the content to be added, as a {@link String}
98-
* @return this Paragraph
98+
* @return this {@link Paragraph}
9999
*/
100100
public Paragraph add(String text) {
101101
return add(new Text(text));
102102
}
103103

104104
/**
105-
* Adds a layout element to the Paragraph.
105+
* Adds a {@link ILeafElement element} to this {@link Paragraph}.
106106
*
107107
* @param element the content to be added, any {@link ILeafElement}
108-
* @return this Paragraph
108+
* @return this {@link Paragraph}
109109
*/
110110
public Paragraph add(ILeafElement element) {
111111
childElements.add(element);
112112
return this;
113113
}
114114

115+
/**
116+
* Adds an {@link IBlockElement element} to this {@link Paragraph}.
117+
*
118+
* @param element the content to be added, any {@link IBlockElement}
119+
* @return this {@link Paragraph}
120+
*/
115121
public Paragraph add(IBlockElement element) {
116122
childElements.add(element);
117123
return this;
118124
}
119125

120126
/**
121-
* Adds a {@link java.util.List} of layout elements to the Paragraph.
127+
* Adds a {@link java.util.List} of layout elements to this {@link Paragraph}.
122128
*
123129
* @param elements the content to be added
124130
* @param <T2> any {@link ILeafElement}
125-
* @return this Paragraph
131+
* @return this {@link Paragraph}
126132
*/
127133
public <T2 extends ILeafElement> Paragraph addAll(java.util.List<T2> elements) {
128134
for (ILeafElement element : elements) {
@@ -132,10 +138,10 @@ public <T2 extends ILeafElement> Paragraph addAll(java.util.List<T2> elements) {
132138
}
133139

134140
/**
135-
* Adds an unspecified amount of tabstop elements as properties to the Paragraph.
141+
* Adds an unspecified amount of tabstop elements as properties to this {@link Paragraph}.
136142
*
137143
* @param tabStops the {@link TabStop tabstop(s)} to be added as properties
138-
* @return this Paragraph
144+
* @return this {@link Paragraph}
139145
* @see TabStop
140146
*/
141147
public Paragraph addTabStops(TabStop... tabStops) {
@@ -144,10 +150,10 @@ public Paragraph addTabStops(TabStop... tabStops) {
144150
}
145151

146152
/**
147-
* Adds a {@link java.util.List} of tabstop elements as properties to the Paragraph.
153+
* Adds a {@link java.util.List} of tabstop elements as properties to this {@link Paragraph}.
148154
*
149155
* @param tabStops the list of {@link TabStop}s to be added as properties
150-
* @return this Paragraph
156+
* @return this {@link Paragraph}
151157
* @see TabStop
152158
*/
153159
public Paragraph addTabStops(java.util.List<TabStop> tabStops) {

layout/src/main/java/com/itextpdf/layout/element/Table.java

+32
Original file line numberDiff line numberDiff line change
@@ -828,16 +828,36 @@ public List<Border> getLastRowBottomBorder() {
828828
return horizontalBorder;
829829
}
830830

831+
/**
832+
* Defines whether the {@link Table} should be extended to occupy all the space left in the available area
833+
* in case it is the last element in this area.
834+
*
835+
* @param isExtended defines whether the {@link Table} should be extended
836+
* @return this {@link Table}
837+
*/
831838
public Table setExtendBottomRow(boolean isExtended) {
832839
setProperty(Property.FILL_AVAILABLE_AREA, isExtended);
833840
return this;
834841
}
835842

843+
/**
844+
* Defines whether the {@link Table} should be extended to occupy all the space left in the available area
845+
* in case the area has been split and it is the last element in the split part of this area.
846+
*
847+
* @param isExtended defines whether the {@link Table} should be extended
848+
* @return this {@link Table}
849+
*/
836850
public Table setExtendBottomRowOnSplit(boolean isExtended) {
837851
setProperty(Property.FILL_AVAILABLE_AREA_ON_SPLIT, isExtended);
838852
return this;
839853
}
840854

855+
/**
856+
* Sets the type of border collapse.
857+
*
858+
* @param collapsePropertyValue {@link BorderCollapsePropertyValue} to be set as the border collapse type
859+
* @return this {@link Table}
860+
*/
841861
public Table setBorderCollapse(BorderCollapsePropertyValue collapsePropertyValue) {
842862
setProperty(Property.BORDER_COLLAPSE, collapsePropertyValue);
843863
if (null != header) {
@@ -849,6 +869,12 @@ public Table setBorderCollapse(BorderCollapsePropertyValue collapsePropertyValue
849869
return this;
850870
}
851871

872+
/**
873+
* Sets the horizontal spacing between this {@link Table table}'s {@link Cell cells}.
874+
*
875+
* @param spacing a horizontal spacing between this {@link Table table}'s {@link Cell cells}
876+
* @return this {@link Table}
877+
*/
852878
public Table setHorizontalBorderSpacing(float spacing) {
853879
setProperty(Property.HORIZONTAL_BORDER_SPACING, spacing);
854880
if (null != header) {
@@ -860,6 +886,12 @@ public Table setHorizontalBorderSpacing(float spacing) {
860886
return this;
861887
}
862888

889+
/**
890+
* Sets the vertical spacing between this {@link Table table}'s {@link Cell cells}.
891+
*
892+
* @param spacing a vertical spacing between this {@link Table table}'s {@link Cell cells}
893+
* @return this {@link Table}
894+
*/
863895
public Table setVerticalBorderSpacing(float spacing) {
864896
setProperty(Property.VERTICAL_BORDER_SPACING, spacing);
865897
if (null != header) {

0 commit comments

Comments
 (0)