aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/pdf
diff options
context:
space:
mode:
authorKeiron Liddle <keiron@apache.org>2002-10-25 09:29:48 +0000
committerKeiron Liddle <keiron@apache.org>2002-10-25 09:29:48 +0000
commitf4277e55a8810a0badd3a0dbb233178b678d0119 (patch)
tree9563455dd2f825ac8c0a24d19e99da70f2d7ec10 /src/org/apache/fop/pdf
parent40209c4fc88254b792d07b63be3955c8288b3e7a (diff)
downloadxmlgraphics-fop-f4277e55a8810a0badd3a0dbb233178b678d0119.tar.gz
xmlgraphics-fop-f4277e55a8810a0badd3a0dbb233178b678d0119.zip
more style fixes
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@195362 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/pdf')
-rw-r--r--src/org/apache/fop/pdf/DCTFilter.java4
-rw-r--r--src/org/apache/fop/pdf/PDFCMap.java4
-rw-r--r--src/org/apache/fop/pdf/PDFColor.java5
-rw-r--r--src/org/apache/fop/pdf/PDFColorSpace.java9
-rw-r--r--src/org/apache/fop/pdf/PDFDocument.java1
-rw-r--r--src/org/apache/fop/pdf/PDFFunction.java84
-rw-r--r--src/org/apache/fop/pdf/PDFGState.java16
-rw-r--r--src/org/apache/fop/pdf/PDFICCStream.java5
-rw-r--r--src/org/apache/fop/pdf/PDFInfo.java8
-rw-r--r--src/org/apache/fop/pdf/PDFNumber.java4
-rw-r--r--src/org/apache/fop/pdf/PDFPattern.java68
-rw-r--r--src/org/apache/fop/pdf/PDFShading.java74
-rw-r--r--src/org/apache/fop/pdf/PDFState.java92
-rw-r--r--src/org/apache/fop/pdf/PDFT1Stream.java2
14 files changed, 189 insertions, 187 deletions
diff --git a/src/org/apache/fop/pdf/DCTFilter.java b/src/org/apache/fop/pdf/DCTFilter.java
index 6f0abf5d6..47260b785 100644
--- a/src/org/apache/fop/pdf/DCTFilter.java
+++ b/src/org/apache/fop/pdf/DCTFilter.java
@@ -9,9 +9,9 @@ package org.apache.fop.pdf;
import org.apache.fop.util.StreamUtilities;
-import java.io.ByteArrayOutputStream;
import java.io.IOException;
-import java.io.*;
+import java.io.InputStream;
+import java.io.OutputStream;
/**
* DCT Filter class. Right now it is just used as a dummy filter flag so
diff --git a/src/org/apache/fop/pdf/PDFCMap.java b/src/org/apache/fop/pdf/PDFCMap.java
index 4e339f162..728855d7a 100644
--- a/src/org/apache/fop/pdf/PDFCMap.java
+++ b/src/org/apache/fop/pdf/PDFCMap.java
@@ -1,6 +1,6 @@
/*
* $Id$
- * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
+ * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
*/
@@ -210,7 +210,7 @@ public class PDFCMap extends PDFStream {
* p.append("\n/UseCMap ");
* if (base instanceof String) {
* p.append("/"+base);
- * } else { // base instanceof PDFStream
+ * } else {// base instanceof PDFStream
* p.append(((PDFStream)base).referencePDF());
* }
* }
diff --git a/src/org/apache/fop/pdf/PDFColor.java b/src/org/apache/fop/pdf/PDFColor.java
index b1f589be6..116b2f328 100644
--- a/src/org/apache/fop/pdf/PDFColor.java
+++ b/src/org/apache/fop/pdf/PDFColor.java
@@ -1,6 +1,6 @@
/*
* $Id$
- * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
+ * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
*/
@@ -9,8 +9,6 @@ package org.apache.fop.pdf;
// Java
import java.util.ArrayList;
-import java.io.IOException;
-import java.io.PrintWriter;
public class PDFColor extends PDFPathPaint {
protected static double blackFactor = 2.0; // could be 3.0 as well.
@@ -306,3 +304,4 @@ public class PDFColor extends PDFPathPaint {
}
}
+
diff --git a/src/org/apache/fop/pdf/PDFColorSpace.java b/src/org/apache/fop/pdf/PDFColorSpace.java
index 62992b4af..b8659ef2d 100644
--- a/src/org/apache/fop/pdf/PDFColorSpace.java
+++ b/src/org/apache/fop/pdf/PDFColorSpace.java
@@ -33,14 +33,15 @@ public class PDFColorSpace {
}
private int calculateNumComponents() {
- if (currentColorSpace == DEVICE_GRAY)
+ if (currentColorSpace == DEVICE_GRAY) {
return 1;
- else if (currentColorSpace == DEVICE_RGB)
+ } else if (currentColorSpace == DEVICE_RGB) {
return 3;
- else if (currentColorSpace == DEVICE_CMYK)
+ } else if (currentColorSpace == DEVICE_CMYK) {
return 4;
- else
+ } else {
return 0;
+ }
}
public void setColorSpace(int theColorSpace) {
diff --git a/src/org/apache/fop/pdf/PDFDocument.java b/src/org/apache/fop/pdf/PDFDocument.java
index 8dd9c0c86..aa672b79b 100644
--- a/src/org/apache/fop/pdf/PDFDocument.java
+++ b/src/org/apache/fop/pdf/PDFDocument.java
@@ -1527,3 +1527,4 @@ public class PDFDocument {
}
}
+
diff --git a/src/org/apache/fop/pdf/PDFFunction.java b/src/org/apache/fop/pdf/PDFFunction.java
index ad265ff91..62ecb25bc 100644
--- a/src/org/apache/fop/pdf/PDFFunction.java
+++ b/src/org/apache/fop/pdf/PDFFunction.java
@@ -461,9 +461,9 @@ public class PDFFunction extends PDFObject {
}
p.append("endobj\n");
+ // end of if FunctionType 0
- } // end of if FunctionType 0
- else if (this.functionType == 2) {
+ } else if (this.functionType == 2) {
// DOMAIN
if (this.domain != null) {
p.append("/Domain [ ");
@@ -668,103 +668,103 @@ public class PDFFunction extends PDFObject {
}
public boolean equals(Object obj) {
- if(obj == null) {
+ if (obj == null) {
return false;
}
- if(obj == this) {
+ if (obj == this) {
return true;
}
- if(!(obj instanceof PDFFunction)) {
+ if (!(obj instanceof PDFFunction)) {
return false;
}
PDFFunction func = (PDFFunction)obj;
- if(functionType != func.functionType) {
+ if (functionType != func.functionType) {
return false;
}
- if(bitsPerSample != func.bitsPerSample) {
+ if (bitsPerSample != func.bitsPerSample) {
return false;
}
- if(order != func.order) {
+ if (order != func.order) {
return false;
}
- if(interpolationExponentN != func.interpolationExponentN) {
+ if (interpolationExponentN != func.interpolationExponentN) {
return false;
}
- if(domain != null) {
- if(!domain.equals(func.domain)) {
+ if (domain != null) {
+ if (!domain.equals(func.domain)) {
return false;
}
- } else if(func.domain != null) {
+ } else if (func.domain != null) {
return false;
}
- if(range != null) {
- if(!range.equals(func.range)) {
+ if (range != null) {
+ if (!range.equals(func.range)) {
return false;
}
- } else if(func.range != null) {
+ } else if (func.range != null) {
return false;
}
- if(size != null) {
- if(!size.equals(func.size)) {
+ if (size != null) {
+ if (!size.equals(func.size)) {
return false;
}
- } else if(func.size != null) {
+ } else if (func.size != null) {
return false;
}
- if(encode != null) {
- if(!encode.equals(func.encode)) {
+ if (encode != null) {
+ if (!encode.equals(func.encode)) {
return false;
}
- } else if(func.encode != null) {
+ } else if (func.encode != null) {
return false;
}
- if(decode != null) {
- if(!decode.equals(func.decode)) {
+ if (decode != null) {
+ if (!decode.equals(func.decode)) {
return false;
}
- } else if(func.decode != null) {
+ } else if (func.decode != null) {
return false;
}
- if(functionDataStream != null) {
- if(!functionDataStream.equals(func.functionDataStream)) {
+ if (functionDataStream != null) {
+ if (!functionDataStream.equals(func.functionDataStream)) {
return false;
}
- } else if(func.functionDataStream != null) {
+ } else if (func.functionDataStream != null) {
return false;
}
- if(filter != null) {
- if(!filter.equals(func.filter)) {
+ if (filter != null) {
+ if (!filter.equals(func.filter)) {
return false;
}
- } else if(func.filter != null) {
+ } else if (func.filter != null) {
return false;
}
- if(cZero != null) {
- if(!cZero.equals(func.cZero)) {
+ if (cZero != null) {
+ if (!cZero.equals(func.cZero)) {
return false;
}
- } else if(func.cZero != null) {
+ } else if (func.cZero != null) {
return false;
}
- if(cOne != null) {
- if(!cOne.equals(func.cOne)) {
+ if (cOne != null) {
+ if (!cOne.equals(func.cOne)) {
return false;
}
- } else if(func.cOne != null) {
+ } else if (func.cOne != null) {
return false;
}
- if(functions != null) {
- if(!functions.equals(func.functions)) {
+ if (functions != null) {
+ if (!functions.equals(func.functions)) {
return false;
}
- } else if(func.functions != null) {
+ } else if (func.functions != null) {
return false;
}
- if(bounds != null) {
- if(!bounds.equals(func.bounds)) {
+ if (bounds != null) {
+ if (!bounds.equals(func.bounds)) {
return false;
}
- } else if(func.bounds != null) {
+ } else if (func.bounds != null) {
return false;
}
return true;
diff --git a/src/org/apache/fop/pdf/PDFGState.java b/src/org/apache/fop/pdf/PDFGState.java
index e535fcdfe..cc5766c71 100644
--- a/src/org/apache/fop/pdf/PDFGState.java
+++ b/src/org/apache/fop/pdf/PDFGState.java
@@ -1,6 +1,6 @@
/*
* $Id$
- * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
+ * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
*/
@@ -81,7 +81,7 @@ public class PDFGState extends PDFObject {
}
public void setAlpha(float val, boolean fill) {
- if(fill) {
+ if (fill) {
values.put(ca, new Float(val));
} else {
values.put(CA, new Float(val));
@@ -113,7 +113,7 @@ public class PDFGState extends PDFObject {
private void appendVal(StringBuffer sb, String name) {
Object val = values.get(name);
- if(val != null) {
+ if (val != null) {
sb.append("/" + name + " " + val + "\n");
}
}
@@ -129,21 +129,21 @@ public class PDFGState extends PDFObject {
*/
public boolean equals(Object obj) {
- if(obj == this) {
+ if (obj == this) {
return true;
}
- if(!(obj instanceof PDFGState)) {
+ if (!(obj instanceof PDFGState)) {
return false;
}
HashMap vals1 = values;
HashMap vals2 = ((PDFGState)obj).values;
- if(vals1.size() != vals2.size()) {
+ if (vals1.size() != vals2.size()) {
return false;
}
- for(Iterator iter = vals1.keySet().iterator(); iter.hasNext(); ) {
+ for(Iterator iter = vals1.keySet().iterator(); iter.hasNext();) {
Object str = iter.next();
Object obj1 = vals1.get(str);
- if(!obj1.equals(vals2.get(str))) {
+ if (!obj1.equals(vals2.get(str))) {
return false;
}
}
diff --git a/src/org/apache/fop/pdf/PDFICCStream.java b/src/org/apache/fop/pdf/PDFICCStream.java
index b3d6cf875..b3f9c140d 100644
--- a/src/org/apache/fop/pdf/PDFICCStream.java
+++ b/src/org/apache/fop/pdf/PDFICCStream.java
@@ -1,6 +1,6 @@
/*
* $Id$
- * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
+ * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
*/
@@ -39,8 +39,9 @@ public class PDFICCStream extends PDFStream {
pb.append(this.number).append(" ").append(this.generation).append(" obj\n<< ");
pb.append("/N ").append(cp.getNumComponents()).append(" ");
- if (pdfColorSpace != null)
+ if (pdfColorSpace != null) {
pb.append("/Alternate /").append(pdfColorSpace.getColorSpacePDFString()).append(" ");
+ }
pb.append("/Length ").append((_data.getSize() + 1)).append(" ").append(filterEntry);
pb.append(" >>\n");
diff --git a/src/org/apache/fop/pdf/PDFInfo.java b/src/org/apache/fop/pdf/PDFInfo.java
index bbef7a897..1004389f9 100644
--- a/src/org/apache/fop/pdf/PDFInfo.java
+++ b/src/org/apache/fop/pdf/PDFInfo.java
@@ -71,16 +71,16 @@ public class PDFInfo extends PDFObject {
public byte[] toPDF() {
String p = this.number + " " + this.generation
+ " obj\n<< /Type /Info\n";
- if(title != null) {
+ if (title != null) {
p += "/Title (" + this.title + ")\n";
}
- if(author != null) {
+ if (author != null) {
p += "/Author (" + this.author + ")\n";
}
- if(subject != null) {
+ if (subject != null) {
p += "/Subject (" + this.subject + ")\n";
}
- if(keywords != null) {
+ if (keywords != null) {
p += "/Keywords (" + this.keywords + ")\n";
}
diff --git a/src/org/apache/fop/pdf/PDFNumber.java b/src/org/apache/fop/pdf/PDFNumber.java
index 66a43d999..38b5675f2 100644
--- a/src/org/apache/fop/pdf/PDFNumber.java
+++ b/src/org/apache/fop/pdf/PDFNumber.java
@@ -1,6 +1,6 @@
/*
* $Id$
- * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
+ * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
*/
@@ -9,7 +9,7 @@ package org.apache.fop.pdf;
public class PDFNumber {
- private PDFNumber() {}
+ private PDFNumber() { }
public static String doubleOut(Double doubleDown) {
StringBuffer p = new StringBuffer();
diff --git a/src/org/apache/fop/pdf/PDFPattern.java b/src/org/apache/fop/pdf/PDFPattern.java
index ba0296a4a..f7363b095 100644
--- a/src/org/apache/fop/pdf/PDFPattern.java
+++ b/src/org/apache/fop/pdf/PDFPattern.java
@@ -1,6 +1,6 @@
/*
* $Id$
- * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
+ * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
*/
@@ -198,7 +198,7 @@ public class PDFPattern extends PDFPathPaint {
p.append(this.number + " " + this.generation
+ " obj\n<< \n/Type /Pattern \n");
- if(this.resources != null) {
+ if (this.resources != null) {
p.append("/Resources " + this.resources.referencePDF() + " \n");
}
@@ -308,85 +308,85 @@ public class PDFPattern extends PDFPathPaint {
public byte[] toPDF() { return null; }
public boolean equals(Object obj) {
- if(obj == null) {
+ if (obj == null) {
return false;
}
- if(obj == this) {
+ if (obj == this) {
return true;
}
- if(!(obj instanceof PDFPattern)) {
+ if (!(obj instanceof PDFPattern)) {
return false;
}
PDFPattern patt = (PDFPattern)obj;
- if(patternType != patt.patternType) {
+ if (patternType != patt.patternType) {
return false;
}
- if(paintType != patt.paintType) {
+ if (paintType != patt.paintType) {
return false;
}
- if(tilingType != patt.tilingType) {
+ if (tilingType != patt.tilingType) {
return false;
}
- if(xStep != patt.xStep) {
+ if (xStep != patt.xStep) {
return false;
}
- if(yStep != patt.yStep) {
+ if (yStep != patt.yStep) {
return false;
}
- if(bBox != null) {
- if(!bBox.equals(patt.bBox)) {
+ if (bBox != null) {
+ if (!bBox.equals(patt.bBox)) {
return false;
}
- } else if(patt.bBox != null) {
+ } else if (patt.bBox != null) {
return false;
}
- if(bBox != null) {
- if(!bBox.equals(patt.bBox)) {
+ if (bBox != null) {
+ if (!bBox.equals(patt.bBox)) {
return false;
}
- } else if(patt.bBox != null) {
+ } else if (patt.bBox != null) {
return false;
}
- if(xUID != null) {
- if(!xUID.equals(patt.xUID)) {
+ if (xUID != null) {
+ if (!xUID.equals(patt.xUID)) {
return false;
}
- } else if(patt.xUID != null) {
+ } else if (patt.xUID != null) {
return false;
}
- if(extGState != null) {
- if(!extGState.equals(patt.extGState)) {
+ if (extGState != null) {
+ if (!extGState.equals(patt.extGState)) {
return false;
}
- } else if(patt.extGState != null) {
+ } else if (patt.extGState != null) {
return false;
}
- if(matrix != null) {
- if(!matrix.equals(patt.matrix)) {
+ if (matrix != null) {
+ if (!matrix.equals(patt.matrix)) {
return false;
}
- } else if(patt.matrix != null) {
+ } else if (patt.matrix != null) {
return false;
}
- if(resources != null) {
- if(!resources.equals(patt.resources)) {
+ if (resources != null) {
+ if (!resources.equals(patt.resources)) {
return false;
}
- } else if(patt.resources != null) {
+ } else if (patt.resources != null) {
return false;
}
- if(shading != null) {
- if(!shading.equals(patt.shading)) {
+ if (shading != null) {
+ if (!shading.equals(patt.shading)) {
return false;
}
- } else if(patt.shading != null) {
+ } else if (patt.shading != null) {
return false;
}
- if(patternDataStream != null) {
- if(!patternDataStream.equals(patt.patternDataStream)) {
+ if (patternDataStream != null) {
+ if (!patternDataStream.equals(patt.patternDataStream)) {
return false;
}
- } else if(patt.patternDataStream != null) {
+ } else if (patt.patternDataStream != null) {
return false;
}
diff --git a/src/org/apache/fop/pdf/PDFShading.java b/src/org/apache/fop/pdf/PDFShading.java
index fdbb2339e..07a033702 100644
--- a/src/org/apache/fop/pdf/PDFShading.java
+++ b/src/org/apache/fop/pdf/PDFShading.java
@@ -1,6 +1,6 @@
/*
* $Id$
- * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
+ * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
*/
@@ -506,95 +506,95 @@ public class PDFShading extends PDFObject {
}
public boolean equals(Object obj) {
- if(obj == null) {
+ if (obj == null) {
return false;
}
- if(obj == this) {
+ if (obj == this) {
return true;
}
- if(!(obj instanceof PDFShading)) {
+ if (!(obj instanceof PDFShading)) {
return false;
}
PDFShading shad = (PDFShading)obj;
- if(shadingType != shad.shadingType) {
+ if (shadingType != shad.shadingType) {
return false;
}
- if(antiAlias != shad.antiAlias) {
+ if (antiAlias != shad.antiAlias) {
return false;
}
- if(bitsPerCoordinate != shad.bitsPerCoordinate) {
+ if (bitsPerCoordinate != shad.bitsPerCoordinate) {
return false;
}
- if(bitsPerFlag != shad.bitsPerFlag) {
+ if (bitsPerFlag != shad.bitsPerFlag) {
return false;
}
- if(bitsPerComponent != shad.bitsPerComponent) {
+ if (bitsPerComponent != shad.bitsPerComponent) {
return false;
}
- if(verticesPerRow != shad.verticesPerRow) {
+ if (verticesPerRow != shad.verticesPerRow) {
return false;
}
- if(colorSpace != null) {
- if(!colorSpace.equals(shad.colorSpace)) {
+ if (colorSpace != null) {
+ if (!colorSpace.equals(shad.colorSpace)) {
return false;
}
- } else if(shad.colorSpace != null) {
+ } else if (shad.colorSpace != null) {
return false;
}
- if(background != null) {
- if(!background.equals(shad.background)) {
+ if (background != null) {
+ if (!background.equals(shad.background)) {
return false;
}
- } else if(shad.background != null) {
+ } else if (shad.background != null) {
return false;
}
- if(bBox != null) {
- if(!bBox.equals(shad.bBox)) {
+ if (bBox != null) {
+ if (!bBox.equals(shad.bBox)) {
return false;
}
- } else if(shad.bBox != null) {
+ } else if (shad.bBox != null) {
return false;
}
- if(domain != null) {
- if(!domain.equals(shad.domain)) {
+ if (domain != null) {
+ if (!domain.equals(shad.domain)) {
return false;
}
- } else if(shad.domain != null) {
+ } else if (shad.domain != null) {
return false;
}
- if(matrix != null) {
- if(!matrix.equals(shad.matrix)) {
+ if (matrix != null) {
+ if (!matrix.equals(shad.matrix)) {
return false;
}
- } else if(shad.matrix != null) {
+ } else if (shad.matrix != null) {
return false;
}
- if(coords != null) {
- if(!coords.equals(shad.coords)) {
+ if (coords != null) {
+ if (!coords.equals(shad.coords)) {
return false;
}
- } else if(shad.coords != null) {
+ } else if (shad.coords != null) {
return false;
}
- if(extend != null) {
- if(!extend.equals(shad.extend)) {
+ if (extend != null) {
+ if (!extend.equals(shad.extend)) {
return false;
}
- } else if(shad.extend != null) {
+ } else if (shad.extend != null) {
return false;
}
- if(decode != null) {
- if(!decode.equals(shad.decode)) {
+ if (decode != null) {
+ if (!decode.equals(shad.decode)) {
return false;
}
- } else if(shad.decode != null) {
+ } else if (shad.decode != null) {
return false;
}
- if(function != null) {
- if(!function.equals(shad.function)) {
+ if (function != null) {
+ if (!function.equals(shad.function)) {
return false;
}
- } else if(shad.function != null) {
+ } else if (shad.function != null) {
return false;
}
return true;
diff --git a/src/org/apache/fop/pdf/PDFState.java b/src/org/apache/fop/pdf/PDFState.java
index d9500c1b2..264c702de 100644
--- a/src/org/apache/fop/pdf/PDFState.java
+++ b/src/org/apache/fop/pdf/PDFState.java
@@ -34,39 +34,39 @@ import java.awt.geom.AffineTransform;
* the possible combinations after completing.
*/
public class PDFState {
- private final static String COLOR = "color";
- private final static String BACKCOLOR = "backcolor";
- private final static String PAINT = "paint";
- private final static String BACKPAINT = "backpaint";
- private final static String LINECAP = "lineCap";
- private final static String LINEJOIN = "lineJoin";
- private final static String LINEWIDTH = "lineWidth";
- private final static String MITERLIMIT = "miterLimit";
- private final static String TEXT = "text";
- private final static String DASHOFFSET = "dashOffset";
- private final static String DASHARRAY = "dashArray";
- private final static String TRANSFORM = "transform";
- private final static String FONTSIZE = "fontSize";
- private final static String FONTNAME = "fontName";
- private final static String CLIP = "clip";
- private final static String GSTATE = "gstate";
-
- Color color = Color.black;
- Color backcolor = Color.white;
- Paint paint = null;
- Paint backPaint = null;
- int lineCap = 0;
- int lineJoin = 0;
- float lineWidth = 1;
- float miterLimit = 0;
- boolean text = false;
- int dashOffset = 0;
- int[] dashArray = new int[0];
- AffineTransform transform = new AffineTransform();
- float fontSize = 0;
- String fontName = "";
- Shape clip = null;
- PDFGState gstate = null;
+ private static final String COLOR = "color";
+ private static final String BACKCOLOR = "backcolor";
+ private static final String PAINT = "paint";
+ private static final String BACKPAINT = "backpaint";
+ private static final String LINECAP = "lineCap";
+ private static final String LINEJOIN = "lineJoin";
+ private static final String LINEWIDTH = "lineWidth";
+ private static final String MITERLIMIT = "miterLimit";
+ private static final String TEXT = "text";
+ private static final String DASHOFFSET = "dashOffset";
+ private static final String DASHARRAY = "dashArray";
+ private static final String TRANSFORM = "transform";
+ private static final String FONTSIZE = "fontSize";
+ private static final String FONTNAME = "fontName";
+ private static final String CLIP = "clip";
+ private static final String GSTATE = "gstate";
+
+ private Color color = Color.black;
+ private Color backcolor = Color.white;
+ private Paint paint = null;
+ private Paint backPaint = null;
+ private int lineCap = 0;
+ private int lineJoin = 0;
+ private float lineWidth = 1;
+ private float miterLimit = 0;
+ private boolean text = false;
+ private int dashOffset = 0;
+ private int[] dashArray = new int[0];
+ private AffineTransform transform = new AffineTransform();
+ private float fontSize = 0;
+ private String fontName = "";
+ private Shape clip = null;
+ private PDFGState gstate = null;
ArrayList stateStack = new ArrayList();
@@ -132,7 +132,7 @@ public class PDFState {
while(stateStack.size() > pos + 1) {
stateStack.remove(stateStack.size() - 1);
}
- if(stateStack.size() > pos) {
+ if (stateStack.size() > pos) {
pop();
}
}
@@ -142,7 +142,7 @@ public class PDFState {
}
public boolean setColor(Color col) {
- if(!col.equals(color)) {
+ if (!col.equals(color)) {
color = col;
return true;
}
@@ -150,7 +150,7 @@ public class PDFState {
}
public boolean setBackColor(Color col) {
- if(!col.equals(backcolor)) {
+ if (!col.equals(backcolor)) {
backcolor = col;
return true;
}
@@ -158,12 +158,12 @@ public class PDFState {
}
public boolean setPaint(Paint p) {
- if(paint == null) {
- if(p != null) {
+ if (paint == null) {
+ if (p != null) {
paint = p;
return true;
}
- } else if(!paint.equals(p)) {
+ } else if (!paint.equals(p)) {
paint = p;
return true;
}
@@ -174,11 +174,11 @@ public class PDFState {
* For clips it can start a new state
*/
public boolean checkClip(Shape cl) {
- if(clip == null) {
- if(cl != null) {
+ if (clip == null) {
+ if (cl != null) {
return true;
}
- } else if(!new Area(clip).equals(new Area(cl))) {
+ } else if (!new Area(clip).equals(new Area(cl))) {
return true;
}
return false;
@@ -215,7 +215,7 @@ public class PDFState {
public AffineTransform getTransform() {
AffineTransform tf;
AffineTransform at = new AffineTransform();
- for(Iterator iter = stateStack.iterator(); iter.hasNext(); ) {
+ for (Iterator iter = stateStack.iterator(); iter.hasNext();) {
HashMap map = (HashMap)iter.next();
tf = (AffineTransform)map.get(TRANSFORM);
at.concatenate(tf);
@@ -238,14 +238,14 @@ public class PDFState {
PDFGState state;
PDFGState newstate = new PDFGState(0);
newstate.addValues(defaultState);
- for(Iterator iter = stateStack.iterator(); iter.hasNext(); ) {
+ for (Iterator iter = stateStack.iterator(); iter.hasNext(); ) {
HashMap map = (HashMap)iter.next();
state = (PDFGState)map.get(GSTATE);
- if(state != null) {
+ if (state != null) {
newstate.addValues(state);
}
}
- if(gstate != null) {
+ if (gstate != null) {
newstate.addValues(gstate);
}
diff --git a/src/org/apache/fop/pdf/PDFT1Stream.java b/src/org/apache/fop/pdf/PDFT1Stream.java
index c0f62380f..39f9d8b2d 100644
--- a/src/org/apache/fop/pdf/PDFT1Stream.java
+++ b/src/org/apache/fop/pdf/PDFT1Stream.java
@@ -17,7 +17,7 @@ public class PDFT1Stream extends PDFStream {
origLength = len;
}
- private final static boolean byteCmp(byte[] src, int offset, byte[] cmp) {
+ private static final boolean byteCmp(byte[] src, int offset, byte[] cmp) {
boolean ret = true;
for (int i = 0; ret == true && i < cmp.length; i++) {
// System.out.println("Compare: ");