You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by sp...@apache.org on 2008/02/14 22:57:53 UTC
svn commit: r627882 [18/41] - in
/xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking: ./
examples/embedding/ examples/embedding/java/embedding/
examples/embedding/java/embedding/intermediate/ examples/embedding/xml/xml/
examples/fo/ examples/...
Modified: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/svg/PDFGraphics2D.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/svg/PDFGraphics2D.java?rev=627882&r1=627881&r2=627882&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/svg/PDFGraphics2D.java (original)
+++ xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/svg/PDFGraphics2D.java Thu Feb 14 13:55:44 2008
@@ -41,7 +41,6 @@
import java.awt.image.BufferedImage;
import java.awt.image.ColorModel;
import java.awt.image.DataBuffer;
-import java.awt.image.DataBufferInt;
import java.awt.image.DirectColorModel;
import java.awt.image.ImageObserver;
import java.awt.image.Raster;
@@ -62,13 +61,21 @@
import org.apache.batik.ext.awt.RenderingHintsKeyExt;
import org.apache.batik.gvt.GraphicsNode;
import org.apache.batik.gvt.PatternPaint;
+
+import org.apache.xmlgraphics.image.loader.ImageInfo;
+import org.apache.xmlgraphics.image.loader.ImageSize;
+import org.apache.xmlgraphics.image.loader.impl.ImageRawCCITTFax;
+import org.apache.xmlgraphics.image.loader.impl.ImageRawJPEG;
+import org.apache.xmlgraphics.image.loader.impl.ImageRendered;
+import org.apache.xmlgraphics.java2d.AbstractGraphics2D;
+import org.apache.xmlgraphics.java2d.GraphicContext;
+
import org.apache.fop.fonts.CIDFont;
import org.apache.fop.fonts.Font;
import org.apache.fop.fonts.FontInfo;
import org.apache.fop.fonts.FontSetup;
import org.apache.fop.fonts.FontTriplet;
import org.apache.fop.fonts.LazyFont;
-import org.apache.fop.image.JpegImage;
import org.apache.fop.pdf.BitmapImage;
import org.apache.fop.pdf.PDFAnnotList;
import org.apache.fop.pdf.PDFColor;
@@ -76,9 +83,9 @@
import org.apache.fop.pdf.PDFDeviceColorSpace;
import org.apache.fop.pdf.PDFDocument;
import org.apache.fop.pdf.PDFGState;
+import org.apache.fop.pdf.PDFImage;
import org.apache.fop.pdf.PDFImageXObject;
import org.apache.fop.pdf.PDFLink;
-import org.apache.fop.pdf.PDFName;
import org.apache.fop.pdf.PDFNumber;
import org.apache.fop.pdf.PDFPattern;
import org.apache.fop.pdf.PDFResourceContext;
@@ -86,10 +93,10 @@
import org.apache.fop.pdf.PDFState;
import org.apache.fop.pdf.PDFText;
import org.apache.fop.pdf.PDFXObject;
-import org.apache.fop.render.pdf.FopPDFImage;
+import org.apache.fop.render.pdf.ImageRawCCITTFaxAdapter;
+import org.apache.fop.render.pdf.ImageRawJPEGAdapter;
+import org.apache.fop.render.pdf.ImageRenderedAdapter;
import org.apache.fop.util.ColorExt;
-import org.apache.xmlgraphics.java2d.AbstractGraphics2D;
-import org.apache.xmlgraphics.java2d.GraphicContext;
/**
* PDF Graphics 2D.
@@ -136,10 +143,10 @@
protected int baseLevel = 0;
/**
- * The count of JPEG images added to document so they recieve
+ * The count of natively handled images added to document so they receive
* unique keys.
*/
- protected int[] jpegCount = {0};
+ protected int nativeCount = 0;
/**
* The current font information.
@@ -225,7 +232,7 @@
this.pageRef = g.pageRef;
this.graphicsState = g.graphicsState;
this.currentStream = g.currentStream;
- this.jpegCount = g.jpegCount;
+ this.nativeCount = g.nativeCount;
this.outputStream = g.outputStream;
this.ovFontState = g.ovFontState;
}
@@ -344,6 +351,14 @@
+ PDFNumber.doubleOut(matrix[5], DEC) + " cm\n");
}
+ private void concatMatrix(AffineTransform transform) {
+ if (!transform.isIdentity()) {
+ double[] matrix = new double[6];
+ transform.getMatrix(matrix);
+ concatMatrix(matrix);
+ }
+ }
+
/**
* This is mainly used for shading patterns which use the document-global coordinate system
* instead of the local one.
@@ -386,44 +401,41 @@
}
/**
- * Add a JPEG image directly to the PDF document.
- * This is used by the PDFImageElementBridge to draw a JPEG
- * directly into the pdf document rather than converting the image into
+ * Add a natively handled image directly to the PDF document.
+ * This is used by the PDFImageElementBridge to draw a natively handled image
+ * (like JPEG or CCITT images)
+ * directly into the PDF document rather than converting the image into
* a bitmap and increasing the size.
*
- * @param jpeg the jpeg image to draw
+ * @param image the image to draw
* @param x the x position
* @param y the y position
* @param width the width to draw the image
* @param height the height to draw the image
*/
- public void addJpegImage(JpegImage jpeg, float x, float y,
+ void addNativeImage(org.apache.xmlgraphics.image.loader.Image image, float x, float y,
float width, float height) {
preparePainting();
- // Need to include hash code as when invoked from FO you
- // may have several 'independent' PDFGraphics2D so the
- // count is not enough.
- String key = "__AddJPEG_" + hashCode() + "_" + jpegCount[0];
- jpegCount[0]++;
- FopPDFImage fopimage = new FopPDFImage(jpeg, key);
- PDFName imageName = this.pdfDoc.addImage(resourceContext,
- fopimage).getName();
- AffineTransform at = getTransform();
- double[] matrix = new double[6];
- at.getMatrix(matrix);
- currentStream.write("q\n");
- if (!at.isIdentity()) {
- concatMatrix(matrix);
+ String key = image.getInfo().getOriginalURI();
+ if (key == null) {
+ // Need to include hash code as when invoked from FO you
+ // may have several 'independent' PDFGraphics2D so the
+ // count is not enough.
+ key = "__AddNative_" + hashCode() + "_" + nativeCount;
+ nativeCount++;
}
- Shape imclip = getClip();
- writeClip(imclip);
-
- currentStream.write("" + width + " 0 0 "
- + (-height) + " "
- + x + " "
- + (y + height) + " cm\n"
- + imageName + " Do\nQ\n");
-
+
+ PDFImage pdfImage;
+ if (image instanceof ImageRawJPEG) {
+ pdfImage = new ImageRawJPEGAdapter((ImageRawJPEG)image, key);
+ } else if (image instanceof ImageRawCCITTFax) {
+ pdfImage = new ImageRawCCITTFaxAdapter((ImageRawCCITTFax)image, key);
+ } else {
+ throw new IllegalArgumentException(
+ "Unsupported Image subclass: " + image.getClass().getName());
+ }
+
+ PDFXObject xObject = this.pdfDoc.addImage(resourceContext, pdfImage);
if (outputStream != null) {
try {
this.pdfDoc.output(outputStream);
@@ -431,6 +443,10 @@
// ignore exception, will be thrown again later
}
}
+
+ AffineTransform at = new AffineTransform();
+ at.translate(x, y);
+ useXObject(xObject, at, width, height);
}
/**
@@ -477,40 +493,7 @@
BufferedImage.TYPE_INT_ARGB);
}
- /**
- * Draws as much of the specified image as has already been scaled
- * to fit inside the specified rectangle.
- * <p>
- * The image is drawn inside the specified rectangle of this
- * graphics context's coordinate space, and is scaled if
- * necessary. Transparent pixels do not affect whatever pixels
- * are already there.
- * <p>
- * This method returns immediately in all cases, even if the
- * entire image has not yet been scaled, dithered, and converted
- * for the current output device.
- * If the current output representation is not yet complete, then
- * <code>drawImage</code> returns <code>false</code>. As more of
- * the image becomes available, the process that draws the image notifies
- * the image observer by calling its <code>imageUpdate</code> method.
- * <p>
- * A scaled version of an image will not necessarily be
- * available immediately just because an unscaled version of the
- * image has been constructed for this output device. Each size of
- * the image may be cached separately and generated from the original
- * data in a separate image production sequence.
- * @param img the specified image to be drawn.
- * @param x the <i>x</i> coordinate.
- * @param y the <i>y</i> coordinate.
- * @param width the width of the rectangle.
- * @param height the height of the rectangle.
- * @param observer object to be notified as more of
- * the image is converted.
- * @return true if the image was drawn
- * @see java.awt.Image
- * @see java.awt.image.ImageObserver
- * @see java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)
- */
+ /** {@inheritDoc} */
public boolean drawImage(Image img, int x, int y, int width, int height,
ImageObserver observer) {
preparePainting();
@@ -518,8 +501,9 @@
// the pdf document. If so, we just reuse the reference;
// otherwise we have to build a FopImage and add it to the pdf
// document
- PDFXObject imageInfo = pdfDoc.getXObject("TempImage:" + img.toString());
- if (imageInfo == null) {
+ String key = "TempImage:" + img.toString();
+ PDFXObject xObject = pdfDoc.getXObject(key);
+ if (xObject == null) {
// OK, have to build and add a PDF image
Dimension size = new Dimension(width, height);
@@ -538,92 +522,14 @@
}
g.dispose();
- final byte[] result = new byte[buf.getWidth() * buf.getHeight() * 3 /*for RGB*/];
- byte[] mask = new byte[buf.getWidth() * buf.getHeight()];
- boolean hasMask = false;
- //boolean binaryMask = true;
-
- Raster raster = buf.getData();
- DataBuffer bd = raster.getDataBuffer();
-
- int count = 0;
- int maskpos = 0;
- int[] iarray;
- int i, j, val, alpha;
- switch (bd.getDataType()) {
- case DataBuffer.TYPE_INT:
- int[][] idata = ((DataBufferInt)bd).getBankData();
- for (i = 0; i < idata.length; i++) {
- iarray = idata[i];
- for (j = 0; j < iarray.length; j++) {
- val = iarray[j];
- alpha = val >>> 24;
- mask[maskpos++] = (byte)(alpha & 0xFF);
- if (alpha != 255) {
- hasMask = true;
- }
- result[count++] = (byte)((val >> 16) & 0xFF);
- result[count++] = (byte)((val >> 8) & 0xFF);
- result[count++] = (byte)((val) & 0xFF);
- }
- }
- break;
- default:
- // error
- break;
- }
- String ref = null;
- if (hasMask) {
- // if the mask is binary then we could convert it into a bitmask
- BitmapImage fopimg = new BitmapImage("TempImageMask:"
- + img.toString(), buf.getWidth(),
- buf.getHeight(), mask, null);
- fopimg.setColorSpace(new PDFDeviceColorSpace(PDFDeviceColorSpace.DEVICE_GRAY));
- PDFImageXObject xobj = pdfDoc.addImage(resourceContext, fopimg);
- ref = xobj.referencePDF();
-
- if (outputStream != null) {
- try {
- this.pdfDoc.output(outputStream);
- } catch (IOException ioe) {
- // ignore exception, will be thrown again later
- }
- }
- } else {
- mask = null;
- }
-
- BitmapImage fopimg = new BitmapImage("TempImage:"
- + img.toString(), buf.getWidth(),
- buf.getHeight(), result, ref);
- imageInfo = pdfDoc.addImage(resourceContext, fopimg);
- //int xObjectNum = imageInfo.getXNumber();
-
- if (outputStream != null) {
- try {
- this.pdfDoc.output(outputStream);
- } catch (IOException ioe) {
- // ignore exception, will be thrown again later
- }
- }
+ xObject = addRenderedImage(key, buf);
} else {
- resourceContext.getPDFResources().addXObject(imageInfo);
+ resourceContext.getPDFResources().addXObject(xObject);
}
- // now do any transformation required and add the actual image
- // placement instance
- AffineTransform at = getTransform();
- double[] matrix = new double[6];
- at.getMatrix(matrix);
- currentStream.write("q\n");
- if (!at.isIdentity()) {
- concatMatrix(matrix);
- }
- Shape imclip = getClip();
- writeClip(imclip);
- currentStream.write("" + width + " 0 0 " + (-height) + " " + x
- + " " + (y + height) + " cm\n"
- + imageInfo.getName() + " Do\nQ\n");
+ AffineTransform at = new AffineTransform();
+ at.translate(x, y);
+ useXObject(xObject, at, width, height);
return true;
}
@@ -1325,63 +1231,61 @@
}
}
- /**
- * Renders a {@link RenderedImage},
- * applying a transform from image
- * space into user space before drawing.
- * The transformation from user space into device space is done with
- * the current <code>Transform</code> in the <code>Graphics2D</code>.
- * The specified transformation is applied to the image before the
- * transform attribute in the <code>Graphics2D</code> context is applied.
- * The rendering attributes applied include the <code>Clip</code>,
- * <code>Transform</code>, and <code>Composite</code> attributes. Note
- * that no rendering is done if the specified transform is
- * noninvertible.
- * @param img the image to be rendered
- * @param xform the transformation from image space into user space
- * @see #transform
- * @see #setTransform
- * @see #setComposite
- * @see #clip
- * @see #setClip
- */
+ /** {@inheritDoc} */
public void drawRenderedImage(RenderedImage img, AffineTransform xform) {
- //NYI
+ String key = "TempImage:" + img.toString();
+ drawInnerRenderedImage(key, img, xform);
}
- /**
- * Renders a
- * {@link RenderableImage},
- * applying a transform from image space into user space before drawing.
- * The transformation from user space into device space is done with
- * the current <code>Transform</code> in the <code>Graphics2D</code>.
- * The specified transformation is applied to the image before the
- * transform attribute in the <code>Graphics2D</code> context is applied.
- * The rendering attributes applied include the <code>Clip</code>,
- * <code>Transform</code>, and <code>Composite</code> attributes. Note
- * that no rendering is done if the specified transform is
- * noninvertible.
- * <p>
- * Rendering hints set on the <code>Graphics2D</code> object might
- * be used in rendering the <code>RenderableImage</code>.
- * If explicit control is required over specific hints recognized by a
- * specific <code>RenderableImage</code>, or if knowledge of which hints
- * are used is required, then a <code>RenderedImage</code> should be
- * obtained directly from the <code>RenderableImage</code>
- * and rendered using
- * {@link #drawRenderedImage(RenderedImage, AffineTransform) drawRenderedImage}.
- * @param img the image to be rendered
- * @param xform the transformation from image space into user space
- * @see #transform
- * @see #setTransform
- * @see #setComposite
- * @see #clip
- * @see #setClip
- * @see #drawRenderedImage
- */
+ /** {@inheritDoc} */
+ public void drawInnerRenderedImage(String key, RenderedImage img, AffineTransform xform) {
+ preparePainting();
+ PDFXObject xObject = pdfDoc.getXObject(key);
+ if (xObject == null) {
+ xObject = addRenderedImage(key, img);
+ } else {
+ resourceContext.getPDFResources().addXObject(xObject);
+ }
+
+ useXObject(xObject, xform, img.getWidth(), img.getHeight());
+ }
+
+ private void useXObject(PDFXObject xObject, AffineTransform xform, float width, float height) {
+ // now do any transformation required and add the actual image
+ // placement instance
+ currentStream.write("q\n");
+ concatMatrix(getTransform());
+ Shape imclip = getClip();
+ writeClip(imclip);
+ concatMatrix(xform);
+ String w = PDFNumber.doubleOut(width, DEC);
+ String h = PDFNumber.doubleOut(height, DEC);
+ currentStream.write("" + w + " 0 0 -" + h + " 0 " + h + " cm\n"
+ + xObject.getName() + " Do\nQ\n");
+ }
+
+ private PDFXObject addRenderedImage(String key, RenderedImage img) {
+ ImageInfo info = new ImageInfo(null, "image/unknown");
+ ImageSize size = new ImageSize(img.getWidth(), img.getHeight(), 72);
+ info.setSize(size);
+ ImageRendered imgRend = new ImageRendered(info, img, null);
+ ImageRenderedAdapter adapter = new ImageRenderedAdapter(imgRend, key);
+ PDFXObject xObject = pdfDoc.addImage(resourceContext, adapter);
+ if (outputStream != null) {
+ try {
+ this.pdfDoc.output(outputStream);
+ } catch (IOException ioe) {
+ // ignore exception, will be thrown again later
+ }
+ }
+ return xObject;
+ }
+
+ /** {@inheritDoc} */
public void drawRenderableImage(RenderableImage img,
AffineTransform xform) {
- //NYI
+ //TODO Check if this is good enough
+ drawRenderedImage(img.createDefaultRendering(), xform);
}
/**
Propchange: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/svg/PDFGraphicsConfiguration.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Thu Feb 14 13:55:44 2008
@@ -1 +1 @@
-Author Date Id Revision
+Id
Modified: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/svg/PDFImageElementBridge.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/svg/PDFImageElementBridge.java?rev=627882&r1=627881&r2=627882&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/svg/PDFImageElementBridge.java (original)
+++ xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/svg/PDFImageElementBridge.java Thu Feb 14 13:55:44 2008
@@ -19,24 +19,29 @@
package org.apache.fop.svg;
-import org.apache.batik.bridge.SVGImageElementBridge;
-
-import java.awt.Shape;
import java.awt.Graphics2D;
+import java.awt.Shape;
import java.awt.geom.Rectangle2D;
-import java.io.BufferedInputStream;
-import java.io.InputStream;
import org.w3c.dom.Element;
+import org.w3c.dom.svg.SVGDocument;
import org.apache.batik.bridge.BridgeContext;
+import org.apache.batik.bridge.SVGImageElementBridge;
import org.apache.batik.gvt.AbstractGraphicsNode;
import org.apache.batik.gvt.GraphicsNode;
import org.apache.batik.util.ParsedURL;
-import org.apache.fop.image.JpegImage;
-import org.apache.fop.image.FopImage;
-import org.apache.fop.image.analyser.ImageReaderFactory;
+import org.apache.xmlgraphics.image.loader.Image;
+import org.apache.xmlgraphics.image.loader.ImageException;
+import org.apache.xmlgraphics.image.loader.ImageFlavor;
+import org.apache.xmlgraphics.image.loader.ImageInfo;
+import org.apache.xmlgraphics.image.loader.ImageManager;
+import org.apache.xmlgraphics.image.loader.ImageSessionContext;
+import org.apache.xmlgraphics.image.loader.impl.ImageGraphics2D;
+import org.apache.xmlgraphics.image.loader.impl.ImageRawCCITTFax;
+import org.apache.xmlgraphics.image.loader.impl.ImageRawJPEG;
+import org.apache.xmlgraphics.image.loader.impl.ImageXMLDOM;
/**
* Bridge class for the <image> element when jpeg images.
@@ -50,6 +55,11 @@
*/
public PDFImageElementBridge() { }
+ private final ImageFlavor[] supportedFlavors = new ImageFlavor[]
+ {ImageFlavor.RAW_JPEG,
+ ImageFlavor.RAW_CCITTFAX,
+ ImageFlavor.GRAPHICS2D,
+ ImageFlavor.XML_DOM};
/**
* Create the raster image node.
* THis checks if it is a jpeg file and creates a jpeg node
@@ -60,110 +70,120 @@
* @return a new graphics node
*/
protected GraphicsNode createImageGraphicsNode
- (BridgeContext ctx, Element imageElement, ParsedURL purl) {
+ (BridgeContext ctx, Element imageElement, ParsedURL purl) {
+ PDFBridgeContext pdfCtx = (PDFBridgeContext)ctx;
+
+ ImageManager manager = pdfCtx.getImageManager();
+ ImageSessionContext sessionContext = pdfCtx.getImageSessionContext();
try {
- InputStream is = purl.openStream();
- if (!is.markSupported()) {
- is = new BufferedInputStream(is, 1024);
- }
+ ImageInfo info = manager.getImageInfo(purl.toString(), sessionContext);
+ Image image = manager.getImage(info, supportedFlavors, sessionContext);
- is.mark(3);
- byte [] data = new byte[3];
- is.read(data);
- is.reset();
- if ((data[0] == (byte)0xFF)
- && (data[1] == (byte)0xD8)
- && (data[2] == (byte)0xFF)) {
- FopImage.ImageInfo ii = ImageReaderFactory.make
- (purl.toString(), is, null);
- JpegImage jpeg = new JpegImage(ii);
- jpeg.load(FopImage.ORIGINAL_DATA);
- PDFJpegNode node = new PDFJpegNode(jpeg, ctx, imageElement, purl);
-
- Rectangle2D imgBounds = getImageBounds(ctx, imageElement);
- Rectangle2D bounds = node.getPrimitiveBounds();
- float [] vb = new float[4];
- vb[0] = 0; // x
- vb[1] = 0; // y
- vb[2] = (float) bounds.getWidth(); // width
- vb[3] = (float) bounds.getHeight(); // height
-
- // handles the 'preserveAspectRatio', 'overflow' and 'clip'
- // and sets the appropriate AffineTransform to the image node
- initializeViewport(ctx, imageElement, node, vb, imgBounds);
- return node;
+ //TODO color profile overrides aren't handled, yet!
+ //ICCColorSpaceExt colorspaceOverride = extractColorSpace(e, ctx);
+ AbstractGraphicsNode specializedNode = null;
+ if (image instanceof ImageXMLDOM) {
+ ImageXMLDOM xmlImage = (ImageXMLDOM)image;
+ if (xmlImage.getDocument() instanceof SVGDocument) {
+ return createSVGImageNode(ctx, imageElement,
+ (SVGDocument)xmlImage.getDocument());
+ } else {
+ //Convert image to Graphics2D
+ image = manager.convertImage(xmlImage,
+ new ImageFlavor[] {ImageFlavor.GRAPHICS2D});
+ }
+ }
+ if (image instanceof ImageRawJPEG) {
+ specializedNode = new LoaderImageNode(image, ctx, imageElement, purl);
+ } else if (image instanceof ImageRawCCITTFax) {
+ specializedNode = new LoaderImageNode(image, ctx, imageElement, purl);
+ } else if (image instanceof ImageGraphics2D) {
+ ImageGraphics2D g2dImage = (ImageGraphics2D)image;
+ specializedNode = new Graphics2DNode(g2dImage);
+ } else {
+ ctx.getUserAgent().displayError(
+ new ImageException("Cannot convert an image to a usable format: " + purl));
}
- } catch (Exception ex) {
- //TODO Handle this exception
+
+ Rectangle2D imgBounds = getImageBounds(ctx, imageElement);
+ Rectangle2D bounds = specializedNode.getPrimitiveBounds();
+ float [] vb = new float[4];
+ vb[0] = 0; // x
+ vb[1] = 0; // y
+ vb[2] = (float) bounds.getWidth(); // width
+ vb[3] = (float) bounds.getHeight(); // height
+
+ // handles the 'preserveAspectRatio', 'overflow' and 'clip'
+ // and sets the appropriate AffineTransform to the image node
+ initializeViewport(ctx, imageElement, specializedNode, vb, imgBounds);
+ return specializedNode;
+ } catch (Exception e) {
+ ctx.getUserAgent().displayError(e);
}
-
+
return superCreateGraphicsNode(ctx, imageElement, purl);
}
/**
+ * Calls the superclass' createImageGraphicNode() method to create the normal GraphicsNode.
+ * @param ctx the bridge context
+ * @param imageElement the image element
+ * @param purl the parsed URL
+ * @return the newly created graphics node
* @see org.apache.batik.bridge.SVGImageElementBridge#createGraphicsNode(BridgeContext, Element)
*/
protected GraphicsNode superCreateGraphicsNode
- (BridgeContext ctx, Element imageElement, ParsedURL purl) {
+ (BridgeContext ctx, Element imageElement, ParsedURL purl) {
return super.createImageGraphicsNode(ctx, imageElement, purl);
}
/**
- * A PDF jpeg node.
- * This holds a jpeg image so that it can be drawn into
+ * An image node for natively handled Image instance.
+ * This holds a natively handled image so that it can be drawn into
* the PDFGraphics2D.
*/
- public class PDFJpegNode extends AbstractGraphicsNode {
+ public class LoaderImageNode extends AbstractGraphicsNode {
- private JpegImage jpeg;
+ private Image image;
private BridgeContext ctx;
private Element imageElement;
private ParsedURL purl;
private GraphicsNode origGraphicsNode = null;
/**
- * Create a new pdf jpeg node for drawing jpeg images
- * into pdf graphics.
- * @param j the jpeg image
+ * Create a new image node for drawing natively handled images
+ * into PDF graphics.
+ * @param image the JPEG image
* @param ctx the bridge context
* @param imageElement the SVG image element
* @param purl the URL to the image
*/
- public PDFJpegNode(JpegImage j, BridgeContext ctx,
+ public LoaderImageNode(Image image, BridgeContext ctx,
Element imageElement, ParsedURL purl) {
- this.jpeg = j;
+ this.image = image;
this.ctx = ctx;
this.imageElement = imageElement;
this.purl = purl;
}
- /**
- * Get the outline of this image.
- * @return the outline shape which is the primitive bounds
- */
+ /** {@inheritDoc} */
public Shape getOutline() {
return getPrimitiveBounds();
}
- /**
- * Paint this jpeg image.
- * As this is used for inserting jpeg into pdf
- * it adds the jpeg image to the PDFGraphics2D.
- * @param g2d the graphics to draw the image on
- */
+ /** {@inheritDoc} */
public void primitivePaint(Graphics2D g2d) {
if (g2d instanceof PDFGraphics2D) {
PDFGraphics2D pdfg = (PDFGraphics2D) g2d;
float x = 0;
float y = 0;
try {
- float width = jpeg.getWidth();
- float height = jpeg.getHeight();
- pdfg.addJpegImage(jpeg, x, y, width, height);
+ float width = image.getSize().getWidthPx();
+ float height = image.getSize().getHeightPx();
+ pdfg.addNativeImage(image, x, y, width, height);
} catch (Exception e) {
- //TODO Handle this exception properly
- e.printStackTrace();
+ ctx.getUserAgent().displayError(e);
}
} else {
// Not going directly into PDF so use
@@ -179,40 +199,71 @@
}
}
- /**
- * Get the geometrix bounds of the image.
- * @return the primitive bounds
- */
+ /** {@inheritDoc} */
public Rectangle2D getGeometryBounds() {
return getPrimitiveBounds();
}
- /**
- * Get the primitive bounds of this bridge element.
- * @return the bounds of the jpeg image
- */
+ /** {@inheritDoc} */
public Rectangle2D getPrimitiveBounds() {
- try {
- return new Rectangle2D.Double(0, 0, jpeg.getWidth(),
- jpeg.getHeight());
- } catch (Exception e) {
- //TODO Handle this exception properly
- e.printStackTrace();
- }
- return null;
+ return new Rectangle2D.Double(0, 0,
+ image.getSize().getWidthPx(),
+ image.getSize().getHeightPx());
}
+ /** {@inheritDoc} */
+ public Rectangle2D getSensitiveBounds() {
+ //No interactive features, just return primitive bounds
+ return getPrimitiveBounds();
+ }
+
+ }
+
+ /**
+ * A node that holds a Graphics2D image.
+ */
+ public class Graphics2DNode extends AbstractGraphicsNode {
+
+ private ImageGraphics2D image;
+
/**
- * Returns the bounds of the sensitive area covered by this node,
- * This includes the stroked area but does not include the effects
- * of clipping, masking or filtering.
- * @return the bounds of the sensitive area
+ * Create a new Graphics2D node.
+ * @param g2d the Graphics2D image
*/
+ public Graphics2DNode(ImageGraphics2D g2d) {
+ this.image = g2d;
+ }
+
+ /** {@inheritDoc} */
+ public Shape getOutline() {
+ return getPrimitiveBounds();
+ }
+
+ /** {@inheritDoc} */
+ public void primitivePaint(Graphics2D g2d) {
+ int width = image.getSize().getWidthPx();
+ int height = image.getSize().getHeightPx();
+ Rectangle2D area = new Rectangle2D.Double(0, 0, width, height);
+ image.getGraphics2DImagePainter().paint(g2d, area);
+ }
+
+ /** {@inheritDoc} */
+ public Rectangle2D getGeometryBounds() {
+ return getPrimitiveBounds();
+ }
+
+ /** {@inheritDoc} */
+ public Rectangle2D getPrimitiveBounds() {
+ return new Rectangle2D.Double(0, 0,
+ image.getSize().getWidthPx(),
+ image.getSize().getHeightPx());
+ }
+
+ /** {@inheritDoc} */
public Rectangle2D getSensitiveBounds() {
//No interactive features, just return primitive bounds
return getPrimitiveBounds();
}
}
-
}
Modified: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/svg/PDFTranscoder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/svg/PDFTranscoder.java?rev=627882&r1=627881&r2=627882&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/svg/PDFTranscoder.java (original)
+++ xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/svg/PDFTranscoder.java Thu Feb 14 13:55:44 2008
@@ -23,6 +23,10 @@
import java.io.BufferedOutputStream;
import java.io.IOException;
import java.io.OutputStream;
+import java.io.InputStream;
+
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamSource;
import org.w3c.dom.Document;
import org.w3c.dom.svg.SVGLength;
@@ -41,6 +45,12 @@
import org.apache.batik.transcoder.image.ImageTranscoder;
import org.apache.batik.transcoder.keys.BooleanKey;
import org.apache.batik.transcoder.keys.FloatKey;
+import org.apache.batik.util.ParsedURL;
+
+import org.apache.xmlgraphics.image.loader.ImageContext;
+import org.apache.xmlgraphics.image.loader.ImageManager;
+import org.apache.xmlgraphics.image.loader.ImageSessionContext;
+import org.apache.xmlgraphics.image.loader.impl.AbstractImageSessionContext;
import org.apache.fop.Version;
import org.apache.fop.fonts.FontInfo;
@@ -99,6 +109,9 @@
/** Graphics2D instance that is used to paint to */
protected PDFDocumentGraphics2D graphics = null;
+ private ImageManager imageManager;
+ private ImageSessionContext imageSessionContext;
+
/**
* Constructs a new <tt>PDFTranscoder</tt>.
*/
@@ -141,6 +154,11 @@
graphics.getPDFDocument().getInfo().setProducer("Apache FOP Version "
+ Version.getVersion()
+ ": PDF Transcoder for Batik");
+ if (hints.containsKey(KEY_DEVICE_RESOLUTION)) {
+ graphics.setDeviceDPI(((Float)hints.get(KEY_DEVICE_RESOLUTION)).floatValue());
+ }
+
+ setupImageInfrastructure(uri);
try {
Configuration effCfg = this.cfg;
@@ -196,9 +214,6 @@
//int h = (int)(height + 0.5);
try {
- if (hints.containsKey(KEY_DEVICE_RESOLUTION)) {
- graphics.setDeviceDPI(((Float)hints.get(KEY_DEVICE_RESOLUTION)).floatValue());
- }
OutputStream out = output.getOutputStream();
if (!(out instanceof BufferedOutputStream)) {
out = new BufferedOutputStream(out);
@@ -227,6 +242,39 @@
}
}
+ private void setupImageInfrastructure(final String baseURI) {
+ final ImageContext imageContext = new ImageContext() {
+ public float getSourceResolution() {
+ return 25.4f / userAgent.getPixelUnitToMillimeter();
+ }
+ };
+ this.imageManager = new ImageManager(imageContext);
+ this.imageSessionContext = new AbstractImageSessionContext() {
+
+ public ImageContext getParentContext() {
+ return imageContext;
+ }
+
+ public float getTargetResolution() {
+ return graphics.getDeviceDPI();
+ }
+
+ public Source resolveURI(String uri) {
+ System.out.println("resolve " + uri);
+ try {
+ ParsedURL url = new ParsedURL(baseURI, uri);
+ InputStream in = url.openStream();
+ StreamSource source = new StreamSource(in, url.toString());
+ return source;
+ } catch (IOException ioe) {
+ userAgent.displayError(ioe);
+ return null;
+ }
+ }
+
+ };
+ }
+
/** {@inheritDoc} */
protected BridgeContext createBridgeContext() {
//For compatibility with Batik 1.6
@@ -239,7 +287,8 @@
if (isTextStroked()) {
fontInfo = null;
}
- BridgeContext ctx = new PDFBridgeContext(userAgent, fontInfo);
+ BridgeContext ctx = new PDFBridgeContext(userAgent, fontInfo,
+ this.imageManager, this.imageSessionContext);
return ctx;
}
Propchange: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/tools/anttasks/FileCompare.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Thu Feb 14 13:55:44 2008
@@ -1 +1 @@
-Author Date Id Revision
+Id
Propchange: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/traits/MinOptMax.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Thu Feb 14 13:55:44 2008
@@ -1 +1 @@
-Author Date Id Revision
+Id
Modified: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/CharUtilities.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/CharUtilities.java?rev=627882&r1=627881&r2=627882&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/CharUtilities.java (original)
+++ xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/CharUtilities.java Thu Feb 14 13:55:44 2008
@@ -68,7 +68,10 @@
public static final char ZERO_WIDTH_NOBREAK_SPACE = '\uFEFF';
/** soft hyphen */
public static final char SOFT_HYPHEN = '\u00AD';
-
+ /** missing ideograph */
+ public static final char MISSING_IDEOGRAPH = '\u25A1';
+ /** Unicode value indicating the the character is "not a character". */
+ public static final char NOT_A_CHARACTER = '\uFFFF';
/**
* Utility class: Constructor prevents instantiating when subclassed.
Propchange: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/CharUtilities.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Thu Feb 14 13:55:44 2008
@@ -1 +1 @@
-Author Date Id Revision
+Id
Propchange: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/ColorExt.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/ColorProfileUtil.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/ColorSpaceCache.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/ColorUtil.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/ColorUtil.java?rev=627882&r1=627881&r2=627882&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/ColorUtil.java (original)
+++ xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/ColorUtil.java Thu Feb 14 13:55:44 2008
@@ -22,10 +22,7 @@
import java.awt.Color;
import java.awt.color.ColorSpace;
import java.util.Collections;
-import java.util.LinkedList;
-import java.util.List;
import java.util.Map;
-import java.util.StringTokenizer;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -167,30 +164,28 @@
try {
if (poss != -1 && pose != -1) {
value = value.substring(poss + 1, pose);
- StringTokenizer st = new StringTokenizer(value, ",");
- if (st.hasMoreTokens()) {
- String str = st.nextToken().trim();
- red = Float.parseFloat(str.substring(2)) / 255f;
- }
- if (st.hasMoreTokens()) {
- String str = st.nextToken().trim();
- green = Float.parseFloat(str.substring(2)) / 255f;
- }
- if (st.hasMoreTokens()) {
- String str = st.nextToken().trim();
- blue = Float.parseFloat(str.substring(2)) / 255f;
- } else {
- throw new NumberFormatException();
+ String[] args = value.split(",");
+ if (args.length != 3) {
+ throw new PropertyException(
+ "Invalid number of arguments for a java.awt.Color: " + value);
}
- if ((red < 0.0 || red > 1.0) || (green < 0.0 || green > 1.0)
+
+ red = Float.parseFloat(args[0].trim().substring(2)) / 255f;
+ green = Float.parseFloat(args[1].trim().substring(2)) / 255f;
+ blue = Float.parseFloat(args[2].trim().substring(2)) / 255f;
+ if ((red < 0.0 || red > 1.0)
+ || (green < 0.0 || green > 1.0)
|| (blue < 0.0 || blue > 1.0)) {
throw new PropertyException("Color values out of range");
}
} else {
- throw new NullPointerException();
+ throw new IllegalArgumentException(
+ "Invalid format for a java.awt.Color: " + value);
}
+ } catch (PropertyException pe) {
+ throw pe;
} catch (Exception e) {
- throw new PropertyException("Unknown color format: " + value);
+ throw new PropertyException(e);
}
return new Color(red, green, blue);
}
@@ -210,44 +205,46 @@
int pose = value.indexOf(")");
if (poss != -1 && pose != -1) {
value = value.substring(poss + 1, pose);
- StringTokenizer st = new StringTokenizer(value, ",");
try {
+ String[] args = value.split(",");
+ if (args.length != 3) {
+ throw new PropertyException(
+ "Invalid number of arguments: rgb(" + value + ")");
+ }
float red = 0.0f, green = 0.0f, blue = 0.0f;
- if (st.hasMoreTokens()) {
- String str = st.nextToken().trim();
- if (str.endsWith("%")) {
- red = Float.parseFloat(str.substring(0,
- str.length() - 1)) / 100.0f;
- } else {
- red = Float.parseFloat(str) / 255f;
- }
- }
- if (st.hasMoreTokens()) {
- String str = st.nextToken().trim();
- if (str.endsWith("%")) {
- green = Float.parseFloat(str.substring(0,
- str.length() - 1)) / 100.0f;
- } else {
- green = Float.parseFloat(str) / 255f;
- }
- }
- if (st.hasMoreTokens()) {
- String str = st.nextToken().trim();
- if (str.endsWith("%")) {
- blue = Float.parseFloat(str.substring(0,
- str.length() - 1)) / 100.0f;
- } else {
- blue = Float.parseFloat(str) / 255f;
- }
+ String str = args[0].trim();
+ if (str.endsWith("%")) {
+ red = Float.parseFloat(str.substring(0,
+ str.length() - 1)) / 100f;
+ } else {
+ red = Float.parseFloat(str) / 255f;
}
- if ((red < 0.0 || red > 1.0) || (green < 0.0 || green > 1.0)
+ str = args[1].trim();
+ if (str.endsWith("%")) {
+ green = Float.parseFloat(str.substring(0,
+ str.length() - 1)) / 100f;
+ } else {
+ green = Float.parseFloat(str) / 255f;
+ }
+ str = args[2].trim();
+ if (str.endsWith("%")) {
+ blue = Float.parseFloat(str.substring(0,
+ str.length() - 1)) / 100f;
+ } else {
+ blue = Float.parseFloat(str) / 255f;
+ }
+ if ((red < 0.0 || red > 1.0)
+ || (green < 0.0 || green > 1.0)
|| (blue < 0.0 || blue > 1.0)) {
throw new PropertyException("Color values out of range");
}
parsedColor = new Color(red, green, blue);
+ } catch (PropertyException pe) {
+ //simply re-throw
+ throw pe;
} catch (Exception e) {
- throw new PropertyException(
- "Arguments to rgb() must be [0..255] or [0%..100%]");
+ //wrap in a PropertyException
+ throw new PropertyException(e);
}
} else {
throw new PropertyException("Unknown color format: " + value
@@ -269,29 +266,28 @@
Color parsedColor = null;
try {
int len = value.length();
- if ((len >= 4) && (len <= 5)) {
- // note: divide by 15 so F = FF = 1 and so on
- float red = Integer.parseInt(value.substring(1, 2), 16) / 15f;
- float green = Integer.parseInt(value.substring(2, 3), 16) / 15f;
- float blue = Integer.parseInt(value.substring(3, 4), 16) / 15f;
- float alpha = 1.0f;
- if (len == 5) {
- alpha = Integer.parseInt(value.substring(4), 16) / 15f;
- }
- parsedColor = new Color(red, green, blue, alpha);
+ int alpha;
+ if (len == 5 || len == 9) {
+ alpha = Integer.parseInt(
+ value.substring((len == 5) ? 3 : 7), 16);
+ } else {
+ alpha = 0xFF;
+ }
+ int red = 0, green = 0, blue = 0;
+ if ((len == 4) || (len == 5)) {
+ //multiply by 0x11 = 17 = 255/15
+ red = Integer.parseInt(value.substring(1, 2), 16) * 0x11;
+ green = Integer.parseInt(value.substring(2, 3), 16) * 0x11;
+ blue = Integer.parseInt(value.substring(3, 4), 16) *0X11;
} else if ((len == 7) || (len == 9)) {
- int red = Integer.parseInt(value.substring(1, 3), 16);
- int green = Integer.parseInt(value.substring(3, 5), 16);
- int blue = Integer.parseInt(value.substring(5, 7), 16);
- int alpha = 255;
- if (len == 9) {
- alpha = Integer.parseInt(value.substring(7), 16);
- }
- parsedColor = new Color(red, green, blue, alpha);
+ red = Integer.parseInt(value.substring(1, 3), 16);
+ green = Integer.parseInt(value.substring(3, 5), 16);
+ blue = Integer.parseInt(value.substring(5, 7), 16);
} else {
throw new NumberFormatException();
}
- } catch (NumberFormatException e) {
+ parsedColor = new Color(red, green, blue, alpha);
+ } catch (Exception e) {
throw new PropertyException("Unknown color format: " + value
+ ". Must be #RGB. #RGBA, #RRGGBB, or #RRGGBBAA");
}
@@ -311,79 +307,65 @@
int poss = value.indexOf("(");
int pose = value.indexOf(")");
if (poss != -1 && pose != -1) {
- value = value.substring(poss + 1, pose);
- StringTokenizer st = new StringTokenizer(value, ",");
+ String[] args = value.substring(poss + 1, pose).split(",");
+
try {
- float red = 0.0f, green = 0.0f, blue = 0.0f;
- if (st.hasMoreTokens()) {
- String str = st.nextToken().trim();
- red = Float.parseFloat(str);
- }
- if (st.hasMoreTokens()) {
- String str = st.nextToken().trim();
- green = Float.parseFloat(str);
- }
- if (st.hasMoreTokens()) {
- String str = st.nextToken().trim();
- blue = Float.parseFloat(str);
+ if (args.length < 5) {
+ throw new PropertyException("Too few arguments for rgb-icc() function");
}
- /* Verify rgb replacement arguments */
- if ((red < 0.0 || red > 1.0)
- || (green < 0.0 || green > 1.0)
- || (blue < 0.0 || blue > 1.0)) {
- throw new PropertyException("Color values out of range");
- }
/* Get and verify ICC profile name */
- String iccProfileName = null;
- if (st.hasMoreTokens()) {
- iccProfileName = st.nextToken().trim();
- }
- if (iccProfileName == null || iccProfileName.length() == 0) {
+ String iccProfileName = args[3].trim();
+ if (iccProfileName == null || "".equals(iccProfileName)) {
throw new PropertyException("ICC profile name missing");
}
/* Get and verify ICC profile source */
- String iccProfileSrc = null;
- if (st.hasMoreTokens()) {
- iccProfileSrc = st.nextToken().trim();
- // Strip quotes
- iccProfileSrc = iccProfileSrc.substring(1, iccProfileSrc.length() - 1);
- }
- if (iccProfileSrc == null || iccProfileSrc.length() == 0) {
+ String iccProfileSrc = args[4].trim();
+ if (iccProfileSrc == null || "".equals(iccProfileSrc)) {
throw new PropertyException("ICC profile source missing");
}
/* ICC profile arguments */
- List iccArgList = new LinkedList();
- while (st.hasMoreTokens()) {
- String str = st.nextToken().trim();
- iccArgList.add(new Float(str));
- }
- /* Copy ICC profile arguments from list to array */
- float[] iccComponents = new float[iccArgList.size()];
- for (int ix = 0; ix < iccArgList.size(); ix++) {
- iccComponents[ix] = ((Float)iccArgList.get(ix)).floatValue();
+ float[] iccComponents = new float[args.length - 5];
+ for (int ix = 4; ++ix < args.length;) {
+ iccComponents[ix - 5] = Float.parseFloat(args[ix].trim());
}
/* Ask FOP factory to get ColorSpace for the specified ICC profile source */
ColorSpace colorSpace = (foUserAgent != null
? foUserAgent.getFactory().getColorSpace(
foUserAgent.getBaseURL(), iccProfileSrc) : null);
+
+ float red = 0, green = 0, blue = 0;
+ red = Float.parseFloat(args[0].trim());
+ green = Float.parseFloat(args[1].trim());
+ blue = Float.parseFloat(args[2].trim());;
+ /* Verify rgb replacement arguments */
+ if ((red < 0 || red > 255)
+ || (green < 0 || green > 255)
+ || (blue < 0 || blue > 255)) {
+ throw new PropertyException("Color values out of range. "
+ + "Arguments to rgb-icc() must be [0..255] or [0%..100%]");
+ }
+
if (colorSpace != null) {
// ColorSpace available - create ColorExt (keeps track of replacement rgb
// values for possible later colorTOsRGBString call
- parsedColor = ColorExt.createFromFoRgbIcc(red, green, blue,
+ parsedColor = ColorExt.createFromFoRgbIcc(red/255, green/255, blue/255,
iccProfileName, iccProfileSrc, colorSpace, iccComponents);
} else {
// ICC profile could not be loaded - use rgb replacement values */
log.warn("Color profile '" + iccProfileSrc
+ "' not found. Using rgb replacement values.");
- parsedColor = new Color(red, green, blue);
+ parsedColor = new Color((int)red, (int)green, (int)blue);
}
+ } catch (PropertyException pe) {
+ //simply re-throw
+ throw pe;
} catch (Exception e) {
- throw new PropertyException(
- "Arguments to rgb-icc() must be [0..255] or [0%..100%]");
+ //wrap in a PropertyException
+ throw new PropertyException(e);
}
} else {
throw new PropertyException("Unknown color format: " + value
- + ". Must be fop-rgb-icc(r,g,b,NCNAME,\"src\",....)");
+ + ". Must be fop-rgb-icc(r,g,b,NCNAME,src,....)");
}
return parsedColor;
}
@@ -403,61 +385,58 @@
int pose = value.indexOf(")");
if (poss != -1 && pose != -1) {
value = value.substring(poss + 1, pose);
- StringTokenizer st = new StringTokenizer(value, ",");
+ String[] args = value.split(",");
try {
+ if (args.length != 4) {
+ throw new PropertyException(
+ "Invalid number of arguments: cmyk(" + value + ")");
+ }
float cyan = 0.0f, magenta = 0.0f, yellow = 0.0f, black = 0.0f;
- if (st.hasMoreTokens()) {
- String str = st.nextToken().trim();
- if (str.endsWith("%")) {
- cyan = Float.parseFloat(str.substring(0,
- str.length() - 1)) / 100.0f;
- } else {
- cyan = Float.parseFloat(str);
- }
- }
- if (st.hasMoreTokens()) {
- String str = st.nextToken().trim();
- if (str.endsWith("%")) {
- magenta = Float.parseFloat(str.substring(0,
- str.length() - 1)) / 100.0f;
- } else {
- magenta = Float.parseFloat(str);
- }
- }
- if (st.hasMoreTokens()) {
- String str = st.nextToken().trim();
- if (str.endsWith("%")) {
- yellow = Float.parseFloat(str.substring(0,
- str.length() - 1)) / 100.0f;
- } else {
- yellow = Float.parseFloat(str);
- }
- }
- if (st.hasMoreTokens()) {
- String str = st.nextToken().trim();
- if (str.endsWith("%")) {
- black = Float.parseFloat(str.substring(0,
- str.length() - 1)) / 100.0f;
- } else {
- black = Float.parseFloat(str);
- }
- }
+ String str = args[0].trim();
+ if (str.endsWith("%")) {
+ cyan = Float.parseFloat(str.substring(0,
+ str.length() - 1)) / 100.0f;
+ } else {
+ cyan = Float.parseFloat(str);
+ }
+ str = args[1].trim();
+ if (str.endsWith("%")) {
+ magenta = Float.parseFloat(str.substring(0,
+ str.length() - 1)) / 100.0f;
+ } else {
+ magenta = Float.parseFloat(str);
+ }
+ str = args[2].trim();
+ if (str.endsWith("%")) {
+ yellow = Float.parseFloat(str.substring(0,
+ str.length() - 1)) / 100.0f;
+ } else {
+ yellow = Float.parseFloat(str);
+ }
+ str = args[3].trim();
+ if (str.endsWith("%")) {
+ black = Float.parseFloat(str.substring(0,
+ str.length() - 1)) / 100.0f;
+ } else {
+ black = Float.parseFloat(str);
+ }
+
if ((cyan < 0.0 || cyan > 1.0)
|| (magenta < 0.0 || magenta > 1.0)
|| (yellow < 0.0 || yellow > 1.0)
|| (black < 0.0 || black > 1.0)) {
- throw new PropertyException("Color values out of range");
+ throw new PropertyException("Color values out of range"
+ + "Arguments to cmyk() must be in the range [0%-100%] or [0.0-1.0]");
}
float[] cmyk = new float[] {cyan, magenta, yellow, black};
CMYKColorSpace cmykCs = CMYKColorSpace.getInstance();
float[] rgb = cmykCs.toRGB(cmyk);
parsedColor = ColorExt.createFromFoRgbIcc(rgb[0], rgb[1], rgb[2],
null, "#CMYK", cmykCs, cmyk);
-
-
+ } catch (PropertyException pe) {
+ throw pe;
} catch (Exception e) {
- throw new PropertyException(
- "Arguments to cmyk() must be in the range [0%-100%] or [0.0-1.0]");
+ throw new PropertyException(e);
}
} else {
throw new PropertyException("Unknown color format: " + value
@@ -668,7 +647,6 @@
colorMap.put("whitesmoke", new Color(245, 245, 245));
colorMap.put("yellow", new Color(255, 255, 0));
colorMap.put("yellowgreen", new Color(154, 205, 50));
-
colorMap.put("transparent", new Color(0, 0, 0, 0));
}
Propchange: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/ColorUtil.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/CommandLineLogger.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Thu Feb 14 13:55:44 2008
@@ -1 +1 @@
-Author Date Id Revision
+Id
Propchange: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/ContentHandlerFactory.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/ContentHandlerFactoryRegistry.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/DOM2SAX.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/DOMBuilderContentHandlerFactory.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/DataURIResolver.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/DataURLUtil.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/DefaultErrorListener.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/DelegatingContentHandler.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/LogUtil.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/LogUtil.java?rev=627882&r1=627881&r2=627882&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/LogUtil.java (original)
+++ xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/LogUtil.java Thu Feb 14 13:55:44 2008
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-/* $Id: $ */
+/* $Id$ */
package org.apache.fop.util;
Propchange: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/LogUtil.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/QName.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/QName.java?rev=627882&r1=627881&r2=627882&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/QName.java (original)
+++ xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/QName.java Thu Feb 14 13:55:44 2008
@@ -1,138 +1,138 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/* $Id$ */
-
-package org.apache.fop.util;
-
-import java.io.Serializable;
-
-/**
- * Represents a qualified name of an XML element or an XML attribute.
- * <p>
- * Note: This class allows to carry a namespace prefix but it is not used in the equals() and
- * hashCode() methods.
- */
-public class QName implements Serializable {
-
- private static final long serialVersionUID = -5225376740044770690L;
-
- private String namespaceURI;
- private String localName;
- private String prefix;
- private int hashCode;
-
- /**
- * Main constructor.
- * @param namespaceURI the namespace URI
- * @param prefix the namespace prefix, may be null
- * @param localName the local name
- */
- public QName(String namespaceURI, String prefix, String localName) {
- if (localName == null) {
- throw new NullPointerException("Parameter localName must not be null");
- }
- if (localName.length() == 0) {
- throw new IllegalArgumentException("Parameter localName must not be empty");
- }
- this.namespaceURI = namespaceURI;
- this.prefix = prefix;
- this.localName = localName;
- this.hashCode = toHashString().hashCode();
- }
-
- /**
- * Main constructor.
- * @param namespaceURI the namespace URI
- * @param qName the qualified name
- */
- public QName(String namespaceURI, String qName) {
- if (qName == null) {
- throw new NullPointerException("Parameter localName must not be null");
- }
- if (qName.length() == 0) {
- throw new IllegalArgumentException("Parameter localName must not be empty");
- }
- this.namespaceURI = namespaceURI;
- int p = qName.indexOf(':');
- if (p > 0) {
- this.prefix = qName.substring(0, p);
- this.localName = qName.substring(p + 1);
- } else {
- this.prefix = null;
- this.localName = qName;
- }
- this.hashCode = toHashString().hashCode();
- }
-
- /** @return the namespace URI */
- public String getNamespaceURI() {
- return this.namespaceURI;
- }
-
- /** @return the namespace prefix */
- public String getPrefix() {
- return this.prefix;
- }
-
- /** @return the local name */
- public String getLocalName() {
- return this.localName;
- }
-
- /** @return the fully qualified name */
- public String getQName() {
- return getPrefix() != null ? getPrefix() + ':' + getLocalName() : getLocalName();
- }
-
- /** {@inheritDoc} */
- public int hashCode() {
- return this.hashCode;
- }
-
- /** {@inheritDoc} */
- public boolean equals(Object obj) {
- if (obj == null) {
- return false;
- } else if (obj == this) {
- return true;
- } else {
- if (obj instanceof QName) {
- QName other = (QName)obj;
- if ((getNamespaceURI() == null && other.getNamespaceURI() == null)
- || getNamespaceURI().equals(other.getNamespaceURI())) {
- return getLocalName().equals(other.getLocalName());
- }
- }
- }
- return false;
- }
-
- /** {@inheritDoc} */
- public String toString() {
- return prefix != null
- ? (prefix + ":" + localName)
- : toHashString();
- }
-
- private String toHashString() {
- return (namespaceURI != null
- ? ("{" + namespaceURI + "}" + localName)
- : localName);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.util;
+
+import java.io.Serializable;
+
+/**
+ * Represents a qualified name of an XML element or an XML attribute.
+ * <p>
+ * Note: This class allows to carry a namespace prefix but it is not used in the equals() and
+ * hashCode() methods.
+ */
+public class QName implements Serializable {
+
+ private static final long serialVersionUID = -5225376740044770690L;
+
+ private String namespaceURI;
+ private String localName;
+ private String prefix;
+ private int hashCode;
+
+ /**
+ * Main constructor.
+ * @param namespaceURI the namespace URI
+ * @param prefix the namespace prefix, may be null
+ * @param localName the local name
+ */
+ public QName(String namespaceURI, String prefix, String localName) {
+ if (localName == null) {
+ throw new NullPointerException("Parameter localName must not be null");
+ }
+ if (localName.length() == 0) {
+ throw new IllegalArgumentException("Parameter localName must not be empty");
+ }
+ this.namespaceURI = namespaceURI;
+ this.prefix = prefix;
+ this.localName = localName;
+ this.hashCode = toHashString().hashCode();
+ }
+
+ /**
+ * Main constructor.
+ * @param namespaceURI the namespace URI
+ * @param qName the qualified name
+ */
+ public QName(String namespaceURI, String qName) {
+ if (qName == null) {
+ throw new NullPointerException("Parameter localName must not be null");
+ }
+ if (qName.length() == 0) {
+ throw new IllegalArgumentException("Parameter localName must not be empty");
+ }
+ this.namespaceURI = namespaceURI;
+ int p = qName.indexOf(':');
+ if (p > 0) {
+ this.prefix = qName.substring(0, p);
+ this.localName = qName.substring(p + 1);
+ } else {
+ this.prefix = null;
+ this.localName = qName;
+ }
+ this.hashCode = toHashString().hashCode();
+ }
+
+ /** @return the namespace URI */
+ public String getNamespaceURI() {
+ return this.namespaceURI;
+ }
+
+ /** @return the namespace prefix */
+ public String getPrefix() {
+ return this.prefix;
+ }
+
+ /** @return the local name */
+ public String getLocalName() {
+ return this.localName;
+ }
+
+ /** @return the fully qualified name */
+ public String getQName() {
+ return getPrefix() != null ? getPrefix() + ':' + getLocalName() : getLocalName();
+ }
+
+ /** {@inheritDoc} */
+ public int hashCode() {
+ return this.hashCode;
+ }
+
+ /** {@inheritDoc} */
+ public boolean equals(Object obj) {
+ if (obj == null) {
+ return false;
+ } else if (obj == this) {
+ return true;
+ } else {
+ if (obj instanceof QName) {
+ QName other = (QName)obj;
+ if ((getNamespaceURI() == null && other.getNamespaceURI() == null)
+ || getNamespaceURI().equals(other.getNamespaceURI())) {
+ return getLocalName().equals(other.getLocalName());
+ }
+ }
+ }
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ public String toString() {
+ return prefix != null
+ ? (prefix + ":" + localName)
+ : toHashString();
+ }
+
+ private String toHashString() {
+ return (namespaceURI != null
+ ? ("{" + namespaceURI + "}" + localName)
+ : localName);
+ }
+
+}
Propchange: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/QName.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/QName.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/UnitConv.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/UnitConv.java?rev=627882&r1=627881&r2=627882&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/UnitConv.java (original)
+++ xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/UnitConv.java Thu Feb 14 13:55:44 2008
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-/* $Id: FixedLength.java 279656 2005-09-08 22:06:48Z pietsch $ */
+/* $Id$ */
package org.apache.fop.util;
Propchange: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/UnitConv.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/WriterOutputStream.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/java/org/apache/fop/util/XMLizable.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/sandbox/org/apache/fop/render/mif/MIFElement.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Thu Feb 14 13:55:44 2008
@@ -1 +1 @@
-Author Date Id Revision
+Id
Modified: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/sandbox/org/apache/fop/render/mif/MIFFOEventHandlerMaker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/sandbox/org/apache/fop/render/mif/MIFFOEventHandlerMaker.java?rev=627882&r1=627881&r2=627882&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/sandbox/org/apache/fop/render/mif/MIFFOEventHandlerMaker.java (original)
+++ xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/sandbox/org/apache/fop/render/mif/MIFFOEventHandlerMaker.java Thu Feb 14 13:55:44 2008
@@ -1,52 +1,52 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/* $Id$ */
-
-package org.apache.fop.render.mif;
-
-import java.io.OutputStream;
-
-import org.apache.fop.apps.FOUserAgent;
-import org.apache.fop.apps.MimeConstants;
-import org.apache.fop.fo.FOEventHandler;
-import org.apache.fop.render.AbstractFOEventHandlerMaker;
-
-/**
- * Maker class for MIF support.
- */
-public class MIFFOEventHandlerMaker extends AbstractFOEventHandlerMaker {
-
- private static final String[] MIMES = new String[] {MimeConstants.MIME_MIF};
-
-
- /** @see org.apache.fop.render.AbstractFOEventHandlerMaker */
- public FOEventHandler makeFOEventHandler(FOUserAgent ua, OutputStream out) {
- return new MIFHandler(ua, out);
- }
-
- /** @see org.apache.fop.render.AbstractFOEventHandlerMaker#needsOutputStream() */
- public boolean needsOutputStream() {
- return true;
- }
-
- /** @see org.apache.fop.render.AbstractFOEventHandlerMaker#getSupportedMimeTypes() */
- public String[] getSupportedMimeTypes() {
- return MIMES;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.render.mif;
+
+import java.io.OutputStream;
+
+import org.apache.fop.apps.FOUserAgent;
+import org.apache.fop.apps.MimeConstants;
+import org.apache.fop.fo.FOEventHandler;
+import org.apache.fop.render.AbstractFOEventHandlerMaker;
+
+/**
+ * Maker class for MIF support.
+ */
+public class MIFFOEventHandlerMaker extends AbstractFOEventHandlerMaker {
+
+ private static final String[] MIMES = new String[] {MimeConstants.MIME_MIF};
+
+
+ /** @see org.apache.fop.render.AbstractFOEventHandlerMaker */
+ public FOEventHandler makeFOEventHandler(FOUserAgent ua, OutputStream out) {
+ return new MIFHandler(ua, out);
+ }
+
+ /** @see org.apache.fop.render.AbstractFOEventHandlerMaker#needsOutputStream() */
+ public boolean needsOutputStream() {
+ return true;
+ }
+
+ /** @see org.apache.fop.render.AbstractFOEventHandlerMaker#getSupportedMimeTypes() */
+ public String[] getSupportedMimeTypes() {
+ return MIMES;
+ }
+
+}
Propchange: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/sandbox/org/apache/fop/render/mif/MIFFOEventHandlerMaker.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/sandbox/org/apache/fop/render/mif/MIFFile.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Thu Feb 14 13:55:44 2008
@@ -1 +1 @@
-Author Date Id Revision
+Id
Propchange: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/sandbox/org/apache/fop/render/mif/MIFHandler.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Thu Feb 14 13:55:44 2008
@@ -1 +1 @@
-Author Date Id Revision
+Id
Propchange: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/sandbox/org/apache/fop/render/mif/PGFElement.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Thu Feb 14 13:55:44 2008
@@ -1 +1 @@
-Author Date Id Revision
+Id
Propchange: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/sandbox/org/apache/fop/render/mif/RefElement.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Thu Feb 14 13:55:44 2008
@@ -1 +1 @@
-Author Date Id Revision
+Id
Propchange: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/sandbox/org/apache/fop/render/mif/RulingElement.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Thu Feb 14 13:55:44 2008
@@ -1 +1 @@
-Author Date Id Revision
+Id
Modified: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/sandbox/org/apache/fop/render/svg/SVGRendererMaker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/sandbox/org/apache/fop/render/svg/SVGRendererMaker.java?rev=627882&r1=627881&r2=627882&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/sandbox/org/apache/fop/render/svg/SVGRendererMaker.java (original)
+++ xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/sandbox/org/apache/fop/render/svg/SVGRendererMaker.java Thu Feb 14 13:55:44 2008
@@ -1,50 +1,50 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/* $Id$ */
-
-package org.apache.fop.render.svg;
-
-import org.apache.fop.apps.FOUserAgent;
-import org.apache.fop.apps.MimeConstants;
-import org.apache.fop.render.AbstractRendererMaker;
-import org.apache.fop.render.Renderer;
-
-/**
- * RendererMaker for the SVG Renderer.
- */
-public class SVGRendererMaker extends AbstractRendererMaker {
-
- private static final String[] MIMES = new String[] {MimeConstants.MIME_SVG};
-
-
- /**@see org.apache.fop.render.AbstractRendererMaker */
- public Renderer makeRenderer(FOUserAgent ua) {
- return new SVGRenderer();
- }
-
- /** @see org.apache.fop.render.AbstractRendererMaker#needsOutputStream() */
- public boolean needsOutputStream() {
- return true;
- }
-
- /** @see org.apache.fop.render.AbstractRendererMaker#getSupportedMimeTypes() */
- public String[] getSupportedMimeTypes() {
- return MIMES;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.render.svg;
+
+import org.apache.fop.apps.FOUserAgent;
+import org.apache.fop.apps.MimeConstants;
+import org.apache.fop.render.AbstractRendererMaker;
+import org.apache.fop.render.Renderer;
+
+/**
+ * RendererMaker for the SVG Renderer.
+ */
+public class SVGRendererMaker extends AbstractRendererMaker {
+
+ private static final String[] MIMES = new String[] {MimeConstants.MIME_SVG};
+
+
+ /**@see org.apache.fop.render.AbstractRendererMaker */
+ public Renderer makeRenderer(FOUserAgent ua) {
+ return new SVGRenderer();
+ }
+
+ /** @see org.apache.fop.render.AbstractRendererMaker#needsOutputStream() */
+ public boolean needsOutputStream() {
+ return true;
+ }
+
+ /** @see org.apache.fop.render.AbstractRendererMaker#getSupportedMimeTypes() */
+ public String[] getSupportedMimeTypes() {
+ return MIMES;
+ }
+
+}
Propchange: xmlgraphics/fop/branches/Temp_Interleaved_Page_Line_Breaking/src/sandbox/org/apache/fop/render/svg/SVGRendererMaker.java
------------------------------------------------------------------------------
svn:eol-style = native
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org