]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
changed PDFNumber to use static methods
authorKeiron Liddle <keiron@apache.org>
Mon, 18 Jun 2001 08:10:33 +0000 (08:10 +0000)
committerKeiron Liddle <keiron@apache.org>
Mon, 18 Jun 2001 08:10:33 +0000 (08:10 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194291 13f79535-47bb-0310-9956-ffa450edef68

src/org/apache/fop/pdf/PDFColor.java
src/org/apache/fop/pdf/PDFFunction.java
src/org/apache/fop/pdf/PDFNumber.java
src/org/apache/fop/pdf/PDFPattern.java
src/org/apache/fop/pdf/PDFShading.java
src/org/apache/fop/pdf/PDFXObject.java

index bd8b837acecfca5f92d90fcab297a188191cd387..f98dcc26783ac60a4b00b8fadc5e2870b0fdefeb 100644 (file)
@@ -1,52 +1,7 @@
-/*-- $Id$ -- 
-
- ============================================================================
-                                                The Apache Software License, Version 1.1
- ============================================================================
-        Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
- Redistribution and use in source and binary forms, with or without modifica-
- tion, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must        retain the above copyright      notice,
-        this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright notice,
-        this list of conditions and the following disclaimer in the documentation
-        and/or other materials provided with the distribution.
- 3. The end-user documentation included with the redistribution, if any, must
-        include  the following  acknowledgment:        "This product includes  software
-        developed      by the  Apache Software Foundation      (http://www.apache.org/)."
-        Alternately, this      acknowledgment may      appear in the software itself,  if
-        and wherever such third-party acknowledgments normally appear.
- 4. The names "Fop" and  "Apache Software Foundation"  must not be used to
-        endorse  or promote  products derived  from this       software without        prior
-        written permission. For written permission, please contact
-        apache@apache.org.
- 5. Products  derived from this software may not  be called "Apache", nor may
-        "Apache" appear        in their name,  without prior written permission  of the
-        Apache Software Foundation.
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- FITNESS  FOR A PARTICULAR     PURPOSE ARE  DISCLAIMED.        IN NO  EVENT SHALL      THE
- APACHE SOFTWARE       FOUNDATION      OR ITS CONTRIBUTORS     BE LIABLE FOR   ANY DIRECT,
- INDIRECT, INCIDENTAL, SPECIAL,        EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
- DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION) HOWEVER CAUSED AND ON
- ANY   THEORY OF LIABILITY,  WHETHER  IN CONTRACT,     STRICT LIABILITY,  OR TORT
- (INCLUDING  NEGLIGENCE OR     OTHERWISE) ARISING IN   ANY WAY OUT OF THE      USE OF
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- This software consists of voluntary contributions made  by many individuals
- on  behalf of the Apache Software     Foundation and was      originally created by
- James Tauber <jtauber@jtauber.com>. For more  information on the Apache 
- Software Foundation, please see <http://www.apache.org/>.
+/* $Id$
+ * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
+ * For details on use and redistribution please refer to the
+ * LICENSE file included with these sources.
  */
 package org.apache.fop.pdf;
 
@@ -70,8 +25,6 @@ public class PDFColor extends PDFPathPaint {
        protected double yellow = -1.0;
        protected double black  = -1.0;
        
-       private PDFNumber pdfNumber = new PDFNumber();
-       
        public PDFColor(org.apache.fop.datatypes.ColorType theColor)
        {
                this.colorSpace = new ColorSpace(ColorSpace.DEVICE_RGB);
@@ -233,22 +186,22 @@ public class PDFColor extends PDFPathPaint {
                        if(fillNotStroke)
                        { //fill
                                if(same) {
-                                       p.append(pdfNumber.doubleOut(this.red) + " g\n");
+                                       p.append(PDFNumber.doubleOut(this.red) + " g\n");
                                } else {
-                                       p.append(pdfNumber.doubleOut(this.red)+" "
-                                               +pdfNumber.doubleOut(this.green)+" "
-                                               +pdfNumber.doubleOut(this.blue)+" "
+                                       p.append(PDFNumber.doubleOut(this.red)+" "
+                                               +PDFNumber.doubleOut(this.green)+" "
+                                               +PDFNumber.doubleOut(this.blue)+" "
                                                +" rg \n");
                                }
                        } 
                        else
                        {//stroke/border
                                if(same) {
-                                       p.append(pdfNumber.doubleOut(this.red) + " G\n");
+                                       p.append(PDFNumber.doubleOut(this.red) + " G\n");
                                } else {
-                                       p.append(pdfNumber.doubleOut(this.red)+" "
-                                               +pdfNumber.doubleOut(this.green)+" "
-                                               +pdfNumber.doubleOut(this.blue)+" "
+                                       p.append(PDFNumber.doubleOut(this.red)+" "
+                                               +PDFNumber.doubleOut(this.green)+" "
+                                               +PDFNumber.doubleOut(this.blue)+" "
                                                +" RG \n");
                                }
                        }
@@ -258,17 +211,17 @@ public class PDFColor extends PDFPathPaint {
                        
                        if(fillNotStroke)
                        { //fill
-                               p.append(pdfNumber.doubleOut(this.cyan) + " "
-                                       + pdfNumber.doubleOut(this.magenta) + " "
-                                       + pdfNumber.doubleOut(this.yellow) + " "
-                                       + pdfNumber.doubleOut(this.black) + " k \n");
+                               p.append(PDFNumber.doubleOut(this.cyan) + " "
+                                       + PDFNumber.doubleOut(this.magenta) + " "
+                                       + PDFNumber.doubleOut(this.yellow) + " "
+                                       + PDFNumber.doubleOut(this.black) + " k \n");
                        }
                        else
                        { //fill
-                               p.append(pdfNumber.doubleOut(this.cyan) + " "
-                                       + pdfNumber.doubleOut(this.magenta) + " "
-                                       + pdfNumber.doubleOut(this.yellow) + " "
-                                       + pdfNumber.doubleOut(this.black) + " K \n");
+                               p.append(PDFNumber.doubleOut(this.cyan) + " "
+                                       + PDFNumber.doubleOut(this.magenta) + " "
+                                       + PDFNumber.doubleOut(this.yellow) + " "
+                                       + PDFNumber.doubleOut(this.black) + " K \n");
                        }
                        
                }//end of if CMYK
@@ -277,11 +230,11 @@ public class PDFColor extends PDFPathPaint {
                
                        if(fillNotStroke)
                        {
-                               p.append(pdfNumber.doubleOut(this.black)        + " g \n");
+                               p.append(PDFNumber.doubleOut(this.black)        + " g \n");
                        }
                        else
                        {
-                               p.append(pdfNumber.doubleOut(this.black)        + " G \n");
+                               p.append(PDFNumber.doubleOut(this.black)        + " G \n");
                        }
                
                }
index 848166fe53ab01df510ef955225c6b5b2e49a5f7..18213e5fd3c23ce029eaa05425f353550ee8489c 100644 (file)
@@ -1,52 +1,7 @@
-/*-- $Id$ -- 
-
- ============================================================================
-                                                The Apache Software License, Version 1.1
- ============================================================================
-        Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
- Redistribution and use in source and binary forms, with or without modifica-
- tion, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must        retain the above copyright  notice,
-        this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright notice,
-        this list of conditions and the following disclaimer in the documentation
-        and/or other materials provided with the distribution.
- 3. The end-user documentation included with the redistribution, if any, must
-        include  the following  acknowledgment:        "This product includes  software
-        developed      by the  Apache Software Foundation      (http://www.apache.org/)."
-        Alternately, this  acknowledgment may  appear in the software itself,  if
-        and wherever such third-party acknowledgments normally appear.
- 4. The names "Fop" and  "Apache Software Foundation"  must not be used to
-        endorse  or promote  products derived  from this       software without        prior
-        written permission. For written permission, please contact
-        apache@apache.org.
- 5. Products  derived from this software may not  be called "Apache", nor may
-        "Apache" appear        in their name,  without prior written permission  of the
-        Apache Software Foundation.
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.   IN NO  EVENT SHALL  THE
- APACHE SOFTWARE       FOUNDATION      OR ITS CONTRIBUTORS     BE LIABLE FOR   ANY DIRECT,
- INDIRECT, INCIDENTAL, SPECIAL,        EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
- DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
- OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
- ANY   THEORY OF LIABILITY,  WHETHER  IN CONTRACT,     STRICT LIABILITY,  OR TORT
- (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN      ANY WAY OUT OF THE  USE OF
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- This software  consists of voluntary contributions made  by many individuals
- on  behalf of the Apache Software     Foundation and was  originally created by
- James Tauber <jtauber@jtauber.com>. For more  information on the Apache 
- Software Foundation, please see <http://www.apache.org/>.
+/* $Id$
+ * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
+ * For details on use and redistribution please refer to the
+ * LICENSE file included with these sources.
  */
 
 package org.apache.fop.pdf;
@@ -142,7 +97,6 @@ public class PDFFunction extends PDFObject {
    
        /* *************************TYPE 4************************** */
        //See 'data' above.
-       private PDFNumber pdfNumber = new PDFNumber();
        
        /**
         * create an complete Function object of Type 0, A Sampled function.
@@ -391,7 +345,7 @@ public class PDFFunction extends PDFObject {
                                vectorSize = this.domain.size();
                                for(tempInt=0; tempInt < vectorSize; tempInt++)
                                {
-                                       p.append(pdfNumber.doubleOut(
+                                       p.append(PDFNumber.doubleOut(
                                                (Double)this.domain.elementAt(tempInt))
                                                +" ");
                                }
@@ -410,7 +364,7 @@ public class PDFFunction extends PDFObject {
                                vectorSize = this.size.size();
                                for(tempInt=0; tempInt < vectorSize; tempInt++)
                                {
-                                       p.append(pdfNumber.doubleOut(
+                                       p.append(PDFNumber.doubleOut(
                                        (Double)this.size.elementAt(tempInt)) +" ");
                                }
                                p.append("] \n");
@@ -422,7 +376,7 @@ public class PDFFunction extends PDFObject {
                                vectorSize = this.encode.size();
                                for(tempInt=0; tempInt < vectorSize; tempInt++)
                                {
-                                       p.append(pdfNumber.doubleOut(
+                                       p.append(PDFNumber.doubleOut(
                                        (Double)this.encode.elementAt(tempInt)) +" ");
                                }
                                p.append("] \n");
@@ -455,7 +409,7 @@ public class PDFFunction extends PDFObject {
                                vectorSize = this.range.size();
                                for(tempInt=0; tempInt < vectorSize; tempInt++)
                                {
-                                       p.append(pdfNumber.doubleOut(
+                                       p.append(PDFNumber.doubleOut(
                                        (Double)this.range.elementAt(tempInt)) +" ");
                                }
                                
@@ -469,7 +423,7 @@ public class PDFFunction extends PDFObject {
                                vectorSize = this.decode.size();
                                for(tempInt=0; tempInt < vectorSize; tempInt++)
                                {
-                                       p.append(pdfNumber.doubleOut(
+                                       p.append(PDFNumber.doubleOut(
                                        (Double)this.decode.elementAt(tempInt)) +" ");
                                }
                                
@@ -522,7 +476,7 @@ public class PDFFunction extends PDFObject {
                                vectorSize = this.domain.size();
                                for(tempInt=0; tempInt < vectorSize; tempInt++)
                                {
-                                       p.append(pdfNumber.doubleOut(
+                                       p.append(PDFNumber.doubleOut(
                                        (Double)this.domain.elementAt(tempInt)) +" ");
                                }
                                
@@ -541,7 +495,7 @@ public class PDFFunction extends PDFObject {
                                vectorSize = this.range.size();
                                for(tempInt=0; tempInt < vectorSize; tempInt++)
                                {
-                                       p.append(pdfNumber.doubleOut(
+                                       p.append(PDFNumber.doubleOut(
                                        (Double)this.range.elementAt(tempInt)) +" ");
                                }
                                
@@ -557,7 +511,7 @@ public class PDFFunction extends PDFObject {
                                vectorSize = this.cZero.size();
                                for(tempInt = 0; tempInt < vectorSize; tempInt++)
                                {
-                                       p.append(pdfNumber.doubleOut(
+                                       p.append(PDFNumber.doubleOut(
                                        (Double)this.cZero.elementAt(tempInt))+" ");
                                }
                                p.append("] \n");                               
@@ -570,7 +524,7 @@ public class PDFFunction extends PDFObject {
                                vectorSize = this.cOne.size();
                                for(tempInt = 0; tempInt < vectorSize; tempInt++)
                                {
-                                       p.append(pdfNumber.doubleOut(
+                                       p.append(PDFNumber.doubleOut(
                                        (Double)this.cOne.elementAt(tempInt))+" ");
                                }
                                p.append("] \n");
@@ -578,7 +532,7 @@ public class PDFFunction extends PDFObject {
                        
                        //N: The interpolation Exponent
                        p.append("/N "
-                               +pdfNumber.doubleOut(
+                               +PDFNumber.doubleOut(
                                        new Double(this.interpolationExponentN))
                                +" \n");
                        
@@ -594,7 +548,7 @@ public class PDFFunction extends PDFObject {
                                vectorSize = this.domain.size();
                                for(tempInt=0; tempInt < vectorSize; tempInt++)
                                {
-                                       p.append(pdfNumber.doubleOut(
+                                       p.append(PDFNumber.doubleOut(
                                        (Double)this.domain.elementAt(tempInt)) +" ");
                                }
                                p.append("] \n");
@@ -611,7 +565,7 @@ public class PDFFunction extends PDFObject {
                                vectorSize = this.range.size();
                                for(tempInt=0; tempInt < vectorSize; tempInt++)
                                {
-                                       p.append(pdfNumber.doubleOut(
+                                       p.append(PDFNumber.doubleOut(
                                        (Double)this.range.elementAt(tempInt)) +" ");
                                }
                                
@@ -639,7 +593,7 @@ public class PDFFunction extends PDFObject {
                                vectorSize = this.encode.size();
                                for(tempInt=0; tempInt < vectorSize; tempInt++)
                                {
-                                       p.append(pdfNumber.doubleOut(
+                                       p.append(PDFNumber.doubleOut(
                                        (Double)this.encode.elementAt(tempInt)) +" ");
                                }
                                                                
@@ -666,7 +620,7 @@ public class PDFFunction extends PDFObject {
                                vectorSize= this.bounds.size();
                                for(tempInt = 0; tempInt < vectorSize; tempInt++)
                                {
-                                       p.append(pdfNumber.doubleOut(
+                                       p.append(PDFNumber.doubleOut(
                                        (Double)this.bounds.elementAt(tempInt))+" ");
                                }
                        
@@ -681,7 +635,7 @@ public class PDFFunction extends PDFObject {
                                        // of the whole. e.g. if there are 4, then [ 0.25 0.25 0.25 ]
                                        
                                        String functionsFraction = 
-                                               pdfNumber.doubleOut(new Double(
+                                               PDFNumber.doubleOut(new Double(
                                                        1.0 / ((double)numberOfFunctions)));
        
                                        for(tempInt =0;tempInt+1 < numberOfFunctions; tempInt++)
@@ -708,7 +662,7 @@ public class PDFFunction extends PDFObject {
                                vectorSize = this.domain.size();
                                for(tempInt=0; tempInt < vectorSize; tempInt++)
                                {
-                                       p.append(pdfNumber.doubleOut(
+                                       p.append(PDFNumber.doubleOut(
                                        (Double)this.domain.elementAt(tempInt)) +" ");
                                }
                                
@@ -726,7 +680,7 @@ public class PDFFunction extends PDFObject {
                                vectorSize = this.range.size();
                                for(tempInt=0; tempInt < vectorSize; tempInt++)
                                {
-                                       p.append(pdfNumber.doubleOut(
+                                       p.append(PDFNumber.doubleOut(
                                        (Double)this.range.elementAt(tempInt)) +" ");
                                }
                                
index d866b14d07525a1a1d6c7f31484bb15b8e70ca63..c13e00ad4c11cf451edcea6052acbb10e06d4c71 100644 (file)
@@ -1,67 +1,18 @@
-/*-- $Id$ -- 
-
- ============================================================================
-                                  The Apache Software License, Version 1.1
- ============================================================================
-       Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
- Redistribution and use in source and binary forms, with or without modifica-
- tion, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must  retain the above copyright  notice,
-       this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright notice,
-       this list of conditions and the following disclaimer in the documentation
-       and/or other materials provided with the distribution.
- 3. The end-user documentation included with the redistribution, if any, must
-       include  the following  acknowledgment:  "This product includes  software
-       developed  by the  Apache Software Foundation  (http://www.apache.org/)."
-       Alternately, this  acknowledgment may  appear in the software itself,  if
-       and wherever such third-party acknowledgments normally appear.
- 4. The names "FOP" and  "Apache Software Foundation"  must not be used to
-       endorse  or promote  products derived  from this  software without      prior
-       written permission. For written permission, please contact
-       apache@apache.org.
- 5. Products  derived from this software may not  be called "Apache", nor may
-       "Apache" appear  in their name,  without prior written permission  of the
-       Apache Software Foundation.
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- FITNESS  FOR A PARTICULAR     PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
- APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
- INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
- DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION) HOWEVER CAUSED AND ON
- ANY  THEORY OF LIABILITY,     WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
- (INCLUDING  NEGLIGENCE OR     OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- This software consists of voluntary contributions made  by many individuals
- on  behalf of the Apache Software     Foundation and was      originally created by
- James Tauber <jtauber@jtauber.com>. For more  information on the Apache 
- Software Foundation, please see <http://www.apache.org/>.
+/* $Id$
+ * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
+ * For details on use and redistribution please refer to the
+ * LICENSE file included with these sources.
  */
 
 package org.apache.fop.pdf;
 
 public class PDFNumber {
-
        
-       public PDFNumber()
+       private PDFNumber()
        {
-               
-               //How can I allow people to use the method, without allowing construction?
-               
        }
        
-       public String doubleOut(Double doubleDown)
+       public static String doubleOut(Double doubleDown)
        {
                StringBuffer p = new StringBuffer();
                if(doubleDown.doubleValue() < 0) {
@@ -99,7 +50,7 @@ public class PDFNumber {
                return(p.toString());
        }
        
-       public String doubleOut(double doubleDown)
+       public static String doubleOut(double doubleDown)
        {
                
                StringBuffer p = new StringBuffer();
@@ -139,7 +90,7 @@ public class PDFNumber {
                return(p.toString());
        }
 
-       public String doubleOut(double doubleDown, int dec)
+       public static String doubleOut(double doubleDown, int dec)
        {
                
                StringBuffer p = new StringBuffer();
@@ -178,4 +129,5 @@ public class PDFNumber {
                }
                return(p.toString());
        }
-} 
+}
index 02055358e60aad3c8f27e1d8743eccafd86c9fca..8e76e5fcc4f031e28df4f1d8bd7e5dcc317051a3 100644 (file)
@@ -1,52 +1,7 @@
-/*-- $Id$ --
-
- ============================================================================
-                                                The Apache Software License, Version 1.1
- ============================================================================
-
-        Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without modifica-
- tion, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must        retain the above copyright  notice,
-        this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright notice,
-        this list of conditions and the following disclaimer in the documentation
-        and/or other materials provided with the distribution.
-
- 3. The end-user documentation included with the redistribution, if any, must
-        include  the following  acknowledgment:        "This product includes  software
-        developed      by the  Apache Software Foundation      (http://www.apache.org/)."
-        Alternately, this  acknowledgment may  appear in the software itself,  if
-        and wherever such third-party acknowledgments normally appear.
-
- 4. The names "Fop" and  "Apache Software Foundation"  must not be used to
-        endorse  or promote  products derived  from this       software without        prior
-        written permission. For written permission, please contact
-        apache@apache.org.
-
- 5. Products  derived from this software may not  be called "Apache", nor may
-        "Apache" appear        in their name,  without prior written permission  of the
-        Apache Software Foundation.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.   IN NO  EVENT SHALL  THE
- APACHE SOFTWARE       FOUNDATION      OR ITS CONTRIBUTORS     BE LIABLE FOR   ANY DIRECT,
- INDIRECT, INCIDENTAL, SPECIAL,        EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
- DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
- OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
- ANY   THEORY OF LIABILITY,  WHETHER  IN CONTRACT,     STRICT LIABILITY,  OR TORT
- (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN      ANY WAY OUT OF THE  USE OF
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- This software  consists of voluntary contributions made  by many individuals
- on  behalf of the Apache Software     Foundation and was  originally created by
- James Tauber <jtauber@jtauber.com>. For more  information on the Apache
- Software Foundation, please see <http://www.apache.org/>.
-
+/* $Id$
+ * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
+ * For details on use and redistribution please refer to the
+ * LICENSE file included with these sources.
  */
 
 package org.apache.fop.pdf;
@@ -68,8 +23,6 @@ import org.apache.fop.datatypes.ColorSpace;
  * All PDF Functions have a FunctionType (0,2,3, or 4), a Domain, and a Range.
  */
 public class PDFPattern extends PDFPathPaint {
-       private PDFNumber pdfNumber = new PDFNumber();
-       
        /**
         * The resources associated with this pattern
         */
@@ -269,13 +222,13 @@ public class PDFPattern extends PDFPathPaint {
                                for (tempInt =0; tempInt < vectorSize; tempInt++)
                                {
                                        p.append(
-                                       pdfNumber.doubleOut((Double)this.bBox.elementAt(tempInt)));                             
+                                       PDFNumber.doubleOut((Double)this.bBox.elementAt(tempInt)));                             
                                        p.append(" ");
                                }
                                p.append("] \n");
                        }
-                       p.append("/XStep "+pdfNumber.doubleOut(new Double(this.xStep))+" \n");
-                       p.append("/YStep "+pdfNumber.doubleOut(new Double(this.yStep))+" \n");
+                       p.append("/XStep "+PDFNumber.doubleOut(new Double(this.xStep))+" \n");
+                       p.append("/YStep "+PDFNumber.doubleOut(new Double(this.yStep))+" \n");
                        
                        if(this.matrix != null)
                        {
@@ -283,7 +236,7 @@ public class PDFPattern extends PDFPathPaint {
                                p.append("/Matrix [ ");
                                for (tempInt =0; tempInt < vectorSize; tempInt++)
                                {
-                                       p.append(pdfNumber.doubleOut(
+                                       p.append(PDFNumber.doubleOut(
                                                (Double)this.matrix.elementAt(tempInt)));
                                        p.append(" ");
                                }
@@ -337,7 +290,7 @@ public class PDFPattern extends PDFPathPaint {
                                p.append("/Matrix [ ");
                                for (tempInt =0; tempInt < vectorSize; tempInt++)
                                {
-                                       p.append(pdfNumber.doubleOut(
+                                       p.append(PDFNumber.doubleOut(
                                        (Double)this.matrix.elementAt(tempInt)));
                                        p.append(" ");
                                }
index a9aeea1cf180202066e7497b1da244195bf43f77..47ff4cd1759d8837de863a9ac5b1c5d94152a3dc 100644 (file)
@@ -1,52 +1,7 @@
-/*-- $Id$ -- 
-
- ============================================================================
-                                                The Apache Software License, Version 1.1
- ============================================================================
-        Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
- Redistribution and use in source and binary forms, with or without modifica-
- tion, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must        retain the above copyright  notice,
-        this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright notice,
-        this list of conditions and the following disclaimer in the documentation
-        and/or other materials provided with the distribution.
- 3. The end-user documentation included with the redistribution, if any, must
-        include  the following  acknowledgment:        "This product includes  software
-        developed      by the  Apache Software Foundation      (http://www.apache.org/)."
-        Alternately, this  acknowledgment may  appear in the software itself,  if
-        and wherever such third-party acknowledgments normally appear.
- 4. The names "Fop" and  "Apache Software Foundation"  must not be used to
-        endorse  or promote  products derived  from this       software without        prior
-        written permission. For written permission, please contact
-        apache@apache.org.
- 5. Products  derived from this software may not  be called "Apache", nor may
-        "Apache" appear        in their name,  without prior written permission  of the
-        Apache Software Foundation.
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.   IN NO  EVENT SHALL  THE
- APACHE SOFTWARE       FOUNDATION      OR ITS CONTRIBUTORS     BE LIABLE FOR   ANY DIRECT,
- INDIRECT, INCIDENTAL, SPECIAL,        EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
- DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
- OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
- ANY   THEORY OF LIABILITY,  WHETHER  IN CONTRACT,     STRICT LIABILITY,  OR TORT
- (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN      ANY WAY OUT OF THE  USE OF
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- This software  consists of voluntary contributions made  by many individuals
- on  behalf of the Apache Software     Foundation and was  originally created by
- James Tauber <jtauber@jtauber.com>. For more  information on the Apache 
- Software Foundation, please see <http://www.apache.org/>.
+/* $Id$
+ * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
+ * For details on use and redistribution please refer to the
+ * LICENSE file included with these sources.
  */
 
 package org.apache.fop.pdf;
@@ -54,7 +9,6 @@ package org.apache.fop.pdf;
 //Java... 
 import java.util.Vector;
 
-
 //FOP
 import org.apache.fop.datatypes.ColorSpace;
 
@@ -160,8 +114,6 @@ public class PDFShading extends PDFObject {
         */
        protected int verticesPerRow = 0;
        
-       private PDFNumber pdfNumber = new PDFNumber();
-       
        /**
         * Constructor for type function based shading
         * 
@@ -367,7 +319,7 @@ public class PDFShading extends PDFObject {
                        vectorSize = this.background.size();
                        for(tempInt=0; tempInt < vectorSize; tempInt++)
                        {
-                               p.append(pdfNumber.doubleOut(
+                               p.append(PDFNumber.doubleOut(
                                (Double)this.background.elementAt(tempInt)) +" ");
                        }
                        p.append("] \n");
@@ -379,7 +331,7 @@ public class PDFShading extends PDFObject {
                        vectorSize = this.bBox.size();
                        for(tempInt=0; tempInt < vectorSize; tempInt++)
                        {
-                               p.append(pdfNumber.doubleOut(
+                               p.append(PDFNumber.doubleOut(
                                (Double)this.bBox.elementAt(tempInt)) +" ");
                        }
                        p.append("] \n");
@@ -399,7 +351,7 @@ public class PDFShading extends PDFObject {
                                vectorSize = this.domain.size();
                                for(tempInt=0; tempInt < vectorSize; tempInt++)
                                {
-                                       p.append(pdfNumber.doubleOut(
+                                       p.append(PDFNumber.doubleOut(
                                        (Double)this.domain.elementAt(tempInt)) +" ");
                                }
                                p.append("] \n");
@@ -415,7 +367,7 @@ public class PDFShading extends PDFObject {
                                vectorSize = this.matrix.size();
                                for(tempInt=0; tempInt < vectorSize; tempInt++)
                                {
-                                       p.append(pdfNumber.doubleOut(
+                                       p.append(PDFNumber.doubleOut(
                                        (Double)this.matrix.elementAt(tempInt)) +" ");
                                }
                                p.append("] \n");
@@ -437,7 +389,7 @@ public class PDFShading extends PDFObject {
                                vectorSize = this.coords.size();
                                for(tempInt=0; tempInt < vectorSize; tempInt++)
                                {
-                                       p.append(pdfNumber.doubleOut(
+                                       p.append(PDFNumber.doubleOut(
                                        (Double)this.coords.elementAt(tempInt)) +" ");
                                }
                                p.append("] \n");
@@ -450,7 +402,7 @@ public class PDFShading extends PDFObject {
                                vectorSize = this.domain.size();
                                for(tempInt=0; tempInt < vectorSize; tempInt++)
                                {
-                                       p.append(pdfNumber.doubleOut(
+                                       p.append(PDFNumber.doubleOut(
                                        (Double)this.domain.elementAt(tempInt)) +" ");
                                }
                                p.append("] \n");
index 4d043475f098ae108f651db84fc4decbb5b0e2e5..372468cf7e191530dfed074c0eff0d2808cd95d9 100644 (file)
@@ -1,53 +1,9 @@
-/*-- $Id$ -- 
-
- ============================================================================
-                   The Apache Software License, Version 1.1
- ============================================================================
-    Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
- Redistribution and use in source and binary forms, with or without modifica-
- tion, are permitted provided that the following conditions are met:
- 1. Redistributions of  source code must  retain the above copyright  notice,
-    this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright notice,
-    this list of conditions and the following disclaimer in the documentation
-    and/or other materials provided with the distribution.
- 3. The end-user documentation included with the redistribution, if any, must
-    include  the following  acknowledgment:  "This product includes  software
-    developed  by the  Apache Software Foundation  (http://www.apache.org/)."
-    Alternately, this  acknowledgment may  appear in the software itself,  if
-    and wherever such third-party acknowledgments normally appear.
- 4. The names "Fop" and  "Apache Software Foundation"  must not be used to
-    endorse  or promote  products derived  from this  software without  prior
-    written permission. For written permission, please contact
-    apache@apache.org.
- 5. Products  derived from this software may not  be called "Apache", nor may
-    "Apache" appear  in their name,  without prior written permission  of the
-    Apache Software Foundation.
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
- APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
- INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
- DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
- OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
- ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
- (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- This software  consists of voluntary contributions made  by many individuals
- on  behalf of the Apache Software  Foundation and was  originally created by
- James Tauber <jtauber@jtauber.com>. For more  information on the Apache 
- Software Foundation, please see <http://www.apache.org/>.
+/* $Id$
+ * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
+ * For details on use and redistribution please refer to the
+ * LICENSE file included with these sources.
  */
+
 /* modified by JKT to integrate with 0.12.0 */
 /* modified by Eric SCHAEFFER to integrate with 0.13.0 */
 
@@ -126,7 +82,7 @@ public class PDFXObject extends PDFObject {
                if (fopimage.isTransparent()) {
                        PDFColor transp = fopimage.getTransparentColor();
                        p = p + "/Mask [" + transp.red255() + " " + transp.red255() + " " + transp.green255() + " " + transp.green255() + " " + transp.blue255() + " " + transp.blue255() + "]\n";
-               }
+    }
                p = p + dictEntries;
                p = p + ">>\n";