From: Keiron Liddle Date: Mon, 18 Jun 2001 08:10:33 +0000 (+0000) Subject: changed PDFNumber to use static methods X-Git-Tag: PRE_CODEFORMATTING~88 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=bddb571181396e7e67e1e988029c2097ace379e2;p=xmlgraphics-fop.git changed PDFNumber to use static methods git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194291 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/org/apache/fop/pdf/PDFColor.java b/src/org/apache/fop/pdf/PDFColor.java index bd8b837ac..f98dcc267 100644 --- a/src/org/apache/fop/pdf/PDFColor.java +++ b/src/org/apache/fop/pdf/PDFColor.java @@ -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 . For more information on the Apache - Software Foundation, please see . - +/* $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"); } } diff --git a/src/org/apache/fop/pdf/PDFFunction.java b/src/org/apache/fop/pdf/PDFFunction.java index 848166fe5..18213e5fd 100644 --- a/src/org/apache/fop/pdf/PDFFunction.java +++ b/src/org/apache/fop/pdf/PDFFunction.java @@ -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 . For more information on the Apache - Software Foundation, please see . - +/* $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)) +" "); } diff --git a/src/org/apache/fop/pdf/PDFNumber.java b/src/org/apache/fop/pdf/PDFNumber.java index d866b14d0..c13e00ad4 100644 --- a/src/org/apache/fop/pdf/PDFNumber.java +++ b/src/org/apache/fop/pdf/PDFNumber.java @@ -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 . For more information on the Apache - Software Foundation, please see . - +/* $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()); } -} +} + diff --git a/src/org/apache/fop/pdf/PDFPattern.java b/src/org/apache/fop/pdf/PDFPattern.java index 02055358e..8e76e5fcc 100644 --- a/src/org/apache/fop/pdf/PDFPattern.java +++ b/src/org/apache/fop/pdf/PDFPattern.java @@ -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 . For more information on the Apache - Software Foundation, please see . - +/* $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(" "); } diff --git a/src/org/apache/fop/pdf/PDFShading.java b/src/org/apache/fop/pdf/PDFShading.java index a9aeea1cf..47ff4cd17 100644 --- a/src/org/apache/fop/pdf/PDFShading.java +++ b/src/org/apache/fop/pdf/PDFShading.java @@ -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 . For more information on the Apache - Software Foundation, please see . - +/* $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"); diff --git a/src/org/apache/fop/pdf/PDFXObject.java b/src/org/apache/fop/pdf/PDFXObject.java index 4d043475f..372468cf7 100644 --- a/src/org/apache/fop/pdf/PDFXObject.java +++ b/src/org/apache/fop/pdf/PDFXObject.java @@ -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 . For more information on the Apache - Software Foundation, please see . - +/* $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";