[FOray-commit] SF.net SVN: foray: [7266] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2006-05-26 17:23:19
|
Revision: 7266 Author: victormote Date: 2006-05-26 10:23:07 -0700 (Fri, 26 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7266&view=rev Log Message: ----------- Move the FOraySpecific class to the app package and delete the specific package. Added Paths: ----------- trunk/foray/foray-app/src/java/org/foray/app/FOraySpecific.java Removed Paths: ------------- trunk/foray/foray-specific/ Copied: trunk/foray/foray-app/src/java/org/foray/app/FOraySpecific.java (from rev 7265, trunk/foray/foray-specific/src/java/org/foray/specific/FOraySpecific.java) =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOraySpecific.java (rev 0) +++ trunk/foray/foray-app/src/java/org/foray/app/FOraySpecific.java 2006-05-26 17:23:07 UTC (rev 7266) @@ -0,0 +1,117 @@ +/* + * Copyright 2006 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.foray.common.Logging; +import org.foray.common.XMLParser; +import org.foray.font.FOrayFontServer; +import org.foray.graphic.FOrayGraphicServer; + +import org.axsl.areaW.AreaTreeFactory; +import org.axsl.foR.FOTreeFactory; +import org.axsl.fontR.FontException; +import org.axsl.fontR.FontServer; +import org.axsl.graphicR.GraphicServer; +import org.axsl.layout.LayoutFactory; +import org.axsl.text.TextServer; + +import org.apache.commons.logging.Log; + +import org.xml.sax.EntityResolver; + +import java.net.URL; + +/** + * Utility class that creates FOray-specific implementations of the high-level + * objects for each module. + * The purpose of the methods in this class is to simplify the task of getting + * FOray started up in a standard manner without diminishing the flexibility + * of its pluggable nature. + */ +public class FOraySpecific { + + /** + * Private constructor, as this class should never be instantiated. + */ + private FOraySpecific() { + } + + public static Log makeLogger(SessionConfig configuration) { + if (configuration.optionVerbosity().equals("debug")) { + return Logging.makeDebugLogger(); + } else { + return Logging.makeDefaultLogger(); + } + } + + public static FontServer makeFontServer(Log logger, + SessionConfig configuration, EntityResolver entityResolver) + throws FOrayException { + FOrayFontServer forayFontServer = new FOrayFontServer(logger); + forayFontServer.setBaseFontURL( + configuration.optionFontBaseDirectory()); + forayFontServer.setBaseURL(configuration.optionBaseDirectory()); + forayFontServer.setEntityResolver(entityResolver); + try { + forayFontServer.setup(configuration.optionFontConfiguration(), + null); + } catch (FontException e) { + throw new FOrayException(e); + } + return forayFontServer; + } + + public static TextServer makeTextServer(Log logger, + SessionConfig configuration) throws FOrayException { + URL hyphenationDir = configuration.optionHyphenationBaseDirectory(); + return new org.foray.text.TextServer(logger, hyphenationDir); + + } + + public static GraphicServer makeGraphicServer(Log logger) + throws FOrayException { + return new FOrayGraphicServer(logger, XMLParser.getParserClassName()); + } + + public FOTreeFactory makeFOTreeFactory(GraphicServer graphicServer, + TextServer textServer, URL[] graphicSearchPath) + throws FOrayException { + return null; +// return new FOrayFOTreeServer(this.getLogger(), +// graphicServer, textServer, graphicSearchPath,Wi +// getConfiguration().optionCacheGraphics()); +// + } + + public AreaTreeFactory makeAreaTreeFactory() + throws FOrayException { + return null; + } + + public LayoutFactory makeLayoutFactory() throws FOrayException { + return null; + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |