Skip to content

Commit 8d6aad1

Browse files
Rename PdfLinkAnnotation get/setLeaderLine to get/setLeaderLineLength, deprecate methods with old names
1 parent e84b47a commit 8d6aad1

File tree

3 files changed

+28
-3
lines changed

3 files changed

+28
-3
lines changed

kernel/src/main/java/com/itextpdf/kernel/pdf/annot/PdfLineAnnotation.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,9 @@ public PdfLineAnnotation setLineEndingStyles(PdfArray lineEndingStyles) {
143143
* when traversing the line from its starting point to its ending point (as specified by {@link PdfName#L} (see {@link #getLine()});
144144
* a negative value indicates the opposite direction.
145145
* @return a float specifying the length of leader lines in default user space.
146+
* @deprecated use {@link #getLeaderLineLength()} instead.
146147
*/
148+
@Deprecated
147149
public float getLeaderLine() {
148150
PdfNumber n = getPdfObject().getAsNumber(PdfName.LL);
149151
return n == null ? 0 : n.floatValue();
@@ -156,11 +158,37 @@ public float getLeaderLine() {
156158
* a negative value indicates the opposite direction.
157159
* @param leaderLine a float specifying the length of leader lines in default user space.
158160
* @return this {@link PdfLineAnnotation} instance.
161+
* @deprecated use {@link #setLeaderLineLength(float)} instead.
159162
*/
163+
@Deprecated
160164
public PdfLineAnnotation setLeaderLine(float leaderLine) {
161165
return (PdfLineAnnotation) put(PdfName.LL, new PdfNumber(leaderLine));
162166
}
163167

168+
/**
169+
* The length of leader lines in default user space that extend from each endpoint of the line perpendicular
170+
* to the line itself. A positive value means that the leader lines appear in the direction that is clockwise
171+
* when traversing the line from its starting point to its ending point (as specified by {@link PdfName#L} (see {@link #getLine()});
172+
* a negative value indicates the opposite direction.
173+
* @return a float specifying the length of leader lines in default user space.
174+
*/
175+
public float getLeaderLineLength() {
176+
PdfNumber n = getPdfObject().getAsNumber(PdfName.LL);
177+
return n == null ? 0 : n.floatValue();
178+
}
179+
180+
/**
181+
* Sets the length of leader lines in default user space that extend from each endpoint of the line perpendicular
182+
* to the line itself. A positive value means that the leader lines appear in the direction that is clockwise
183+
* when traversing the line from its starting point to its ending point (as specified by {@link PdfName#L} (see {@link #getLine()});
184+
* a negative value indicates the opposite direction.
185+
* @param leaderLineLength a float specifying the length of leader lines in default user space.
186+
* @return this {@link PdfLineAnnotation} instance.
187+
*/
188+
public PdfLineAnnotation setLeaderLineLength(float leaderLineLength) {
189+
return (PdfLineAnnotation) put(PdfName.LL, new PdfNumber(leaderLineLength));
190+
}
191+
164192
/**
165193
* A non-negative number that represents the length of leader line extensions that extend from the line proper
166194
* 180 degrees from the leader lines.

pdftest/src/main/java/com/itextpdf/test/RunnerSearchConfig.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/*
2-
$Id$
32
43
This file is part of the iText (R) project.
54
Copyright (c) 1998-2016 iText Group NV

pdftest/src/main/java/com/itextpdf/test/WrappedSamplesRunner.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
/*
2-
$Id$
3-
42
This file is part of the iText (R) project.
53
Copyright (c) 1998-2016 iText Group NV
64
Authors: Bruno Lowagie, Paulo Soares, et al.

0 commit comments

Comments
 (0)