[FOray-commit] SF.net SVN: foray: [7916] trunk/foray/foray-pdf/src/java/org/foray/pdf
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2006-09-05 23:07:34
|
Revision: 7916
http://svn.sourceforge.net/foray/?rev=7916&view=rev
Author: victormote
Date: 2006-09-05 16:07:25 -0700 (Tue, 05 Sep 2006)
Log Message:
-----------
Conform to standard class-ordering scheme, as reported by checkstyle.
Modified Paths:
--------------
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFCMap.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDocument.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFEncryption.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFont.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFDocumentGraphics2D.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFCMap.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFCMap.java 2006-09-05 22:56:23 UTC (rev 7915)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFCMap.java 2006-09-05 23:07:25 UTC (rev 7916)
@@ -104,24 +104,24 @@
public static final String Identity_V = "Identity-V";
/**
- * /CMapName attribute, one of the predefined constants
+ * horizontal writing direction
*/
- protected String name;
+ public static final byte WMODE_HORIZONTAL = 0;
/**
- * /CIDSystemInfo attribute
+ * vertical writing direction
*/
- protected PDFCIDSystemInfo sysInfo;
+ public static final byte WMODE_VERTICAL = 1;
/**
- * horizontal writing direction
+ * /CMapName attribute, one of the predefined constants
*/
- public static final byte WMODE_HORIZONTAL = 0;
+ protected String name;
/**
- * vertical writing direction
+ * /CIDSystemInfo attribute
*/
- public static final byte WMODE_VERTICAL = 1;
+ protected PDFCIDSystemInfo sysInfo;
/**
* font's writing direction
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDocument.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDocument.java 2006-09-05 22:56:23 UTC (rev 7915)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDocument.java 2006-09-05 23:07:25 UTC (rev 7916)
@@ -74,12 +74,12 @@
* bytes. */
public static final String ENCODING = "ISO-8859-1";
+ private static final Integer locationPlaceholder = new Integer(0);
+
/** The version of PDF that this document should create when it is
* written. */
private int pdfVersion = PDF_VERSION_1_6;
- private static final Integer locationPlaceholder = new Integer(0);
-
/**
* the current character position
*/
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFEncryption.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFEncryption.java 2006-09-05 22:56:23 UTC (rev 7915)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFEncryption.java 2006-09-05 23:07:25 UTC (rev 7916)
@@ -90,16 +90,6 @@
}
- static final char [] pad = {
- 0x28, 0xBF, 0x4E, 0x5E, 0x4E, 0x75, 0x8A, 0x41,
- 0x64, 0x00, 0x4E, 0x56, 0xFF, 0xFA, 0x01, 0x08,
- 0x2E, 0x2E, 0x00, 0xB6, 0xD0, 0x68, 0x3E, 0x80,
- 0x2F, 0x0C, 0xA9, 0xFE, 0x64, 0x53, 0x69, 0x7A };
- static final char[] digits = {'0','1','2','3','4','5','6','7',
- '8','9','A','B','C','D','E','F'};
-
- /** Value of PRINT permission
- */
public static final int PERMISSION_PRINT = 4;
/** Value of content editting permission
*/
@@ -111,6 +101,16 @@
*/
public static final int PERMISSION_EDIT_ANNOTATIONS = 32;
+ static final char [] pad = {
+ 0x28, 0xBF, 0x4E, 0x5E, 0x4E, 0x75, 0x8A, 0x41,
+ 0x64, 0x00, 0x4E, 0x56, 0xFF, 0xFA, 0x01, 0x08,
+ 0x2E, 0x2E, 0x00, 0xB6, 0xD0, 0x68, 0x3E, 0x80,
+ 0x2F, 0x0C, 0xA9, 0xFE, 0x64, 0x53, 0x69, 0x7A };
+ static final char[] digits = {'0','1','2','3','4','5','6','7',
+ '8','9','A','B','C','D','E','F'};
+
+ /** Value of PRINT permission
+ */
// Encryption tools
MessageDigest digest = null;
Cipher cipher = null;
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFont.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFont.java 2006-09-05 22:56:23 UTC (rev 7915)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFont.java 2006-09-05 23:07:25 UTC (rev 7916)
@@ -61,10 +61,10 @@
/* The order is important here. */
new String[] {"Type0", "Type1", "MMType1", "Type3", "TrueType" };
+ protected FontUse fsFont;
+
private byte fontSubType = -1;
- protected FontUse fsFont;
-
/**
* Local cache (for performance) of the font system's helper class for PDF
* output.
@@ -81,12 +81,12 @@
* a PDFStream containing a CMap in a Type0 font.
* If <code>null</code> then not written out in the PDF.
*/
- protected PDFEncoding pdfEncoding;
+ private PDFEncoding pdfEncoding;
/**
* descriptor of font metrics
*/
- protected PDFFontDescriptor descriptor = null;
+ private PDFFontDescriptor descriptor = null;
/**
* Create the /Font object
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFDocumentGraphics2D.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFDocumentGraphics2D.java 2006-09-05 22:56:23 UTC (rev 7915)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFDocumentGraphics2D.java 2006-09-05 23:07:25 UTC (rev 7916)
@@ -91,6 +91,13 @@
}
+ /**
+ * This constructor supports the create method
+ */
+ public PDFDocumentGraphics2D(final PDFDocumentGraphics2D g) {
+ super(g);
+ }
+
public PDFDocument getPDFDocument() {
return this.pdfDoc;
}
@@ -149,13 +156,6 @@
}
/**
- * This constructor supports the create method
- */
- public PDFDocumentGraphics2D(final PDFDocumentGraphics2D g) {
- super(g);
- }
-
- /**
* Creates a new <code>Graphics</code> object that is
* a copy of this <code>Graphics</code> object.
* @return a new graphics context that is a copy of
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java 2006-09-05 22:56:23 UTC (rev 7915)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java 2006-09-05 23:07:25 UTC (rev 7916)
@@ -98,27 +98,15 @@
* @see org.apache.batik.ext.awt.g2d.AbstractGraphics2D
*/
public class PDFGraphics2D extends AbstractGraphics2D {
- boolean standalone = false;
/**
* the PDF Document being created
*/
protected PDFDocument pdfDoc;
- /**
- * the current annotation list to add annotations to
- */
- PDFAnnotList currentAnnotList = null;
+ protected boolean standalone = false;
- protected org.axsl.fontR.FontUse overrideFont = null;
- protected float overrideFontSize;
-
/**
- * the current stream to add PDF commands to
- */
- StringWriter currentStream = new StringWriter();
-
- /**
* the current (internal) font
*/
protected org.axsl.fontR.FontUse currentFont;
@@ -129,15 +117,33 @@
protected float currentFontSize;
/**
+ * the current stream to add PDF commands to
+ */
+ protected StringWriter currentStream = new StringWriter();
+
+ /**
* the current colour for use in svg
*/
- PDFColor currentColour = new PDFColor(new Color(0, 0, 0));
+ protected PDFColor currentColour = new PDFColor(new Color(0, 0, 0));
+ /**
+ * the current annotation list to add annotations to
+ */
+ protected PDFAnnotList currentAnnotList = null;
+
+ private org.axsl.fontR.FontUse overrideFont = null;
+ private float overrideFontSize;
+
private PDFXObject xObject;
private FontConsumer fontConsumer;
/**
+ * Used to create proper font metrics
+ */
+ private Graphics2D fmg;
+
+ /**
* Create a new PDFGraphics2D with the given pdf document info.
* This is used to create a Graphics object for use inside an already
* existing document.
@@ -160,7 +166,18 @@
transformCoordinates(contentRectangle, svgDocument);
}
+ public PDFGraphics2D(final boolean textAsShapes) {
+ super(textAsShapes);
+ }
+
/**
+ * This constructor supports the create method
+ */
+ public PDFGraphics2D(final PDFGraphics2D g) {
+ super(g);
+ }
+
+ /**
* @param svgDocument
*/
private void transformCoordinates(final Rectangle2D.Float contentRectangle,
@@ -186,10 +203,6 @@
}
}
- public PDFGraphics2D(final boolean textAsShapes) {
- super(textAsShapes);
- }
-
public String getString() {
return currentStream.toString();
}
@@ -205,13 +218,6 @@
}
/**
- * This constructor supports the create method
- */
- public PDFGraphics2D(final PDFGraphics2D g) {
- super(g);
- }
-
- /**
* Creates a new <code>Graphics</code> object that is
* a copy of this <code>Graphics</code> object.
* @return a new graphics context that is a copy of
@@ -1080,11 +1086,6 @@
return new PDFGraphicsConfiguration();
}
- /**
- * Used to create proper font metrics
- */
- private Graphics2D fmg;
-
private void initGraphicalEnvironment() {
try {
final BufferedImage bi = new BufferedImage(1, 1,
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java 2006-09-05 22:56:23 UTC (rev 7915)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java 2006-09-05 23:07:25 UTC (rev 7916)
@@ -59,6 +59,13 @@
*/
public class PDFTextPainter implements TextPainter {
+ /**
+ * Use the stroking text painter to get the bounds and shape.
+ * Also used as a fallback to draw the string with strokes.
+ */
+ private static final TextPainter PROXY_PAINTER =
+ StrokingTextPainter.getInstance();
+
/** A logger for user messages. */
Log logger;
@@ -72,14 +79,6 @@
String fontFamily = null;
/**
- * Use the stroking text painter to get the bounds and shape.
- * Also used as a fallback to draw the string with strokes.
- */
- protected static final TextPainter PROXY_PAINTER =
- StrokingTextPainter.getInstance();
-
-
- /**
* Constructor.
* @param logger A Log instance for logging user messages.
* @param consumer The FontConsumer that should be used for font resolution.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|