You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by pb...@apache.org on 2004/03/16 13:17:54 UTC

cvs commit: xml-fop/src/java/org/apache/fop/render AbstractRenderer.java Renderer.java

pbwest      2004/03/16 04:17:54

  Modified:    src/java/org/apache/fop/render Tag: FOP_0-20-0_Alt-Design
                        AbstractRenderer.java Renderer.java
  Log:
  startRenderer and stopRenderer methods removed.
  Many fields and their setter removed - use general options setter.
  Commented out many fields until design of rendering in alt-design is finalised.
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.24.2.3  +38 -88    xml-fop/src/java/org/apache/fop/render/AbstractRenderer.java
  
  Index: AbstractRenderer.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/AbstractRenderer.java,v
  retrieving revision 1.24.2.2
  retrieving revision 1.24.2.3
  diff -u -r1.24.2.2 -r1.24.2.3
  --- AbstractRenderer.java	13 Mar 2004 08:46:05 -0000	1.24.2.2
  +++ AbstractRenderer.java	16 Mar 2004 12:17:53 -0000	1.24.2.3
  @@ -18,9 +18,8 @@
   
   package org.apache.fop.render;
   
  -import java.io.IOException;
   import java.io.OutputStream;
  -import java.util.Date;
  +import java.util.HashMap;
   import java.util.Map;
   import java.util.logging.Logger;
   // XML
  @@ -33,87 +32,56 @@
   import org.apache.fop.apps.Fop;
   import org.apache.fop.configuration.FOUserAgent;
   
  -import org.apache.avalon.framework.configuration.Configurable;
  -import org.apache.avalon.framework.configuration.Configuration;
  -import org.apache.avalon.framework.configuration.ConfigurationException;
  -
   /**
    * Abstract base class for all renderers. The Abstract renderer does all the
    * top level processing of the area tree and adds some abstract methods to
    * handle viewports. This keeps track of the current block and inline position.
    */
   public abstract class AbstractRenderer
  -         implements Renderer, Configurable {
  +         implements Renderer {
   
  -    /**
  -     * user agent
  -     */
  +    protected OutputStream output;
  +    /** user agent */
       protected FOUserAgent userAgent;
   
  -    /**
  -     * producer (usually "FOP")
  -     */
  -    protected String producer = "FOP";
  -
  -    /**
  -     * creator of document
  -     */
  -    protected String creator = null;
  -
  -    /**
  -     * creation time
  -     */
  -    protected Date creationDate = null;
  -
  -    /**
  -     * renderer configuration
  -     */
  -    protected Map options;
  -
  -    /**
  -     * block progression position
  -     */
  -    protected int currentBPPosition = 0;
  -
  -    /**
  -     * inline progression position
  -     */
  -    protected int currentIPPosition = 0;
  -
  -    /**
  -     * current inline progression position in block
  -     */
  -    protected int currentBlockIPPosition = 0;
  -
  -    /**
  -     * the block progression position of the containing block used for
  -     * absolutely positioned blocks
  -     */
  -    protected int containingBPPosition = 0;
  +    /** renderer configuration */
  +    protected Map options = new HashMap();
   
  -    /**
  -     * the inline progression position of the containing block used for
  -     * absolutely positioned blocks
  -     */
  -    protected int containingIPPosition = 0;
  +//    /** block progression position  */
  +//    protected int currentBPPosition = 0;
  +//
  +//    /** inline progression position */
  +//    protected int currentIPPosition = 0;
  +//
  +//    /** current inline progression position in block */
  +//    protected int currentBlockIPPosition = 0;
  +//
  +//    /**
  +//     * the block progression position of the containing block used for
  +//     * absolutely positioned blocks
  +//     */
  +//    protected int containingBPPosition = 0;
  +//
  +//    /**
  +//     * the inline progression position of the containing block used for
  +//     * absolutely positioned blocks
  +//     */
  +//    protected int containingIPPosition = 0;
   
   
       protected Logger log = Logger.getLogger(Fop.fopPackage);
  -    
  +
       /**
  -     * @see org.apache.avalon.framework.configuration.Configurable#configure(Configuration)
  +     * Implements Runnable.run() so that this thread can be started.
  +     * Set up the fonts and perform other initialization.
  +     * Respond to requests from layout thread for information
  +     * Wait for requests from layout thread for layout.
        */
  -    public void configure(Configuration conf) throws ConfigurationException {
  -    }
  -
  -    /** @see org.apache.fop.render.Renderer */
  -    public void setProducer(String inProducer) {
  -        producer = inProducer;
  +    public void run() {
       }
   
  -    /** @see org.apache.fop.render.Renderer */
  -    public void setCreator(String inCreator) {
  -        creator = inCreator;
  +    public synchronized void setOutputStream(OutputStream output) {
  +        this.output = output;
       }
   
   //    /**
  @@ -121,32 +89,14 @@
   //     */
   //    public abstract void setupFontInfo(FOTreeControl foTreeControl);
   
  -    /**
  -     *  @see org.apache.fop.render.Renderer
  -     */
  -    public void setUserAgent(FOUserAgent agent) {
  +    /**  @see org.apache.fop.render.Renderer */
  +    public synchronized void setUserAgent(FOUserAgent agent) {
           userAgent = agent;
       }
   
  -    /**
  -     * @param date
  -     */
  -    public void setCreationDate(Date date) {
  -        creationDate = date;
  +    public synchronized void setOption(String key, Object value) {
  +        options.put(key, value);
       }
  -
  -    /** @see org.apache.fop.render.Renderer */
  -    public void setOptions(Map opt) {
  -        options = opt;
  -    }
  -
  -    /** @see org.apache.fop.render.Renderer */
  -    public void startRenderer(OutputStream outputStream)
  -        throws IOException { }
  -
  -    /** @see org.apache.fop.render.Renderer */
  -    public void stopRenderer()
  -        throws IOException { }
   
       /**
        * Check if this renderer supports out of order rendering. If this renderer
  
  
  
  1.8.2.3   +3 -65     xml-fop/src/java/org/apache/fop/render/Renderer.java
  
  Index: Renderer.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/Renderer.java,v
  retrieving revision 1.8.2.2
  retrieving revision 1.8.2.3
  diff -u -r1.8.2.2 -r1.8.2.3
  --- Renderer.java	13 Mar 2004 08:46:05 -0000	1.8.2.2
  +++ Renderer.java	16 Mar 2004 12:17:53 -0000	1.8.2.3
  @@ -21,9 +21,6 @@
   // Java
   import java.io.OutputStream;
   import java.io.IOException;
  -import java.util.Date;
  -import java.util.Map;
  -
   // FOP
   import org.apache.fop.apps.FOPException;
   import org.apache.fop.area.PageViewport;
  @@ -41,35 +38,9 @@
    * ({@link AbstractRenderer}, {@link PrintRenderer}) which already handle a lot
    * of things letting you concentrate on the details of the output format.
    */
  -public interface Renderer {
  -
  -    /**
  -     * Role constant for Avalon.
  -     */
  -    String ROLE = Renderer.class.getName();
  +public interface Renderer extends Runnable {
   
  -
  -    /**
  -     * Initiates the rendering phase.
  -     * This must only be called once for a rendering. If
  -     * stopRenderer is called then this may be called again
  -     * for a new document rendering.
  -     *
  -     * @param outputStream     The OutputStream to use for output
  -     * @exception IOException  If an I/O error occurs
  -     */
  -    void startRenderer(OutputStream outputStream)
  -        throws IOException;
  -
  -    /**
  -     * Signals the end of the rendering phase.
  -     * The renderer should reset to an initial state and dispose of
  -     * any resources for the completed rendering.
  -     *
  -     * @exception IOException  If an I/O error occurs
  -     */
  -    void stopRenderer()
  -        throws IOException;
  +    void setOutputStream(OutputStream outputStream);
   
       /**
        * Set the User Agent.
  @@ -78,40 +49,7 @@
        */
       void setUserAgent(FOUserAgent agent);
   
  -    /**
  -     * Set up renderer options.
  -     *
  -     * @param options  The Configuration for the renderer
  -     */
  -    void setOptions(Map options);
  -
  -    /**
  -     * Set the producer of the rendering. If this method isn't called the
  -     * renderer uses a default. Note: Not all renderers support this feature.
  -     *
  -     * @param producer  The name of the producer (normally "FOP") to be
  -     *      embedded in the generated file.
  -     */
  -    void setProducer(String producer);
  -
  -    /**
  -     * Set the creator of the document to be rendered.
  -     * If this method isn't called the renderer uses a default.
  -     * Note: Not all renderers support this feature.
  -     *
  -     * @param creator  The name of the document creator
  -     */
  -    void setCreator(String creator);
  -    
  -    /**
  -     * Set the creator date/timeof the document to be rendered.
  -     * If this method isn't called the renderer uses the current date/time
  -     * as default.
  -     * Note: Not all renderers support this feature.
  -     *
  -     * @param date The name of the document creator
  -     */
  -    void setCreationDate(Date date);
  +    void setOption(String key, Object value);
   
       /**
        * Reports if out of order rendering is supported. <p>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org