You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2018/02/08 18:45:51 UTC

svn commit: r1823590 - in /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation: PDAnnotationLine.java handlers/PDLineAppearanceHandler.java

Author: tilman
Date: Thu Feb  8 18:45:51 2018
New Revision: 1823590

URL: http://svn.apache.org/viewvc?rev=1823590&view=rev
Log:
PDFBOX-3353: rename method according to style; improve javadoc

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationLine.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDLineAppearanceHandler.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationLine.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationLine.java?rev=1823590&r1=1823589&r2=1823590&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationLine.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationLine.java Thu Feb  8 18:45:51 2018
@@ -267,11 +267,12 @@ public class PDAnnotationLine extends PD
     }
 
     /**
-     * This will retrieve if the contents are shown as a caption or not.
+     * This will retrieve whether the text specified by the /Contents or /RC entries shall be
+     * shown as a caption in the appearance of the line.
      *
-     * @return boolean if the content is shown as a caption.
+     * @return boolean if the contents shall be shown as a caption (default: false).
      */
-    public boolean getCaption()
+    public boolean hasCaption()
     {
         return getCOSObject().getBoolean(COSName.CAP, false);
     }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDLineAppearanceHandler.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDLineAppearanceHandler.java?rev=1823590&r1=1823589&r2=1823590&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDLineAppearanceHandler.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDLineAppearanceHandler.java Thu Feb  8 18:45:51 2018
@@ -169,8 +169,7 @@ public class PDLineAppearanceHandler ext
                 double angle = Math.atan2(y2 - y1, x2 - x1);
                 cs.transform(Matrix.getRotateInstance(angle, x1, y1));
                 float lineLength = (float) Math.sqrt(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1)));
-                //TODO rename getCaption() to isCaption() or hasCaption()
-                if (annotation.getCaption() && !contents.isEmpty())
+                if (annotation.hasCaption() && !contents.isEmpty())
                 {
                     PDType1Font font = PDType1Font.HELVETICA;
                     // TODO: support newlines!!!!!