cvs commit: xml-fop/src/org/apache/fop/fo/pagination FoLayoutMasterSet.java FoPageSequenceMaster.java FoSimplePageMaster.java

2002-11-29 Thread pbwest
pbwest  2002/11/29 09:11:54

  Modified:src/org/apache/fop/fo/pagination Tag: FOP_0-20-0_Alt-Design
FoLayoutMasterSet.java FoPageSequenceMaster.java
FoSimplePageMaster.java
  Log:
  Added surrenderEvent() calls.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.1.2.17  +4 -6  
xml-fop/src/org/apache/fop/fo/pagination/Attic/FoLayoutMasterSet.java
  
  Index: FoLayoutMasterSet.java
  ===
  RCS file: 
/home/cvs/xml-fop/src/org/apache/fop/fo/pagination/Attic/FoLayoutMasterSet.java,v
  retrieving revision 1.1.2.16
  retrieving revision 1.1.2.17
  diff -u -r1.1.2.16 -r1.1.2.17
  --- FoLayoutMasterSet.java21 Nov 2002 08:11:50 -  1.1.2.16
  +++ FoLayoutMasterSet.java29 Nov 2002 17:11:54 -  1.1.2.17
  @@ -108,9 +108,6 @@
   setupPageMasters(event);
   // No need to clean up the build tree, because the whole subtree
   // will be deleted.
  -// This is problematical: while Node is obliged to belong to a Tree,
  -// any remaining references to elements of the subtree will keep the
  -// whole subtree from being GCed.
   makeSparsePropsSet();
   }
   
  @@ -176,6 +173,7 @@
   (Aargh! expectStartElement(events, list));
   // Flush the master event
   xmlevents.getEndElement(ev);
  +pool.surrenderEvent(ev);
   } while (true);
   } catch (NoSuchElementException e) {
   // Unexpected end of file
  
  
  
  1.1.2.15  +4 -2  
xml-fop/src/org/apache/fop/fo/pagination/Attic/FoPageSequenceMaster.java
  
  Index: FoPageSequenceMaster.java
  ===
  RCS file: 
/home/cvs/xml-fop/src/org/apache/fop/fo/pagination/Attic/FoPageSequenceMaster.java,v
  retrieving revision 1.1.2.14
  retrieving revision 1.1.2.15
  diff -u -r1.1.2.14 -r1.1.2.15
  --- FoPageSequenceMaster.java 13 Nov 2002 04:15:19 -  1.1.2.14
  +++ FoPageSequenceMaster.java 29 Nov 2002 17:11:54 -  1.1.2.15
  @@ -215,6 +215,7 @@
   throw new FOPException
   (Aargh! expectStartElement(events, list));
   xmlevents.getEndElement(ev);
  +pool.surrenderEvent(ev);
   } while (true);
   } catch (NoSuchElementException e) {
   throw new FOPException(Unexpected EOF in page-sequence-master.);
  @@ -304,6 +305,7 @@
   //(Found conditional-page-master-reference);
   new FoConditionalPageMasterReference(foTree, this, ev);
   this.xmlevents.getEndElement(ev);
  +this.pool.surrenderEvent(ev);
   } while (true);
   } catch (NoSuchElementException e) {
   // End of file reached
  
  
  
  1.1.2.12  +7 -2  
xml-fop/src/org/apache/fop/fo/pagination/Attic/FoSimplePageMaster.java
  
  Index: FoSimplePageMaster.java
  ===
  RCS file: 
/home/cvs/xml-fop/src/org/apache/fop/fo/pagination/Attic/FoSimplePageMaster.java,v
  retrieving revision 1.1.2.11
  retrieving revision 1.1.2.12
  diff -u -r1.1.2.11 -r1.1.2.12
  --- FoSimplePageMaster.java   13 Nov 2002 04:15:19 -  1.1.2.11
  +++ FoSimplePageMaster.java   29 Nov 2002 17:11:54 -  1.1.2.12
  @@ -104,6 +104,7 @@
   // Process region-body
   regionBody = new FoRegionBody(foTree, this, regionEv);
   xmlevents.getEndElement(regionEv);
  +pool.surrenderEvent(regionEv);
   
   // Remaining regions are optional
   if ((regionEv = xmlevents.expectStartElement
  @@ -112,6 +113,7 @@
   {
   regionBefore = new FoRegionBefore(foTree, this, regionEv);
   xmlevents.getEndElement(regionEv);
  +pool.surrenderEvent(regionEv);
   }
   
   if ((regionEv = xmlevents.expectStartElement
  @@ -120,6 +122,7 @@
   {
   regionAfter = new FoRegionAfter(foTree, this, regionEv);
   xmlevents.getEndElement(regionEv);
  +pool.surrenderEvent(regionEv);
   }
   
   if ((regionEv = xmlevents.expectStartElement
  @@ -128,6 +131,7 @@
   {
   regionStart = new FoRegionStart(foTree, this, regionEv);
   xmlevents.getEndElement(regionEv);
  +pool.surrenderEvent(regionEv);
   }
   
   if ((regionEv = xmlevents.expectStartElement
  @@ -136,6 +140,7 @@
   {
   regionEnd = new FoRegionEnd(foTree, this, regionEv);
   xmlevents.getEndElement(regionEv);
  +pool.surrenderEvent(regionEv);
   }
   
   // Clean up the build environment
  
  
  


cvs commit: xml-fop/src/org/apache/fop/fo/pagination FoLayoutMasterSet.java FoPageSequenceMaster.java FoSimplePageMaster.java

2002-10-27 Thread pbwest
pbwest  2002/10/27 16:08:12

  Modified:src/org/apache/fop/fo/pagination Tag: FOP_0-20-0_Alt-Design
FoLayoutMasterSet.java FoPageSequenceMaster.java
FoSimplePageMaster.java
  Log:
  Use foType in get/expect calls.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.1.2.11  +11 -13
xml-fop/src/org/apache/fop/fo/pagination/Attic/FoLayoutMasterSet.java
  
  Index: FoLayoutMasterSet.java
  ===
  RCS file: 
/home/cvs/xml-fop/src/org/apache/fop/fo/pagination/Attic/FoLayoutMasterSet.java,v
  retrieving revision 1.1.2.10
  retrieving revision 1.1.2.11
  diff -u -r1.1.2.10 -r1.1.2.11
  --- FoLayoutMasterSet.java24 Oct 2002 14:58:14 -  1.1.2.10
  +++ FoLayoutMasterSet.java28 Oct 2002 00:08:11 -  1.1.2.11
  @@ -42,15 +42,13 @@
   private static final String revision = $Revision$;
   
   /**
  - * An array with ttUriLocalName/tt objects identifying
  + * An array with ttint/tts identifying
* ttsimple-page-master/tt and ttpage-sequence-master/tt
* XML events.
*/
  -private static final UriLocalName[] simpleOrSequenceMaster = {
  -new UriLocalName
  -  (XMLNamespaces.XSLNSpaceIndex, simple-page-master),
  -new UriLocalName
  - (XMLNamespaces.XSLNSpaceIndex, page-sequence-master)
  +private static final int[] simpleOrSequenceMaster = {
  +FObjectNames.SIMPLE_PAGE_MASTER,
  +FObjectNames.PAGE_SEQUENCE_MASTER
   };
   
   /**
  @@ -99,7 +97,7 @@
   {
FoSimplePageMaster simple;
String masterName;
  - String localName;
  +int foType;
FoPageSequenceMaster foPageSeq;
   try {
   do {
  @@ -107,8 +105,8 @@
   xmlevents.expectStartElement
   (simpleOrSequenceMaster, XMLEvent.DISCARD_W_SPACE);
   if (ev == null) break; // No instance of these elements found
  -localName = ev.getLocalName();
  -if (localName.equals(simple-page-master)) {
  +foType = ev.getFoType();
  +if (foType == FObjectNames.SIMPLE_PAGE_MASTER) {
   //System.out.println(Found simple-page-master);
   simple = new FoSimplePageMaster(foTree, this, ev);
   masterName = simple.getMasterName();
  @@ -123,7 +121,7 @@
   (simple-page-master master-name clash in 
+ simplePageMasters:  + masterName);
   simplePageMasters.put(masterName, simple);
  -} else if (localName.equals(page-sequence-master)) {
  +} else if (foType == FObjectNames.PAGE_SEQUENCE_MASTER) {
   //System.out.println(Found page-sequence-master);
   try {
   foPageSeq =
  
  
  
  1.1.2.11  +17 -31
xml-fop/src/org/apache/fop/fo/pagination/Attic/FoPageSequenceMaster.java
  
  Index: FoPageSequenceMaster.java
  ===
  RCS file: 
/home/cvs/xml-fop/src/org/apache/fop/fo/pagination/Attic/FoPageSequenceMaster.java,v
  retrieving revision 1.1.2.10
  retrieving revision 1.1.2.11
  diff -u -r1.1.2.10 -r1.1.2.11
  --- FoPageSequenceMaster.java 24 Oct 2002 14:58:14 -  1.1.2.10
  +++ FoPageSequenceMaster.java 28 Oct 2002 00:08:11 -  1.1.2.11
  @@ -43,28 +43,17 @@
   private static final String revision = $Revision$;
   
   /**
  - * An array with ttUriLocalName/tt objects identifying
  + * An array with ttint/tts identifying
* ttsingle-page-master-reference/tt,
* ttrepeatable-page-master-reference/tt and
* ttrepeatable-page-master-alternatives/tt XML events.
*/
  -private static final UriLocalName[] singleOrRepeatableMasterRefs = {
  -new UriLocalName
  -  (XMLNamespaces.XSLNSpaceIndex, single-page-master-reference),
  -new UriLocalName
  - (XMLNamespaces.XSLNSpaceIndex, repeatable-page-master-reference),
  -new UriLocalName
  - (XMLNamespaces.XSLNSpaceIndex, repeatable-page-master-alternatives)
  +private static final int[] singleOrRepeatableMasterRefs = {
  +FObjectNames.SINGLE_PAGE_MASTER_REFERENCE,
  +FObjectNames.REPEATABLE_PAGE_MASTER_REFERENCE,
  +FObjectNames.REPEATABLE_PAGE_MASTER_ALTERNATIVES
   };
   
  -/**
  - * A ttUriLocalName/tt object identifying a
  - * ttconditional-page-master-reference/tt,
  - */
  -private static final UriLocalName conditionalPageMasterRef =
  - new UriLocalName(XMLNamespaces.XSLNSpaceIndex,
  - conditional-page-master-reference);
  -
   private String 

cvs commit: xml-fop/src/org/apache/fop/fo/pagination FoLayoutMasterSet.java FoPageSequenceMaster.java FoSimplePageMaster.java

2002-10-24 Thread pbwest
pbwest  2002/10/24 07:58:14

  Modified:src/org/apache/fop/fo/pagination Tag: FOP_0-20-0_Alt-Design
FoLayoutMasterSet.java FoPageSequenceMaster.java
FoSimplePageMaster.java
  Log:
  Changed XMLEvent to FoXMLEvent throughout.
  Account for the fact that 'expect' methods returning FoXMLEvents return null on 
failure.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.1.2.10  +13 -8 
xml-fop/src/org/apache/fop/fo/pagination/Attic/FoLayoutMasterSet.java
  
  Index: FoLayoutMasterSet.java
  ===
  RCS file: 
/home/cvs/xml-fop/src/org/apache/fop/fo/pagination/Attic/FoLayoutMasterSet.java,v
  retrieving revision 1.1.2.9
  retrieving revision 1.1.2.10
  diff -u -r1.1.2.9 -r1.1.2.10
  --- FoLayoutMasterSet.java21 Oct 2002 16:12:53 -  1.1.2.9
  +++ FoLayoutMasterSet.java24 Oct 2002 14:58:14 -  1.1.2.10
  @@ -12,10 +12,11 @@
   import org.apache.fop.fo.FOTree;
   import org.apache.fop.fo.FONode;
   import org.apache.fop.fo.expr.PropertyException;
  +import org.apache.fop.xml.FoXMLEvent;
   import org.apache.fop.xml.XMLEvent;
   import org.apache.fop.xml.UriLocalName;
   import org.apache.fop.xml.XMLNamespaces;
  -import org.apache.fop.xml.SyncedXmlEventsBuffer;
  +import org.apache.fop.xml.SyncedFoXmlEventsBuffer;
   import org.apache.fop.datastructs.Tree;
   import org.apache.fop.fo.pagination.FoPageSequenceMaster;
   import org.apache.fop.fo.pagination.PageSequenceMaster;
  @@ -78,7 +79,7 @@
* this node
*/
   public FoLayoutMasterSet
  -(FOTree foTree, FONode parent, XMLEvent event)
  +(FOTree foTree, FONode parent, FoXMLEvent event)
   throws Tree.TreeException, FOPException, PropertyException
   {
   super(foTree, FObjectNames.LAYOUT_MASTER_SET, parent, event,
  @@ -93,7 +94,7 @@
* @param event - the layout page-master-set STARTELEMENT event.
* @throws ttFOPException/tt.
*/
  -public void setupPageMasters(XMLEvent event)
  +public void setupPageMasters(FoXMLEvent event)
throws FOPException, PropertyException
   {
FoSimplePageMaster simple;
  @@ -102,9 +103,10 @@
FoPageSequenceMaster foPageSeq;
   try {
   do {
  -XMLEvent ev =
  +FoXMLEvent ev =
   xmlevents.expectStartElement
   (simpleOrSequenceMaster, XMLEvent.DISCARD_W_SPACE);
  +if (ev == null) break; // No instance of these elements found
   localName = ev.getLocalName();
   if (localName.equals(simple-page-master)) {
   //System.out.println(Found simple-page-master);
  @@ -145,7 +147,8 @@
   (Aargh! expectStartElement(events, list));
   } while (true);
   } catch (NoSuchElementException e) {
  -// Masters exhausted
  +// Unexpected end of file
  +throw new FOPException(layout-master-set: unexpected EOF.);
   }
   catch (PropertyException e) {
   throw new FOPException(e);
  @@ -153,6 +156,8 @@
   catch (Tree.TreeException e) {
   throw new FOPException(e);
   }
  +if (pageMasters.size() == 0)
  +throw new FOPException(No pageg masters defined in 
layout-master-set.);
// Create the master set structures.
// Scan the page-sequence-masters
// N.B. Processing of the page-sequence-masters must be deferred until
  
  
  
  1.1.2.10  +21 -15
xml-fop/src/org/apache/fop/fo/pagination/Attic/FoPageSequenceMaster.java
  
  Index: FoPageSequenceMaster.java
  ===
  RCS file: 
/home/cvs/xml-fop/src/org/apache/fop/fo/pagination/Attic/FoPageSequenceMaster.java,v
  retrieving revision 1.1.2.9
  retrieving revision 1.1.2.10
  diff -u -r1.1.2.9 -r1.1.2.10
  --- FoPageSequenceMaster.java 21 Oct 2002 16:12:54 -  1.1.2.9
  +++ FoPageSequenceMaster.java 24 Oct 2002 14:58:14 -  1.1.2.10
  @@ -15,6 +15,7 @@
   
   // FOP
   import org.apache.fop.fo.FOAttributes;
  +import org.apache.fop.xml.FoXMLEvent;
   import org.apache.fop.xml.XMLEvent;
   import org.apache.fop.xml.XMLNamespaces;
   import org.apache.fop.xml.UriLocalName;
  @@ -68,7 +69,7 @@
   
   //private ArrayList subSequenceList = new ArrayList(1);
   
  -public FoPageSequenceMaster(FOTree foTree, FONode parent, XMLEvent event)
  +public FoPageSequenceMaster(FOTree foTree, FONode parent, FoXMLEvent event)
   throws Tree.TreeException, FOPException, PropertyException
   {
   super(foTree, FObjectNames.PAGE_SEQUENCE_MASTER, parent, event,
  @@ -76,8 +77,9 @@
   // Process sequence members here
   try {
   do {
  -

cvs commit: xml-fop/src/org/apache/fop/fo/pagination FoLayoutMasterSet.java FoPageSequenceMaster.java FoSimplePageMaster.java

2002-10-01 Thread pbwest

pbwest  2002/10/01 18:30:59

  Modified:src/org/apache/fop/fo/pagination Tag: FOP_0-20-0_Alt-Design
FoLayoutMasterSet.java FoPageSequenceMaster.java
FoSimplePageMaster.java
  Log:
  attrSet constants now in FObjects.java
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.1.2.3   +5 -4  
xml-fop/src/org/apache/fop/fo/pagination/Attic/FoLayoutMasterSet.java
  
  Index: FoLayoutMasterSet.java
  ===
  RCS file: 
/home/cvs/xml-fop/src/org/apache/fop/fo/pagination/Attic/FoLayoutMasterSet.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- FoLayoutMasterSet.java16 Sep 2002 05:31:16 -  1.1.2.2
  +++ FoLayoutMasterSet.java2 Oct 2002 01:30:59 -   1.1.2.3
  @@ -6,6 +6,7 @@
   
   import org.apache.fop.apps.FOPException;
   import org.apache.fop.xml.XMLEvent;
  +import org.apache.fop.fo.FObjects;
   import org.apache.fop.fo.FObjectNames;
   import org.apache.fop.fo.FOTree;
   import org.apache.fop.fo.FONode;
  @@ -61,7 +62,7 @@
   throws Tree.TreeException, FOPException, PropertyException
   {
   super(foTree, FObjectNames.LAYOUT_MASTER_SET, parent, event,
  -  FONode.LAYOUT);
  +  FObjects.LAYOUT_SET);
   }
   
   /**
  
  
  
  1.1.2.3   +5 -4  
xml-fop/src/org/apache/fop/fo/pagination/Attic/FoPageSequenceMaster.java
  
  Index: FoPageSequenceMaster.java
  ===
  RCS file: 
/home/cvs/xml-fop/src/org/apache/fop/fo/pagination/Attic/FoPageSequenceMaster.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- FoPageSequenceMaster.java 16 Sep 2002 05:31:16 -  1.1.2.2
  +++ FoPageSequenceMaster.java 2 Oct 2002 01:30:59 -   1.1.2.3
  @@ -20,6 +20,7 @@
   import org.apache.fop.apps.FOPException;
   import org.apache.fop.fo.expr.PropertyException;
   import org.apache.fop.fo.Properties;
  +import org.apache.fop.fo.FObjects;
   import org.apache.fop.fo.FObjectNames;
   import org.apache.fop.fo.FOTree;
   import org.apache.fop.fo.FONode;
  @@ -46,7 +47,7 @@
   throws Tree.TreeException, FOPException, PropertyException
   {
   super(foTree, FObjectNames.PAGE_SEQUENCE_MASTER, parent, null,
  -  FONode.LAYOUT);
  +  FObjects.LAYOUT_SET);
   this.masterName = masterName;
   }
   
  @@ -54,7 +55,7 @@
   throws Tree.TreeException, FOPException, PropertyException
   {
   super(foTree, FObjectNames.PAGE_SEQUENCE_MASTER, parent, event,
  -  FONode.LAYOUT);
  +  FObjects.LAYOUT_SET);
   if (event == null) {
   System.out.println(Null event; throwing FOPException);
   throw new FOPException
  
  
  
  1.1.2.3   +4 -3  
xml-fop/src/org/apache/fop/fo/pagination/Attic/FoSimplePageMaster.java
  
  Index: FoSimplePageMaster.java
  ===
  RCS file: 
/home/cvs/xml-fop/src/org/apache/fop/fo/pagination/Attic/FoSimplePageMaster.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- FoSimplePageMaster.java   16 Sep 2002 05:31:16 -  1.1.2.2
  +++ FoSimplePageMaster.java   2 Oct 2002 01:30:59 -   1.1.2.3
  @@ -13,6 +13,7 @@
   import org.apache.fop.fo.FOAttributes;
   import org.apache.fop.xml.XMLEvent;
   import org.apache.fop.apps.FOPException;
  +import org.apache.fop.fo.FObjects;
   import org.apache.fop.fo.FObjectNames;
   import org.apache.fop.fo.FONode;
   import org.apache.fop.fo.FOTree;
  @@ -39,7 +40,7 @@
   throws Tree.TreeException, FOPException, PropertyException
   {
   super(foTree, FObjectNames.SIMPLE_PAGE_MASTER, parent, event,
  -  FONode.LAYOUT);
  +  FObjects.LAYOUT_SET);
   System.out.println(FOAttributes:  + event);
   try {
   masterName = foAttributes.getFoAttrValue(master-name);
  
  
  

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