pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From msahy...@apache.org
Subject svn commit: r1683481 [2/2] - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/
Date Thu, 04 Jun 2015 08:15:48 GMT
Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAppearanceDictionary.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAppearanceDictionary.java?rev=1683481&r1=1683480&r2=1683481&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAppearanceDictionary.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAppearanceDictionary.java
Thu Jun  4 08:15:47 2015
@@ -37,8 +37,8 @@ public class PDAppearanceDictionary impl
     public PDAppearanceDictionary()
     {
         dictionary = new COSDictionary();
-        //the N entry is required.
-        dictionary.setItem( COSName.N, new COSDictionary() );
+        // the N entry is required.
+        dictionary.setItem(COSName.N, new COSDictionary());
     }
 
     /**
@@ -46,7 +46,7 @@ public class PDAppearanceDictionary impl
      *
      * @param dictionary The annotations dictionary.
      */
-    public PDAppearanceDictionary( COSDictionary dictionary )
+    public PDAppearanceDictionary(COSDictionary dictionary)
     {
         this.dictionary = dictionary;
     }
@@ -58,18 +58,17 @@ public class PDAppearanceDictionary impl
     }
 
     /**
-     * This will return a list of appearances.  In the case where there is
-     * only one appearance the map will contain one entry whose key is the string
-     * "default".
+     * This will return a list of appearances. In the case where there is only one appearance
the map will contain one
+     * entry whose key is the string "default".
      *
      * @return A list of key(java.lang.String) value(PDAppearanceStream) pairs
      */
     public PDAppearanceEntry getNormalAppearance()
     {
-        COSBase entry = dictionary.getDictionaryObject( COSName.N );
-        if ( entry == null )
-        { 
-            return null; 
+        COSBase entry = dictionary.getDictionaryObject(COSName.N);
+        if (entry == null)
+        {
+            return null;
         }
         else
         {
@@ -78,40 +77,37 @@ public class PDAppearanceDictionary impl
     }
 
     /**
-     * This will set a list of appearances.  If you would like to set the single
-     * appearance then you should use the key "default", and when the PDF is written
-     * back to the filesystem then there will only be one stream.
+     * This will set a list of appearances. If you would like to set the single appearance
then you should use the key
+     * "default", and when the PDF is written back to the filesystem then there will only
be one stream.
      *
      * @param entry appearance stream or subdictionary
      */
-    public void setNormalAppearance( PDAppearanceEntry entry )
+    public void setNormalAppearance(PDAppearanceEntry entry)
     {
-        dictionary.setItem( COSName.N, entry );
+        dictionary.setItem(COSName.N, entry);
     }
 
     /**
-     * This will set the normal appearance when there is only one appearance
-     * to be shown.
+     * This will set the normal appearance when there is only one appearance to be shown.
      *
      * @param ap The appearance stream to show.
      */
-    public void setNormalAppearance( PDAppearanceStream ap )
+    public void setNormalAppearance(PDAppearanceStream ap)
     {
-        dictionary.setItem( COSName.N, ap );
+        dictionary.setItem(COSName.N, ap);
     }
 
     /**
-     * This will return a list of appearances.  In the case where there is
-     * only one appearance the map will contain one entry whose key is the string
-     * "default".  If there is no rollover appearance then the normal appearance
-     * will be returned.  Which means that this method will never return null.
+     * This will return a list of appearances. In the case where there is only one appearance
the map will contain one
+     * entry whose key is the string "default". If there is no rollover appearance then the
normal appearance will be
+     * returned. Which means that this method will never return null.
      *
      * @return A list of key(java.lang.String) value(PDAppearanceStream) pairs
      */
     public PDAppearanceEntry getRolloverAppearance()
     {
-        COSBase entry = dictionary.getDictionaryObject( COSName.R );
-        if( entry == null )
+        COSBase entry = dictionary.getDictionaryObject(COSName.R);
+        if (entry == null)
         {
             return getNormalAppearance();
         }
@@ -122,40 +118,37 @@ public class PDAppearanceDictionary impl
     }
 
     /**
-     * This will set a list of appearances.  If you would like to set the single
-     * appearance then you should use the key "default", and when the PDF is written
-     * back to the filesystem then there will only be one stream.
+     * This will set a list of appearances. If you would like to set the single appearance
then you should use the key
+     * "default", and when the PDF is written back to the filesystem then there will only
be one stream.
      *
      * @param entry appearance stream or subdictionary
      */
-    public void setRolloverAppearance( PDAppearanceEntry entry )
+    public void setRolloverAppearance(PDAppearanceEntry entry)
     {
-        dictionary.setItem( COSName.R, entry );
+        dictionary.setItem(COSName.R, entry);
     }
 
     /**
-     * This will set the rollover appearance when there is rollover appearance
-     * to be shown.
+     * This will set the rollover appearance when there is rollover appearance to be shown.
      *
      * @param ap The appearance stream to show.
      */
-    public void setRolloverAppearance( PDAppearanceStream ap )
+    public void setRolloverAppearance(PDAppearanceStream ap)
     {
-        dictionary.setItem( COSName.R, ap );
+        dictionary.setItem(COSName.R, ap);
     }
 
     /**
-     * This will return a list of appearances.  In the case where there is
-     * only one appearance the map will contain one entry whose key is the string
-     * "default".  If there is no rollover appearance then the normal appearance
-     * will be returned.  Which means that this method will never return null.
+     * This will return a list of appearances. In the case where there is only one appearance
the map will contain one
+     * entry whose key is the string "default". If there is no rollover appearance then the
normal appearance will be
+     * returned. Which means that this method will never return null.
      *
      * @return A list of key(java.lang.String) value(PDAppearanceStream) pairs
      */
     public PDAppearanceEntry getDownAppearance()
     {
-        COSBase entry = dictionary.getDictionaryObject( COSName.D );
-        if( entry == null )
+        COSBase entry = dictionary.getDictionaryObject(COSName.D);
+        if (entry == null)
         {
             return getNormalAppearance();
         }
@@ -166,25 +159,23 @@ public class PDAppearanceDictionary impl
     }
 
     /**
-     * This will set a list of appearances.  If you would like to set the single
-     * appearance then you should use the key "default", and when the PDF is written
-     * back to the filesystem then there will only be one stream.
+     * This will set a list of appearances. If you would like to set the single appearance
then you should use the key
+     * "default", and when the PDF is written back to the filesystem then there will only
be one stream.
      *
      * @param entry appearance stream or subdictionary
      */
-    public void setDownAppearance( PDAppearanceEntry entry )
+    public void setDownAppearance(PDAppearanceEntry entry)
     {
-        dictionary.setItem( COSName.D, entry );
+        dictionary.setItem(COSName.D, entry);
     }
-    
+
     /**
-     * This will set the down appearance when there is down appearance
-     * to be shown.
+     * This will set the down appearance when there is down appearance to be shown.
      *
      * @param ap The appearance stream to show.
      */
-    public void setDownAppearance( PDAppearanceStream ap )
+    public void setDownAppearance(PDAppearanceStream ap)
     {
-        dictionary.setItem( COSName.D, ap );
+        dictionary.setItem(COSName.D, ap);
     }
 }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAppearanceEntry.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAppearanceEntry.java?rev=1683481&r1=1683480&r2=1683481&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAppearanceEntry.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAppearanceEntry.java
Thu Jun  4 08:15:47 2015
@@ -27,8 +27,7 @@ import org.apache.pdfbox.pdmodel.common.
 import org.apache.pdfbox.pdmodel.common.COSObjectable;
 
 /**
- * An entry in an appearance dictionary. May contain either a single appearance stream or
an
- * appearance subdictionary.
+ * An entry in an appearance dictionary. May contain either a single appearance stream or
an appearance subdictionary.
  *
  * @author John Hewson
  */
@@ -42,6 +41,7 @@ public class PDAppearanceEntry implement
 
     /**
      * Constructor for reading.
+     * 
      * @param entry
      */
     public PDAppearanceEntry(COSBase entry)
@@ -82,7 +82,7 @@ public class PDAppearanceEntry implement
         {
             throw new IllegalStateException();
         }
-        return new PDAppearanceStream((COSStream)entry);
+        return new PDAppearanceStream((COSStream) entry);
     }
 
     /**
@@ -97,7 +97,7 @@ public class PDAppearanceEntry implement
             throw new IllegalStateException();
         }
 
-        COSDictionary dict = (COSDictionary)entry;
+        COSDictionary dict = (COSDictionary) entry;
         Map<COSName, PDAppearanceStream> map = new HashMap<COSName, PDAppearanceStream>();
 
         for (COSName name : dict.keySet())
@@ -105,12 +105,12 @@ public class PDAppearanceEntry implement
             COSBase value = dict.getDictionaryObject(name);
 
             // the file from PDFBOX-1599 contains /null as its entry, so we skip non-stream
entries
-            if(value instanceof COSStream)
+            if (value instanceof COSStream)
             {
-                map.put(name, new PDAppearanceStream((COSStream)value));
+                map.put(name, new PDAppearanceStream((COSStream) value));
             }
         }
 
-        return new COSDictionaryMap<COSName, PDAppearanceStream>( map, dict );
+        return new COSDictionaryMap<COSName, PDAppearanceStream>(map, dict);
     }
 }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAppearanceStream.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAppearanceStream.java?rev=1683481&r1=1683480&r2=1683481&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAppearanceStream.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAppearanceStream.java
Thu Jun  4 08:15:47 2015
@@ -23,8 +23,8 @@ import org.apache.pdfbox.pdmodel.common.
 import org.apache.pdfbox.pdmodel.graphics.form.PDFormXObject;
 
 /**
- * An appearance stream is a form XObject, a self-contained content stream that shall be
rendered
- * inside the annotation rectangle.
+ * An appearance stream is a form XObject, a self-contained content stream that shall be
rendered inside the annotation
+ * rectangle.
  *
  * @author Ben Litchfield
  * @author John Hewson
@@ -33,6 +33,7 @@ public class PDAppearanceStream extends
 {
     /**
      * Creates a Form XObject for reading.
+     * 
      * @param stream The XObject stream
      */
     public PDAppearanceStream(COSStream stream)
@@ -42,6 +43,7 @@ public class PDAppearanceStream extends
 
     /**
      * Creates a Form Image XObject for writing, in the given document.
+     * 
      * @param document The current document
      */
     public PDAppearanceStream(PDDocument document)

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDBorderEffectDictionary.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDBorderEffectDictionary.java?rev=1683481&r1=1683480&r2=1683481&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDBorderEffectDictionary.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDBorderEffectDictionary.java
Thu Jun  4 08:15:47 2015
@@ -29,8 +29,7 @@ public class PDBorderEffectDictionary im
 {
 
     /*
-     * The various values of the effect applied to the border as defined in the
-     * PDF 1.6 reference Table 8.14
+     * The various values of the effect applied to the border as defined in the PDF 1.6 reference
Table 8.14
      */
 
     /**
@@ -56,10 +55,9 @@ public class PDBorderEffectDictionary im
     /**
      * Constructor.
      *
-     * @param dict
-     *            a border style dictionary.
+     * @param dict a border style dictionary.
      */
-    public PDBorderEffectDictionary( COSDictionary dict )
+    public PDBorderEffectDictionary(COSDictionary dict)
     {
         dictionary = dict;
     }
@@ -78,12 +76,11 @@ public class PDBorderEffectDictionary im
     /**
      * This will set the intensity of the applied effect.
      *
-     * @param i
-     *            the intensity of the effect values 0 to 2
+     * @param i the intensity of the effect values 0 to 2
      */
-    public void setIntensity( float i )
+    public void setIntensity(float i)
     {
-        getCOSObject().setFloat( "I", i );
+        getCOSObject().setFloat("I", i);
     }
 
     /**
@@ -93,29 +90,27 @@ public class PDBorderEffectDictionary im
      */
     public float getIntensity()
     {
-        return getCOSObject().getFloat( "I", 0 );
+        return getCOSObject().getFloat("I", 0);
     }
 
     /**
      * This will set the border effect, see the STYLE_* constants for valid values.
      *
-     * @param s
-     *            the border effect to use
+     * @param s the border effect to use
      */
-    public void setStyle( String s )
+    public void setStyle(String s)
     {
-        getCOSObject().setName( "S", s );
+        getCOSObject().setName("S", s);
     }
 
     /**
-     * This will retrieve the border effect, see the STYLE_* constants for valid
-     * values.
+     * This will retrieve the border effect, see the STYLE_* constants for valid values.
      *
      * @return the effect of the border
      */
     public String getStyle()
     {
-        return getCOSObject().getNameAsString( "S", STYLE_SOLID );
+        return getCOSObject().getNameAsString("S", STYLE_SOLID);
     }
 
 }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDBorderStyleDictionary.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDBorderStyleDictionary.java?rev=1683481&r1=1683480&r2=1683481&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDBorderStyleDictionary.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDBorderStyleDictionary.java
Thu Jun  4 08:15:47 2015
@@ -32,8 +32,7 @@ public class PDBorderStyleDictionary imp
 {
 
     /*
-     * The various values of the style for the border as defined in the PDF 1.6
-     * reference Table 8.13
+     * The various values of the style for the border as defined in the PDF 1.6 reference
Table 8.13
      */
 
     /**
@@ -74,10 +73,9 @@ public class PDBorderStyleDictionary imp
     /**
      * Constructor.
      *
-     * @param dict
-     *            a border style dictionary.
+     * @param dict a border style dictionary.
      */
-    public PDBorderStyleDictionary( COSDictionary dict )
+    public PDBorderStyleDictionary(COSDictionary dict)
     {
         dictionary = dict;
     }
@@ -96,12 +94,11 @@ public class PDBorderStyleDictionary imp
     /**
      * This will set the border width in points, 0 = no border.
      *
-     * @param w
-     *            float the width in points
+     * @param w float the width in points
      */
-    public void setWidth( float w )
+    public void setWidth(float w)
     {
-        getCOSObject().setFloat( "W", w );
+        getCOSObject().setFloat("W", w);
     }
 
     /**
@@ -111,45 +108,42 @@ public class PDBorderStyleDictionary imp
      */
     public float getWidth()
     {
-        return getCOSObject().getFloat( "W", 1 );
+        return getCOSObject().getFloat("W", 1);
     }
 
     /**
      * This will set the border style, see the STYLE_* constants for valid values.
      *
-     * @param s
-     *            the border style to use
+     * @param s the border style to use
      */
-    public void setStyle( String s )
+    public void setStyle(String s)
     {
-        getCOSObject().setName( "S", s );
+        getCOSObject().setName("S", s);
     }
 
     /**
-     * This will retrieve the border style, see the STYLE_* constants for valid
-     * values.
+     * This will retrieve the border style, see the STYLE_* constants for valid values.
      *
      * @return the style of the border
      */
     public String getStyle()
     {
-        return getCOSObject().getNameAsString( "S", STYLE_SOLID );
+        return getCOSObject().getNameAsString("S", STYLE_SOLID);
     }
 
     /**
      * This will set the dash style used for drawing the border.
      *
-     * @param dashArray
-     *            the dash style to use
+     * @param dashArray the dash style to use
      */
-    public void setDashStyle( COSArray dashArray )
+    public void setDashStyle(COSArray dashArray)
     {
         COSArray array = null;
-        if( dashArray != null )
+        if (dashArray != null)
         {
             array = dashArray;
         }
-        getCOSObject().setItem( "D", array );
+        getCOSObject().setItem("D", array);
     }
 
     /**
@@ -159,14 +153,14 @@ public class PDBorderStyleDictionary imp
      */
     public PDLineDashPattern getDashStyle()
     {
-        COSArray d = (COSArray) getCOSObject().getDictionaryObject( "D" );
+        COSArray d = (COSArray) getCOSObject().getDictionaryObject("D");
         if (d == null)
         {
             d = new COSArray();
-            d.add( COSInteger.THREE );
-            getCOSObject().setItem( "D", d );
+            d.add(COSInteger.THREE);
+            getCOSObject().setItem("D", d);
         }
-        return new PDLineDashPattern( d, 0 );
+        return new PDLineDashPattern(d, 0);
     }
 
 }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDExternalDataDictionary.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDExternalDataDictionary.java?rev=1683481&r1=1683480&r2=1683481&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDExternalDataDictionary.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDExternalDataDictionary.java
Thu Jun  4 08:15:47 2015
@@ -41,7 +41,7 @@ public class PDExternalDataDictionary im
     /**
      * Constructor.
      * 
-     *  @param dictionary Dictionary
+     * @param dictionary Dictionary
      */
     public PDExternalDataDictionary(COSDictionary dictionary)
     {
@@ -60,8 +60,8 @@ public class PDExternalDataDictionary im
     }
 
     /**
-     * returns the type of the external data dictionary.
-     * It must be "ExData", if present
+     * returns the type of the external data dictionary. It must be "ExData", if present
+     * 
      * @return the type of the external data dictionary
      */
     public String getType()
@@ -71,6 +71,7 @@ public class PDExternalDataDictionary im
 
     /**
      * returns the subtype of the external data dictionary.
+     * 
      * @return the subtype of the external data dictionary
      */
     public String getSubtype()
@@ -80,6 +81,7 @@ public class PDExternalDataDictionary im
 
     /**
      * This will set the subtype of the external data dictionary.
+     * 
      * @param subtype the subtype of the external data dictionary
      */
     public void setSubtype(String subtype)



Mime
View raw message