cvs commit: xml-fop/src/java/org/apache/fop/apps Fop.java

2004-04-15 Thread pbwest
pbwest  2004/04/15 00:02:18

  Modified:src/java/org/apache/fop/apps Tag: FOP_0-20-0_Alt-Design
Fop.java
  Log:
  Added AWT specific rendering details:
  Renderer provides a GraphicsEnvironment for use in layout
  Added getGraphicsEnvironment
  Added renderer initialisation for AWT
  Set default logging level to INFO (java.util.logging)
  Removed redundant setInputHandler method
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.1.2.16  +15 -14xml-fop/src/java/org/apache/fop/apps/Fop.java
  
  Index: Fop.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/Fop.java,v
  retrieving revision 1.1.2.15
  retrieving revision 1.1.2.16
  diff -u -r1.1.2.15 -r1.1.2.16
  --- Fop.java  16 Mar 2004 06:49:03 -  1.1.2.15
  +++ Fop.java  15 Apr 2004 07:02:18 -  1.1.2.16
  @@ -21,6 +21,7 @@
   package org.apache.fop.apps;
   
   //import java.util.logging.Handler;
  +import java.awt.GraphicsEnvironment;
   import java.io.FileNotFoundException;
   import java.io.IOException;
   import java.io.InputStream;
  @@ -82,6 +83,7 @@
   private XmlEventReader eventReader;
   private FOTree foTree;
   private AreaTree areaTree = new AreaTree();
  +private GraphicsEnvironment gEnv = null;
   
   private Thread driverThread;
   private Thread parserThread;
  @@ -190,8 +192,8 @@
   logger = Logger.getLogger(fopPackage);
   logger.setLevel(Level.CONFIG);
   logger.config(version);
  -// Then restrict to WARNING
  -logger.setLevel(Level.WARNING);
  +// Then restrict to INFO
  +logger.setLevel(Level.INFO);
   }
   
   private void setupRunStats() {
  @@ -256,12 +258,15 @@
   throw new FOPException(e2);
   }
   }
  -setInputHandler(options.getInputHandler());
  +inputHandler = options.getInputHandler();
   parser = inputHandler.getParser();
   saxSource = inputHandler.getInputSource();
   // Setting of namespace-prefixes feature no longer required
   //setParserFeatures(parser);
   
  +rendererType = options.getRenderer();
  +setRenderer(rendererType);
  +gEnv = renderer.getGraphicsEnvironment();
   namespaces = new Namespaces();
   eventsBuffer = new SyncedXmlEventsBuffer(namespaces);
   eventReader = new XmlEventReader(eventsBuffer, namespaces);
  @@ -301,15 +306,6 @@
   }
   
   /**
  - * Sets the InputHandler for XML imput as specified in FOPOptions.
  - * @param inputHandler the InputHandler
  - */
  -public void setInputHandler(InputHandler inputHandler) {
  -this.inputHandler = inputHandler;
  -}
  -
  -
  -/**
* Optionally sets the FOUserAgent instance for FOP to use. The Driver
* class sets up its own FOUserAgent if none is set through this method.
* @param agent FOUserAgent to use
  @@ -351,7 +347,8 @@
   //setRenderer(org.apache.fop.render.pdf.PDFRenderer);
   //break;
   case RENDER_AWT:
  -throw new IllegalArgumentException(Use renderer form of setRenderer() 
for AWT);
  +setRenderer(org.apache.fop.render.awt.AWTRenderer);
  +break;
   //case RENDER_PRINT:
   //setRenderer(org.apache.fop.render.awt.AWTPrintRenderer);
   //break;
  @@ -403,6 +400,10 @@
*/
   public Renderer getRenderer() {
   return renderer;
  +}
  +
  +public GraphicsEnvironment getGraphicsEnvironment() {
  +return gEnv;
   }
   
   /**
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: xml-fop/src/java/org/apache/fop/configuration CLI_Options.java

2004-04-15 Thread pbwest
pbwest  2004/04/15 00:09:40

  Modified:src/java/org/apache/fop/configuration Tag:
FOP_0-20-0_Alt-Design CLI_Options.java
  Log:
  Added usage rport using org.apache.commons.cli.HelpFormatter
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.1.2.3   +42 -16
xml-fop/src/java/org/apache/fop/configuration/Attic/CLI_Options.java
  
  Index: CLI_Options.java
  ===
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/configuration/Attic/CLI_Options.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- CLI_Options.java  14 Mar 2004 02:44:53 -  1.1.2.2
  +++ CLI_Options.java  15 Apr 2004 07:09:40 -  1.1.2.3
  @@ -20,11 +20,14 @@
   package org.apache.fop.configuration;
   
   import java.io.FileNotFoundException;
  +import java.io.PrintWriter;
  +import java.io.StringWriter;
   import java.util.Locale;
   import java.util.logging.Level;
   // fop
   import org.apache.commons.cli.CommandLine;
   import org.apache.commons.cli.CommandLineParser;
  +import org.apache.commons.cli.HelpFormatter;
   import org.apache.commons.cli.Option;
   import org.apache.commons.cli.OptionBuilder;
   import org.apache.commons.cli.OptionGroup;
  @@ -64,17 +67,17 @@
   Options options = new Options();
   OptionBuilder.withArgName(help);
   OptionBuilder.withLongOpt(help);
  -OptionBuilder.withDescription(Describe usage);
  +OptionBuilder.withDescription(Describe usage and exit);
   options.addOption(OptionBuilder.create(?));
   // The mutually exclusive verbosity group includes the -d and -q flags
   OptionGroup verbosity = new OptionGroup();
   OptionBuilder.withArgName(debug mode);
   OptionBuilder.withLongOpt(full-error-dump);
  -OptionBuilder.withDescription(Debug mode: verbose reporting);
  +OptionBuilder.withDescription(Verbosity: verbose reporting);
   verbosity.addOption(OptionBuilder.create(d));
   OptionBuilder.withArgName(quiet mode);
   OptionBuilder.withLongOpt(quiet);
  -OptionBuilder.withDescription(Quiet mode: report errors only);
  +OptionBuilder.withDescription(Verbosity: report errors only);
   verbosity.addOption(OptionBuilder.create(q));
   verbosity.setRequired(false);
   // Add verbosity to options
  @@ -102,12 +105,14 @@
   OptionBuilder.withArgName(fo:file);
   OptionBuilder.withLongOpt(fo);
   OptionBuilder.hasArg();
  -OptionBuilder.withDescription(XSL-FO input file);
  +OptionBuilder.withDescription(Input:XSL-FO input file);
   input.addOption(OptionBuilder.create(fo));
   OptionBuilder.withArgName(xml file);
   OptionBuilder.withLongOpt(xml);
   OptionBuilder.hasArg();
  -OptionBuilder.withDescription(XML source file for generating XSL-FO 
input);
  +OptionBuilder.withDescription(
  +Input:XML source file for generating XSL-FO input.
  ++  Requires -xsl);
   input.addOption(
   OptionBuilder.create(xml));
   // Add the input group to the options
  @@ -134,55 +139,57 @@
   OptionGroup output = new OptionGroup();
   OptionBuilder.withArgName(screen renderer);
   OptionBuilder.withLongOpt(awt);
  -OptionBuilder.withDescription(Input will be renderered to display);
  +OptionBuilder.withDescription(Output:Renderered to display using AWT);
   output.addOption(OptionBuilder.create(awt));
   OptionBuilder.withArgName(pdf output file);
   OptionBuilder.withLongOpt(pdf);
   OptionBuilder.hasArg();
  -OptionBuilder.withDescription(Input will be rendered as PDF to named 
file);
  +OptionBuilder.withDescription(Output:Rendered as PDF to named file);
   output.addOption(OptionBuilder.create(pdf));
   OptionBuilder.withArgName(postscript output file);
   OptionBuilder.withLongOpt(ps);
   OptionBuilder.hasArg();
  -OptionBuilder.withDescription(Input will be rendered as Postscript to 
named file);
  +OptionBuilder.withDescription(Ouput:Rendered as Postscript to named file);
   output.addOption(OptionBuilder.create(ps));
   OptionBuilder.withArgName(pcl output file);
   OptionBuilder.withLongOpt(pcl);
   OptionBuilder.hasArg();
  -OptionBuilder.withDescription(Input will be rendered as PCL to named 
file);
  +OptionBuilder.withDescription(Output:Rendered as PCL to named file);
   output.addOption(OptionBuilder.create(pcl));
   OptionBuilder.withArgName(rtf output file);
   OptionBuilder.withLongOpt(rtf);
   OptionBuilder.hasArg();
  -OptionBuilder.withDescription(Input will be rendered 

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

2004-04-15 Thread pbwest
pbwest  2004/04/15 00:45:08

  Modified:src/java/org/apache/fop/render Tag: FOP_0-20-0_Alt-Design
AbstractRenderer.java
  Log:
  Generate and return a GraphicsEnvironment
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.24.2.4  +5 -507xml-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.3
  retrieving revision 1.24.2.4
  diff -u -r1.24.2.3 -r1.24.2.4
  --- AbstractRenderer.java 16 Mar 2004 12:17:53 -  1.24.2.3
  +++ AbstractRenderer.java 15 Apr 2004 07:45:08 -  1.24.2.4
  @@ -18,6 +18,7 @@
   
   package org.apache.fop.render;
   
  +import java.awt.GraphicsEnvironment;
   import java.io.OutputStream;
   import java.util.HashMap;
   import java.util.Map;
  @@ -47,27 +48,6 @@
   /** renderer configuration */
   protected Map options = new HashMap();
   
  -///** 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);
   
  @@ -80,15 +60,14 @@
   public void run() {
   }
   
  +public GraphicsEnvironment getGraphicsEnvironment() {
  +return null;
  +}
  +
   public synchronized void setOutputStream(OutputStream output) {
   this.output = output;
   }
   
  -///**
  -// *  @see org.apache.fop.render.Renderer
  -// */
  -//public abstract void setupFontInfo(FOTreeControl foTreeControl);
  -
   /**  @see org.apache.fop.render.Renderer */
   public synchronized void setUserAgent(FOUserAgent agent) {
   userAgent = agent;
  @@ -110,12 +89,6 @@
   return false;
   }
   
  -///**
  -// * @param ext  (todo) Description of the Parameter
  -// * @seeorg.apache.fop.render.Renderer
  -// */
  -//public void renderExtension(TreeExt ext) { }
  -
   /**
* Prepare a page for rendering. This is called if the renderer supports
* out of order rendering. The renderer should prepare the page so that a
  @@ -127,110 +100,6 @@
*/
   public void preparePage(PageViewport page) { }
   
  -///**
  -// * Utility method to convert a page sequence title to a string. Some
  -// * renderers may only be able to use a string title. A title is a sequence
  -// * of inline areas that this method attempts to convert to an equivalent
  -// * string.
  -// *
  -// * @param title  The Title to convert
  -// * @return   An expanded string representing the title
  -// */
  -//protected String convertTitleToString(Title title) {
  -//List children = title.getInlineAreas();
  -//String str = convertToString(children);
  -//return str.trim();
  -//}
  -//
  -//private String convertToString(List children) {
  -//StringBuffer sb = new StringBuffer();
  -//for (int count = 0; count  children.size(); count++) {
  -//InlineArea inline = (InlineArea) children.get(count);
  -//if (inline instanceof Character) {
  -//sb.append(((Character) inline).getChar());
  -//} else if (inline instanceof TextArea) {
  -//sb.append(((TextArea) inline).getTextArea());
  -//} else if (inline instanceof InlineParent) {
  -//sb.append(convertToString(
  -//((InlineParent) inline).getChildAreas()));
  -//} else {
  -//sb.append( );
  -//}
  -//}
  -//return sb.toString();
  -//}
  -//
  -///** @see org.apache.fop.render.Renderer */
  -//public void startPageSequence(Title seqTitle) {
  -////do nothing
  -//}
  -
  -// normally this would be overriden to create a page in the
  -// output
  -///** @see org.apache.fop.render.Renderer */
  -//public void renderPage(PageViewport page)
  -//throws IOException, FOPException {
  -//
  -//Page p = page.getPage();
  -//renderPageAreas(p);
  -//}
  -
  -///**
  -// * Renders page areas.
  -// *
  -// * @param page  The 

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

2004-04-15 Thread pbwest
pbwest  2004/04/15 00:46:19

  Modified:src/java/org/apache/fop/render Tag: FOP_0-20-0_Alt-Design
Renderer.java
  Log:
  Add getGraphicsEnvironment
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.8.2.4   +4 -0  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.3
  retrieving revision 1.8.2.4
  diff -u -r1.8.2.3 -r1.8.2.4
  --- Renderer.java 16 Mar 2004 12:17:53 -  1.8.2.3
  +++ Renderer.java 15 Apr 2004 07:46:19 -  1.8.2.4
  @@ -19,6 +19,7 @@
   package org.apache.fop.render;
   
   // Java
  +import java.awt.GraphicsEnvironment;
   import java.io.OutputStream;
   import java.io.IOException;
   // FOP
  @@ -41,6 +42,9 @@
   public interface Renderer extends Runnable {
   
   void setOutputStream(OutputStream outputStream);
  +
  +/** @return the codeGraphicsEnvironment/code of this renderer.  */
  +GraphicsEnvironment getGraphicsEnvironment();
   
   /**
* Set the User Agent.
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: xml-fop/build/classes/conf .cvsignore

2004-04-15 Thread pbwest
pbwest  2004/04/15 00:49:09

  Modified:build/classes/conf Tag: FOP_0-20-0_Alt-Design .cvsignore
  Log:
  
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.1.2.3   +2 -0  xml-fop/build/classes/conf/Attic/.cvsignore
  
  Index: .cvsignore
  ===
  RCS file: /home/cvs/xml-fop/build/classes/conf/Attic/.cvsignore,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- .cvsignore6 Mar 2004 06:08:39 -   1.1.2.2
  +++ .cvsignore15 Apr 2004 07:49:09 -  1.1.2.3
  @@ -1,3 +1,5 @@
   config.dtd
   config.xml
  +fop.system.properties
   fop.xconf
  +logging.properties
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: xml-fop/src/java/org/apache/fop/render/awt AWTRenderer.java

2004-04-15 Thread pbwest
pbwest  2004/04/15 01:01:50

  Modified:src/java/org/apache/fop/render/awt Tag:
FOP_0-20-0_Alt-Design AWTRenderer.java
  Log:
  Removed currently unused code from HEAD
  Added generation of GraphicsEnvironment and getGraphicsEnvironment
  Implements Runnable; added run method
  Added thread termination condition
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.21.2.4  +50 -259   xml-fop/src/java/org/apache/fop/render/awt/AWTRenderer.java
  
  Index: AWTRenderer.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/awt/AWTRenderer.java,v
  retrieving revision 1.21.2.3
  retrieving revision 1.21.2.4
  diff -u -r1.21.2.3 -r1.21.2.4
  --- AWTRenderer.java  16 Mar 2004 12:07:08 -  1.21.2.3
  +++ AWTRenderer.java  15 Apr 2004 08:01:50 -  1.21.2.4
  @@ -29,6 +29,7 @@
   import java.awt.Color;
   import java.awt.Dimension;
   import java.awt.Graphics;
  +import java.awt.GraphicsEnvironment;
   import java.awt.Toolkit;
   import java.awt.event.WindowAdapter;
   import java.awt.event.WindowEvent;
  @@ -38,11 +39,7 @@
   import java.awt.print.Printable;
   import java.io.IOException;
   import java.util.Map;
  -import java.util.Vector;
  -
  -import org.apache.fop.apps.Document;
   import org.apache.fop.apps.FOPException;
  -import org.apache.fop.apps.InputHandler;
   import org.apache.fop.area.PageViewport;
   import org.apache.fop.render.AbstractRenderer;
   import org.apache.fop.render.awt.viewer.PreviewDialog;
  @@ -50,29 +47,18 @@
   
   /**
* This is FOP's AWT renderer.
  + * In alt-design, this renders Graphics2D objects.
*/
   public class AWTRenderer
   extends AbstractRenderer
  -implements Printable, Pageable {
  +implements Runnable, Printable, Pageable {
   
   protected double scaleFactor = 100.0;
   protected int pageNumber = 0;
  -private int pageWidth = 0;
  -private int pageHeight = 0;
  -private Vector pageViewportList = new java.util.Vector();
  -private Vector pageList = new java.util.Vector();
  -private Vector bufferedImageList = new java.util.Vector();
   private BufferedImage currentPageImage = null;
  +private GraphicsEnvironment gEnv =
  +GraphicsEnvironment.getLocalGraphicsEnvironment();
   
  -/** Font configuration */
  -protected Document fontInfo;
  -
  -/**
  -The InputHandler associated with this Renderer.
  -Sent to the PreviewDialog for document reloading.
  -*/
  -private InputHandler inputHandler;
  -
   /**
* The resource bundle used for AWT messages.
*/
  @@ -89,15 +75,19 @@
*/
   protected PreviewDialog frame;
   
  -public AWTRenderer(InputHandler handler) {
  -inputHandler = handler;
  +public AWTRenderer() {
   translator = new Translator();
  -createPreviewDialog(inputHandler);
  +createPreviewDialog();
   }
   
  -public AWTRenderer() {
  -translator = new Translator();
  -createPreviewDialog(null);
  +/**
  + * Returns the graphics environment (including available font information)
  + * for this renderer.
  + * 
  + * @return the graphics environment for this renderer
  + */
  +public GraphicsEnvironment getGraphicsEnvironment() {
  +return gEnv;
   }
   
   /**
  @@ -119,14 +109,6 @@
   //FontSetup.setup(fontInfo, fontImage.createGraphics());
   //}
   
  -public int getPageNumber() {
  -return pageNumber;
  -}
  -
  -public void setPageNumber(int aValue) {
  -pageNumber = aValue;
  -}
  -
   public void setScaleFactor(double newScaleFactor) {
   scaleFactor = newScaleFactor;
   }
  @@ -135,20 +117,28 @@
   return scaleFactor;
   }
   
  -//public void startRenderer(OutputStream out)
  -//throws IOException {
  -//// empty pageViewportList, in case of a reload from PreviewDialog
  -//pageViewportList.removeAllElements();
  -//pageList.removeAllElements();
  -//bufferedImageList.removeAllElements();
  -//System.out.println(\nRegion Types: 0-Before/Top, 1-Start/Left, 2-Body, 
3-End/Right, 4-After/Bottom);
  -//}
  -//
  -//public void stopRenderer()
  -//throws IOException {
  -//frame.setStatus(translator.getString(Status.Show));
  -//frame.showPage();
  -//}
  +private boolean finished = false;
  +
  +public synchronized void finish() {
  +if (finished) return;
  +finished = true;
  +notifyAll();
  +}
  +
  +private synchronized void finishing() {
  +while (! finished) {
  +try {
  +wait();
  +} catch (InterruptedException e) {
  +}
  +}
  +}
  +
  +public void run() {
  +// Start the renderer 

cvs commit: xml-fop/src/java/org/apache/fop/render/awt/viewer PreviewDialog.java

2004-04-15 Thread pbwest
pbwest  2004/04/15 01:04:24

  Modified:src/java/org/apache/fop/render/awt/viewer Tag:
FOP_0-20-0_Alt-Design PreviewDialog.java
  Log:
  Removed InputHandler references to maintain compatibility with AWTRenderer
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.2.2.3   +5 -14 
xml-fop/src/java/org/apache/fop/render/awt/viewer/PreviewDialog.java
  
  Index: PreviewDialog.java
  ===
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/render/awt/viewer/PreviewDialog.java,v
  retrieving revision 1.2.2.2
  retrieving revision 1.2.2.3
  diff -u -r1.2.2.2 -r1.2.2.3
  --- PreviewDialog.java14 Mar 2004 11:21:27 -  1.2.2.2
  +++ PreviewDialog.java15 Apr 2004 08:04:24 -  1.2.2.3
  @@ -49,7 +49,6 @@
   
   //FOP
   import org.apache.fop.apps.Fop;
  -import org.apache.fop.apps.InputHandler;
   import org.apache.fop.apps.FOPException;
   import org.apache.fop.render.awt.AWTRenderer;
   
  @@ -66,8 +65,6 @@
   protected Translator translator;
   /** The AWT renderer */
   protected AWTRenderer renderer;
  -/** The InputHandler associated with this window */
  -protected InputHandler inputHandler;
   /** The Fop used for refreshing/reloading the view */
   protected Fop fop;
   
  @@ -83,9 +80,8 @@
* Creates a new PreviewDialog that uses the given renderer.
* @param aRenderer the to use renderer
*/
  -public PreviewDialog(AWTRenderer aRenderer, InputHandler handler) {
  +public PreviewDialog(AWTRenderer aRenderer) {
   renderer = aRenderer;
  -inputHandler = handler;
   translator = renderer.getTranslator();
   
   //Commands aka Actions
  @@ -219,14 +215,13 @@
   }
   });
   // inputHandler must be set to allow reloading
  -if (inputHandler != null) {
   menu.add(new Command(translator.getString(Menu.Reload)) {
   public void doit() {
   reload();
   }
   });
  -}
  -menu.addSeparator();
  +
  +menu.addSeparator();
   menu.add(new Command(translator.getString(Menu.Exit)) {
   public void doit() {
   dispose();
  @@ -394,13 +389,9 @@
   infoStatus.setText();
   currentPage = 0;
   
  -try {
  +// TODO work out how to reload
   setStatus(translator.getString(Status.Build.FO.tree));
  -fop.render(inputHandler);
   setStatus(translator.getString(Status.Show));
  -} catch (FOPException e) {
  -reportException(e);
  -}
   }
   }
   
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: xml-fop/src/java/org/apache/fop/xml FoXmlSerialHandler.java

2004-04-15 Thread pbwest
pbwest  2004/04/15 04:29:58

  Modified:src/java/org/apache/fop/xml Tag: FOP_0-20-0_Alt-Design
FoXmlSerialHandler.java
  Log:
  Added setRenderThread()
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.1.2.9   +17 -3 
xml-fop/src/java/org/apache/fop/xml/Attic/FoXmlSerialHandler.java
  
  Index: FoXmlSerialHandler.java
  ===
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/xml/Attic/FoXmlSerialHandler.java,v
  retrieving revision 1.1.2.8
  retrieving revision 1.1.2.9
  diff -u -r1.1.2.8 -r1.1.2.9
  --- FoXmlSerialHandler.java   8 Mar 2004 12:42:22 -   1.1.2.8
  +++ FoXmlSerialHandler.java   15 Apr 2004 11:29:58 -  1.1.2.9
  @@ -54,6 +54,7 @@
   private Namespaces namespaces;
   private InputSource source;
   private Thread foThread;
  +private Thread renderThread;
   protected Logger log = Logger.getLogger(Fop.fopPackage);
   private boolean errorDump;
   
  @@ -76,10 +77,23 @@
   }
   }
   
  +/**
  + * Allow the thread starter process to notify the serial handler of
  + * the FO Tree building thread.
  + * @param foThread
  + */
   public void setFoThread(Thread foThread) {
   this.foThread = foThread;
   }
   
  +/**
  + * Allow the thread starter process to notify the serial handler of
  + * the rendering thread.
  + * @param renderThread
  + */
  +public void setRenderThread(Thread renderThread) {
  +this.renderThread = renderThread;
  +}
   /**
* This is the run method for the callback parser thread.
*/
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: xml-fop/src/java/org/apache/fop/render/awt/viewer PreviewDialog.java

2004-04-15 Thread pbwest
pbwest  2004/04/15 04:31:42

  Modified:src/java/org/apache/fop/render/awt/viewer Tag:
FOP_0-20-0_Alt-Design PreviewDialog.java
  Log:
  Disabled fop startup from within PreviewDialog
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.2.2.4   +2 -3  
xml-fop/src/java/org/apache/fop/render/awt/viewer/PreviewDialog.java
  
  Index: PreviewDialog.java
  ===
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/render/awt/viewer/PreviewDialog.java,v
  retrieving revision 1.2.2.3
  retrieving revision 1.2.2.4
  diff -u -r1.2.2.3 -r1.2.2.4
  --- PreviewDialog.java15 Apr 2004 08:04:24 -  1.2.2.3
  +++ PreviewDialog.java15 Apr 2004 11:31:42 -  1.2.2.4
  @@ -379,8 +379,7 @@
   private class Reloader extends Thread {
   public void run() {
   if (fop == null) {
  -fop = new Fop();
  -fop.setRenderer(renderer);
  +throw new RuntimeException(No Fop process to reload);
   } else {
   fop.reset();
   }
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: xml-fop/src/java/org/apache/fop/render/awt AWTRenderer.java

2004-04-15 Thread pbwest
pbwest  2004/04/15 04:33:47

  Modified:src/java/org/apache/fop/render/awt Tag:
FOP_0-20-0_Alt-Design AWTRenderer.java
  Log:
  Disable PreviewDialog
  Return from finishng() on InterruptedException
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.21.2.5  +4 -2  xml-fop/src/java/org/apache/fop/render/awt/AWTRenderer.java
  
  Index: AWTRenderer.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/awt/AWTRenderer.java,v
  retrieving revision 1.21.2.4
  retrieving revision 1.21.2.5
  diff -u -r1.21.2.4 -r1.21.2.5
  --- AWTRenderer.java  15 Apr 2004 08:01:50 -  1.21.2.4
  +++ AWTRenderer.java  15 Apr 2004 11:33:47 -  1.21.2.5
  @@ -76,8 +76,8 @@
   protected PreviewDialog frame;
   
   public AWTRenderer() {
  -translator = new Translator();
  -createPreviewDialog();
  +//translator = new Translator();
  +//createPreviewDialog();
   }
   
   /**
  @@ -130,6 +130,8 @@
   try {
   wait();
   } catch (InterruptedException e) {
  +// We can go now
  +return;
   }
   }
   }
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: xml-fop/src/java/org/apache/fop/apps Fop.java

2004-04-15 Thread pbwest
pbwest  2004/04/15 04:48:27

  Modified:src/java/org/apache/fop/apps Tag: FOP_0-20-0_Alt-Design
Fop.java
  Log:
  Added renderThread based on Runnable Renderer
  Started AWT renderer
  Started renderThread
  Moved relevant variables closer to run method
  Added Javadoc comments to many variables
  Modified thread monitoring and shutdown loop to
  a timed join on the render thread with termination
  based on the termination of the fo thread
  public void setRenderer(String) changed to
  public Renderer getRenderer(String)
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.1.2.17  +96 -51xml-fop/src/java/org/apache/fop/apps/Fop.java
  
  Index: Fop.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/Fop.java,v
  retrieving revision 1.1.2.16
  retrieving revision 1.1.2.17
  diff -u -r1.1.2.16 -r1.1.2.17
  --- Fop.java  15 Apr 2004 07:02:18 -  1.1.2.16
  +++ Fop.java  15 Apr 2004 11:48:26 -  1.1.2.17
  @@ -39,7 +39,6 @@
   import org.apache.fop.configuration.UserOptions;
   import org.apache.fop.fo.FOTree;
   import org.apache.fop.render.Renderer;
  -import org.apache.fop.render.awt.AWTRenderer;
   import org.apache.fop.version.Version;
   import org.apache.fop.xml.FoXmlSerialHandler;
   import org.apache.fop.xml.Namespaces;
  @@ -48,6 +47,15 @@
   import org.xml.sax.InputSource;
   import org.xml.sax.XMLReader;
   
  +/**
  + * The startup class for Fop.  Class Fop includes a main method and a
  + * constructor.  The prior Driver class has been merged in as the Fop
  + * constructor and run method, which are called from within main.
  + * Fop can be run from the command line, or instantiated by an external
  + * process.
  + * 
  + * @version $Revision$ $Name$
  + */
   public class Fop {
   
   /** private constant to indicate renderer was not defined.  */
  @@ -72,24 +80,6 @@
   public static final int RENDER_SVG = 9;
   /** Render to RTF. OutputStream must be set */
   public static final int RENDER_RTF = 10;
  -
  -private InputHandler inputHandler;
  -private XMLReader parser;
  -private InputSource saxSource;
  -
  -private FoXmlSerialHandler xmlhandler;
  -private SyncedXmlEventsBuffer eventsBuffer;
  -private Namespaces namespaces;
  -private XmlEventReader eventReader;
  -private FOTree foTree;
  -private AreaTree areaTree = new AreaTree();
  -private GraphicsEnvironment gEnv = null;
  -
  -private Thread driverThread;
  -private Thread parserThread;
  -private Thread foThread;
  -private Thread areaThread;
  -private Thread renderThread;
   
   /** the renderer type code given by setRenderer  */
   private int rendererType = NOT_SET;
  @@ -235,6 +225,41 @@
   //System.out.println(PC time :  + (endPCi - startPCi));
   }
   
  +
  +/** Manages the flow of xsl:fo source into FOP */
  +private InputHandler inputHandler;
  +/** Parser for the xsl:fo source */
  +private XMLReader parser;
  +/** The parser's xsl:fo source stream */
  +private InputSource saxSource;
  +
  +/** Head process of the parser thread */
  +private FoXmlSerialHandler xmlhandler;
  +/**
  + * XmlEvents buffer which is the link between the parser process and the
  + * FO Tree builder.  It accepts events from the parser, and feeds them to
  + * the FO Tree builder.
  + */
  +private SyncedXmlEventsBuffer eventsBuffer;
  +/** codenamespaces/code object required for XMLEvent handling */
  +private Namespaces namespaces;
  +/** The codeXmlEventReader/code which supplies events to the FO Tree
  + * builder */
  +private XmlEventReader eventReader;
  +/** Head process of the FO Tree builder thread */
  +private FOTree foTree;
  +private AreaTree areaTree = new AreaTree();
  +
  +/** Thread of main Fop process */
  +private Thread fopThread;
  +/** Thread of parser process */
  +private Thread parserThread;
  +/** Thread of FO Tree building process */
  +private Thread foThread;
  +private Thread areaThread;
  +/** Thread of rendering process */
  +private Thread renderThread;
  +
   public void run() {
   setupRunStats();
   
  @@ -273,27 +298,49 @@
   xmlhandler = new FoXmlSerialHandler(eventsBuffer, parser, saxSource);
   foTree = new FOTree(eventReader);
   
  -driverThread = Thread.currentThread();
  +fopThread = Thread.currentThread();
  +renderThread = new Thread(renderer, Renderer);
  +renderThread.setDaemon(true);
   foThread = new Thread(foTree, FOTreeBuilder);
   foThread.setDaemon(true);
   parserThread = new Thread(xmlhandler, XMLSerialHandler);
   parserThread.setDaemon(true);
   
 

Re: [Bug 27773] - [PATCH] Hyphenation

2004-04-15 Thread Simon Pepping
Luca,

I have noticed this problem, and it is nice to see that you are taking
it on. I think it would be better to report this item in a patch of
its own. It really is a new issue.

Simon

On Wed, Apr 14, 2004 at 07:00:10PM -, [EMAIL PROTECTED] wrote:
 --- Additional Comments From [EMAIL PROTECTED]  2004-04-14 19:00 ---
 Yes, I was quite surprised to see that all the information stored in the 
 BreakPoss was thrown away before adding areas; I chose to duplicate the 
 needed values because this involved fewer and less radical changes.
 
 I have found another small bug concerning hyphenation in the 
 HyphenationTree.hyphenate() method.
 Before checking the exception list or using the algorithm, the 
 function normalizes the word: during this phase, if a non-letter character 
 is found null is returned.
 // normalize word
 char[] c = new char[2];
 for (i = 1; i = len; i++) {
 c[0] = w[offset + i - 1];
 int nc = classmap.find(c, 0);
 if (nc  0) {// found a non-letter character, abort
 return null;
 }
 word[i] = (char)nc;
 }
 I think the condition (nc  0) is too strong: at the moment words followed by 
 punctuation marks, or in parenthesis, are not hyphenated.
 
 This is how I tried to fix this problem:
 - non-letter characters at the beginning are not copied into word[]
 - if a non-letter character is found which is not at the beginning, it is not 
 copied into word[] and a boolean variable becomes true
 - if a letter-character is found when the variable is true, null is returned; 
 otherwise, word[] is used to find hyphenation points
 
 I have also added a little optimization: if, after the normalization and the 
 non-letter character removal, the word size is less than (remainCharCount + 
 pushCharCount), null is returned, without checking the exception list and 
 performing the algorithm.
 
 I'm going to attach the proposed patch and a test fo file which shows a few 
 examples.
 
 Regards
 
 Luca

-- 
Simon Pepping
home page: http://www.leverkruid.nl



cvs commit: xml-fop/src/java/org/apache/fop/fo/flow FoPageSequence.java

2004-04-15 Thread pbwest
pbwest  2004/04/15 22:09:10

  Modified:src/java/org/apache/fop/fo/flow Tag: FOP_0-20-0_Alt-Design
FoPageSequence.java
  Log:
  Added HashMap of ArrayLists of static-content subtrees, indexed by flow-name
  Provide access to umodifiable Map of above
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.1.2.12  +58 -7 
xml-fop/src/java/org/apache/fop/fo/flow/Attic/FoPageSequence.java
  
  Index: FoPageSequence.java
  ===
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Attic/FoPageSequence.java,v
  retrieving revision 1.1.2.11
  retrieving revision 1.1.2.12
  diff -u -r1.1.2.11 -r1.1.2.12
  --- FoPageSequence.java   25 Feb 2004 23:40:28 -  1.1.2.11
  +++ FoPageSequence.java   16 Apr 2004 05:09:10 -  1.1.2.12
  @@ -21,9 +21,16 @@
   package org.apache.fop.fo.flow;
   
   // FOP
  +import java.util.ArrayList;
   import java.util.Arrays;
   import java.util.BitSet;
  +import java.util.Collections;
  +import java.util.HashMap;
  +import java.util.Iterator;
  +import java.util.List;
  +import java.util.Map;
   import java.util.NoSuchElementException;
  +import java.util.Set;
   
   import org.apache.fop.apps.FOPException;
   import org.apache.fop.datastructs.TreeException;
  @@ -97,6 +104,20 @@
   private int title = -1;
   /** Child index of first fo:static-content child. */
   private int firstStaticContent = -1;
  +/**
  + * Private map of codeList/codes of static-content subtrees hashed on
  + * flow-name.  Note that there is no restriction on multiple
  + * codefo:static-content/code elements being assigned to a single
  + * codeflow-name/code, so the objects keyed by codeflow-name/code
  + * must be able to hold more than one element; hence codeList/codes.
  + * 
  + * Each element of the codeHashMap/code, keyed on the
  + * codeflow-name/code is an codeArrayList/code containing one or
  + * more instances of codeFoStaticContent/code.
  + */
  +private HashMap staticSubtrees = null;
  +/** Unmodifiable version of codestaticSubtrees/code */
  +public Map staticContents = null;
   /** Child index of fo:flow child. */
   private int flowChild = -1;
   
  @@ -127,18 +148,48 @@
   namespaces.relinquishEvent(ev);
   } // else ignore
   
  -// Look for zero or more static-content
  +// Look for zero or more static-content subtrees
   nowProcessing = static-content;
   while ((ev = xmlevents.expectStartElement
   (FObjectNames.STATIC_CONTENT, XmlEvent.DISCARD_W_SPACE))
  != null) {
   // Loop over remaining fo:static-content
  -if (firstStaticContent == -1)
  +if (firstStaticContent == -1) {
   firstStaticContent = numChildren();
  -new FoStaticContent(getFOTree(), this, (FoXmlEvent)ev);
  +staticSubtrees = new HashMap();
  +}
  +FoStaticContent statContent  =
  +new FoStaticContent(getFOTree(), this, (FoXmlEvent)ev);
   namespaces.relinquishEvent(ev);
  +// Collect the static-content subtrees for this page-sequence
  +String flowname = statContent.getFlowName();
  +if (! staticSubtrees.containsKey(flowname)) {
  +// Create a new list for this key
  +staticSubtrees.put(flowname, new ArrayList(1));
  +}
  +// Add an entry to an existing List
  +ArrayList statconsList =
  +(ArrayList)(staticSubtrees.get(flowname));
  +statconsList.add(statContent);
  +}
  +// Create the unmodifiable map of unmodifiable lists
  +// TODO make the contents of the events buffer unmodifiable
  +// Each value in the Map is an ArrayList.  Iterate over all of the
  +// entries, replacing the ArrayList value in each Map.Entry with an
  +// unmodifiableList constructed from the ArrayList
  +if (staticSubtrees != null) {
  +Set entries = staticSubtrees.entrySet();
  +Iterator iter = entries.iterator();
  +while (iter.hasNext()) {
  +Map.Entry entry = (Map.Entry)(iter.next());
  +entry.setValue(
  +Collections.unmodifiableList(
  +(List)(entry.getValue(;
  +}
  +// Now make an unmodifiableMap from the overall HashMap
  +// of flow-name indexed ArrayLists
  +staticContents = Collections.unmodifiableMap(staticSubtrees);
   }
  -   

cvs commit: xml-fop/src/java/org/apache/fop/fo/flow FoStaticContent.java

2004-04-15 Thread pbwest
pbwest  2004/04/15 22:12:34

  Modified:src/java/org/apache/fop/fo/flow Tag: FOP_0-20-0_Alt-Design
FoStaticContent.java
  Log:
  Added getFlowName()
  Fixed erroneous exception messages
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.1.2.11  +19 -6 
xml-fop/src/java/org/apache/fop/fo/flow/Attic/FoStaticContent.java
  
  Index: FoStaticContent.java
  ===
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Attic/FoStaticContent.java,v
  retrieving revision 1.1.2.10
  retrieving revision 1.1.2.11
  diff -u -r1.1.2.10 -r1.1.2.11
  --- FoStaticContent.java  25 Feb 2004 23:40:28 -  1.1.2.10
  +++ FoStaticContent.java  16 Apr 2004 05:12:34 -  1.1.2.11
  @@ -91,8 +91,7 @@
   
   /**
* Construct an fo:static-content node, and buffer the contents for later
  -* parsing
  - * subtree.
  + * parsing.
* pContent model for fo:static-content: (%block;)+
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
  @@ -109,9 +108,11 @@
   ncName = (NCName)(getPropertyValue(PropNames.FLOW_NAME));
   } catch (PropertyException e) {
   throw new FOPException(
  -Cannot find marker-class-name in fo:marker, e);
  +Cannot find flow-name in fo:static-content, e);
   } catch (ClassCastException e) {
  -throw new FOPException(Wrong PropertyValue type in fo:marker, e);
  +throw new FOPException
  +(Wrong PropertyValue type for flow-name in fo:static-content,
  +e);
   }
   flowName = ncName.getNCName();
   
  @@ -132,11 +133,23 @@
   }
   
   /**
  + * Gets the buffer of codeXmlEvent/codes from this
  + * bfo:static-content/b subtree
  + * 
* @return the static-content subtree buffer
*/
   public XmlEventsArrayBuffer getEventBuffer() {
   return buffer;
   }
   
  +/**
  + * Gets the bflow-name/b with which this bfo:static-content/b
  + * is associated
  + * 
  + * @return the flow-name
  + */
  +public String getFlowName() {
  +return flowName;
  +}
   
   }
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: xml-fop/src/java/org/apache/fop/area PageViewport.java PageRefArea.java

2004-04-15 Thread pbwest
pbwest  2004/04/15 22:15:17

  Modified:src/java/org/apache/fop/area Tag: FOP_0-20-0_Alt-Design
PageViewport.java PageRefArea.java
  Log:
  Eliminated currently unused code
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.2.2.4   +46 -46xml-fop/src/java/org/apache/fop/area/PageViewport.java
  
  Index: PageViewport.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/area/PageViewport.java,v
  retrieving revision 1.2.2.3
  retrieving revision 1.2.2.4
  diff -u -r1.2.2.3 -r1.2.2.4
  --- PageViewport.java 28 Feb 2004 02:06:44 -  1.2.2.3
  +++ PageViewport.java 16 Apr 2004 05:15:16 -  1.2.2.4
  @@ -18,9 +18,9 @@
   package org.apache.fop.area;
   
   import java.awt.geom.Rectangle2D;
  -import java.io.IOException;
  -import java.io.ObjectOutputStream;
  -import java.io.ObjectInputStream;
  +//import java.io.IOException;
  +//import java.io.ObjectOutputStream;
  +//import java.io.ObjectInputStream;
   import java.util.ArrayList;
   import java.util.List;
   import java.util.Map;
  @@ -89,7 +89,7 @@
   /**
* Create a page viewport.
* @param parent node of this viewport
  - * @param sync object on which teh Area is synchronized
  + * @param sync object on which the Area is synchronized
* @param pageId the unique identifier of this page
* @param p the page reference area for the contents of this page
* @param bounds the dimensions of the viewport
  @@ -371,48 +371,48 @@
   }
   }
   
  -/**
  - * Save the viewport pageRefArea to an object stream.
  - * The map of unresolved references are set on the pageRefArea so that
  - * the resolvers can be properly serialized and reloaded.
  - * @param out the object output stream to write the contents
  - */
  -public void savePage(ObjectOutputStream out) {
  -// set the unresolved references so they are serialized
  -synchronized (sync) {
  -((PageRefArea)refArea).setUnresolvedReferences(unresolved);
  -try {
  -out.writeObject(refArea);
  -} catch (IOException e) {
  -throw new RuntimeException(e);
  -}
  -refArea = null;
  -}
  -}
  -
  -/**
  - * Load the viewport pageRefArea from an object stream.
  - * This loads the pageRefArea from the stream and
  - * if there are any unresolved references that were resolved
  - * while saved they will be resolved on the page contents.
  - * @param in the object input stream to read the pageRefArea from
  - * @throws Exception if there is an error loading the pageRefArea
  - */
  -public void loadPage(ObjectInputStream in) throws Exception {
  -synchronized (sync) {
  -PageRefArea pageRefArea = (PageRefArea) in.readObject();
  -refArea = pageRefArea;
  -unresolved = pageRefArea.getUnresolvedReferences();
  -if (unresolved != null  pendingResolved != null) {
  -for (Iterator iter = pendingResolved.keySet().iterator();
  -iter.hasNext();) {
  -String id = (String) iter.next();
  -resolve(id, (List)pendingResolved.get(id));
  -}
  -pendingResolved = null;
  -}
  -}
  -}
  +///**
  +// * Save the viewport pageRefArea to an object stream.
  +// * The map of unresolved references are set on the pageRefArea so that
  +// * the resolvers can be properly serialized and reloaded.
  +// * @param out the object output stream to write the contents
  +// */
  +//public void savePage(ObjectOutputStream out) {
  +//// set the unresolved references so they are serialized
  +//synchronized (sync) {
  +//((PageRefArea)refArea).setUnresolvedReferences(unresolved);
  +//try {
  +//out.writeObject(refArea);
  +//} catch (IOException e) {
  +//throw new RuntimeException(e);
  +//}
  +//refArea = null;
  +//}
  +//}
  +
  +///**
  +// * Load the viewport pageRefArea from an object stream.
  +// * This loads the pageRefArea from the stream and
  +// * if there are any unresolved references that were resolved
  +// * while saved they will be resolved on the page contents.
  +// * @param in the object input stream to read the pageRefArea from
  +// * @throws Exception if there is an error loading the pageRefArea
  +// */
  +//public void loadPage(ObjectInputStream in) throws Exception {
  +//synchronized (sync) {
  +//PageRefArea pageRefArea = (PageRefArea) in.readObject();
  +//refArea = pageRefArea;
  +//unresolved = 

cvs commit: xml-fop/src/java/org/apache/fop/fo FONode.java

2004-04-15 Thread pbwest
pbwest  2004/04/15 22:17:00

  Modified:src/java/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design
FONode.java
  Log:
  Get logger through foTree
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.2.2.17  +4 -3  xml-fop/src/java/org/apache/fop/fo/FONode.java
  
  Index: FONode.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FONode.java,v
  retrieving revision 1.2.2.16
  retrieving revision 1.2.2.17
  diff -u -r1.2.2.16 -r1.2.2.17
  --- FONode.java   8 Mar 2004 20:42:53 -   1.2.2.16
  +++ FONode.java   16 Apr 2004 05:17:00 -  1.2.2.17
  @@ -24,7 +24,6 @@
   import java.util.logging.Logger;
   
   import org.apache.fop.apps.FOPException;
  -import org.apache.fop.apps.Fop;
   import org.apache.fop.datastructs.ROBitSet;
   import org.apache.fop.datastructs.SyncedNode;
   import org.apache.fop.datastructs.TreeException;
  @@ -53,7 +52,6 @@
   private static final String tag = $Name$;
   private static final String revision = $Revision$;
   
  -protected Logger log = Logger.getLogger(Fop.fopPackage);
   /**
* State flags: a bit set of states applicable during FO tree build.
* N.B. States must be powers of 2.
  @@ -111,7 +109,9 @@
* The FO Tree
*/
   protected final FOTree foTree;
  -
  +
  +protected final Logger log;
  +
   /** The buffer from which parser events are drawn. */
   protected final XmlEventReader xmlevents;
   
  @@ -207,6 +207,7 @@
   {
   super(parent, foTree);
   this.foTree = foTree;
  +this.log = foTree.getLogger();
   this.type = type;
   this.stateFlags = stateFlags;
   this.sparsePropsMap = sparsePropsMap;
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: xml-fop/src/java/org/apache/fop/fo FOTree.java

2004-04-15 Thread pbwest
pbwest  2004/04/15 22:18:52

  Modified:src/java/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design
FOTree.java
  Log:
  Added getNextPageId and getLogger methods
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.1.2.9   +22 -3 xml-fop/src/java/org/apache/fop/fo/Attic/FOTree.java
  
  Index: FOTree.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/Attic/FOTree.java,v
  retrieving revision 1.1.2.8
  retrieving revision 1.1.2.9
  diff -u -r1.1.2.8 -r1.1.2.9
  --- FOTree.java   8 Mar 2004 20:46:29 -   1.1.2.8
  +++ FOTree.java   16 Apr 2004 05:18:52 -  1.1.2.9
  @@ -43,6 +43,17 @@
   private static final String tag = $Name$;
   private static final String revision = $Revision$;
   
  +/** Provides a monotonically increasing pageId */
  +private long nextPageId = 0;
  +/** Locking object for synchronizing codegetNextPageId/code method.
  + * The value is irrelevant. */
  +private Boolean lock = new Boolean(true);
  +public long getNextPageId() {
  +synchronized (lock) {
  +return ++nextPageId;
  +}
  +}
  +
   /**
* The buffer from which the ttXmlEvent/tts from the parser will
* be read.  ttprotected/tt so that FONode can access it.
  @@ -165,6 +176,14 @@
   */
   }
   System.out.println(# of FONodes:  + nodecount);
  +}
  +
  +/**
  + * Gets the codeFOTree/code logger
  + * @return the logger
  + */
  +public Logger getLogger() {
  +return log;
   }
   
   }// FOTree
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]