From: Jeremias Maerki Date: Fri, 23 Dec 2005 23:32:13 +0000 (+0000) Subject: Merge from Branch fop-0_91: X-Git-Tag: fop-0_92-beta~264 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=52608fc11982100b24c8ff5cafe7d0100db20259;p=xmlgraphics-fop.git Merge from Branch fop-0_91: Deprecated Fop constructors that use the integer constants for output format selection removed as discussed. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@358882 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/apps/Fop.java b/src/java/org/apache/fop/apps/Fop.java index 2694a7690..720d78644 100644 --- a/src/java/org/apache/fop/apps/Fop.java +++ b/src/java/org/apache/fop/apps/Fop.java @@ -47,9 +47,6 @@ import org.apache.fop.fo.FOTreeBuilder; */ public class Fop implements Constants { - // desired output type: RENDER_PDF, RENDER_PS, etc. - //private int renderType = NOT_SET; - // desired output format: MIME type such as "application/pdf", "application/postscript" etc. private String outputFormat = null; @@ -86,66 +83,6 @@ public class Fop implements Constants { this(outputFormat, null); } - /** - * Constructor for use with already-created FOUserAgents - * @param renderType the type of renderer to use. Must be one of - * - * @param ua FOUserAgent object - * @deprecated Use {@link org.apache.fop.apps.Fop#Fop(java.lang.String, FOUserAgent)} instead! - * This constructor will be removed. - */ - public Fop(int renderType, FOUserAgent ua) { - this(getMimeTypeForRenderType(renderType), ua); - } - - /** - * Constructor that creates a default FOUserAgent - * @see org.apache.fop.apps.Fop#Fop(int, FOUserAgent) - * @deprecated Use {@link org.apache.fop.apps.Fop#Fop(java.lang.String)} instead! - * This constructor will be removed. - */ - public Fop(int renderType) { - this(renderType, null); - } - - private static String getMimeTypeForRenderType(int renderType) { - switch(renderType) { - case Constants.RENDER_PDF: return MimeConstants.MIME_PDF; - case Constants.RENDER_PS: return MimeConstants.MIME_POSTSCRIPT; - case Constants.RENDER_PCL: return MimeConstants.MIME_PCL; - case Constants.RENDER_MIF: return MimeConstants.MIME_MIF; - case Constants.RENDER_RTF: return MimeConstants.MIME_RTF; - case Constants.RENDER_SVG: return MimeConstants.MIME_SVG; - case Constants.RENDER_TXT: return MimeConstants.MIME_PLAIN_TEXT; - - //Bitmap formats - case Constants.RENDER_PNG: return MimeConstants.MIME_PNG; - case Constants.RENDER_TIFF: return MimeConstants.MIME_TIFF; - - //Area tree XML: FOP-specific - case Constants.RENDER_XML: return MimeConstants.MIME_FOP_AREA_TREE; - - //Non-standard pseudo MIME types - case Constants.RENDER_AWT: return MimeConstants.MIME_FOP_AWT_PREVIEW; - case Constants.RENDER_PRINT: return MimeConstants.MIME_FOP_PRINT; - default: - throw new IllegalArgumentException("Illegal renderType value: " + renderType); - } - } - /** * Get the FOUserAgent instance for this process * @return the user agent diff --git a/src/java/org/apache/fop/fo/Constants.java b/src/java/org/apache/fop/fo/Constants.java index 68f1c3f02..a6d183ecf 100644 --- a/src/java/org/apache/fop/fo/Constants.java +++ b/src/java/org/apache/fop/fo/Constants.java @@ -30,44 +30,15 @@ package org.apache.fop.fo; */ public interface Constants { - /* These constants are used by apps.CommandLineOptions and - apps.Fop to describe the input (either .FO or .XML/.XSL) - and desired output (PDF, PS, AWT, etc.) of the document */ + /* These constants are used by apps.CommandLineOptions + to describe the input (either .FO or .XML/.XSL) */ - /** render constants for bounds checking */ - int RENDER_MIN_CONST = 1; - /** render constants for bounds checking */ - int RENDER_MAX_CONST = 12; - /** input / output not set */ + /** (input) not set */ int NOT_SET = 0; /** input: fo file */ int FO_INPUT = 1; /** input: xml+xsl file */ int XSLT_INPUT = 2; - /** output: pdf file */ - int RENDER_PDF = 1; - /** output: screen using swing */ - int RENDER_AWT = 2; - /** output: mif file */ - int RENDER_MIF = 3; - /** output: sent swing rendered file to printer */ - int RENDER_PRINT = 4; - /** output: pcl file */ - int RENDER_PCL = 5; - /** output: postscript file */ - int RENDER_PS = 6; - /** output: text file */ - int RENDER_TXT = 7; - /** output: svg file */ - int RENDER_SVG = 8; - /** output: XML area tree */ - int RENDER_XML = 9; - /** output: RTF file */ - int RENDER_RTF = 10; - /** output: TIFF file */ - int RENDER_TIFF = 11; - /** output: PNG file */ - int RENDER_PNG = 12; // element constants /** FObj base class */