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 2015/05/07 08:51:09 UTC

svn commit: r1678140 - in /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation: PDAnnotationMarkup.java PDAppearanceCharacteristicsDictionary.java

Author: tilman
Date: Thu May  7 06:51:09 2015
New Revision: 1678140

URL: http://svn.apache.org/r1678140
Log:
PDFBOX-2783: Use getCOSObject() instead of getDictionary()

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationMarkup.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAppearanceCharacteristicsDictionary.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationMarkup.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationMarkup.java?rev=1678140&r1=1678139&r2=1678140&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationMarkup.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationMarkup.java Thu May  7 06:51:09 2015
@@ -101,7 +101,7 @@ public class PDAnnotationMarkup extends
      */
     public String getTitlePopup()
     {
-        return getDictionary().getString( "T" );
+        return getCOSObject().getString( "T" );
     }
 
     /**
@@ -113,7 +113,7 @@ public class PDAnnotationMarkup extends
      */
     public void setTitlePopup( String t )
     {
-        getDictionary().setString( "T", t );
+        getCOSObject().setString( "T", t );
     }
 
     /**
@@ -124,7 +124,7 @@ public class PDAnnotationMarkup extends
      */
     public PDAnnotationPopup getPopup()
     {
-        COSDictionary popup = (COSDictionary) getDictionary().getDictionaryObject( "Popup" );
+        COSDictionary popup = (COSDictionary) getCOSObject().getDictionaryObject( "Popup" );
         if (popup != null)
         {
             return new PDAnnotationPopup( popup );
@@ -144,7 +144,7 @@ public class PDAnnotationMarkup extends
      */
     public void setPopup( PDAnnotationPopup popup )
     {
-        getDictionary().setItem( "Popup", popup );
+        getCOSObject().setItem( "Popup", popup );
     }
 
     /**
@@ -155,7 +155,7 @@ public class PDAnnotationMarkup extends
      */
     public float getConstantOpacity()
     {
-        return getDictionary().getFloat( "CA", 1 );
+        return getCOSObject().getFloat( "CA", 1 );
     }
 
     /**
@@ -167,7 +167,7 @@ public class PDAnnotationMarkup extends
      */
     public void setConstantOpacity( float ca )
     {
-        getDictionary().setFloat( "CA", ca );
+        getCOSObject().setFloat( "CA", ca );
     }
 
     /**
@@ -178,7 +178,7 @@ public class PDAnnotationMarkup extends
      */
     public PDTextStream getRichContents()
     {
-        COSBase rc = getDictionary().getDictionaryObject( "RC" );
+        COSBase rc = getCOSObject().getDictionaryObject( "RC" );
         if (rc != null)
         {
             return PDTextStream.createTextStream( rc );
@@ -197,7 +197,7 @@ public class PDAnnotationMarkup extends
      */
     public void setRichContents( PDTextStream rc )
     {
-        getDictionary().setItem( "RC", rc);
+        getCOSObject().setItem( "RC", rc);
     }
 
     /**
@@ -209,7 +209,7 @@ public class PDAnnotationMarkup extends
      */
     public Calendar getCreationDate() throws IOException
     {
-        return getDictionary().getDate( "CreationDate" );
+        return getCOSObject().getDate( "CreationDate" );
     }
 
     /**
@@ -220,7 +220,7 @@ public class PDAnnotationMarkup extends
      */
     public void setCreationDate( Calendar creationDate )
     {
-        getDictionary().setDate( "CreationDate", creationDate );
+        getCOSObject().setDate( "CreationDate", creationDate );
     }
 
     /**
@@ -233,7 +233,7 @@ public class PDAnnotationMarkup extends
      */
     public PDAnnotation getInReplyTo() throws IOException
     {
-        COSBase irt = getDictionary().getDictionaryObject( "IRT" );
+        COSBase irt = getCOSObject().getDictionaryObject( "IRT" );
         return PDAnnotation.createAnnotation( irt );
     }
 
@@ -245,7 +245,7 @@ public class PDAnnotationMarkup extends
      */
     public void setInReplyTo( PDAnnotation irt )
     {
-        getDictionary().setItem( "IRT", irt );
+        getCOSObject().setItem( "IRT", irt );
     }
 
     /**
@@ -255,7 +255,7 @@ public class PDAnnotationMarkup extends
      */
     public String getSubject()
     {
-        return getDictionary().getString( "Subj" );
+        return getCOSObject().getString( "Subj" );
     }
 
     /**
@@ -265,7 +265,7 @@ public class PDAnnotationMarkup extends
      */
     public void setSubject( String subj )
     {
-        getDictionary().setString( "Subj", subj );
+        getCOSObject().setString( "Subj", subj );
     }
 
     /**
@@ -276,7 +276,7 @@ public class PDAnnotationMarkup extends
      */
     public String getReplyType()
     {
-        return getDictionary().getNameAsString( "RT", RT_REPLY );
+        return getCOSObject().getNameAsString( "RT", RT_REPLY );
     }
 
     /**
@@ -287,7 +287,7 @@ public class PDAnnotationMarkup extends
      */
     public void setReplyType( String rt )
     {
-        getDictionary().setName( "RT", rt );
+        getCOSObject().setName( "RT", rt );
     }
 
     /**
@@ -299,7 +299,7 @@ public class PDAnnotationMarkup extends
      */
     public String getIntent()
     {
-        return getDictionary().getNameAsString( "IT" );
+        return getCOSObject().getNameAsString( "IT" );
     }
 
     /**
@@ -311,7 +311,7 @@ public class PDAnnotationMarkup extends
      */
     public void setIntent( String it )
     {
-        getDictionary().setName( "IT", it );
+        getCOSObject().setName( "IT", it );
     }
 
     /**
@@ -321,7 +321,7 @@ public class PDAnnotationMarkup extends
      */
     public PDExternalDataDictionary getExternalData()
     {
-        COSBase exData = this.getDictionary().getDictionaryObject("ExData");
+        COSBase exData = this.getCOSObject().getDictionaryObject("ExData");
         if (exData instanceof COSDictionary)
         {
             return new PDExternalDataDictionary((COSDictionary) exData);
@@ -336,7 +336,7 @@ public class PDAnnotationMarkup extends
      */
     public void setExternalData(PDExternalDataDictionary externalData)
     {
-        this.getDictionary().setItem("ExData", externalData);
+        this.getCOSObject().setItem("ExData", externalData);
     }
 
 }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAppearanceCharacteristicsDictionary.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAppearanceCharacteristicsDictionary.java?rev=1678140&r1=1678139&r2=1678140&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAppearanceCharacteristicsDictionary.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAppearanceCharacteristicsDictionary.java Thu May  7 06:51:09 2015
@@ -49,11 +49,6 @@ public class PDAppearanceCharacteristics
         this.dictionary = dict;
     }
 
-    public COSDictionary getDictionary()
-    {
-        return this.dictionary;
-    }
-
     /**
      * returns the dictionary.
      * @return the dictionary
@@ -71,7 +66,7 @@ public class PDAppearanceCharacteristics
      */
     public int getRotation()
     {
-        return this.getDictionary().getInt(COSName.R, 0);
+        return this.getCOSObject().getInt(COSName.R, 0);
     }
 
     /**
@@ -81,7 +76,7 @@ public class PDAppearanceCharacteristics
      */
     public void setRotation(int rotation)
     {
-        this.getDictionary().setInt(COSName.R, rotation);
+        this.getCOSObject().setInt(COSName.R, rotation);
     }
 
     /**
@@ -101,7 +96,7 @@ public class PDAppearanceCharacteristics
      */
     public void setBorderColour(PDColor c)
     {
-        this.getDictionary().setItem(COSName.BC, c.toCOSArray());
+        this.getCOSObject().setItem(COSName.BC, c.toCOSArray());
     }
 
     /**
@@ -121,7 +116,7 @@ public class PDAppearanceCharacteristics
      */
     public void setBackground(PDColor c)
     {
-        this.getDictionary().setItem(COSName.BG, c.toCOSArray());
+        this.getCOSObject().setItem(COSName.BG, c.toCOSArray());
     }
 
     /**
@@ -131,7 +126,7 @@ public class PDAppearanceCharacteristics
      */
     public String getNormalCaption()
     {
-        return this.getDictionary().getString("CA");
+        return this.getCOSObject().getString("CA");
     }
 
     /**
@@ -141,7 +136,7 @@ public class PDAppearanceCharacteristics
      */
     public void setNormalCaption(String caption)
     {
-        this.getDictionary().setString("CA", caption);
+        this.getCOSObject().setString("CA", caption);
     }
 
     /**
@@ -151,7 +146,7 @@ public class PDAppearanceCharacteristics
      */
     public String getRolloverCaption()
     {
-        return this.getDictionary().getString("RC");
+        return this.getCOSObject().getString("RC");
     }
 
     /**
@@ -161,7 +156,7 @@ public class PDAppearanceCharacteristics
      */
     public void setRolloverCaption(String caption)
     {
-        this.getDictionary().setString("RC", caption);
+        this.getCOSObject().setString("RC", caption);
     }
 
     /**
@@ -171,7 +166,7 @@ public class PDAppearanceCharacteristics
      */
     public String getAlternateCaption()
     {
-        return this.getDictionary().getString("AC");
+        return this.getCOSObject().getString("AC");
     }
 
     /**
@@ -181,7 +176,7 @@ public class PDAppearanceCharacteristics
      */
     public void setAlternateCaption(String caption)
     {
-        this.getDictionary().setString("AC", caption);
+        this.getCOSObject().setString("AC", caption);
     }
 
     /**
@@ -191,7 +186,7 @@ public class PDAppearanceCharacteristics
      */
     public PDFormXObject getNormalIcon()
     {
-        COSBase i = this.getDictionary().getDictionaryObject("I");
+        COSBase i = this.getCOSObject().getDictionaryObject("I");
         if (i instanceof COSStream)
         {
             return new PDFormXObject(new PDStream((COSStream) i), "I");
@@ -206,7 +201,7 @@ public class PDAppearanceCharacteristics
      */
     public PDFormXObject getRolloverIcon()
     {
-        COSBase i = this.getDictionary().getDictionaryObject("RI");
+        COSBase i = this.getCOSObject().getDictionaryObject("RI");
         if (i instanceof COSStream)
         {
             return new PDFormXObject(new PDStream((COSStream) i), "RI");
@@ -221,7 +216,7 @@ public class PDAppearanceCharacteristics
      */
     public PDFormXObject getAlternateIcon()
     {
-        COSBase i = this.getDictionary().getDictionaryObject("IX");
+        COSBase i = this.getCOSObject().getDictionaryObject("IX");
         if (i instanceof COSStream)
         {
             return new PDFormXObject(new PDStream((COSStream) i), "IX");
@@ -231,7 +226,7 @@ public class PDAppearanceCharacteristics
 
     private PDColor getColor(COSName itemName)
     {
-        COSBase c = this.getDictionary().getItem(itemName);
+        COSBase c = this.getCOSObject().getItem(itemName);
         if (c instanceof COSArray)
         {
             PDColorSpace colorSpace = null;