Thread: [FOray-commit] SF.net SVN: foray: [6958] trunk/foray/foray-app/src/java/org/foray/app
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2006-03-15 00:42:28
|
Revision: 6958 Author: victormote Date: 2006-03-14 16:42:14 -0800 (Tue, 14 Mar 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=6958&view=rev Log Message: ----------- Make the method makeOutputTarget from FOrayTarget to FOrayDocument, and make it non-static. This gives us more flexibility in bootstrapping the Renderers. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java trunk/foray/foray-app/src/java/org/foray/app/ant/FOray.java trunk/foray/foray-app/src/java/org/foray/app/test/TestConverter.java trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoFO2PDF.java trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoObj2PDF.java trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoXML2PDF.java trunk/foray/foray-app/src/java/org/foray/demo/servlet/AbstractDemoServlet.java trunk/foray/foray-app/src/java/org/foray/demo/servlet/DemoServlet.java Modified: trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java 2006-03-15 00:27:00 UTC (rev 6957) +++ trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java 2006-03-15 00:42:14 UTC (rev 6958) @@ -112,7 +112,7 @@ */ int outputType = commandLineOptions.getOutputType(); OutputConfig outputOptions = this.outputConfig; - OutputTarget outputTarget = FOrayTarget.makeOutputTarget(outputType, + OutputTarget outputTarget = document.makeOutputTarget(outputType, outputOptions); /* Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java 2006-03-15 00:27:00 UTC (rev 6957) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java 2006-03-15 00:42:14 UTC (rev 6958) @@ -26,6 +26,16 @@ import org.foray.common.FOrayException; import org.foray.common.XMLParser; +import org.foray.output.MIFConverter; +import org.foray.output.OutputConfig; +import org.foray.output.OutputTarget; +import org.foray.render.awt.AWTRenderer; +import org.foray.render.pcl.PCLRenderer; +import org.foray.render.pdf.PDFRenderer; +import org.foray.render.ps.PSRenderer; +import org.foray.render.svg.SVGRenderer; +import org.foray.render.txt.TXTRenderer; +import org.foray.render.xml.XMLRenderer; import org.axsl.font.FontConsumer; import org.axsl.font.FontServer; @@ -403,4 +413,69 @@ return this.unsupportedProperties; } + /** + * Factory method that makes a new Renderer instance for the standard + * renderers. + * @param rendererType The integral id for the Renderer that should be + * used. Must be one of: + * <ul> + * <li>RENDER_PDF + * <li>RENDER_AWT + * <li>RENDER_MIF + * <li>RENDER_XML + * <li>RENDER_PCL + * <li>RENDER_PS + * <li>RENDER_TXT + * <li>RENDER_SVG + * </ul> + * @param outputOptions Map containing the options to be used with the + * Renderer. + */ + public OutputTarget makeOutputTarget(int rendererType, + OutputConfig outputOptions) throws FOrayException { + OutputTarget renderer = null; + switch (rendererType) { + case FOrayTarget.RENDER_AWT: { + renderer = new AWTRenderer(outputOptions); + break; + } + case FOrayTarget.RENDER_PRINT: { + throw new FOrayException("Print renderer cannot be instantiated " + + "from the standard method."); + } + case FOrayTarget.RENDER_PCL: { + renderer = new PCLRenderer(outputOptions); + break; + } + case FOrayTarget.RENDER_PS: { + renderer = new PSRenderer(outputOptions); + break; + } + case FOrayTarget.RENDER_TXT: { + renderer = new TXTRenderer(outputOptions); + break; + } + case FOrayTarget.RENDER_MIF: { + renderer = new MIFConverter(outputOptions); + break; + } + case FOrayTarget.RENDER_XML: { + renderer = new XMLRenderer(outputOptions); + break; + } + case FOrayTarget.RENDER_SVG: { + renderer = new SVGRenderer(outputOptions); + break; + } + default: { + renderer = new PDFRenderer(outputOptions); + break; + } + } + if (renderer == null) { + throw new FOrayException("Unable to create renderer."); + } + return renderer; + } + } Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-03-15 00:27:00 UTC (rev 6957) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-03-15 00:42:14 UTC (rev 6958) @@ -33,19 +33,10 @@ import org.foray.common.FOrayException; import org.foray.font.FOrayFontConsumer; import org.foray.font.FOrayFontServer; -import org.foray.output.MIFConverter; -import org.foray.output.OutputConfig; import org.foray.output.OutputControl; import org.foray.output.OutputTarget; import org.foray.pioneer.PioneerLS; import org.foray.render.Renderer; -import org.foray.render.awt.AWTRenderer; -import org.foray.render.pcl.PCLRenderer; -import org.foray.render.pdf.PDFRenderer; -import org.foray.render.ps.PSRenderer; -import org.foray.render.svg.SVGRenderer; -import org.foray.render.txt.TXTRenderer; -import org.foray.render.xml.XMLRenderer; import org.axsl.areaOut.PageArea; import org.axsl.font.FontConsumer; @@ -494,71 +485,6 @@ return this.outputStream; } - /** - * Factory method that makes a new Renderer instance for the standard - * renderers. - * @param rendererType The integral id for the Renderer that should be - * used. Must be one of: - * <ul> - * <li>RENDER_PDF - * <li>RENDER_AWT - * <li>RENDER_MIF - * <li>RENDER_XML - * <li>RENDER_PCL - * <li>RENDER_PS - * <li>RENDER_TXT - * <li>RENDER_SVG - * </ul> - * @param outputOptions Map containing the options to be used with the - * Renderer. - */ - public static OutputTarget makeOutputTarget(int rendererType, - OutputConfig outputOptions) throws FOrayException { - OutputTarget renderer = null; - switch (rendererType) { - case RENDER_AWT: { - renderer = new AWTRenderer(outputOptions); - break; - } - case RENDER_PRINT: { - throw new FOrayException("Print renderer cannot be instantiated " - + "from the standard method."); - } - case RENDER_PCL: { - renderer = new PCLRenderer(outputOptions); - break; - } - case RENDER_PS: { - renderer = new PSRenderer(outputOptions); - break; - } - case RENDER_TXT: { - renderer = new TXTRenderer(outputOptions); - break; - } - case RENDER_MIF: { - renderer = new MIFConverter(outputOptions); - break; - } - case RENDER_XML: { - renderer = new XMLRenderer(outputOptions); - break; - } - case RENDER_SVG: { - renderer = new SVGRenderer(outputOptions); - break; - } - default: { - renderer = new PDFRenderer(outputOptions); - break; - } - } - if (renderer == null) { - throw new FOrayException("Unable to create renderer."); - } - return renderer; - } - public OutputTarget getOutputTarget() { return this.outputTarget; } Modified: trunk/foray/foray-app/src/java/org/foray/app/ant/FOray.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/ant/FOray.java 2006-03-15 00:27:00 UTC (rev 6957) +++ trunk/foray/foray-app/src/java/org/foray/app/ant/FOray.java 2006-03-15 00:42:14 UTC (rev 6958) @@ -489,7 +489,7 @@ rendererOptions.parseOption("fineDetail", "true", SessionConfig.PRECEDENCE_DEFAULT); } - OutputTarget renderer = FOrayTarget.makeOutputTarget(rendererType, + OutputTarget renderer = document.makeOutputTarget(rendererType, rendererOptions); new FOrayTarget(document, renderer, null, out); Modified: trunk/foray/foray-app/src/java/org/foray/app/test/TestConverter.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/test/TestConverter.java 2006-03-15 00:27:00 UTC (rev 6957) +++ trunk/foray/foray-app/src/java/org/foray/app/test/TestConverter.java 2006-03-15 00:42:14 UTC (rev 6958) @@ -293,7 +293,7 @@ SessionConfig.PRECEDENCE_DEFAULT); renderOptions.parseOption("consistentOutput", "true", SessionConfig.PRECEDENCE_DEFAULT); - OutputTarget renderer = FOrayTarget.makeOutputTarget(rendererType, + OutputTarget renderer = document.makeOutputTarget(rendererType, renderOptions); new FOrayTarget(document, renderer, null, bos); Modified: trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoFO2PDF.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoFO2PDF.java 2006-03-15 00:27:00 UTC (rev 6957) +++ trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoFO2PDF.java 2006-03-15 00:42:14 UTC (rev 6958) @@ -58,7 +58,7 @@ inputHandler.getInputSource(), inputHandler.getParser()); //Setup Renderer - OutputTarget renderer = FOrayTarget.makeOutputTarget(FOrayTarget.RENDER_PDF, + OutputTarget renderer = document.makeOutputTarget(FOrayTarget.RENDER_PDF, null); //Setup FOrayTarget Modified: trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoObj2PDF.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoObj2PDF.java 2006-03-15 00:27:00 UTC (rev 6957) +++ trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoObj2PDF.java 2006-03-15 00:42:14 UTC (rev 6958) @@ -73,7 +73,7 @@ FOrayDocument document = new FOrayDocument(driver, transformer, source); //Setup Renderer - OutputTarget renderer = FOrayTarget.makeOutputTarget(FOrayTarget.RENDER_PDF, + OutputTarget renderer = document.makeOutputTarget(FOrayTarget.RENDER_PDF, null); //Setup FOrayTarget Modified: trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoXML2PDF.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoXML2PDF.java 2006-03-15 00:27:00 UTC (rev 6957) +++ trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoXML2PDF.java 2006-03-15 00:42:14 UTC (rev 6958) @@ -71,7 +71,7 @@ FOrayDocument document = new FOrayDocument(driver, transformer, source); //Setup Renderer - OutputTarget renderer = FOrayTarget.makeOutputTarget(FOrayTarget.RENDER_PDF, + OutputTarget renderer = document.makeOutputTarget(FOrayTarget.RENDER_PDF, null); //Setup FOrayTarget Modified: trunk/foray/foray-app/src/java/org/foray/demo/servlet/AbstractDemoServlet.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/demo/servlet/AbstractDemoServlet.java 2006-03-15 00:27:00 UTC (rev 6957) +++ trunk/foray/foray-app/src/java/org/foray/demo/servlet/AbstractDemoServlet.java 2006-03-15 00:42:14 UTC (rev 6958) @@ -160,7 +160,7 @@ FOrayDocument document = setupSAXDocument(session, inputHandler); // Setup the Renderer - OutputTarget renderer = FOrayTarget.makeOutputTarget(FOrayTarget.RENDER_PDF, + OutputTarget renderer = document.makeOutputTarget(FOrayTarget.RENDER_PDF, null); // Setup FOrayTarget @@ -203,7 +203,7 @@ source); // Setup the Renderer - OutputTarget renderer = FOrayTarget.makeOutputTarget(FOrayTarget.RENDER_PDF, + OutputTarget renderer = document.makeOutputTarget(FOrayTarget.RENDER_PDF, null); // Setup FOrayTarget Modified: trunk/foray/foray-app/src/java/org/foray/demo/servlet/DemoServlet.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/demo/servlet/DemoServlet.java 2006-03-15 00:27:00 UTC (rev 6957) +++ trunk/foray/foray-app/src/java/org/foray/demo/servlet/DemoServlet.java 2006-03-15 00:42:14 UTC (rev 6958) @@ -118,7 +118,7 @@ private FOrayTarget setupTarget(FOrayDocument document) throws FOrayException { // Setup the Renderer - OutputTarget renderer = FOrayTarget.makeOutputTarget(FOrayTarget.RENDER_PDF, + OutputTarget renderer = document.makeOutputTarget(FOrayTarget.RENDER_PDF, null); // Setup FOrayTarget ByteArrayOutputStream output = new ByteArrayOutputStream(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-04-15 17:51:27
|
Revision: 7025 Author: victormote Date: 2006-04-15 10:51:20 -0700 (Sat, 15 Apr 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7025&view=rev Log Message: ----------- Make configuration a URL. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/CommandLineOptions.java trunk/foray/foray-app/src/java/org/foray/app/Options.java trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTask.java Modified: trunk/foray/foray-app/src/java/org/foray/app/CommandLineOptions.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/CommandLineOptions.java 2006-04-15 15:42:02 UTC (rev 7024) +++ trunk/foray/foray-app/src/java/org/foray/app/CommandLineOptions.java 2006-04-15 17:51:20 UTC (rev 7025) @@ -33,6 +33,7 @@ import java.io.File; import java.io.FileNotFoundException; import java.net.MalformedURLException; +import java.net.URL; /** * Options parses the commandline arguments @@ -65,7 +66,7 @@ private static final int AREA_OUTPUT = 9; /* user configuration file */ - File userConfigFile = null; + URL userConfigFile = null; /* input fo file */ File fofile = null; /* xsltfile (xslt transformation as input) */ @@ -153,7 +154,11 @@ throw new FOrayException("if you use '-c', you must " + "specify the name of the configuration file"); } - userConfigFile = new File(args[currentArgument + 1]); + try { + this.userConfigFile = new URL(args[currentArgument + 1]); + } catch (MalformedURLException e) { + throw new FOrayException(e); + } currentArgument++; return true; } @@ -520,7 +525,7 @@ return outfile; } - public File getUserConfigFile() { + public URL getUserConfigFile() { return userConfigFile; } Modified: trunk/foray/foray-app/src/java/org/foray/app/Options.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/Options.java 2006-04-15 15:42:02 UTC (rev 7024) +++ trunk/foray/foray-app/src/java/org/foray/app/Options.java 2006-04-15 17:51:20 UTC (rev 7025) @@ -32,7 +32,7 @@ import org.xml.sax.InputSource; import org.xml.sax.SAXException; -import java.io.File; +import java.net.URL; /** * Options handles loading of configuration files and @@ -53,7 +53,7 @@ } public Options(Log logger, SessionConfig sessionConfig, - OutputConfig renderConfig, File userConfigFile) throws FOrayException { + OutputConfig renderConfig, URL userConfigFile) throws FOrayException { this(logger, sessionConfig, renderConfig); this.loadUserconfiguration(userConfigFile); initOptions(); @@ -70,7 +70,7 @@ // setting clOptions void setCommandLineOptions(CommandLineOptions clOptions) { // load user configuration file,if there is one - File userConfigFile = clOptions.getUserConfigFile(); + URL userConfigFile = clOptions.getUserConfigFile(); if (userConfigFile != null) { this.loadUserconfiguration(userConfigFile); } @@ -82,14 +82,11 @@ } } - public void loadUserconfiguration(String userConfigFile) { - loadUserconfiguration(new File(userConfigFile)); - } - - public void loadUserconfiguration(File userConfigFile) { - if (userConfigFile != null) { - loadUserconfiguration(InputHandler.fileInputSource(userConfigFile)); + public void loadUserconfiguration(URL userConfigFile) { + if (userConfigFile == null) { + return; } + loadUserconfiguration(InputHandler.urlInputSource(userConfigFile)); } public void loadUserconfiguration(InputSource userConfigSource) { Modified: trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTask.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTask.java 2006-04-15 15:42:02 UTC (rev 7024) +++ trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTask.java 2006-04-15 17:51:20 UTC (rev 7025) @@ -50,6 +50,7 @@ import java.io.File; import java.io.FileOutputStream; import java.io.OutputStream; +import java.net.URL; import java.util.ArrayList; import java.util.List; @@ -74,7 +75,7 @@ File outDir; String format; //MIME type File baseDir; - File userConfig; + URL userConfig; int messageType = Project.MSG_VERBOSE; boolean logFiles = true; private boolean force = false; @@ -83,7 +84,7 @@ * Sets the user configuration file. * @param userConfig File containing the user configuration. */ - public void setUserconfig (File userConfig) { + public void setUserconfig (URL userConfig) { this.userConfig = userConfig; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-04-15 18:32:10
|
Revision: 7028 Author: victormote Date: 2006-04-15 11:32:03 -0700 (Sat, 15 Apr 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7028&view=rev Log Message: ----------- Move some methods that should be standardized to a more central location, also nearer their constants. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTaskStarter.java Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-04-15 18:07:30 UTC (rev 7027) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-04-15 18:32:03 UTC (rev 7028) @@ -549,4 +549,68 @@ return this.document; } + /** + * Converts a String description of the desired Renderer to a valid + * renderer code. + * @param format The String description of the desired Renderer, either + * a mime type or a standard description. + * @return One of {@link #RENDER_PDF}, {@link #RENDER_AWT}, + * {@link #RENDER_MIF}, {@link #RENDER_XML}, {@link #RENDER_PRINT}, + * {@link #RENDER_PCL}, {@link #RENDER_PS}, {@link #RENDER_TXT}, + * {@link #RENDER_SVG}, or -1 if the input is not valid. + */ + public static int getRendererType(String format) { + if ((format == null) + || format.equalsIgnoreCase("application/pdf") + || format.equalsIgnoreCase("pdf")) { + return RENDER_PDF; + } + if (format.equalsIgnoreCase("application/postscript") + || format.equalsIgnoreCase("ps")) { + return RENDER_PS; + } + if (format.equalsIgnoreCase("application/vnd.mif") + || format.equalsIgnoreCase("mif")) { + return RENDER_MIF; + } + if (format.equalsIgnoreCase("application/vnd.gp-PCL") + || format.equalsIgnoreCase("pcl")) { + return RENDER_PCL; + } + if (format.equalsIgnoreCase("text/plain") + || format.equalsIgnoreCase("txt")) { + return RENDER_TXT; + } + if (format.equalsIgnoreCase("text/xml") + || format.equalsIgnoreCase("at") + || format.equalsIgnoreCase("xml")) { + return RENDER_XML; + } + return -1; + } + + public static String getMimeExtension(int rendererType) { + switch (rendererType) { + case RENDER_PDF: { + return ".pdf"; + } + case RENDER_PS: { + return ".ps"; + } + case RENDER_MIF: { + return ".mif"; + } + case RENDER_PCL: { + return ".pcl"; + } + case RENDER_TXT: { + return ".txt"; + } + case RENDER_XML: { + return ".xml"; + } + } + return null; + } + } Modified: trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTaskStarter.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTaskStarter.java 2006-04-15 18:07:30 UTC (rev 7027) +++ trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTaskStarter.java 2006-04-15 18:32:03 UTC (rev 7028) @@ -63,53 +63,6 @@ logFiles = aLogFiles; } - private int determineRenderer(String format) { - if ((format == null) || - format.equalsIgnoreCase("application/pdf") || - format.equalsIgnoreCase("pdf")) { - return FOrayTarget.RENDER_PDF; - } else if (format.equalsIgnoreCase("application/postscript") || - format.equalsIgnoreCase("ps")) { - return FOrayTarget.RENDER_PS; - } else if (format.equalsIgnoreCase("application/vnd.mif") || - format.equalsIgnoreCase("mif")) { - return FOrayTarget.RENDER_MIF; - } else if (format.equalsIgnoreCase("application/vnd.gp-PCL") || - format.equalsIgnoreCase("pcl")) { - return FOrayTarget.RENDER_PCL; - } else if (format.equalsIgnoreCase("text/plain") || - format.equalsIgnoreCase("txt")) { - return FOrayTarget.RENDER_TXT; - } else if (format.equalsIgnoreCase("text/xml") || - format.equalsIgnoreCase("at") || - format.equalsIgnoreCase("xml")) { - return FOrayTarget.RENDER_XML; - } else { - String err = "Couldn't determine renderer to use: "+format; - throw new BuildException(err); - } - } - - private String determineExtension(int renderer) { - switch (renderer) { - case FOrayTarget.RENDER_PDF: - return ".pdf"; - case FOrayTarget.RENDER_PS: - return ".ps"; - case FOrayTarget.RENDER_MIF: - return ".mif"; - case FOrayTarget.RENDER_PCL: - return ".pcl"; - case FOrayTarget.RENDER_TXT: - return ".txt"; - case FOrayTarget.RENDER_XML: - return ".xml"; - default: - String err = "Unknown renderer: "+renderer; - throw new BuildException(err); - } - } - private File replaceExtension(File file, String expectedExt, String newExt) { String name = file.getName(); @@ -148,8 +101,12 @@ task.log("Error setting base directory: " + e, Project.MSG_ERR); } - int rint = determineRenderer(task.getFormat()); - String newExtension = determineExtension(rint); + int rint = FOrayTarget.getRendererType(task.getFormat()); + String newExtension = FOrayTarget.getMimeExtension(rint); + if (newExtension == null) { + String err = "Unknown renderer: "+ rint; + throw new BuildException(err); + } // actioncount = # of fofiles actually processed through FOray int actioncount = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-04-15 20:25:53
|
Revision: 7035 Author: victormote Date: 2006-04-15 13:25:47 -0700 (Sat, 15 Apr 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7035&view=rev Log Message: ----------- General cleanup of the Starter construction. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/AWTStarter.java trunk/foray/foray-app/src/java/org/foray/app/Starter.java trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTask.java trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTaskStarter.java Modified: trunk/foray/foray-app/src/java/org/foray/app/AWTStarter.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/AWTStarter.java 2006-04-15 19:32:23 UTC (rev 7034) +++ trunk/foray/foray-app/src/java/org/foray/app/AWTStarter.java 2006-04-15 20:25:47 UTC (rev 7035) @@ -76,7 +76,7 @@ } private void init() throws FOrayException { - this.userMessage = new UserMessage(logger); + this.userMessage = new UserMessage(getLogger()); try { UIManager.setLookAndFeel(new javax.swing.plaf.metal.MetalLookAndFeel()); } catch (Exception e) { @@ -134,7 +134,7 @@ protected PreviewDialog createPreviewDialog(AWTRenderer renderer, Translator res) { - PreviewDialog frame = new PreviewDialog(renderer, res, logger); + PreviewDialog frame = new PreviewDialog(renderer, res, getLogger()); frame.validate(); frame.addWindowListener(new WindowAdapter() { public void windowClosed(WindowEvent we) { @@ -173,11 +173,11 @@ in = url.openStream(); } catch (Exception ex) { - logger.error("Can't find URL to: <" + path + "> " + getLogger().error("Can't find URL to: <" + path + "> " + ex.getMessage()); - logger.error(ex.getMessage()); + getLogger().error(ex.getMessage()); } - return new SecureResourceBundle(in, logger); + return new SecureResourceBundle(in, getLogger()); } } Modified: trunk/foray/foray-app/src/java/org/foray/app/Starter.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/Starter.java 2006-04-15 19:32:23 UTC (rev 7034) +++ trunk/foray/foray-app/src/java/org/foray/app/Starter.java 2006-04-15 20:25:47 UTC (rev 7035) @@ -38,7 +38,7 @@ Options options; InputHandler inputHandler; - protected Log logger; + private Log logger; protected SessionConfig sessionConfig; protected OutputConfig outputConfig; @@ -56,4 +56,8 @@ abstract public void run() throws FOrayException; + public Log getLogger() { + return this.logger; + } + } Modified: trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTask.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTask.java 2006-04-15 19:32:23 UTC (rev 7034) +++ trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTask.java 2006-04-15 20:25:47 UTC (rev 7035) @@ -64,6 +64,7 @@ int messageType = Project.MSG_VERBOSE; boolean logFiles = true; private boolean force = false; + Log logger; /** * Sets the user configuration file. @@ -243,11 +244,15 @@ } } try { - Starter starter = new FOrayAntTaskStarter(this, log, logFiles); + Starter starter = new FOrayAntTaskStarter(this, log); starter.run(); } catch (FOrayException ex) { throw new BuildException(ex); } } + public Log getLogger() { + return this.logger; + } + } Modified: trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTaskStarter.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTaskStarter.java 2006-04-15 19:32:23 UTC (rev 7034) +++ trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTaskStarter.java 2006-04-15 20:25:47 UTC (rev 7035) @@ -53,9 +53,9 @@ import java.net.URL; class FOrayAntTaskStarter extends Starter { + + /** The parent task for this starter. */ FOrayAntTask task; - Log log; - boolean logFiles; /** Number of fofiles actually processed. */ int actioncount = 0; @@ -64,12 +64,9 @@ */ int skippedcount = 0; - FOrayAntTaskStarter(FOrayAntTask task, Log aLogger, boolean aLogFiles) - throws FOrayException { - super(aLogger, null, null); + FOrayAntTaskStarter(FOrayAntTask task, Log logger) throws FOrayException { + super(logger, null, null); this.task = task; - log = aLogger; - logFiles = aLogFiles; } private File replaceExtension(File file, String expectedExt, @@ -86,7 +83,7 @@ Log logger = Logging.makeDefaultLogger(); SessionConfig configuration = new SessionConfig(logger); if (task.userConfig != null) { - new Options (log, configuration, null, task.userConfig); + new Options (this.getLogger(), configuration, null, task.userConfig); } setBaseDirectory(configuration); @@ -232,7 +229,7 @@ private void render(File foFile, File outFile, SessionConfig configuration) throws FOrayException { - InputHandler inputHandler = new FOInputHandler(logger, foFile); + InputHandler inputHandler = new FOInputHandler(getLogger(), foFile); XMLReader parser = inputHandler.getParser(); OutputStream out = null; @@ -244,17 +241,19 @@ throw new BuildException(ex); } - if (logFiles) task.log(foFile + " -> " + outFile, Project.MSG_INFO); + if (this.task.getLogFiles()) { + task.log(foFile + " -> " + outFile, Project.MSG_INFO); + } try { - FOraySession session = new FOraySession(log, configuration, null, - null, null, null); + FOraySession session = new FOraySession(this.getLogger(), + configuration, null, null, null, null); FOrayDocument document = new FOrayDocument(session, inputHandler.getInputSource(), parser); OutputConfig rendererOptions = null; if (getRendererType() == FOrayTarget.RENDER_XML) { - rendererOptions = new OutputConfig(logger); + rendererOptions = new OutputConfig(getLogger()); rendererOptions.parseOption("fineDetail", "true", SessionConfig.PRECEDENCE_DEFAULT); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-04-15 20:49:16
|
Revision: 7036 Author: victormote Date: 2006-04-15 13:49:03 -0700 (Sat, 15 Apr 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7036&view=rev Log Message: ----------- Handle bad URLs a bit more gracefully. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/AWTStarter.java trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java trunk/foray/foray-app/src/java/org/foray/app/FOInputHandler.java trunk/foray/foray-app/src/java/org/foray/app/InputHandler.java trunk/foray/foray-app/src/java/org/foray/app/Options.java trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTaskStarter.java trunk/foray/foray-app/src/java/org/foray/demo/servlet/AbstractDemoServlet.java Modified: trunk/foray/foray-app/src/java/org/foray/app/AWTStarter.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/AWTStarter.java 2006-04-15 20:25:47 UTC (rev 7035) +++ trunk/foray/foray-app/src/java/org/foray/app/AWTStarter.java 2006-04-15 20:49:03 UTC (rev 7036) @@ -47,6 +47,7 @@ import java.awt.Toolkit; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; +import java.io.IOException; import java.io.InputStream; import java.net.URL; @@ -105,8 +106,12 @@ if (parser == null) { throw new FOrayException("Unable to create SAX parser"); } - this.document = new FOrayDocument(session, - inputHandler.getInputSource(), parser); + try { + this.document = new FOrayDocument(session, + inputHandler.getInputSource(), parser); + } catch (IOException e) { + throw new FOrayException(e); + } OutputConfig renderOptions = commandLineOptions.getRendererOptions(); this.renderer = new AWTRenderer(renderOptions); Modified: trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java 2006-04-15 20:25:47 UTC (rev 7035) +++ trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java 2006-04-15 20:49:03 UTC (rev 7036) @@ -43,6 +43,7 @@ import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; +import java.io.IOException; /** * Superclass for all classes which start FOray from the commandline. @@ -56,7 +57,11 @@ throws FOrayException { super(logger, sessionConfig, outputConfig); this.commandLineOptions = commandLineOptions; - options.setCommandLineOptions(commandLineOptions); + try { + options.setCommandLineOptions(commandLineOptions); + } catch (IOException e) { + throw new FOrayException(e); + } super.setInputHandler(commandLineOptions.getInputHandler()); } @@ -99,7 +104,12 @@ * Multiple documents can be instantiated, and they will be processed * in the order submitted. */ - InputSource saxInputSource = inputHandler.getInputSource(); + InputSource saxInputSource; + try { + saxInputSource = inputHandler.getInputSource(); + } catch (IOException e) { + throw new FOrayException(e); + } XMLReader parser = inputHandler.getParser(); FOrayDocument document = new FOrayDocument(session, saxInputSource, parser); Modified: trunk/foray/foray-app/src/java/org/foray/app/FOInputHandler.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOInputHandler.java 2006-04-15 20:25:47 UTC (rev 7035) +++ trunk/foray/foray-app/src/java/org/foray/app/FOInputHandler.java 2006-04-15 20:49:03 UTC (rev 7036) @@ -32,6 +32,7 @@ import org.xml.sax.XMLReader; import java.io.File; +import java.io.IOException; import java.net.URL; /** @@ -52,9 +53,10 @@ this.foURL = url; } - public InputSource getInputSource () { - if (fofile != null) + public InputSource getInputSource () throws IOException { + if (fofile != null) { return super.fileInputSource(fofile); + } return super.urlInputSource(foURL); } Modified: trunk/foray/foray-app/src/java/org/foray/app/InputHandler.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/InputHandler.java 2006-04-15 20:25:47 UTC (rev 7035) +++ trunk/foray/foray-app/src/java/org/foray/app/InputHandler.java 2006-04-15 20:49:03 UTC (rev 7036) @@ -33,6 +33,7 @@ import org.xml.sax.XMLReader; import java.io.File; +import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; @@ -42,7 +43,7 @@ Log logger; - abstract public InputSource getInputSource(); + abstract public InputSource getInputSource() throws IOException ; abstract public XMLReader getParser() throws FOrayException; abstract public void run(FOrayDocument driver) throws FOrayException; @@ -51,8 +52,8 @@ this.logger = logger; } - public static InputSource urlInputSource(URL url) { - return new InputSource(url.toString()); + public static InputSource urlInputSource(URL url) throws IOException { + return new InputSource(url.openStream()); } /** Modified: trunk/foray/foray-app/src/java/org/foray/app/Options.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/Options.java 2006-04-15 20:25:47 UTC (rev 7035) +++ trunk/foray/foray-app/src/java/org/foray/app/Options.java 2006-04-15 20:49:03 UTC (rev 7036) @@ -32,6 +32,7 @@ import org.xml.sax.InputSource; import org.xml.sax.SAXException; +import java.io.IOException; import java.net.URL; /** @@ -55,7 +56,11 @@ public Options(Log logger, SessionConfig sessionConfig, OutputConfig renderConfig, URL userConfigFile) throws FOrayException { this(logger, sessionConfig, renderConfig); - this.loadUserconfiguration(userConfigFile); + try { + this.loadUserconfiguration(userConfigFile); + } catch (IOException e) { + throw new FOrayException(e); + } initOptions(); } @@ -68,7 +73,7 @@ } // setting clOptions - void setCommandLineOptions(CommandLineOptions clOptions) { + void setCommandLineOptions(CommandLineOptions clOptions) throws IOException { // load user configuration file,if there is one URL userConfigFile = clOptions.getUserConfigFile(); if (userConfigFile != null) { @@ -82,7 +87,7 @@ } } - public void loadUserconfiguration(URL userConfigFile) { + public void loadUserconfiguration(URL userConfigFile) throws IOException { if (userConfigFile == null) { return; } Modified: trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTaskStarter.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTaskStarter.java 2006-04-15 20:25:47 UTC (rev 7035) +++ trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTaskStarter.java 2006-04-15 20:49:03 UTC (rev 7036) @@ -33,7 +33,6 @@ import org.foray.app.SessionConfig; import org.foray.app.Starter; import org.foray.common.FOrayException; -import org.foray.common.Logging; import org.foray.output.OutputConfig; import org.foray.output.OutputTarget; @@ -80,8 +79,7 @@ } public void run() throws FOrayException { - Log logger = Logging.makeDefaultLogger(); - SessionConfig configuration = new SessionConfig(logger); + SessionConfig configuration = new SessionConfig(getLogger()); if (task.userConfig != null) { new Options (this.getLogger(), configuration, null, task.userConfig); } @@ -97,7 +95,9 @@ if (actioncount + skippedcount == 0) { task.log("No files processed. No files were selected by the filesets " + "and no fofile was set." , Project.MSG_WARN); - } else if (skippedcount > 0) { + return; + } + if (skippedcount > 0) { task.log(skippedcount + " xslfo file(s) skipped (no change found" + " since last generation; set force=\"true\" to override)." , Project.MSG_INFO); Modified: trunk/foray/foray-app/src/java/org/foray/demo/servlet/AbstractDemoServlet.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/demo/servlet/AbstractDemoServlet.java 2006-04-15 20:25:47 UTC (rev 7035) +++ trunk/foray/foray-app/src/java/org/foray/demo/servlet/AbstractDemoServlet.java 2006-04-15 20:49:03 UTC (rev 7036) @@ -38,6 +38,7 @@ import java.io.ByteArrayOutputStream; import java.io.File; +import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; @@ -122,8 +123,13 @@ protected FOrayDocument setupSAXDocument(FOraySession session, InputHandler inputHandler) throws FOrayException { // Setup FOrayDocument - FOrayDocument document = new FOrayDocument(session, - inputHandler.getInputSource(), inputHandler.getParser()); + FOrayDocument document; + try { + document = new FOrayDocument(session, + inputHandler.getInputSource(), inputHandler.getParser()); + } catch (IOException e) { + throw new FOrayException(e); + } return document; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-04-15 21:13:14
|
Revision: 7038 Author: victormote Date: 2006-04-15 14:13:07 -0700 (Sat, 15 Apr 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7038&view=rev Log Message: ----------- More cleanup of Ant-related startup errors. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java trunk/foray/foray-app/src/java/org/foray/app/ConfigurationParser.java trunk/foray/foray-app/src/java/org/foray/app/Options.java Modified: trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java 2006-04-15 21:07:34 UTC (rev 7037) +++ trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java 2006-04-15 21:13:07 UTC (rev 7038) @@ -57,11 +57,7 @@ throws FOrayException { super(logger, sessionConfig, outputConfig); this.commandLineOptions = commandLineOptions; - try { options.setCommandLineOptions(commandLineOptions); - } catch (IOException e) { - throw new FOrayException(e); - } super.setInputHandler(commandLineOptions.getInputHandler()); } Modified: trunk/foray/foray-app/src/java/org/foray/app/ConfigurationParser.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/ConfigurationParser.java 2006-04-15 21:07:34 UTC (rev 7037) +++ trunk/foray/foray-app/src/java/org/foray/app/ConfigurationParser.java 2006-04-15 21:13:07 UTC (rev 7038) @@ -89,11 +89,18 @@ * should be sent. */ public ConfigurationParser(SessionConfig sessionConfig, - OutputConfig outputConfig, InputSource source, Log logger) { + OutputConfig outputConfig, InputSource source, Log logger) + throws FOrayException { this.sessionConfig = sessionConfig; this.outputConfig = outputConfig; this.filename = source; this.logger = logger; + if (this.sessionConfig == null) { + throw new FOrayException("Session Configuration is null."); + } + if (this.outputConfig == null) { + throw new FOrayException("Output Configuration is null."); + } } /** Modified: trunk/foray/foray-app/src/java/org/foray/app/Options.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/Options.java 2006-04-15 21:07:34 UTC (rev 7037) +++ trunk/foray/foray-app/src/java/org/foray/app/Options.java 2006-04-15 21:13:07 UTC (rev 7038) @@ -54,13 +54,10 @@ } public Options(Log logger, SessionConfig sessionConfig, - OutputConfig renderConfig, URL userConfigFile) throws FOrayException { + OutputConfig renderConfig, URL userConfigFile) + throws FOrayException { this(logger, sessionConfig, renderConfig); - try { - this.loadUserconfiguration(userConfigFile); - } catch (IOException e) { - throw new FOrayException(e); - } + this.loadUserconfiguration(userConfigFile); initOptions(); } @@ -73,7 +70,8 @@ } // setting clOptions - void setCommandLineOptions(CommandLineOptions clOptions) throws IOException { + void setCommandLineOptions(CommandLineOptions clOptions) + throws FOrayException { // load user configuration file,if there is one URL userConfigFile = clOptions.getUserConfigFile(); if (userConfigFile != null) { @@ -87,14 +85,20 @@ } } - public void loadUserconfiguration(URL userConfigFile) throws IOException { + public void loadUserconfiguration(URL userConfigFile) + throws FOrayException { if (userConfigFile == null) { return; } - loadUserconfiguration(InputHandler.urlInputSource(userConfigFile)); + try { + loadUserconfiguration(InputHandler.urlInputSource(userConfigFile)); + } catch (IOException e) { + throw new FOrayException(e); + } } - public void loadUserconfiguration(InputSource userConfigSource) { + public void loadUserconfiguration(InputSource userConfigSource) + throws FOrayException { // read user configuration ConfigurationParser reader = new ConfigurationParser(this.sessionConfig, this.renderConfig, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-04-29 17:52:23
|
Revision: 7095 Author: victormote Date: 2006-04-29 10:52:03 -0700 (Sat, 29 Apr 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7095&view=rev Log Message: ----------- Let each FOTreeBuilder have its own logger. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/FOraySession.java trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java trunk/foray/foray-fotree/src/java/org/foray/fotree/FOrayFOTreeServer.java Modified: trunk/foray/foray-app/src/java/org/foray/app/FOraySession.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOraySession.java 2006-04-28 21:48:43 UTC (rev 7094) +++ trunk/foray/foray-app/src/java/org/foray/app/FOraySession.java 2006-04-29 17:52:03 UTC (rev 7095) @@ -235,7 +235,7 @@ if (this.foTreeServer != null) { return; } - this.foTreeServer = new FOrayFOTreeServer(); + this.foTreeServer = new FOrayFOTreeServer(this.getLogger()); } public GraphicServer getGraphicServer() { Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java 2006-04-28 21:48:43 UTC (rev 7094) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java 2006-04-29 17:52:03 UTC (rev 7095) @@ -82,9 +82,13 @@ private FOrayFOTreeServer server; - public FOTreeBuilder(FOrayFOTreeServer server, FOTreeControl treeControl) { + private Log logger; + + public FOTreeBuilder(FOrayFOTreeServer server, FOTreeControl treeControl, + Log logger) { this.server = server; this.treeControl = treeControl; + this.logger = logger; } /** @@ -233,7 +237,7 @@ } public Log getLogger() { - return getFOTreeControl().getLogger(); + return this.logger; } private int getLine() { Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FOrayFOTreeServer.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FOrayFOTreeServer.java 2006-04-28 21:48:43 UTC (rev 7094) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FOrayFOTreeServer.java 2006-04-29 17:52:03 UTC (rev 7095) @@ -34,6 +34,8 @@ import org.axsl.fotree.FOTreeControl; import org.axsl.fotree.FOTreeServer; +import org.apache.commons.logging.Log; + import java.util.Enumeration; import java.util.HashMap; import java.util.Iterator; @@ -45,6 +47,8 @@ */ public class FOrayFOTreeServer implements FOTreeServer { + Log logger; + /** * Map whose key is a String of the namespace URI, and whose value is * a Namespace instance that knows how to parse items in that namespace. @@ -56,7 +60,8 @@ private NamespaceSVG namespaceSVG; private NamespaceXML namespaceXML; - public FOrayFOTreeServer() { + public FOrayFOTreeServer(Log logger) { + this.logger = logger; setupNamespaces(); } @@ -184,7 +189,11 @@ */ public org.axsl.fotree.FOTreeBuilder makeTreeBuilder( FOTreeControl control) { - return new FOTreeBuilder(this, control); + return new FOTreeBuilder(this, control, this.getLogger()); } + public Log getLogger() { + return this.logger; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-03 18:30:31
|
Revision: 7120 Author: victormote Date: 2006-05-03 11:14:06 -0700 (Wed, 03 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7120&view=rev Log Message: ----------- Conform to new aXSL requirements regarding movement of some FOTreeControl methods to FOTreeBuilder setters. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java trunk/foray/foray-fotree/src/java/org/foray/fotree/Namespace.java Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java 2006-05-03 17:15:54 UTC (rev 7119) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java 2006-05-03 18:14:06 UTC (rev 7120) @@ -304,38 +304,6 @@ return this.session.getLogger(); } - /** - * The client application can use this method to add a list of FO objects - * that it does not support, and that it wishes to have flagged for the - * user at parse time. The object will be created within the FOTree, but the - * user will receive a logged message warning them that the object is not - * supported. - * Note that multiple arrays can be added, and the relationship is OR, so - * that if a given item appears in any one or more of the arrays, it will - * be flagged. - * @param unsupportedObjectList An array of bytes, each element of which - * represents an element which should be flagged to the user. - */ - public void setUnsupportedObjects(byte[] unsupportedObjectList) { - this.unsupportedObjects = unsupportedObjectList; - } - - /** - * The client application can use this method to add a list of FO properties - * that it does not support, and that it wishes to have flagged for the - * user at parse time. The property will be created within the FOTree, but - * the user will receive a logged message warning them that the object is - * not supported. - * Note that multiple arrays can be added, and the relationship is OR, so - * that if a given item appears in any one or more of the arrays, it will - * be flagged. - * @param unsupportedPropertyList An array of shorts, each element of which - * represents an attribute which should be flagged to the user. - */ - public void setUnsupportedProperties(short[] unsupportedPropertyList) { - this.unsupportedProperties = unsupportedPropertyList; - } - public FontServer getFontServer() { return this.session.getFontServer(); } @@ -406,14 +374,6 @@ return this.treeBuilder; } - public byte[] unsupportedObjectsFO() { - return this.unsupportedObjects; - } - - public short[] unsupportedPropertiesFO() { - return this.unsupportedProperties; - } - /** * Factory method that makes a new Renderer instance for the standard * renderers. Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java 2006-05-03 17:15:54 UTC (rev 7119) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java 2006-05-03 18:14:06 UTC (rev 7120) @@ -52,6 +52,9 @@ public class FOTreeBuilder extends DefaultHandler implements org.axsl.fotree.FOTreeBuilder { + byte[] unsupportedObjectsFO; + short[] unsupportedPropertiesFO; + /** * current formatting object being handled */ @@ -373,4 +376,20 @@ return this.server; } + public void setUnsupportedObjectsFO(byte[] unsupportedObjectsFO) { + this.unsupportedObjectsFO = unsupportedObjectsFO; + } + + public byte[] getUnsupportedObjectsFO() { + return this.unsupportedObjectsFO; + } + + public void setUnsupportedPropertiesFO(short[] unsupportedPropertiesFO) { + this.unsupportedPropertiesFO = unsupportedPropertiesFO; + } + + public short[] getUnsupportedPropertiesFO() { + return this.unsupportedPropertiesFO; + } + } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/Namespace.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/Namespace.java 2006-05-03 17:15:54 UTC (rev 7119) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/Namespace.java 2006-05-03 18:14:06 UTC (rev 7120) @@ -24,7 +24,6 @@ package org.foray.fotree; -import org.axsl.fotree.FOTreeControl; import org.axsl.fotree.FOTreeException; import org.xml.sax.Attributes; @@ -254,8 +253,7 @@ public void checkSupportedElement(FOTreeBuilder builder, String localName, Locator locator) { - FOTreeControl control = builder.getFOTreeControl(); - byte[] unsupportedObjects = control.unsupportedObjectsFO(); + byte[] unsupportedObjects = builder.getUnsupportedObjectsFO(); if (unsupportedObjects == null) { return; } @@ -271,8 +269,7 @@ public void checkSupportedAttribute(FOTreeBuilder builder, String attributeName, Locator locator) { - FOTreeControl control = builder.getFOTreeControl(); - short[] unsupportedProperties = control.unsupportedPropertiesFO(); + short[] unsupportedProperties = builder.getUnsupportedPropertiesFO(); if (unsupportedProperties == null) { return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-03 18:42:15
|
Revision: 7121 Author: victormote Date: 2006-05-03 11:41:57 -0700 (Wed, 03 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7121&view=rev Log Message: ----------- Conform to new aXSL requirements regarding movement of some FOTreeControl methods to FOTreeBuilder setters. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/FOraySession.java trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java trunk/foray/foray-fotree/src/java/org/foray/fotree/FOrayFOTreeServer.java Modified: trunk/foray/foray-app/src/java/org/foray/app/FOraySession.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOraySession.java 2006-05-03 18:14:06 UTC (rev 7120) +++ trunk/foray/foray-app/src/java/org/foray/app/FOraySession.java 2006-05-03 18:41:57 UTC (rev 7121) @@ -235,7 +235,8 @@ if (this.foTreeServer != null) { return; } - this.foTreeServer = new FOrayFOTreeServer(this.getLogger()); + this.foTreeServer = new FOrayFOTreeServer(this.getLogger(), + this.getGraphicServer(), this.getTextServer()); } public GraphicServer getGraphicServer() { Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java 2006-05-03 18:14:06 UTC (rev 7120) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java 2006-05-03 18:41:57 UTC (rev 7121) @@ -35,6 +35,8 @@ import org.axsl.fotree.FOTreeEvent; import org.axsl.fotree.FOTreeException; import org.axsl.fotree.FOTreeListener; +import org.axsl.graphic.GraphicServer; +import org.axsl.text.TextServer; import org.apache.commons.logging.Log; @@ -87,6 +89,9 @@ private Log logger; + private GraphicServer graphicServer; + private TextServer textServer; + public FOTreeBuilder(FOrayFOTreeServer server, FOTreeControl treeControl, Log logger) { this.server = server; @@ -392,4 +397,20 @@ return this.unsupportedPropertiesFO; } + public void setGraphicServer(GraphicServer graphicServer) { + this.graphicServer = graphicServer; + } + + public GraphicServer getGraphicServer() { + return this.graphicServer; + } + + public void setTextServer(TextServer textServer) { + this.textServer = textServer; + } + + public TextServer getTextServer() { + return this.textServer; + } + } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2006-05-03 18:14:06 UTC (rev 7120) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2006-05-03 18:41:57 UTC (rev 7121) @@ -368,11 +368,11 @@ } public GraphicServer getGraphicServer() { - return getFOTreeControl().getGraphicServer(); + return getFOTreeBuilder().getGraphicServer(); } public TextServer getTextServer() { - return getFOTreeControl().getTextServer(); + return getFOTreeBuilder().getTextServer(); } /** Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FOrayFOTreeServer.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FOrayFOTreeServer.java 2006-05-03 18:14:06 UTC (rev 7120) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FOrayFOTreeServer.java 2006-05-03 18:41:57 UTC (rev 7121) @@ -33,6 +33,8 @@ import org.axsl.fotree.FOTreeControl; import org.axsl.fotree.FOTreeServer; +import org.axsl.graphic.GraphicServer; +import org.axsl.text.TextServer; import org.apache.commons.logging.Log; @@ -48,6 +50,8 @@ public class FOrayFOTreeServer implements FOTreeServer { Log logger; + GraphicServer graphicServer; + TextServer textServer; /** * Map whose key is a String of the namespace URI, and whose value is @@ -60,8 +64,11 @@ private NamespaceSVG namespaceSVG; private NamespaceXML namespaceXML; - public FOrayFOTreeServer(Log logger) { + public FOrayFOTreeServer(Log logger, GraphicServer graphicServer, + TextServer textServer) { this.logger = logger; + this.graphicServer = graphicServer; + this.textServer = textServer; setupNamespaces(); } @@ -189,7 +196,11 @@ */ public org.axsl.fotree.FOTreeBuilder makeTreeBuilder( FOTreeControl control) { - return new FOTreeBuilder(this, control, this.getLogger()); + FOTreeBuilder foTreeBuilder = new FOTreeBuilder(this, control, + this.getLogger()); + foTreeBuilder.setGraphicServer(this.graphicServer); + foTreeBuilder.setTextServer(this.textServer); + return foTreeBuilder; } public Log getLogger() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-03 19:13:23
|
Revision: 7122 Author: victormote Date: 2006-05-03 12:13:12 -0700 (Wed, 03 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7122&view=rev Log Message: ----------- Conform to new aXSL requirements regarding movement of some FOTreeControl methods to FOTreeBuilder setters. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java 2006-05-03 18:41:57 UTC (rev 7121) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java 2006-05-03 19:13:12 UTC (rev 7122) @@ -233,6 +233,7 @@ public synchronized void processTarget(FOrayTarget target) throws FOrayException { this.setTarget(target); + this.treeBuilder.setFontConsumer(this.getFontConsumer()); try { if (this.jaxpTransformer == null) { // Regular SAX Input Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java 2006-05-03 18:41:57 UTC (rev 7121) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java 2006-05-03 19:13:12 UTC (rev 7122) @@ -31,6 +31,7 @@ import org.foray.fotree.svg.NamespaceSVG; import org.foray.fotree.xml.NamespaceXML; +import org.axsl.font.FontConsumer; import org.axsl.fotree.FOTreeControl; import org.axsl.fotree.FOTreeEvent; import org.axsl.fotree.FOTreeException; @@ -91,6 +92,7 @@ private GraphicServer graphicServer; private TextServer textServer; + private FontConsumer fontConsumer; public FOTreeBuilder(FOrayFOTreeServer server, FOTreeControl treeControl, Log logger) { @@ -413,4 +415,12 @@ return this.textServer; } + public void setFontConsumer(FontConsumer consumer) { + this.fontConsumer = consumer; + } + + public FontConsumer getFontConsumer() { + return this.fontConsumer; + } + } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2006-05-03 18:41:57 UTC (rev 7121) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2006-05-03 19:13:12 UTC (rev 7122) @@ -364,7 +364,7 @@ } public FontConsumer getFontConsumer() { - return getFOTreeControl().getFontConsumer(); + return getFOTreeBuilder().getFontConsumer(); } public GraphicServer getGraphicServer() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-03 19:43:34
|
Revision: 7123 Author: victormote Date: 2006-05-03 12:43:11 -0700 (Wed, 03 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7123&view=rev Log Message: ----------- Conform to new aXSL requirements regarding movement of some FOTreeControl methods to FOTreeBuilder setters, including the removal of the FOTreeControl interface. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java trunk/foray/foray-app/src/java/org/foray/app/FOraySession.java trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java trunk/foray/foray-areatree/src/java/org/foray/area/LayoutControl.java trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java trunk/foray/foray-fotree/src/java/org/foray/fotree/FOrayFOTreeServer.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ExternalGraphic.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BackgroundImage.java trunk/foray/foray-output/src/java/org/foray/output/OutputControl.java Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java 2006-05-03 19:13:12 UTC (rev 7122) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java 2006-05-03 19:43:11 UTC (rev 7123) @@ -39,7 +39,6 @@ import org.axsl.font.FontConsumer; import org.axsl.font.FontServer; -import org.axsl.fotree.FOTreeControl; import org.axsl.graphic.GraphicServer; import org.axsl.pdf.PDFDocument; import org.axsl.text.TextServer; @@ -53,7 +52,6 @@ import org.xml.sax.XMLReader; import java.io.IOException; -import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; @@ -66,7 +64,7 @@ * This class manages the process of parsing an input FO document and creating * an FOTree. */ -public class FOrayDocument implements FOTreeControl { +public class FOrayDocument { /** The "parent" FOraySession. */ private FOraySession session; @@ -113,10 +111,6 @@ /** The SAX parser. */ private XMLReader parser; - /** The ordered list of URLs that should be tried when resolving the - * location of Graphics for this document. */ - private URL[] graphicSearchPath; - /** * Private constructor used only by the other constructors. * @param session The parent FOraySession. @@ -124,7 +118,7 @@ private FOrayDocument(FOraySession session) { this.session = session; session.registerDocument(this); - treeBuilder = this.session.getFOTreeServer().makeTreeBuilder(this); + treeBuilder = this.session.getFOTreeServer().makeTreeBuilder(); } /** @@ -309,14 +303,6 @@ return this.session.getFontServer(); } - /** - * @return True if graphics should be cached in memory, false if the memory - * should be released. - */ - public boolean getCachingGraphics() { - return getConfiguration().optionCacheGraphics(); - } - public String getParserClassName() { return XMLParser.getParserClassName(); } @@ -330,31 +316,6 @@ return getConfiguration().optionBaseDirectory(); } - /** - * {@inheritDoc} - */ - public URL[] getGraphicSearchPath() { - if (this.graphicSearchPath == null) { - this.graphicSearchPath = buildGraphicSearchPath(); - } - return this.graphicSearchPath; - } - - /** - * - */ - private URL[] buildGraphicSearchPath() { - URL[] urls = new URL[3]; - urls[0] = getConfiguration().getBaseDocument(); - urls[1] = getConfiguration().optionBaseDirectory(); - try { - urls[2] = new URL(System.getProperty("user.dir")); - } catch (MalformedURLException e) { - // Ignore this -- just leave the null value in the array - } - return urls; - } - public FontConsumer getFontConsumer() { return this.currentTarget.getFontConsumer(); } Modified: trunk/foray/foray-app/src/java/org/foray/app/FOraySession.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOraySession.java 2006-05-03 19:13:12 UTC (rev 7122) +++ trunk/foray/foray-app/src/java/org/foray/app/FOraySession.java 2006-05-03 19:43:11 UTC (rev 7123) @@ -42,6 +42,7 @@ import org.xml.sax.EntityResolver; +import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.Iterator; @@ -236,9 +237,26 @@ return; } this.foTreeServer = new FOrayFOTreeServer(this.getLogger(), - this.getGraphicServer(), this.getTextServer()); + this.getGraphicServer(), this.getTextServer(), + this.buildGraphicSearchPath(), + getConfiguration().optionCacheGraphics()); } + /** + * + */ + private URL[] buildGraphicSearchPath() { + URL[] urls = new URL[3]; + urls[0] = getConfiguration().getBaseDocument(); + urls[1] = getConfiguration().optionBaseDirectory(); + try { + urls[2] = new URL(System.getProperty("user.dir")); + } catch (MalformedURLException e) { + // Ignore this -- just leave the null value in the array + } + return urls; + } + public GraphicServer getGraphicServer() { return this.graphicServer; } Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-03 19:13:12 UTC (rev 7122) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-03 19:43:11 UTC (rev 7123) @@ -463,14 +463,6 @@ return document.getBaseURL(); } - /** - * @return True if graphics should be cached in memory, false if the memory - * should be released. - */ - public boolean getCachingGraphics() { - return document.getCachingGraphics(); - } - public FontConsumer getFontConsumer() { return this.fontConsumer; } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LayoutControl.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/LayoutControl.java 2006-05-03 19:13:12 UTC (rev 7122) +++ trunk/foray/foray-areatree/src/java/org/foray/area/LayoutControl.java 2006-05-03 19:43:11 UTC (rev 7123) @@ -37,11 +37,6 @@ public interface LayoutControl { /** - * @return True if graphics should be cached, false otherwise. - */ - public boolean getCachingGraphics() ; - - /** * @return The URL that is the root of the path for finding external files. */ public URL getBaseURL() ; Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java 2006-05-03 19:13:12 UTC (rev 7122) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java 2006-05-03 19:43:11 UTC (rev 7123) @@ -32,7 +32,6 @@ import org.foray.fotree.xml.NamespaceXML; import org.axsl.font.FontConsumer; -import org.axsl.fotree.FOTreeControl; import org.axsl.fotree.FOTreeEvent; import org.axsl.fotree.FOTreeException; import org.axsl.fotree.FOTreeListener; @@ -46,6 +45,7 @@ import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; +import java.net.URL; import java.util.HashSet; import java.util.Iterator; @@ -70,8 +70,6 @@ private Locator locator; - private FOTreeControl treeControl; - /** * Collection of objects that have registered to be notified about * FOTreeEvent firings. @@ -93,11 +91,11 @@ private GraphicServer graphicServer; private TextServer textServer; private FontConsumer fontConsumer; + URL[] graphicSearchPath; + boolean cachingGraphics; - public FOTreeBuilder(FOrayFOTreeServer server, FOTreeControl treeControl, - Log logger) { + public FOTreeBuilder(FOrayFOTreeServer server, Log logger) { this.server = server; - this.treeControl = treeControl; this.logger = logger; } @@ -343,10 +341,6 @@ } } - public FOTreeControl getFOTreeControl() { - return this.treeControl; - } - public NamespaceFO getFONamespace() { return getTreeServer().getFONamespace(); } @@ -423,4 +417,20 @@ return this.fontConsumer; } + public void setGraphicSearchPath(URL[] graphicSearchPath) { + this.graphicSearchPath = graphicSearchPath; + } + + public URL[] getGraphicSearchPath() { + return this.graphicSearchPath; + } + + public void setCachingGraphics(boolean cachingGraphics) { + this.cachingGraphics = cachingGraphics; + } + + public boolean getCachingGraphics() { + return this.cachingGraphics; + } + } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2006-05-03 19:13:12 UTC (rev 7122) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2006-05-03 19:43:11 UTC (rev 7123) @@ -31,7 +31,6 @@ import org.axsl.common.Constants; import org.axsl.font.FontConsumer; import org.axsl.font.FontUse; -import org.axsl.fotree.FOTreeControl; import org.axsl.fotree.FOTreeException; import org.axsl.fotree.ShadowEffect; import org.axsl.fotree.Shape; @@ -247,10 +246,6 @@ return getFObjParent().getFlow(); } - public FOTreeControl getFOTreeControl() { - return getFOTreeBuilder().getFOTreeControl(); - } - public FOTreeBuilder getFOTreeBuilder() { return getFObjParent().getFOTreeBuilder(); } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FOrayFOTreeServer.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FOrayFOTreeServer.java 2006-05-03 19:13:12 UTC (rev 7122) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FOrayFOTreeServer.java 2006-05-03 19:43:11 UTC (rev 7123) @@ -31,13 +31,13 @@ import org.foray.fotree.svg.NamespaceSVG; import org.foray.fotree.xml.NamespaceXML; -import org.axsl.fotree.FOTreeControl; import org.axsl.fotree.FOTreeServer; import org.axsl.graphic.GraphicServer; import org.axsl.text.TextServer; import org.apache.commons.logging.Log; +import java.net.URL; import java.util.Enumeration; import java.util.HashMap; import java.util.Iterator; @@ -52,6 +52,8 @@ Log logger; GraphicServer graphicServer; TextServer textServer; + URL[] graphicSearchPath; + boolean cachingGraphics; /** * Map whose key is a String of the namespace URI, and whose value is @@ -65,10 +67,13 @@ private NamespaceXML namespaceXML; public FOrayFOTreeServer(Log logger, GraphicServer graphicServer, - TextServer textServer) { + TextServer textServer, URL[] graphicSearchPath, + boolean cachingGraphics) { this.logger = logger; this.graphicServer = graphicServer; this.textServer = textServer; + this.graphicSearchPath = graphicSearchPath; + this.cachingGraphics = cachingGraphics; setupNamespaces(); } @@ -194,12 +199,12 @@ /** * {@inheritDoc} */ - public org.axsl.fotree.FOTreeBuilder makeTreeBuilder( - FOTreeControl control) { - FOTreeBuilder foTreeBuilder = new FOTreeBuilder(this, control, - this.getLogger()); + public org.axsl.fotree.FOTreeBuilder makeTreeBuilder() { + FOTreeBuilder foTreeBuilder = new FOTreeBuilder(this, this.getLogger()); foTreeBuilder.setGraphicServer(this.graphicServer); foTreeBuilder.setTextServer(this.textServer); + foTreeBuilder.setGraphicSearchPath(this.graphicSearchPath); + foTreeBuilder.setCachingGraphics(this.cachingGraphics); return foTreeBuilder; } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ExternalGraphic.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ExternalGraphic.java 2006-05-03 19:13:12 UTC (rev 7122) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ExternalGraphic.java 2006-05-03 19:43:11 UTC (rev 7123) @@ -84,8 +84,8 @@ makeGraphicAttempted = true; try { this.graphic = getGraphicServer().makeGraphic(traitSrc(), - getFOTreeControl().getGraphicSearchPath(), - getFOTreeControl().getCachingGraphics()); + getFOTreeBuilder().getGraphicSearchPath(), + getFOTreeBuilder().getCachingGraphics()); } catch (GraphicException e) { getLogger().error(e.getMessage() + "\n" + this.getContextMessage()); Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BackgroundImage.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BackgroundImage.java 2006-05-03 19:13:12 UTC (rev 7122) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BackgroundImage.java 2006-05-03 19:43:11 UTC (rev 7123) @@ -95,8 +95,8 @@ Graphic backgroundImage = null; try { backgroundImage = fobj.getGraphicServer().makeGraphic(src, - fobj.getFOTreeControl().getGraphicSearchPath(), - fobj.getFOTreeControl().getCachingGraphics()); + fobj.getFOTreeBuilder().getGraphicSearchPath(), + fobj.getFOTreeBuilder().getCachingGraphics()); } catch (GraphicException imgex) { backgroundImage = null; fobj.getLogger().error("Error creating background image: " Modified: trunk/foray/foray-output/src/java/org/foray/output/OutputControl.java =================================================================== --- trunk/foray/foray-output/src/java/org/foray/output/OutputControl.java 2006-05-03 19:13:12 UTC (rev 7122) +++ trunk/foray/foray-output/src/java/org/foray/output/OutputControl.java 2006-05-03 19:43:11 UTC (rev 7123) @@ -47,13 +47,6 @@ public URL getBaseURL() ; /** - * Tells whether graphics should be cached in memory for reuse. - * @return True if graphics should be cached in memory, false if they - * should be removed after being used. - */ - public boolean getCachingGraphics() ; - - /** * @return The FontConsumer implementation which should be used by this * renderer. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-04 22:55:57
|
Revision: 7140 Author: victormote Date: 2006-05-04 15:55:45 -0700 (Thu, 04 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7140&view=rev Log Message: ----------- Move some AreaTreeControl methods to AreaTree constructor. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java trunk/foray/foray-areatree/src/java/org/foray/area/AreaTreeControl.java Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-04 22:35:10 UTC (rev 7139) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-04 22:55:45 UTC (rev 7140) @@ -309,7 +309,9 @@ private AreaTree getAreaTree() { if (this.areaTree == null) { this.areaTree = new AreaTree(this.document.getFOTreeBuilder() - .getRootFObj(), this); + .getRootFObj(), this, this.getFontConsumer(), + this.getTextServer(), this.getLogger(), + this.getLayoutStrategy()); } return this.areaTree; } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java 2006-05-04 22:35:10 UTC (rev 7139) +++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java 2006-05-04 22:55:45 UTC (rev 7140) @@ -432,7 +432,7 @@ } public LayoutStrategy getLayoutStrategy() { - return this.getAreaTreeControl().getLayoutStrategy(); + return this.getAreaNodeParent().getLayoutStrategy(); } } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java 2006-05-04 22:35:10 UTC (rev 7139) +++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java 2006-05-04 22:55:45 UTC (rev 7140) @@ -47,6 +47,10 @@ /** The AreaTreeControl implementation that controls this AreaTree. */ AreaTreeControl control; + private FontConsumer fontConsumer; + private TextServer textServer; + private Log logger; + private LayoutStrategy layoutStrategy; /** * An ordered list of all of the PageCollection objects that have been @@ -57,9 +61,15 @@ */ public ArrayList pageCollectionsProcessed = new ArrayList(); - public AreaTree(Root root, AreaTreeControl control) { + public AreaTree(Root root, AreaTreeControl control, + FontConsumer fontConsumer, TextServer textServer, Log logger, + LayoutStrategy layoutStrategy) { super(root, null); this.control = control; + this.fontConsumer = fontConsumer; + this.textServer = textServer; + this.logger = logger; + this.layoutStrategy = layoutStrategy; /* * These registration steps must take place after the AreaTreeControl * has been stored. @@ -83,7 +93,7 @@ } public FontConsumer getFontConsumer() { - return control.getFontConsumer(); + return this.fontConsumer; } public PageSequence getCurrentPageSequence() { @@ -99,13 +109,21 @@ } public TextServer getTextServer() { - return control.getTextServer(); + return this.textServer; } public Log getLogger() { - return control.getLogger(); + return this.logger; } + /** + * Overrides method in AreaNode, because this knows how to return the + * LayoutStrategy directly. + */ + public LayoutStrategy getLayoutStrategy() { + return this.layoutStrategy; + } + public byte getAreaType() { return AreaNode.AREATYPE_AREA_TREE; } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaTreeControl.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/AreaTreeControl.java 2006-05-04 22:35:10 UTC (rev 7139) +++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaTreeControl.java 2006-05-04 22:55:45 UTC (rev 7140) @@ -26,12 +26,8 @@ import org.foray.common.FOrayException; -import org.axsl.font.FontConsumer; import org.axsl.fotree.fo.PageSequence; -import org.axsl.text.TextServer; -import org.apache.commons.logging.Log; - import java.util.ArrayList; /** @@ -41,11 +37,6 @@ public interface AreaTreeControl { /** - * Returns the FontConsumer that is being used to process this document. - */ - public FontConsumer getFontConsumer(); - - /** * Takes a completed page from the AreaTree and does something with it * (presumable renders it). * @param page The PageRA instance to be processed. @@ -58,10 +49,4 @@ public ArrayList getDocumentMarkers() ; - public TextServer getTextServer() ; - - public Log getLogger() ; - - public LayoutStrategy getLayoutStrategy() ; - } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-04 23:47:52
|
Revision: 7143 Author: victormote Date: 2006-05-04 16:47:36 -0700 (Thu, 04 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7143&view=rev Log Message: ----------- Move more methods from AreaTreeControl to AreaTree classes. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java trunk/foray/foray-areatree/src/java/org/foray/area/AreaTreeControl.java trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-04 23:19:48 UTC (rev 7142) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-04 23:47:36 UTC (rev 7143) @@ -43,7 +43,6 @@ import org.axsl.font.FontServer; import org.axsl.fotree.FOTreeEvent; import org.axsl.fotree.FOTreeListener; -import org.axsl.fotree.fo.Marker; import org.axsl.fotree.fo.PageSequence; import org.axsl.graphic.GraphicServer; import org.axsl.text.TextServer; @@ -137,8 +136,6 @@ /** * The list of markers. */ - private ArrayList documentMarkers; - private ArrayList currentPageSequenceMarkers; private PageSequence currentPageSequence; /** @@ -317,26 +314,6 @@ } public synchronized void queuePage(PageRA page) throws FOrayException { - // process markers - PageSequence pageSequence = page.getPageSequence(); - if (pageSequence != currentPageSequence) { - currentPageSequence = pageSequence; - currentPageSequenceMarkers = null; - } - ArrayList markers = page.getMarkers(); - if (markers != null) { - if (documentMarkers == null) { - documentMarkers = new ArrayList(); - } - if (currentPageSequenceMarkers == null) { - currentPageSequenceMarkers = new ArrayList(); - } - for (int i = 0; i < markers.size(); i++) { - Marker marker = (Marker) markers.get(i); - currentPageSequenceMarkers.add(marker); - documentMarkers.add(marker); - } - } /* * We run the pages through a queue because any page page that contains @@ -381,20 +358,10 @@ } // Auxillary function for retrieving markers. - public ArrayList getDocumentMarkers() { - return documentMarkers; - } - - // Auxillary function for retrieving markers. public PageSequence getCurrentPageSequence() { return currentPageSequence; } - // Auxillary function for retrieving markers. - public ArrayList getCurrentPageSequenceMarkers() { - return currentPageSequenceMarkers; - } - /** * Return the logger to be used. (Required by the FontConsumer interface). */ Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java 2006-05-04 23:19:48 UTC (rev 7142) +++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java 2006-05-04 23:47:36 UTC (rev 7143) @@ -51,6 +51,7 @@ private TextServer textServer; private Log logger; private LayoutStrategy layoutStrategy; + private ArrayList documentMarkers = new ArrayList(); /** * An ordered list of all of the PageCollection objects that have been @@ -96,12 +97,8 @@ return this.fontConsumer; } - public ArrayList getCurrentPageSequenceMarkers() { - return control.getCurrentPageSequenceMarkers(); - } - public ArrayList getDocumentMarkers() { - return control.getDocumentMarkers(); + return this.documentMarkers; } public TextServer getTextServer() { Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaTreeControl.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/AreaTreeControl.java 2006-05-04 23:19:48 UTC (rev 7142) +++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaTreeControl.java 2006-05-04 23:47:36 UTC (rev 7143) @@ -26,8 +26,6 @@ import org.foray.common.FOrayException; -import java.util.ArrayList; - /** * This is conceptually the ancestor of the entire AreaTree. Implementations * are usually classes from applications wanting to build and use an AreaTree. @@ -41,8 +39,4 @@ */ public void queuePage(PageRA page) throws FOrayException ; - public ArrayList getCurrentPageSequenceMarkers() ; - - public ArrayList getDocumentMarkers() ; - } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java 2006-05-04 23:19:48 UTC (rev 7142) +++ trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java 2006-05-04 23:47:36 UTC (rev 7143) @@ -54,6 +54,8 @@ */ public int currentPageNumber; + private ArrayList currentPageSequenceMarkers = new ArrayList(); + /** * Constructor. * @param pageSeq The "cousin" PageSequence object for which this @@ -115,7 +117,7 @@ } public ArrayList getCurrentPageSequenceMarkers() { - return getAreaTree().getCurrentPageSequenceMarkers(); + return this.currentPageSequenceMarkers; } public ArrayList getDocumentMarkers() { Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2006-05-04 23:19:48 UTC (rev 7142) +++ trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2006-05-04 23:47:36 UTC (rev 7143) @@ -250,6 +250,15 @@ */ public void layoutComplete() throws FOrayException { purgeEmptyNodes(this); + ArrayList markers = getMarkers(); + if (markers != null) { + for (int i = 0; i < markers.size(); i++) { + Marker marker = (Marker) markers.get(i); + this.getPageCollection().getCurrentPageSequenceMarkers() + .add(marker); + this.getAreaTree().getDocumentMarkers().add(marker); + } + } getAreaTreeControl().queuePage(this); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-08 17:38:39
|
Revision: 7162 Author: victormote Date: 2006-05-07 07:57:29 -0700 (Sun, 07 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7162&view=rev Log Message: ----------- Use more render-specific Exception. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java trunk/foray/foray-render/src/java/org/foray/render/Renderer.java trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-07 01:07:38 UTC (rev 7161) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-07 14:57:29 UTC (rev 7162) @@ -38,6 +38,7 @@ import org.foray.pioneer.PioneerLS; import org.foray.render.Renderer; +import org.axsl.areaR.AreaRException; import org.axsl.areaR.PageArea; import org.axsl.foR.FOTreeEvent; import org.axsl.foR.FOTreeListener; @@ -221,7 +222,7 @@ try { processQueue(true); outputTarget.stopOutput(); - } catch (FOrayException e) { + } catch (AreaRException e) { throw new SAXException(e); } catch (IOException e) { @@ -287,7 +288,7 @@ pageCollection); try { processQueue(false); - } catch (FOrayException e1) { + } catch (AreaRException e1) { throw new SAXException(e1); } catch (IOException e1) { // TODO Auto-generated catch block @@ -336,7 +337,7 @@ move forward, so return. */ private synchronized void processQueue(boolean force) - throws FOrayException, IOException { + throws AreaRException, IOException { if (! (this.outputTarget instanceof Renderer)) { return; } Modified: trunk/foray/foray-render/src/java/org/foray/render/Renderer.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2006-05-07 01:07:38 UTC (rev 7161) +++ trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2006-05-07 14:57:29 UTC (rev 7162) @@ -29,7 +29,7 @@ package org.foray.render; -import org.foray.common.FOrayException; +import org.axsl.areaR.AreaRException; import org.foray.common.MUserAgent; import org.foray.common.SVGUserAgent; import org.foray.output.OutputConfig; @@ -100,7 +100,7 @@ * render the given area tree to the given stream */ public abstract void render(PageArea page) throws IOException, - FOrayException; + AreaRException; protected void doFrame(Area area) { markBorder(area); Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-05-07 01:07:38 UTC (rev 7161) +++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-05-07 14:57:29 UTC (rev 7162) @@ -29,7 +29,7 @@ package org.foray.render.pdf; -import org.foray.common.FOrayException; +import org.axsl.areaR.AreaRException; import org.foray.common.StringUtilPre5; import org.foray.output.OutputConfig; import org.foray.render.PrintRenderer; @@ -373,7 +373,7 @@ /** * Render page to PDF. {@inheritDoc} */ - public void render(PageArea page) throws FOrayException, IOException { + public void render(PageArea page) throws AreaRException, IOException { getLogger().debug("Rendering single page to PDF."); float w = page.getWidth(); float h = page.getHeight(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-08 23:12:16
|
Revision: 7223 Author: victormote Date: 2006-05-08 15:42:56 -0700 (Mon, 08 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7223&view=rev Log Message: ----------- Steps toward making page queuing event-based. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java trunk/foray/foray-areatree/src/java/org/foray/area/AreaTreeControl.java Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-08 21:58:50 UTC (rev 7222) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-08 22:42:56 UTC (rev 7223) @@ -26,7 +26,6 @@ import org.foray.area.AreaTree; import org.foray.area.AreaTreeControl; -import org.foray.area.PageRA; import org.foray.font.FOrayFontConsumer; import org.foray.font.FOrayFontServer; import org.foray.layout.LayoutStrategy; @@ -37,6 +36,8 @@ import org.axsl.areaR.AreaRException; import org.axsl.areaR.PageArea; +import org.axsl.areaW.AreaTreeEvent; +import org.axsl.areaW.AreaTreeListener; import org.axsl.areaW.AreaWException; import org.axsl.foR.FOTreeEvent; import org.axsl.foR.FOTreeListener; @@ -66,7 +67,7 @@ FOTreeBuilder when a PageSequence is created, and AreaTree when a Page is formatted.<P> */ -public class FOrayTarget implements FOTreeListener, +public class FOrayTarget implements FOTreeListener, AreaTreeListener, AreaTreeControl, OutputControl { private static final boolean MEM_PROFILE_WITH_GC = false; @@ -305,8 +306,23 @@ return this.areaTree; } - public synchronized void queuePage(PageRA page) throws AreaWException { + public void pageComplete(AreaTreeEvent event) { + org.axsl.areaW.PageArea page = event.getPage(); + org.axsl.areaR.PageArea pageToRender = (PageArea) page; + try { + queuePage(pageToRender); + } catch (AreaWException e) { + /* TODO: Do something better with this. */ + e.printStackTrace(); + } + } + public void areaTreeComplete(AreaTreeEvent event) { + /* We currently ignore this event. */ + } + + public synchronized void queuePage(PageArea page) throws AreaWException { + /* * We run the pages through a queue because any page page that contains * an unresolved ref-id prevents subsequent pages from being rendered. Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaTreeControl.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/AreaTreeControl.java 2006-05-08 21:58:50 UTC (rev 7222) +++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaTreeControl.java 2006-05-08 22:42:56 UTC (rev 7223) @@ -24,6 +24,7 @@ package org.foray.area; +import org.axsl.areaR.PageArea; import org.axsl.areaW.AreaWException; /** @@ -37,6 +38,6 @@ * (presumable renders it). * @param page The PageRA instance to be processed. */ - public void queuePage(PageRA page) throws AreaWException ; + public void queuePage(PageArea page) throws AreaWException ; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-08 23:56:40
|
Revision: 7229 Author: victormote Date: 2006-05-08 16:56:26 -0700 (Mon, 08 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7229&view=rev Log Message: ----------- Remove the end-of-document event. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-08 23:51:04 UTC (rev 7228) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-08 23:56:26 UTC (rev 7229) @@ -317,12 +317,7 @@ } } - public void areaTreeComplete(AreaTreeEvent event) { - /* We currently ignore this event. */ - } - public synchronized void queuePage(PageArea page) throws AreaWException { - /* * We run the pages through a queue because any page page that contains * an unresolved ref-id prevents subsequent pages from being rendered. Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java 2006-05-08 23:51:04 UTC (rev 7228) +++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java 2006-05-08 23:56:26 UTC (rev 7229) @@ -226,16 +226,4 @@ } } - /** - * Notify all listeners that a "Document Complete" event has been fired. - */ - protected void notifyDocumentComplete() { - AreaTreeEvent event = new AreaTreeEvent(this); - for (int i = 0; i < this.areaTreeListeners.size(); i++) { - AreaTreeListener listener = (AreaTreeListener) - this.areaTreeListeners.get(i); - listener.areaTreeComplete(event); - } - } - } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-08 23:56:40
|
Revision: 7165 Author: victormote Date: 2006-05-07 09:13:01 -0700 (Sun, 07 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7165&view=rev Log Message: ----------- Move a LayoutControl method to LayoutStrategy constructor. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java trunk/foray/foray-areatree/src/java/org/foray/area/LayoutControl.java trunk/foray/foray-areatree/src/java/org/foray/area/LayoutStrategy.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java Modified: trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java 2006-05-07 16:05:59 UTC (rev 7164) +++ trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java 2006-05-07 16:13:01 UTC (rev 7165) @@ -129,7 +129,7 @@ * Targets that do not need an OutputStream should set that parameter * to null. */ - LayoutStrategy layout = new PioneerLS(); + LayoutStrategy layout = new PioneerLS(session.getLogger()); FileOutputStream outputFileStream = getFileOutputStream(); FOrayTarget target = new FOrayTarget(document, outputTarget, layout, outputFileStream); Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-07 16:05:59 UTC (rev 7164) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-07 16:13:01 UTC (rev 7165) @@ -171,7 +171,7 @@ // Validate the LayoutStrategy. If null, create a default one. this.layout = layout; if (this.layout == null) { - this.layout = new PioneerLS(); + this.layout = new PioneerLS(this.getLogger()); } this.layout.setLayoutControl(this); Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LayoutControl.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/LayoutControl.java 2006-05-07 16:05:59 UTC (rev 7164) +++ trunk/foray/foray-areatree/src/java/org/foray/area/LayoutControl.java 2006-05-07 16:13:01 UTC (rev 7165) @@ -26,8 +26,6 @@ import org.axsl.graphicR.GraphicServer; -import org.apache.commons.logging.Log; - import java.net.URL; /** @@ -43,6 +41,4 @@ public GraphicServer getGraphicServer(); - public Log getLogger(); - } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LayoutStrategy.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/LayoutStrategy.java 2006-05-07 16:05:59 UTC (rev 7164) +++ trunk/foray/foray-areatree/src/java/org/foray/area/LayoutStrategy.java 2006-05-07 16:13:01 UTC (rev 7165) @@ -48,6 +48,8 @@ import org.axsl.text.line.LineOutput; import org.axsl.text.line.LineText; +import org.apache.commons.logging.Log; + /** * Abstract base class for all Layout systems. */ @@ -60,6 +62,8 @@ */ protected LayoutControl control; + Log logger; + /** * The AreaTree instance that this layout system is processing. */ @@ -68,7 +72,8 @@ /** * Constructor. */ - public LayoutStrategy() { + public LayoutStrategy(Log logger) { + this.logger = logger; } /** @@ -223,4 +228,8 @@ return lineArea; } + public Log getLogger() { + return this.logger; + } + } Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java =================================================================== --- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java 2006-05-07 16:05:59 UTC (rev 7164) +++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java 2006-05-07 16:13:01 UTC (rev 7165) @@ -87,7 +87,8 @@ /** * Constructor. */ - public PioneerLS() { + public PioneerLS(Log logger) { + super(logger); } public void completeCurrentLineInBlock(NormalBlockArea area) { @@ -577,10 +578,6 @@ }; } - public Log getLogger() { - return this.control.getLogger(); - } - public LineBreaker getLineBreaker() { return this.currentLineBreaker; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-08 23:51:40
|
Revision: 7225 Author: victormote Date: 2006-05-08 16:15:04 -0700 (Mon, 08 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7225&view=rev Log Message: ----------- 1. Implement event-fired system for notification of pages completed. 2. Remove AreaTree control interface. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java Removed Paths: ------------- trunk/foray/foray-areatree/src/java/org/foray/area/AreaTreeControl.java Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-08 23:06:41 UTC (rev 7224) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-08 23:15:04 UTC (rev 7225) @@ -25,7 +25,6 @@ package org.foray.app; import org.foray.area.AreaTree; -import org.foray.area.AreaTreeControl; import org.foray.font.FOrayFontConsumer; import org.foray.font.FOrayFontServer; import org.foray.layout.LayoutStrategy; @@ -68,7 +67,7 @@ and AreaTree when a Page is formatted.<P> */ public class FOrayTarget implements FOTreeListener, AreaTreeListener, - AreaTreeControl, OutputControl { + OutputControl { private static final boolean MEM_PROFILE_WITH_GC = false; /** Render to PDF. OutputStream must be set. */ @@ -300,8 +299,9 @@ private AreaTree getAreaTree() { if (this.areaTree == null) { this.areaTree = new AreaTree(this.document.getFOTreeBuilder() - .getRootFObj(), this, this.getFontConsumer(), + .getRootFObj(), this.getFontConsumer(), this.getTextServer(), this.getLogger()); + this.areaTree.registerListener(this); } return this.areaTree; } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java 2006-05-08 23:06:41 UTC (rev 7224) +++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java 2006-05-08 23:15:04 UTC (rev 7225) @@ -258,10 +258,6 @@ return getAreaNodeParent().getLogger(); } - public AreaTreeControl getAreaTreeControl() { - return getAreaNodeParent().getAreaTreeControl(); - } - /** * Finds either "this" or the nearest ancestor area that was generated by * a block-level formatting object. Deleted: trunk/foray/foray-areatree/src/java/org/foray/area/AreaTreeControl.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/AreaTreeControl.java 2006-05-08 23:06:41 UTC (rev 7224) +++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaTreeControl.java 2006-05-08 23:15:04 UTC (rev 7225) @@ -1,43 +0,0 @@ -/* - * Copyright 2004 The FOray Project. - * http://www.foray.org - * - * Licensed 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. - * - * This work is in part derived from the following work(s), used with the - * permission of the licensor: - * Apache FOP, licensed by the Apache Software Foundation - * - */ - -/* $Id$ */ - -package org.foray.area; - -import org.axsl.areaR.PageArea; -import org.axsl.areaW.AreaWException; - -/** - * This is conceptually the ancestor of the entire AreaTree. Implementations - * are usually classes from applications wanting to build and use an AreaTree. - */ -public interface AreaTreeControl { - - /** - * Takes a completed page from the AreaTree and does something with it - * (presumable renders it). - * @param page The PageRA instance to be processed. - */ - public void queuePage(PageArea page) throws AreaWException ; - -} Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2006-05-08 23:06:41 UTC (rev 7224) +++ trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2006-05-08 23:15:04 UTC (rev 7225) @@ -291,7 +291,7 @@ this.getAreaTree().getDocumentMarkers().add(marker); } } - getAreaTreeControl().queuePage(this); + this.getAreaTree().notifyFObjComplete(this); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-09 01:15:14
|
Revision: 7168 Author: victormote Date: 2006-05-07 09:24:46 -0700 (Sun, 07 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7168&view=rev Log Message: ----------- Remove no-longer-needed LayoutControl interface. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java trunk/foray/foray-areatree/src/java/org/foray/area/LayoutStrategy.java Removed Paths: ------------- trunk/foray/foray-areatree/src/java/org/foray/area/LayoutControl.java Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-07 16:21:14 UTC (rev 7167) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-07 16:24:46 UTC (rev 7168) @@ -26,7 +26,6 @@ import org.foray.area.AreaTree; import org.foray.area.AreaTreeControl; -import org.foray.area.LayoutControl; import org.foray.area.LayoutStrategy; import org.foray.area.PageCollection; import org.foray.area.PageRA; @@ -69,7 +68,7 @@ and AreaTree when a Page is formatted.<P> */ public class FOrayTarget implements FOTreeListener, - AreaTreeControl, LayoutControl, OutputControl { + AreaTreeControl, OutputControl { private static final boolean MEM_PROFILE_WITH_GC = false; /** Render to PDF. OutputStream must be set. */ @@ -173,7 +172,6 @@ if (this.layout == null) { this.layout = new PioneerLS(this.getLogger()); } - this.layout.setLayoutControl(this); // Validate the OutputStream. this.outputStream = outputStream; Deleted: trunk/foray/foray-areatree/src/java/org/foray/area/LayoutControl.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/LayoutControl.java 2006-05-07 16:21:14 UTC (rev 7167) +++ trunk/foray/foray-areatree/src/java/org/foray/area/LayoutControl.java 2006-05-07 16:24:46 UTC (rev 7168) @@ -1,37 +0,0 @@ -/* - * Copyright 2004 The FOray Project. - * http://www.foray.org - * - * Licensed 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. - * - * This work is in part derived from the following work(s), used with the - * permission of the licensor: - * Apache FOP, licensed by the Apache Software Foundation - * - */ - -/* $Id$ */ - -package org.foray.area; - -import org.axsl.graphicR.GraphicServer; - -/** - * This interface allows the client application to pass information about the - * environment to the layout engine. - */ -public interface LayoutControl { - - public GraphicServer getGraphicServer(); - -} Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LayoutStrategy.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/LayoutStrategy.java 2006-05-07 16:21:14 UTC (rev 7167) +++ trunk/foray/foray-areatree/src/java/org/foray/area/LayoutStrategy.java 2006-05-07 16:24:46 UTC (rev 7168) @@ -56,12 +56,6 @@ public abstract class LayoutStrategy implements LineBreakHandler, org.axsl.areaW.LayoutStrategy { - /** - * The LayoutControl implementation that passes information to this - * layout system. - */ - protected LayoutControl control; - Log logger; /** @@ -77,14 +71,6 @@ } /** - * @param control The LayoutControl implementation that passes information - * to this layout system. - */ - public void setLayoutControl(LayoutControl control) { - this.control = control; - } - - /** * This the main processing of the LayoutStrategy implementation, which * is to create the needed content in the given PageCollection to satisfy * the PageCollection's cousin PageSequence in the FOTree. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-09 00:52:56
|
Revision: 7163 Author: victormote Date: 2006-05-07 08:21:53 -0700 (Sun, 07 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7163&view=rev Log Message: ----------- Move FOrayException class from Common to App module, forcing other modules to use more appropriate Exception classes. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/AWTStarter.java trunk/foray/foray-app/src/java/org/foray/app/CommandLineOptions.java trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java trunk/foray/foray-app/src/java/org/foray/app/ConfigurationParser.java trunk/foray/foray-app/src/java/org/foray/app/FOInputHandler.java trunk/foray/foray-app/src/java/org/foray/app/FOray.java trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java trunk/foray/foray-app/src/java/org/foray/app/FOraySession.java trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java trunk/foray/foray-app/src/java/org/foray/app/InputHandler.java trunk/foray/foray-app/src/java/org/foray/app/Options.java trunk/foray/foray-app/src/java/org/foray/app/PrintStarter.java trunk/foray/foray-app/src/java/org/foray/app/Starter.java trunk/foray/foray-app/src/java/org/foray/app/TraxInputHandler.java trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTask.java trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTaskStarter.java trunk/foray/foray-app/src/java/org/foray/app/test/TestConverter.java trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoAWTViewer.java trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoFO2PDF.java trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoObj2PDF.java trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoXML2PDF.java trunk/foray/foray-app/src/java/org/foray/demo/servlet/AbstractDemoServlet.java trunk/foray/foray-app/src/java/org/foray/demo/servlet/DemoPrintServlet.java trunk/foray/foray-app/src/java/org/foray/demo/servlet/DemoServlet.java trunk/foray/foray-areatree/src/java/org/foray/area/AbstractInlineArea.java trunk/foray/foray-areatree/src/java/org/foray/area/Area.java trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java trunk/foray/foray-areatree/src/java/org/foray/area/AreaTreeControl.java trunk/foray/foray-areatree/src/java/org/foray/area/BeforeFloatRA.java trunk/foray/foray-areatree/src/java/org/foray/area/ContainerRA.java trunk/foray/foray-areatree/src/java/org/foray/area/FootnoteRA.java trunk/foray/foray-areatree/src/java/org/foray/area/LayoutStrategy.java trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java trunk/foray/foray-areatree/src/java/org/foray/area/MainRA.java trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java trunk/foray/foray-areatree/src/java/org/foray/area/NormalFlowRA.java trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java trunk/foray/foray-areatree/src/java/org/foray/area/RegionRABody.java trunk/foray/foray-areatree/src/java/org/foray/area/SVGArea.java trunk/foray/foray-areatree/src/java/org/foray/area/SpanRA.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/AbstractFlowPL.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/AbstractTableBodyPL.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/BlockContainerPL.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/BlockPL.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/CharacterPL.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/ContinuedLabelPL.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/ExternalGraphicPL.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FONodePL.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FOTextPL.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FObjMixedPL.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FObjPL.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FlowPL.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FootnoteBodyPL.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FootnotePL.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/InstreamForeignObjectPL.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/LeaderPL.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/ListBlockPL.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/ListItemBodyPL.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/ListItemLabelPL.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/ListItemPL.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PageNumberCitationPL.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PageNumberPL.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/RetrieveMarkerPL.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/StaticContentPL.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableCellPL.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableColumnPL.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TablePL.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableRowPL.java Added Paths: ----------- trunk/foray/foray-app/src/java/org/foray/app/FOrayException.java Removed Paths: ------------- trunk/foray/foray-common/src/java/org/foray/common/FOrayException.java Modified: trunk/foray/foray-app/src/java/org/foray/app/AWTStarter.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/AWTStarter.java 2006-05-07 14:57:29 UTC (rev 7162) +++ trunk/foray/foray-app/src/java/org/foray/app/AWTStarter.java 2006-05-07 15:21:53 UTC (rev 7163) @@ -31,7 +31,6 @@ * Modified to use streaming API by Mark Lillywhite, mar...@in... */ -import org.foray.common.FOrayException; import org.foray.output.OutputConfig; import org.foray.render.awt.AWTRenderer; import org.foray.render.awt.viewer.PreviewDialog; Modified: trunk/foray/foray-app/src/java/org/foray/app/CommandLineOptions.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/CommandLineOptions.java 2006-05-07 14:57:29 UTC (rev 7162) +++ trunk/foray/foray-app/src/java/org/foray/app/CommandLineOptions.java 2006-05-07 15:21:53 UTC (rev 7163) @@ -24,7 +24,6 @@ package org.foray.app; -import org.foray.common.FOrayException; import org.foray.common.Logging; import org.foray.output.OutputConfig; Modified: trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java 2006-05-07 14:57:29 UTC (rev 7162) +++ trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java 2006-05-07 15:21:53 UTC (rev 7163) @@ -25,7 +25,6 @@ package org.foray.app; import org.foray.area.LayoutStrategy; -import org.foray.common.FOrayException; import org.foray.output.OutputConfig; import org.foray.output.OutputTarget; import org.foray.pioneer.PioneerLS; Modified: trunk/foray/foray-app/src/java/org/foray/app/ConfigurationParser.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/ConfigurationParser.java 2006-05-07 14:57:29 UTC (rev 7162) +++ trunk/foray/foray-app/src/java/org/foray/app/ConfigurationParser.java 2006-05-07 15:21:53 UTC (rev 7163) @@ -24,7 +24,6 @@ package org.foray.app; -import org.foray.common.FOrayException; import org.foray.output.OutputConfig; import org.apache.commons.logging.Log; Modified: trunk/foray/foray-app/src/java/org/foray/app/FOInputHandler.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOInputHandler.java 2006-05-07 14:57:29 UTC (rev 7162) +++ trunk/foray/foray-app/src/java/org/foray/app/FOInputHandler.java 2006-05-07 15:21:53 UTC (rev 7163) @@ -24,7 +24,6 @@ package org.foray.app; -import org.foray.common.FOrayException; import org.apache.commons.logging.Log; Modified: trunk/foray/foray-app/src/java/org/foray/app/FOray.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOray.java 2006-05-07 14:57:29 UTC (rev 7162) +++ trunk/foray/foray-app/src/java/org/foray/app/FOray.java 2006-05-07 15:21:53 UTC (rev 7163) @@ -24,7 +24,6 @@ package org.foray.app; -import org.foray.common.FOrayException; import org.foray.common.Logging; import org.apache.commons.logging.Log; Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java 2006-05-07 14:57:29 UTC (rev 7162) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java 2006-05-07 15:21:53 UTC (rev 7163) @@ -24,7 +24,6 @@ package org.foray.app; -import org.foray.common.FOrayException; import org.foray.common.XMLParser; import org.foray.output.MIFConverter; import org.foray.output.OutputConfig; Copied: trunk/foray/foray-app/src/java/org/foray/app/FOrayException.java (from rev 7155, trunk/foray/foray-common/src/java/org/foray/common/FOrayException.java) =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayException.java (rev 0) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayException.java 2006-05-07 15:21:53 UTC (rev 7163) @@ -0,0 +1,166 @@ +/* + * Copyright 2004 The FOray Project. + * http://www.foray.org + * + * Licensed 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. + * + * This work is in part derived from the following work(s), used with the + * permission of the licensor: + * Apache FOP, licensed by the Apache Software Foundation + * + */ + +/* $Id$ */ + +package org.foray.app; + +import org.xml.sax.SAXException; + +import java.io.PrintStream; +import java.io.PrintWriter; +import java.lang.reflect.InvocationTargetException; + +/** + * Exception thrown when FOray has a problem. + */ +public class FOrayException extends Exception { + static final long serialVersionUID = 298590433713255908L; + + private static final String EXCEPTION_SEPARATOR = "\n---------\n"; + + private Throwable _exception; + private String contextMessage; + + /** + * Create a new FOray Exception + * + * @param message descriptive message + */ + public FOrayException(String message) { + super(message); + this.contextMessage = null; + } + + public FOrayException(String message, String contextMessage) { + super(message); + this.contextMessage = contextMessage; + } + + public FOrayException(Throwable e) { + super(e.getMessage()); + setException(e); + this.contextMessage = null; + } + + public FOrayException(Throwable e, String contextMessage) { + super(e.getMessage()); + setException(e); + this.contextMessage = contextMessage; + } + + public FOrayException(String message, Throwable e) { + super(message); + setException(e); + this.contextMessage = null; + } + + public FOrayException(String message, Throwable e, String contextMessage) { + super(message); + setException(e); + this.contextMessage = contextMessage; + } + + protected void setException(Throwable t) { + _exception = t; + } + + public Throwable getException() { + return _exception; + } + + public void setContextMessage(String contextMessage) { + this.contextMessage = contextMessage; + } + + public boolean isContextSet() { + return this.contextMessage != null; + } + + protected Throwable getRootException() { + Throwable result = _exception; + + if (result instanceof SAXException) { + result = ((SAXException)result).getException(); + } + if (result instanceof InvocationTargetException) { + result = + ((InvocationTargetException)result) + .getTargetException(); + } + if (result != _exception) { + return result; + } + return null; + } + + public String getMessage() { + if (this.contextMessage != null) { + return super.getMessage() + "\n" + + this.contextMessage; + } + return super.getMessage(); + } + + public void printStackTrace() { + synchronized (System.err) { + super.printStackTrace(); + if (_exception != null) { + System.err.println(EXCEPTION_SEPARATOR); + _exception.printStackTrace(); + } + if (getRootException() != null) { + System.err.println(EXCEPTION_SEPARATOR); + getRootException().printStackTrace(); + } + } + } + + public void printStackTrace(PrintStream stream) { + synchronized (stream) { + super.printStackTrace(stream); + if (_exception != null) { + stream.println(EXCEPTION_SEPARATOR); + _exception.printStackTrace(stream); + } + if (getRootException() != null) { + stream.println(EXCEPTION_SEPARATOR); + getRootException().printStackTrace(stream); + } + } + } + + public void printStackTrace(PrintWriter writer) { + synchronized (writer) { + super.printStackTrace(writer); + if (_exception != null) { + writer.println(EXCEPTION_SEPARATOR); + _exception.printStackTrace(writer); + } + if (getRootException() != null) { + writer.println(EXCEPTION_SEPARATOR); + getRootException().printStackTrace(writer); + } + } + } + +} Modified: trunk/foray/foray-app/src/java/org/foray/app/FOraySession.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOraySession.java 2006-05-07 14:57:29 UTC (rev 7162) +++ trunk/foray/foray-app/src/java/org/foray/app/FOraySession.java 2006-05-07 15:21:53 UTC (rev 7163) @@ -24,7 +24,6 @@ package org.foray.app; -import org.foray.common.FOrayException; import org.foray.common.Logging; import org.foray.common.XMLParser; import org.foray.font.FOrayFontServer; Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-07 14:57:29 UTC (rev 7162) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-07 15:21:53 UTC (rev 7163) @@ -30,7 +30,6 @@ import org.foray.area.LayoutStrategy; import org.foray.area.PageCollection; import org.foray.area.PageRA; -import org.foray.common.FOrayException; import org.foray.font.FOrayFontConsumer; import org.foray.font.FOrayFontServer; import org.foray.output.OutputControl; @@ -40,6 +39,7 @@ import org.axsl.areaR.AreaRException; import org.axsl.areaR.PageArea; +import org.axsl.areaW.AreaWException; import org.axsl.foR.FOTreeEvent; import org.axsl.foR.FOTreeListener; import org.axsl.foR.fo.PageSequence; @@ -281,7 +281,7 @@ (pageSequence); try { layout.formatPageSequence(pageCollection); - } catch (FOrayException e) { + } catch (AreaWException e) { throw new SAXException(e); } this.results.haveFormattedPageSequence(pageSequence, @@ -309,7 +309,7 @@ return this.areaTree; } - public synchronized void queuePage(PageRA page) throws FOrayException { + public synchronized void queuePage(PageRA page) throws AreaWException { /* * We run the pages through a queue because any page page that contains @@ -396,7 +396,7 @@ .getRootFObj(); try { getAreaTree().layoutDocumentNodes(rootFObj); - } catch (FOrayException e1) { + } catch (AreaWException e1) { getLogger().error("Error in layout of Document nodes."); e1.printStackTrace(); } Modified: trunk/foray/foray-app/src/java/org/foray/app/InputHandler.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/InputHandler.java 2006-05-07 14:57:29 UTC (rev 7162) +++ trunk/foray/foray-app/src/java/org/foray/app/InputHandler.java 2006-05-07 15:21:53 UTC (rev 7163) @@ -24,7 +24,6 @@ package org.foray.app; -import org.foray.common.FOrayException; import org.apache.commons.logging.Log; Modified: trunk/foray/foray-app/src/java/org/foray/app/Options.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/Options.java 2006-05-07 14:57:29 UTC (rev 7162) +++ trunk/foray/foray-app/src/java/org/foray/app/Options.java 2006-05-07 15:21:53 UTC (rev 7163) @@ -24,7 +24,6 @@ package org.foray.app; -import org.foray.common.FOrayException; import org.foray.output.OutputConfig; import org.apache.commons.logging.Log; Modified: trunk/foray/foray-app/src/java/org/foray/app/PrintStarter.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/PrintStarter.java 2006-05-07 14:57:29 UTC (rev 7162) +++ trunk/foray/foray-app/src/java/org/foray/app/PrintStarter.java 2006-05-07 15:21:53 UTC (rev 7163) @@ -24,7 +24,6 @@ package org.foray.app; -import org.foray.common.FOrayException; import org.foray.common.Logging; import org.foray.output.OutputConfig; Modified: trunk/foray/foray-app/src/java/org/foray/app/Starter.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/Starter.java 2006-05-07 14:57:29 UTC (rev 7162) +++ trunk/foray/foray-app/src/java/org/foray/app/Starter.java 2006-05-07 15:21:53 UTC (rev 7163) @@ -24,7 +24,6 @@ package org.foray.app; -import org.foray.common.FOrayException; import org.foray.output.OutputConfig; import org.apache.commons.logging.Log; Modified: trunk/foray/foray-app/src/java/org/foray/app/TraxInputHandler.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/TraxInputHandler.java 2006-05-07 14:57:29 UTC (rev 7162) +++ trunk/foray/foray-app/src/java/org/foray/app/TraxInputHandler.java 2006-05-07 15:21:53 UTC (rev 7163) @@ -25,7 +25,6 @@ package org.foray.app; -import org.foray.common.FOrayException; import org.apache.commons.logging.Log; Modified: trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTask.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTask.java 2006-05-07 14:57:29 UTC (rev 7162) +++ trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTask.java 2006-05-07 15:21:53 UTC (rev 7163) @@ -24,9 +24,9 @@ package org.foray.app.ant; +import org.foray.app.FOrayException; import org.foray.app.FOrayTarget; import org.foray.app.Starter; -import org.foray.common.FOrayException; import org.foray.common.Logging; import org.apache.commons.logging.Log; Modified: trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTaskStarter.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTaskStarter.java 2006-05-07 14:57:29 UTC (rev 7162) +++ trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTaskStarter.java 2006-05-07 15:21:53 UTC (rev 7163) @@ -26,13 +26,13 @@ import org.foray.app.FOInputHandler; import org.foray.app.FOrayDocument; +import org.foray.app.FOrayException; import org.foray.app.FOraySession; import org.foray.app.FOrayTarget; import org.foray.app.InputHandler; import org.foray.app.Options; import org.foray.app.SessionConfig; import org.foray.app.Starter; -import org.foray.common.FOrayException; import org.foray.output.OutputConfig; import org.foray.output.OutputTarget; Modified: trunk/foray/foray-app/src/java/org/foray/app/test/TestConverter.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/test/TestConverter.java 2006-05-07 14:57:29 UTC (rev 7162) +++ trunk/foray/foray-app/src/java/org/foray/app/test/TestConverter.java 2006-05-07 15:21:53 UTC (rev 7163) @@ -26,12 +26,12 @@ import org.foray.app.FOInputHandler; import org.foray.app.FOrayDocument; +import org.foray.app.FOrayException; import org.foray.app.FOraySession; import org.foray.app.FOrayTarget; import org.foray.app.InputHandler; import org.foray.app.SessionConfig; import org.foray.app.TraxInputHandler; -import org.foray.common.FOrayException; import org.foray.common.Logging; import org.foray.output.OutputConfig; import org.foray.output.OutputTarget; Modified: trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoAWTViewer.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoAWTViewer.java 2006-05-07 14:57:29 UTC (rev 7162) +++ trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoAWTViewer.java 2006-05-07 15:21:53 UTC (rev 7163) @@ -35,13 +35,13 @@ import javax.xml.transform.TransformerException; import org.foray.app.Application; +import org.foray.app.FOrayException; import org.foray.app.SessionConfig; import org.foray.app.FOInputHandler; import org.foray.app.FOrayDocument; import org.foray.app.FOraySession; import org.foray.app.FOrayTarget; import org.foray.app.InputHandler; -import org.foray.common.FOrayException; import org.foray.render.awt.AWTRenderer; import org.foray.render.awt.viewer.PreviewDialog; import org.foray.render.awt.viewer.SecureResourceBundle; Modified: trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoFO2PDF.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoFO2PDF.java 2006-05-07 14:57:29 UTC (rev 7162) +++ trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoFO2PDF.java 2006-05-07 15:21:53 UTC (rev 7163) @@ -30,13 +30,13 @@ import java.io.OutputStream; import org.foray.app.Application; +import org.foray.app.FOrayException; import org.foray.app.SessionConfig; import org.foray.app.FOInputHandler; import org.foray.app.FOrayDocument; import org.foray.app.FOraySession; import org.foray.app.FOrayTarget; import org.foray.app.InputHandler; -import org.foray.common.FOrayException; import org.foray.output.OutputTarget; /** Modified: trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoObj2PDF.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoObj2PDF.java 2006-05-07 14:57:29 UTC (rev 7162) +++ trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoObj2PDF.java 2006-05-07 15:21:53 UTC (rev 7163) @@ -36,11 +36,11 @@ import javax.xml.transform.stream.StreamSource; import org.foray.app.Application; +import org.foray.app.FOrayException; import org.foray.app.SessionConfig; import org.foray.app.FOrayDocument; import org.foray.app.FOraySession; import org.foray.app.FOrayTarget; -import org.foray.common.FOrayException; import org.foray.output.OutputTarget; import org.foray.demo.embed.model.ProjectTeam; Modified: trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoXML2PDF.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoXML2PDF.java 2006-05-07 14:57:29 UTC (rev 7162) +++ trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoXML2PDF.java 2006-05-07 15:21:53 UTC (rev 7163) @@ -36,11 +36,11 @@ import javax.xml.transform.stream.StreamSource; import org.foray.app.Application; +import org.foray.app.FOrayException; import org.foray.app.SessionConfig; import org.foray.app.FOrayDocument; import org.foray.app.FOraySession; import org.foray.app.FOrayTarget; -import org.foray.common.FOrayException; import org.foray.output.OutputTarget; /** Modified: trunk/foray/foray-app/src/java/org/foray/demo/servlet/AbstractDemoServlet.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/demo/servlet/AbstractDemoServlet.java 2006-05-07 14:57:29 UTC (rev 7162) +++ trunk/foray/foray-app/src/java/org/foray/demo/servlet/AbstractDemoServlet.java 2006-05-07 15:21:53 UTC (rev 7163) @@ -26,11 +26,11 @@ import org.foray.app.FOInputHandler; import org.foray.app.FOrayDocument; +import org.foray.app.FOrayException; import org.foray.app.FOraySession; import org.foray.app.FOrayTarget; import org.foray.app.InputHandler; import org.foray.app.SessionConfig; -import org.foray.common.FOrayException; import org.foray.common.Logging; import org.foray.output.OutputTarget; Modified: trunk/foray/foray-app/src/java/org/foray/demo/servlet/DemoPrintServlet.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/demo/servlet/DemoPrintServlet.java 2006-05-07 14:57:29 UTC (rev 7162) +++ trunk/foray/foray-app/src/java/org/foray/demo/servlet/DemoPrintServlet.java 2006-05-07 15:21:53 UTC (rev 7163) @@ -25,10 +25,10 @@ package org.foray.demo.servlet; import org.foray.app.FOrayDocument; +import org.foray.app.FOrayException; import org.foray.app.FOraySession; import org.foray.app.FOrayTarget; import org.foray.app.InputHandler; -import org.foray.common.FOrayException; import org.foray.render.awt.AWTPrintRenderer; import java.awt.print.PrinterJob ; Modified: trunk/foray/foray-app/src/java/org/foray/demo/servlet/DemoServlet.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/demo/servlet/DemoServlet.java 2006-05-07 14:57:29 UTC (rev 7162) +++ trunk/foray/foray-app/src/java/org/foray/demo/servlet/DemoServlet.java 2006-05-07 15:21:53 UTC (rev 7163) @@ -25,10 +25,10 @@ package org.foray.demo.servlet; import org.foray.app.FOrayDocument; +import org.foray.app.FOrayException; import org.foray.app.FOraySession; import org.foray.app.FOrayTarget; import org.foray.app.InputHandler; -import org.foray.common.FOrayException; import org.foray.output.OutputTarget; import java.io.ByteArrayOutputStream; Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AbstractInlineArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/AbstractInlineArea.java 2006-05-07 14:57:29 UTC (rev 7162) +++ trunk/foray/foray-areatree/src/java/org/foray/area/AbstractInlineArea.java 2006-05-07 15:21:53 UTC (rev 7163) @@ -24,9 +24,8 @@ package org.foray.area; -import org.foray.common.FOrayException; - import org.axsl.areaR.GeneralInlineArea; +import org.axsl.areaW.AreaWException; import org.axsl.foR.FObj; import org.axsl.foR.WritingMode; @@ -53,7 +52,7 @@ return WritingMode.AXIS_IP; } - public Area getOverflowArea(Area childRequesting) throws FOrayException { + public Area getOverflowArea(Area childRequesting) throws AreaWException { return getParentArea().getOverflowArea(this); } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/Area.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2006-05-07 14:57:29 UTC (rev 7162) +++ trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2006-05-07 15:21:53 UTC (rev 7163) @@ -24,8 +24,7 @@ package org.foray.area; -import org.foray.common.FOrayException; - +import org.axsl.areaW.AreaWException; import org.axsl.common.Constants; import org.axsl.foR.FObj; import org.axsl.foR.WritingMode; @@ -985,7 +984,7 @@ * overflow condition. */ public abstract Area getOverflowArea(Area childRequesting) - throws FOrayException; + throws AreaWException; public int traitHalfLeadingOpt() { return traitGeneratedBy().traitHalfLeadingOpt(); Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java 2006-05-07 14:57:29 UTC (rev 7162) +++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java 2006-05-07 15:21:53 UTC (rev 7163) @@ -24,8 +24,7 @@ package org.foray.area; -import org.foray.common.FOrayException; - +import org.axsl.areaW.AreaWException; import org.axsl.foR.FObj; import org.axsl.foR.fo.Bookmark; import org.axsl.foR.fo.BookmarkTitle; @@ -129,11 +128,11 @@ * @param rootFObj The Root instance that is the grand ancestor of the * FOTree that was parsed. */ - public void layoutDocumentNodes(Root rootFObj) throws FOrayException { + public void layoutDocumentNodes(Root rootFObj) throws AreaWException { layoutBookmarkTree(rootFObj); } - private void layoutBookmarkTree(Root rootFObj) throws FOrayException { + private void layoutBookmarkTree(Root rootFObj) throws AreaWException { BookmarkTree bookmarkTree = rootFObj.g... [truncated message content] |
|
From: <vic...@us...> - 2006-05-09 11:51:40
|
Revision: 7230 Author: victormote Date: 2006-05-09 04:51:21 -0700 (Tue, 09 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7230&view=rev Log Message: ----------- Move some methods from OutputControl to OutputTarget setters. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java trunk/foray/foray-output/src/java/org/foray/output/OutputControl.java trunk/foray/foray-output/src/java/org/foray/output/OutputTarget.java Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-08 23:56:26 UTC (rev 7229) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-09 11:51:21 UTC (rev 7230) @@ -178,6 +178,7 @@ && outputStream == null) { throw new FOrayException("OutputStream is required."); } + this.outputTarget.setOutputStream(this.getOutputStream()); FontServer server = getFontServer(); if (server instanceof FOrayFontServer) { Modified: trunk/foray/foray-output/src/java/org/foray/output/OutputControl.java =================================================================== --- trunk/foray/foray-output/src/java/org/foray/output/OutputControl.java 2006-05-08 23:56:26 UTC (rev 7229) +++ trunk/foray/foray-output/src/java/org/foray/output/OutputControl.java 2006-05-09 11:51:21 UTC (rev 7230) @@ -29,7 +29,6 @@ import org.apache.commons.logging.Log; -import java.io.OutputStream; import java.net.URL; /** @@ -96,10 +95,4 @@ */ public String getDeveloperURLShort() ; - /** - * @return The OutputStream that should be written, or null if there is - * none. - */ - public OutputStream getOutputStream() ; - } Modified: trunk/foray/foray-output/src/java/org/foray/output/OutputTarget.java =================================================================== --- trunk/foray/foray-output/src/java/org/foray/output/OutputTarget.java 2006-05-08 23:56:26 UTC (rev 7229) +++ trunk/foray/foray-output/src/java/org/foray/output/OutputTarget.java 2006-05-09 11:51:21 UTC (rev 7230) @@ -37,6 +37,7 @@ public abstract class OutputTarget { protected OutputControl outputControl; + OutputStream outputStream; protected OutputConfig options; @@ -101,8 +102,12 @@ */ public abstract boolean isUsingSystemFonts(); + public void setOutputStream(OutputStream stream) { + this.outputStream = stream; + } + public OutputStream getOutputStream() { - return this.outputControl.getOutputStream(); + return this.outputStream; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-09 12:08:43
|
Revision: 7231 Author: victormote Date: 2006-05-09 05:08:05 -0700 (Tue, 09 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7231&view=rev Log Message: ----------- Move some methods from OutputControl to OutputTarget setters. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java trunk/foray/foray-output/src/java/org/foray/output/OutputControl.java trunk/foray/foray-output/src/java/org/foray/output/OutputTarget.java trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/PreviewDialog.java trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/PreviewDialogAboutBox.java trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-09 11:51:21 UTC (rev 7230) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-09 12:08:05 UTC (rev 7231) @@ -178,7 +178,6 @@ && outputStream == null) { throw new FOrayException("OutputStream is required."); } - this.outputTarget.setOutputStream(this.getOutputStream()); FontServer server = getFontServer(); if (server instanceof FOrayFontServer) { @@ -188,6 +187,17 @@ this.getOutputTarget().isUsingFreeStandingFonts()); } + /* Finish configuring the OutputTarget. */ + this.outputTarget.setOutputStream(this.getOutputStream()); + this.outputTarget.setApplicationName( + Application.getApplicationName()); + this.outputTarget.setApplicationNameShort( + Application.getApplicationNameShort()); + this.outputTarget.setApplicationVersion(Application.getVersion()); + this.outputTarget.setDeveloperURLShort( + Application.getDeveloperURLShort()); + + // Start the renderer. startRenderer(); } @@ -459,34 +469,6 @@ return getConfiguration().optionStrokeSVGText(); } - /** - * {@inheritDoc} - */ - public String getApplicationName() { - return Application.getApplicationName(); - } - - /** - * {@inheritDoc} - */ - public String getApplicationNameShort() { - return Application.getApplicationNameShort(); - } - - /** - * {@inheritDoc} - */ - public String getVersion() { - return Application.getVersion(); - } - - /** - * {@inheritDoc} - */ - public String getDeveloperURLShort() { - return Application.getDeveloperURLShort(); - } - public SessionConfig getConfiguration() { return document.getConfiguration(); } Modified: trunk/foray/foray-output/src/java/org/foray/output/OutputControl.java =================================================================== --- trunk/foray/foray-output/src/java/org/foray/output/OutputControl.java 2006-05-09 11:51:21 UTC (rev 7230) +++ trunk/foray/foray-output/src/java/org/foray/output/OutputControl.java 2006-05-09 12:08:05 UTC (rev 7231) @@ -69,30 +69,4 @@ */ public boolean strokeSVGText() ; - /** - * @return The name of the application that is creating the output. - */ - public String getApplicationName() ; - - /** - * @return The "short" name of the application that is creating the - * output. - * For example, if the name of the application is "XYZ Document Processor", - * the short name might be "XYZ". - */ - public String getApplicationNameShort() ; - - /** - * @return The current version of the application that is creating the - * output. - */ - public String getVersion() ; - - /** - * @return The shortened version of the URL to the home-page of the - * developer. For example, if the URL is "http://www.xyz.com", return - * "www.xyz.com". - */ - public String getDeveloperURLShort() ; - } Modified: trunk/foray/foray-output/src/java/org/foray/output/OutputTarget.java =================================================================== --- trunk/foray/foray-output/src/java/org/foray/output/OutputTarget.java 2006-05-09 11:51:21 UTC (rev 7230) +++ trunk/foray/foray-output/src/java/org/foray/output/OutputTarget.java 2006-05-09 12:08:05 UTC (rev 7231) @@ -38,7 +38,10 @@ protected OutputControl outputControl; OutputStream outputStream; - + public String applicationName; + public String applicationNameShort; + public String applicationVersion; + public String developerURLShort; protected OutputConfig options; /** @@ -118,4 +121,66 @@ return true; } + /** + * @return The name of the application that is creating the output. + */ + public String getApplicationName() { + return applicationName; + } + + /** + * @param applicationName The applicationName to set. + */ + public void setApplicationName(String applicationName) { + this.applicationName = applicationName; + } + + /** + * @return The "short" name of the application that is creating the + * output. + * For example, if the name of the application is "XYZ Document Processor", + * the short name might be "XYZ". + */ + public String getApplicationNameShort() { + return applicationNameShort; + } + + /** + * @param applicationNameShort The applicationNameShort to set. + */ + public void setApplicationNameShort(String applicationNameShort) { + this.applicationNameShort = applicationNameShort; + } + + /** + * @return The current version of the application that is creating the + * output. + */ + public String getApplicationVersion() { + return applicationVersion; + } + + /** + * @param applicationVersion The applicationVersion to set. + */ + public void setApplicationVersion(String applicationVersion) { + this.applicationVersion = applicationVersion; + } + + /** + * @return The shortened version of the URL to the home-page of the + * developer. For example, if the URL is "http://www.xyz.com", return + * "www.xyz.com". + */ + public String getDeveloperURLShort() { + return developerURLShort; + } + + /** + * @param developerURLShort The developerURLShort to set. + */ + public void setDeveloperURLShort(String developerURLShort) { + this.developerURLShort = developerURLShort; + } + } Modified: trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/PreviewDialog.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/PreviewDialog.java 2006-05-09 11:51:21 UTC (rev 7230) +++ trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/PreviewDialog.java 2006-05-09 12:08:05 UTC (rev 7231) @@ -184,7 +184,7 @@ this.setSize(new Dimension(379, 476)); previewArea.setMinimumSize(new Dimension(50, 50)); - this.setTitle(renderer.getOutputControl().getApplicationNameShort() + this.setTitle(renderer.getApplicationNameShort() + ": AWT-" + res.getString("Preview")); scale.addItem("25"); Modified: trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/PreviewDialogAboutBox.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/PreviewDialogAboutBox.java 2006-05-09 11:51:21 UTC (rev 7230) +++ trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/PreviewDialogAboutBox.java 2006-05-09 12:08:05 UTC (rev 7231) @@ -32,7 +32,7 @@ package org.foray.render.awt.viewer; -import org.foray.output.OutputControl; +import org.foray.render.Renderer; import java.awt.AWTEvent; import java.awt.BorderLayout; @@ -78,10 +78,10 @@ public PreviewDialogAboutBox(PreviewDialog parent) { super(parent); - OutputControl control = parent.getRenderer().getOutputControl(); - String product = control.getApplicationNameShort() + " AWT-Preview"; - String version = "Version: " + control.getVersion(); - String copyright = "See " + control.getDeveloperURLShort(); + Renderer renderer = parent.getRenderer(); + String product = renderer.getApplicationNameShort() + " AWT-Preview"; + String version = "Version: " + renderer.getApplicationVersion(); + String copyright = "See " + renderer.getDeveloperURLShort(); enableEvents(AWTEvent.WINDOW_EVENT_MASK); /* imageIcon = new ImageIcon(getClass().getResource("Hier der Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-05-09 11:51:21 UTC (rev 7230) +++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-05-09 12:08:05 UTC (rev 7231) @@ -134,9 +134,8 @@ getLogger().error("Unsupported PDF Version: " + pdfVersion); } } - this.pdfDoc.setProducer( - getOutputControl().getApplicationNameShort() + " " - + getOutputControl().getVersion()); + this.pdfDoc.setProducer(getApplicationNameShort() + " " + + getApplicationVersion()); Date now = new Date(); this.pdfDoc.setCreationDate(now); // setup Encryption Modified: trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java 2006-05-09 11:51:21 UTC (rev 7230) +++ trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java 2006-05-09 12:08:05 UTC (rev 7231) @@ -228,7 +228,7 @@ } protected void writeProcs() { - this.basicProcSet = getOutputControl().getApplicationNameShort() + this.basicProcSet = getApplicationNameShort() + "procs"; write("%%BeginResource: procset " + this.basicProcSet); write("%%Title: Utility procedures"); @@ -321,7 +321,7 @@ write(fontContents); } - this.fontProcSet = getOutputControl().getApplicationNameShort() + this.fontProcSet = getApplicationNameShort() + "Fonts"; write("%%BeginResource: procset " + this.fontProcSet); write("%%Title: Font setup (shortcuts) for this file"); @@ -1060,7 +1060,7 @@ this.pagecount = 0; this.out = new PSStream(this.getOutputStream()); write("%!PS-Adobe-3.0"); - write("%%Creator: " + getOutputControl().getVersion()); + write("%%Creator: " + getApplicationVersion()); write("%%Pages: (atend)"); write("%%DocumentProcessColors: Black"); write("%%DocumentSuppliedResources: procset " + this.fontProcSet); Modified: trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 2006-05-09 11:51:21 UTC (rev 7230) +++ trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 2006-05-09 12:08:05 UTC (rev 7231) @@ -529,7 +529,7 @@ getLogger().debug("rendering areas to XML"); this.writer = new PrintWriter(this.getOutputStream()); this.writer.write("<?xml version=\"1.0\"?>\n<!-- produced by " - + this.getOutputControl().getVersion() + " -->\n"); + + getApplicationVersion() + " -->\n"); writeStartTag("<AreaTree>"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-09 12:18:17
|
Revision: 7232 Author: victormote Date: 2006-05-09 05:18:02 -0700 (Tue, 09 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7232&view=rev Log Message: ----------- Remove no-longer-needed methods. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java trunk/foray/foray-output/src/java/org/foray/output/OutputControl.java Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-09 12:08:05 UTC (rev 7231) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-09 12:18:02 UTC (rev 7232) @@ -43,7 +43,6 @@ import org.axsl.foR.fo.PageSequence; import org.axsl.fontR.FontConsumer; import org.axsl.fontR.FontServer; -import org.axsl.graphicR.GraphicServer; import org.axsl.text.TextServer; import org.apache.commons.logging.Log; @@ -52,7 +51,6 @@ import java.io.IOException; import java.io.OutputStream; -import java.net.URL; import java.util.ArrayList; /** @@ -432,15 +430,6 @@ return false; } - /** - * Required by FOTreeControl interface. - * @return The base URL that should be used for finding external files, like - * graphical images, etc. - */ - public URL getBaseURL() { - return document.getBaseURL(); - } - public FontConsumer getFontConsumer() { return this.fontConsumer; } @@ -453,10 +442,6 @@ return document.getTextServer(); } - public GraphicServer getGraphicServer() { - return document.getGraphicServer(); - } - public OutputStream getOutputStream() { return this.outputStream; } Modified: trunk/foray/foray-output/src/java/org/foray/output/OutputControl.java =================================================================== --- trunk/foray/foray-output/src/java/org/foray/output/OutputControl.java 2006-05-09 12:08:05 UTC (rev 7231) +++ trunk/foray/foray-output/src/java/org/foray/output/OutputControl.java 2006-05-09 12:18:02 UTC (rev 7232) @@ -25,12 +25,9 @@ package org.foray.output; import org.axsl.fontR.FontConsumer; -import org.axsl.graphicR.GraphicServer; import org.apache.commons.logging.Log; -import java.net.URL; - /** * Interface for programs external to the Rendering process to give the * Renderers environmental information. @@ -38,26 +35,12 @@ public interface OutputControl { /** - * Returns the base URL that should be used for constructing paths to - * external resources. - * @return The base URL that should be used for constructing paths to - * external resources. - */ - public URL getBaseURL() ; - - /** * @return The FontConsumer implementation which should be used by this * renderer. */ public FontConsumer getFontConsumer() ; /** - * @return The GraphicServer implementation which should be used by this - * renderer. - */ - public GraphicServer getGraphicServer() ; - - /** * @return The logger that should be used to log messages by this * renderer. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-09 12:33:17
|
Revision: 7234 Author: victormote Date: 2006-05-09 05:32:50 -0700 (Tue, 09 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7234&view=rev Log Message: ----------- 1. Move some methods from OutputControl to OutputTarget setters. 2. Remove no-longer needed OutputControl interface. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java trunk/foray/foray-output/src/java/org/foray/output/OutputTarget.java Removed Paths: ------------- trunk/foray/foray-output/src/java/org/foray/output/OutputControl.java Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-09 12:22:50 UTC (rev 7233) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-09 12:32:50 UTC (rev 7234) @@ -28,7 +28,6 @@ import org.foray.font.FOrayFontConsumer; import org.foray.font.FOrayFontServer; import org.foray.layout.LayoutStrategy; -import org.foray.output.OutputControl; import org.foray.output.OutputTarget; import org.foray.pioneer.PioneerLS; import org.foray.render.Renderer; @@ -64,8 +63,7 @@ FOTreeBuilder when a PageSequence is created, and AreaTree when a Page is formatted.<P> */ -public class FOrayTarget implements FOTreeListener, AreaTreeListener, - OutputControl { +public class FOrayTarget implements FOTreeListener, AreaTreeListener { private static final boolean MEM_PROFILE_WITH_GC = false; /** Render to PDF. OutputStream must be set. */ @@ -162,7 +160,6 @@ if (this.outputTarget == null) { throw new FOrayException("OutputTarget has not been set."); } - this.outputTarget.setOutputControl(this); // Validate the LayoutStrategy. If null, create a default one. this.layout = layout; @@ -194,8 +191,11 @@ this.outputTarget.setApplicationVersion(Application.getVersion()); this.outputTarget.setDeveloperURLShort( Application.getDeveloperURLShort()); + this.outputTarget.setStrokeSVGText(getConfiguration() + .optionStrokeSVGText()); + this.outputTarget.setLogger(this.getLogger()); + this.outputTarget.setFontConsumer(this.getFontConsumer()); - // Start the renderer. startRenderer(); } @@ -450,10 +450,6 @@ return this.outputTarget; } - public boolean strokeSVGText() { - return getConfiguration().optionStrokeSVGText(); - } - public SessionConfig getConfiguration() { return document.getConfiguration(); } Deleted: trunk/foray/foray-output/src/java/org/foray/output/OutputControl.java =================================================================== --- trunk/foray/foray-output/src/java/org/foray/output/OutputControl.java 2006-05-09 12:22:50 UTC (rev 7233) +++ trunk/foray/foray-output/src/java/org/foray/output/OutputControl.java 2006-05-09 12:32:50 UTC (rev 7234) @@ -1,49 +0,0 @@ -/* - * Copyright 2004 The FOray Project. - * http://www.foray.org - * - * Licensed 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. - * - * This work is in part derived from the following work(s), used with the - * permission of the licensor: - * Apache FOP, licensed by the Apache Software Foundation - * - */ - -/* $Id$ */ - -package org.foray.output; - -import org.axsl.fontR.FontConsumer; - -import org.apache.commons.logging.Log; - -/** - * Interface for programs external to the Rendering process to give the - * Renderers environmental information. - */ -public interface OutputControl { - - /** - * @return The FontConsumer implementation which should be used by this - * renderer. - */ - public FontConsumer getFontConsumer() ; - - /** - * @return The logger that should be used to log messages by this - * renderer. - */ - public Log getLogger() ; - -} Modified: trunk/foray/foray-output/src/java/org/foray/output/OutputTarget.java =================================================================== --- trunk/foray/foray-output/src/java/org/foray/output/OutputTarget.java 2006-05-09 12:22:50 UTC (rev 7233) +++ trunk/foray/foray-output/src/java/org/foray/output/OutputTarget.java 2006-05-09 12:32:50 UTC (rev 7234) @@ -36,13 +36,14 @@ */ public abstract class OutputTarget { - protected OutputControl outputControl; OutputStream outputStream; public String applicationName; public String applicationNameShort; public String applicationVersion; public String developerURLShort; boolean strokeSVGText; + Log logger; + FontConsumer fontConsumer; protected OutputConfig options; @@ -53,25 +54,8 @@ this.options = outputConfig; } - /** - * @param outputControl The OutputControl instance which should be used - * to provide environmental information to this renderer. - */ - public void setOutputControl(OutputControl outputControl) { - this.outputControl = outputControl; - } - - /** - * Return the OutputControl implementation which is the conceptual "parent" - * of this renderer. - * @return The OutputControl instance that controls this renderer. - */ - public OutputControl getOutputControl() { - return this.outputControl; - } - public Log getLogger() { - return this.outputControl.getLogger(); + return this.logger; } /** @@ -79,7 +63,7 @@ * Renderer. */ public FontConsumer getFontConsumer() { - return outputControl.getFontConsumer(); + return this.fontConsumer; } /** @@ -197,4 +181,18 @@ return this.strokeSVGText; } + /** + * @param logger The logger to set. + */ + public void setLogger(Log logger) { + this.logger = logger; + } + + /** + * @param fontConsumer The fontConsumer to set. + */ + public void setFontConsumer(FontConsumer fontConsumer) { + this.fontConsumer = fontConsumer; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-24 15:19:34
|
Revision: 7236 Author: victormote Date: 2006-05-24 08:19:19 -0700 (Wed, 24 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7236&view=rev Log Message: ----------- Conform to axsl name changes. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java trunk/foray/foray-app/src/java/org/foray/app/FOraySession.java trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java trunk/foray/foray-fotree/src/java/org/foray/fotree/FOrayFOTreeServer.java Modified: trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java 2006-05-09 12:47:10 UTC (rev 7235) +++ trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java 2006-05-24 15:19:19 UTC (rev 7236) @@ -29,7 +29,7 @@ import org.foray.output.OutputTarget; import org.foray.pioneer.PioneerLS; -import org.axsl.foR.FOTreeServer; +import org.axsl.foR.FOTreeFactory; import org.axsl.fontR.FontServer; import org.axsl.graphicR.GraphicServer; import org.axsl.text.TextServer; @@ -87,7 +87,7 @@ FontServer fontServer = null; TextServer textServer = null; GraphicServer graphicServer = null; - FOTreeServer foTreeServer = null; + FOTreeFactory foTreeServer = null; FOraySession session = new FOraySession(logger, sessionConfig, fontServer, textServer, graphicServer, foTreeServer); Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java 2006-05-09 12:47:10 UTC (rev 7235) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java 2006-05-24 15:19:19 UTC (rev 7236) @@ -97,7 +97,7 @@ private ArrayList targetList = new ArrayList(); /** The FO tree builder, which handles the SAX events. */ - private org.axsl.foR.FOTreeBuilder treeBuilder; + private org.axsl.foR.FOTree treeBuilder; private FOrayTarget currentTarget; @@ -117,7 +117,7 @@ private FOrayDocument(FOraySession session) { this.session = session; session.registerDocument(this); - treeBuilder = this.session.getFOTreeServer().makeTreeBuilder(); + treeBuilder = this.session.getFOTreeServer().makeFOTree(); } /** @@ -331,7 +331,7 @@ return session.getConfiguration(); } - public org.axsl.foR.FOTreeBuilder getFOTreeBuilder() { + public org.axsl.foR.FOTree getFOTreeBuilder() { return this.treeBuilder; } Modified: trunk/foray/foray-app/src/java/org/foray/app/FOraySession.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOraySession.java 2006-05-09 12:47:10 UTC (rev 7235) +++ trunk/foray/foray-app/src/java/org/foray/app/FOraySession.java 2006-05-24 15:19:19 UTC (rev 7236) @@ -30,7 +30,7 @@ import org.foray.fotree.FOrayFOTreeServer; import org.foray.graphic.FOrayGraphicServer; -import org.axsl.foR.FOTreeServer; +import org.axsl.foR.FOTreeFactory; import org.axsl.fontR.FontException; import org.axsl.fontR.FontServer; import org.axsl.graphicR.GraphicServer; @@ -82,7 +82,7 @@ private GraphicServer graphicServer; /** */ - private FOTreeServer foTreeServer; + private FOTreeFactory foTreeServer; /** A SessionConfig instance to be used for this session. */ private SessionConfig configuration; @@ -116,7 +116,7 @@ */ public FOraySession(Log logger, SessionConfig configuration, FontServer fontServer, TextServer textServer, - GraphicServer graphicServer, FOTreeServer foTreeServer) + GraphicServer graphicServer, FOTreeFactory foTreeServer) throws FOrayException { this.log = logger; if (this.log == null) { @@ -276,7 +276,7 @@ } } - public FOTreeServer getFOTreeServer() { + public FOTreeFactory getFOTreeServer() { return this.foTreeServer; } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java 2006-05-09 12:47:10 UTC (rev 7235) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java 2006-05-24 15:19:19 UTC (rev 7236) @@ -52,7 +52,7 @@ * SAX Handler that builds the formatting object tree. */ public class FOTreeBuilder extends DefaultHandler - implements org.axsl.foR.FOTreeBuilder { + implements org.axsl.foR.FOTree { byte[] unsupportedObjectsFO; short[] unsupportedPropertiesFO; Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FOrayFOTreeServer.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FOrayFOTreeServer.java 2006-05-09 12:47:10 UTC (rev 7235) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FOrayFOTreeServer.java 2006-05-24 15:19:19 UTC (rev 7236) @@ -31,7 +31,7 @@ import org.foray.fotree.svg.NamespaceSVG; import org.foray.fotree.xml.NamespaceXML; -import org.axsl.foR.FOTreeServer; +import org.axsl.foR.FOTreeFactory; import org.axsl.graphicR.GraphicServer; import org.axsl.text.TextServer; @@ -47,7 +47,7 @@ * FOTreeServer encapsulates the FOTree at a high level of abstraction for a * client application. */ -public class FOrayFOTreeServer implements FOTreeServer { +public class FOrayFOTreeServer implements FOTreeFactory { Log logger; GraphicServer graphicServer; @@ -199,7 +199,7 @@ /** * {@inheritDoc} */ - public org.axsl.foR.FOTreeBuilder makeTreeBuilder() { + public org.axsl.foR.FOTree makeFOTree() { FOTreeBuilder foTreeBuilder = new FOTreeBuilder(this, this.getLogger()); foTreeBuilder.setGraphicServer(this.graphicServer); foTreeBuilder.setTextServer(this.textServer); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |