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

2002-12-02 Thread pbwest
pbwest  2002/12/02 23:22:24

  Modified:src/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design FONode.java
  Log:
  sparsePropsMap changed from HashMap to int[].
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.19.2.30 +9 -10 xml-fop/src/org/apache/fop/fo/FONode.java
  
  Index: FONode.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FONode.java,v
  retrieving revision 1.19.2.29
  retrieving revision 1.19.2.30
  diff -u -r1.19.2.29 -r1.19.2.30
  --- FONode.java   29 Nov 2002 16:09:16 -  1.19.2.29
  +++ FONode.java   3 Dec 2002 07:22:23 -   1.19.2.30
  @@ -16,6 +16,7 @@
   import org.apache.fop.datatypes.indirect.Inherit;
   import org.apache.fop.datatypes.indirect.IndirectValue;
   import org.apache.fop.datastructs.Node;
  +import org.apache.fop.datastructs.Node.*;
   import org.apache.fop.datastructs.TreeException;
   import org.apache.fop.datastructs.ROBitSet;
   import org.apache.fop.apps.FOPException;
  @@ -157,7 +158,7 @@
   /** Map of ttInteger/tt indices of isparsePropsSet/i array.
   It is indexed by the FO index of the FO associated with a given
   position in the ipropertySet/i array. */
  -private final HashMap sparsePropsMap;
  +private final int[] sparsePropsMap;
   
   /** An array of of the applicable property indices, in property index
   order. */
  @@ -206,7 +207,7 @@
* @param stateFlags - the set of states relevant at this point in the
* tree.  Includes the state information necessaryto select an attribute
* set for this node.
  - * @param sparsePropsMap - a ttHashMap/tt mapping the property indices
  + * @param sparsePropsMap - an ttint[]/tt mapping the property indices
* to their offsets in the set of properties applicable to this node.
* @param sparseindices - an ttint[]/tt holding the set of property
* indices applicable to this node, in ascending order.
  @@ -216,7 +217,7 @@
*/
   public FONode
   (FOTree foTree, int type, FONode parent, FoXMLEvent event,
  - int stateFlags, HashMap sparsePropsMap, int[] sparseIndices)
  + int stateFlags, int[] sparsePropsMap, int[] sparseIndices)
   throws TreeException, FOPException, PropertyException
   {
   super(foTree, parent);
  @@ -478,7 +479,7 @@
   PropertyValue pval;
   if (propertySet == null) {
   return IndirectValue.adjustedPropertyValue
  -(getSparsePropValue(property));
  +(sparsePropsSet[ sparsePropsMap[property] ]);
   }
   if ((pval = propertySet[property]) != null) 
   return IndirectValue.adjustedPropertyValue(pval);
  @@ -499,9 +500,7 @@
* @return the ttPropertyValue/tt for the specified property.
*/
   public PropertyValue getSparsePropValue(int prop) {
  -return sparsePropsSet[
  -((Integer)(sparsePropsMap.get(Ints.consts.get(prop.intValue()
  -];
  +return sparsePropsSet[ sparsePropsMap[prop] ];
   }
   
   
  
  
  

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




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

2002-11-29 Thread pbwest
pbwest  2002/11/29 08:09:16

  Modified:src/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design FONode.java
  Log:
  Wrapped attribute handling in exception catching and logging. Get event pool.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.19.2.29 +38 -21xml-fop/src/org/apache/fop/fo/FONode.java
  
  Index: FONode.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FONode.java,v
  retrieving revision 1.19.2.28
  retrieving revision 1.19.2.29
  diff -u -r1.19.2.28 -r1.19.2.29
  --- FONode.java   22 Nov 2002 02:48:34 -  1.19.2.28
  +++ FONode.java   29 Nov 2002 16:09:16 -  1.19.2.29
  @@ -7,6 +7,7 @@
   import org.apache.fop.fo.properties.Property;
   import org.apache.fop.fo.expr.PropertyException;
   import org.apache.fop.fo.expr.PropertyParser;
  +import org.apache.fop.fo.expr.FunctionNotImplementedException;
   import org.apache.fop.datatypes.Ints;
   import org.apache.fop.datatypes.PropertyValue;
   import org.apache.fop.datatypes.PropertyValueList;
  @@ -19,6 +20,7 @@
   import org.apache.fop.datastructs.ROBitSet;
   import org.apache.fop.apps.FOPException;
   import org.apache.fop.xml.FoXMLEvent;
  +import org.apache.fop.xml.FoXMLEventPool;
   import org.apache.fop.xml.SyncedFoXmlEventsBuffer;
   import org.apache.fop.xml.XMLNamespaces;
   import org.apache.fop.messaging.MessageHandler;
  @@ -105,7 +107,10 @@
   PAGESEQ | FLOW | STATIC | TITLE | MC_MARKER;
   
   /** The buffer from which parser events are drawn. */
  -protected SyncedFoXmlEventsBuffer xmlevents;
  +protected final SyncedFoXmlEventsBuffer xmlevents;
  +
  +/** The pool of ttFoXMLEvent/tts associated with ixmlevents/i. */
  +protected final FoXMLEventPool pool;
   
   /** The namespaces object associated with ixmlevents/i. */
   protected XMLNamespaces namespaces;
  @@ -222,6 +227,7 @@
   this.numProps = sparseIndices.length;
   attrBitSet = FOPropertySets.getAttrROBitSet(stateFlags);
   xmlevents = foTree.xmlevents;
  +pool = xmlevents.getPool();
   namespaces = xmlevents.getNamespaces();
   exprParser = foTree.exprParser;
   propertySet = new PropertyValue[PropNames.LAST_PROPERTY_INDEX + 1];
  @@ -248,7 +254,7 @@
   int property;
   int prop = foKeys[propx].intValue();
   if ( ! attrBitSet.get(prop)) {
  -MessageHandler.log(Ignoring 
  +MessageHandler.logln(Ignoring 
  + PropNames.getPropertyName(prop)
  +  on 
  + FObjectNames.getFOName(type)
  @@ -258,30 +264,41 @@
   continue;
   }
   String attrValue = foAttributes.getFoAttrValue(prop);
  -props = handleAttrValue(prop, attrValue);
  -ptype = props.getType();
  -if (ptype != PropertyValue.LIST) { 
  -property = props.getProperty();
  -// Update the propertySet
  -propertySet[property] = props;
  -specifiedProps.set(property);
  -// Handle corresponding properties here
  -} else { // a list
  -PropertyValue value;
  -Iterator propvals = ((PropertyValueList)props).iterator();
  -while (propvals.hasNext()) {
  -value = (PropertyValue)(propvals.next());
  -property = value.getProperty();
  -propertySet[value.getProperty()] = value;
  +try {
  +props = handleAttrValue(prop, attrValue);
  +ptype = props.getType();
  +if (ptype != PropertyValue.LIST) { 
  +property = props.getProperty();
  +// Update the propertySet
  +propertySet[property] = props;
   specifiedProps.set(property);
   // Handle corresponding properties here
  +} else { // a list
  +PropertyValue value;
  +Iterator propvals = ((PropertyValueList)props).iterator();
  +while (propvals.hasNext()) {
  +value = (PropertyValue)(propvals.next());
  +property = value.getProperty();
  +propertySet[value.getProperty()] = value;
  +specifiedProps.set(property);
  +// Handle corresponding properties here
  +}
   }
  +} catch (FunctionNotImplementedException e) {
  +MessageHandler.logln
  +(Function not implemented:  + e.getMessage()
  + + . Ignoring property '
  +   

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

2002-11-20 Thread pbwest
pbwest  2002/11/20 23:01:10

  Modified:src/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design FONode.java
  Log:
  attrSet - stateFlags.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.19.2.26 +49 -29xml-fop/src/org/apache/fop/fo/FONode.java
  
  Index: FONode.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FONode.java,v
  retrieving revision 1.19.2.25
  retrieving revision 1.19.2.26
  diff -u -r1.19.2.25 -r1.19.2.26
  --- FONode.java   13 Nov 2002 15:12:17 -  1.19.2.25
  +++ FONode.java   21 Nov 2002 07:01:09 -  1.19.2.26
  @@ -55,27 +55,54 @@
   /**
* State flags: a bit set of states applicable during FO tree build.
* N.B. States must be powers of 2.
  + * pbBEWARE/b At what point are these ancestry flags supposed to
  + * apply?  If they are son-of (MC), they should only be expected to
  + * be applied on the children of a particular node type.  I don't think
  + * the higher level FO nodes are making this assumption.
  + * pJust changed most of the higher-level flags by removing the MC_
  + * prefix, which remains on some of the lower levels.  Use this convention
  + * for now: unprefixed name (e.g. Root), is a self-or-descendent
  + * indicator, while MC_ prefixed names are descendents only.
  + * pTODO: check for consistency of application.
*/
   public static final int
  - NOSTATE = 0
  -// These are used to select the attribute set for the node
  -   ,ROOT_SET = 1
  -   ,DECLARATIONS_SET = 2
  - ,LAYOUT_SET = 4
  - ,SEQ_MASTER_SET = 8
  -,PAGESEQ_SET = 16
  -   ,FLOW_SET = 32
  - ,STATIC_SET = 64
  -  ,TITLE_SET = 128
  - ,MARKER_SET = 256
  -,OUT_OF_LINE = 512
  -;
  + NOSTATE = 0
  +// These are used to select the attribute set for the node
  +   ,ROOT = 1
  +   ,DECLARATIONS = 2
  + ,LAYOUT = 4
  + ,SEQ_MASTER = 8
  +,PAGESEQ = 16
  +   ,FLOW = 32
  + ,STATIC = 64
  +  ,TITLE = 128
  +  ,MC_MARKER = 256
  +   ,MC_FLOAT = 512
  +,MC_FOOTNOTE = 1024
  +  ,MC_MULTI_CASE = 2048
  +   ,MC_ABSOLUTELY_POSITIONED = 4096
  +;
  +
  +public static final int
  +ROOT_SET = ROOT
  +   ,DECLARATIONS_SET = ROOT | DECLARATIONS
  + ,LAYOUT_SET = ROOT | LAYOUT
  + ,SEQ_MASTER_SET = LAYOUT_SET | SEQ_MASTER
  +,PAGESEQ_SET = ROOT | PAGESEQ
  +   ,FLOW_SET = PAGESEQ_SET | FLOW
  + ,STATIC_SET = PAGESEQ_SET | STATIC
  + ,TITLE_SET = PAGESEQ_SET | TITLE
  +,MARKER_SET = FLOW_SET | MC_MARKER
  +;
  +
  +public static final int MC_OUT_OF_LINE =
  +MC_FLOAT | MC_FOOTNOTE | MC_ABSOLUTELY_POSITIONED;
   
   /** The subset of istateFlags/i that select the relevant
   atttribute set or the node. */
   public static final int ATTRIBUTESETS = 
  -ROOT_SET | DECLARATIONS_SET | LAYOUT_SET | SEQ_MASTER_SET |
  -PAGESEQ_SET | FLOW_SET | STATIC_SET | TITLE_SET | MARKER_SET;
  +ROOT | DECLARATIONS | LAYOUT | SEQ_MASTER |
  +PAGESEQ | FLOW | STATIC | TITLE | MC_MARKER;
   
   /** The buffer from which parser events are drawn. */
   protected SyncedFoXmlEventsBuffer xmlevents;
  @@ -137,10 +164,7 @@
   /** The property expression parser in the FOTree. */
   protected PropertyParser exprParser;
   
  -/** The iattrSet/i argument. */
  -protected int attrSet;
  -
  -/** The ttROBitSet/tt of the iattrSet/i argument. */
  +/** The ttROBitSet/tt from the istateFlags/i argument. */
   protected ROBitSet attrBitSet;
   
   /** The state flags passed to this node. */
  @@ -182,7 +206,7 @@
* @param sparseindices - an ttint[]/tt holding the set of property
* indices applicable to this node, in ascending order.
* isparsePropsMap/i maps property indices to a position in this array.
  - * Together they paovide a sparse array facility for this node's
  + * Together they provide a sparse array facility for this node's
* properties.
*/
   public FONode
  @@ -193,20 +217,16 @@
   super(foTree, parent);
   this.type = type;
   this.stateFlags = stateFlags;
  -attrSet = stateFlags  ATTRIBUTESETS;
  -if ((attrSet  (attrSet - 1)) != 0)
  -throw new PropertyException
  -(Invalid attribut set:  + attrSet);
   this.sparsePropsMap = sparsePropsMap;
   this.sparseIndices = sparseIndices;
   

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

2002-11-20 Thread pbwest
pbwest  2002/11/20 23:04:40

  Modified:src/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design FONode.java
  Log:
  Added Id.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.19.2.27 +3 -3  xml-fop/src/org/apache/fop/fo/FONode.java
  
  Index: FONode.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FONode.java,v
  retrieving revision 1.19.2.26
  retrieving revision 1.19.2.27
  diff -u -r1.19.2.26 -r1.19.2.27
  --- FONode.java   21 Nov 2002 07:01:09 -  1.19.2.26
  +++ FONode.java   21 Nov 2002 07:04:39 -  1.19.2.27
  @@ -35,7 +35,7 @@
   /*
* FONode.java
* Created: Sat Nov 10 01:39:37 2001
  - *
  + * $Id$
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
  
  
  

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




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

2002-11-13 Thread pbwest
pbwest  2002/11/13 07:12:18

  Modified:src/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design FONode.java
  Log:
  Remove debugging printlns.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.19.2.25 +2 -6  xml-fop/src/org/apache/fop/fo/FONode.java
  
  Index: FONode.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FONode.java,v
  retrieving revision 1.19.2.24
  retrieving revision 1.19.2.25
  diff -u -r1.19.2.24 -r1.19.2.25
  --- FONode.java   13 Nov 2002 04:04:48 -  1.19.2.24
  +++ FONode.java   13 Nov 2002 15:12:17 -  1.19.2.25
  @@ -191,8 +191,6 @@
   throws TreeException, FOPException, PropertyException
   {
   super(foTree, parent);
  -if (type == FObjectNames.BLOCK)
  -System.out.println(Constructing FONode for FoBlock);
   this.type = type;
   this.stateFlags = stateFlags;
   attrSet = stateFlags  ATTRIBUTESETS;
  @@ -214,8 +212,6 @@
   // Do not set up the remaining properties now.
   // These will be developed by inheritance or from the initial values
   // as the property values are referenced.
  -if (type == FObjectNames.BLOCK)
  -System.out.println(Finshed constructing FONode for FoBlock);
   }
   
   private void processAttributes() throws FOPException, PropertyException {
  
  
  

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




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

2002-11-12 Thread pbwest
pbwest  2002/11/12 20:04:48

  Modified:src/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design FONode.java
  Log:
  Created stateFlags.
  Moved attribute set constants from FOPropertySets and merged with
  stateFlags.
  Changed attrSet argument to constructor to a stateFlags arg.
  Removed numProps arg from constructor.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.19.2.24 +61 -17xml-fop/src/org/apache/fop/fo/FONode.java
  
  Index: FONode.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FONode.java,v
  retrieving revision 1.19.2.23
  retrieving revision 1.19.2.24
  diff -u -r1.19.2.23 -r1.19.2.24
  --- FONode.java   11 Nov 2002 17:19:38 -  1.19.2.23
  +++ FONode.java   13 Nov 2002 04:04:48 -  1.19.2.24
  @@ -52,26 +52,57 @@
   private static final String tag = $Name$;
   private static final String revision = $Revision$;
   
  +/**
  + * State flags: a bit set of states applicable during FO tree build.
  + * N.B. States must be powers of 2.
  + */
  +public static final int
  + NOSTATE = 0
  +// These are used to select the attribute set for the node
  +   ,ROOT_SET = 1
  +   ,DECLARATIONS_SET = 2
  + ,LAYOUT_SET = 4
  + ,SEQ_MASTER_SET = 8
  +,PAGESEQ_SET = 16
  +   ,FLOW_SET = 32
  + ,STATIC_SET = 64
  +  ,TITLE_SET = 128
  + ,MARKER_SET = 256
  +,OUT_OF_LINE = 512
  +;
  +
  +/** The subset of istateFlags/i that select the relevant
  +atttribute set or the node. */
  +public static final int ATTRIBUTESETS = 
  +ROOT_SET | DECLARATIONS_SET | LAYOUT_SET | SEQ_MASTER_SET |
  +PAGESEQ_SET | FLOW_SET | STATIC_SET | TITLE_SET | MARKER_SET;
  +
   /** The buffer from which parser events are drawn. */
   protected SyncedFoXmlEventsBuffer xmlevents;
  +
   /** The namespaces object associated with ixmlevents/i. */
   protected XMLNamespaces namespaces;
  +
   /** The FO type. */
   public final int type;
   
   /** The attributes defined on this node. When the FO subtree of this
* node has been constructed, it will be deleted. */
   public FOAttributes foAttributes;
  +
   /** The map of properties specified on this node. N.B. This
 * ttHashMap/tt starts life in FOAttributes.  It is modifiable, and
 * will be modified when is contains shorthands or compounds.
 * When the FO subtree of this node has been constructed, and the
 * ipropertySet/i is complete, it will be deleted. */
   public HashMap foProperties = null;
  +
   /** The sorted keys of ifoProperties/i. */
   protected Integer[] foKeys = null;
  +
   /** The size of ifoKeys/i. */
   private int numAttrs = 0;
  +
   /** BitSet of properties which have been specified on this node. */
   private BitSet specifiedProps =
   new BitSet(PropNames.LAST_PROPERTY_INDEX + 1);
  @@ -85,17 +116,21 @@
   While isparsePropsSet/i is null,
   this variable will be a reference to the complete property set. */
   private PropertyValue[] propertySet;
  +
   /** The set of properties directly applicable to this node.  Its size is
   determined by the inumProps/i value passed in to the constructor.
   */
   private PropertyValue[] sparsePropsSet;
  +
   /** Map of ttInteger/tt indices of isparsePropsSet/i array.
   It is indexed by the FO index of the FO associated with a given
   position in the ipropertySet/i array. */
   private final HashMap sparsePropsMap;
  +
   /** An array of of the applicable property indices, in property index
   order. */
   private final int[] sparseIndices;
  +
   /** The number of applicable properties. Size of isparsePropsSet/i. */
   private final int numProps;
   
  @@ -103,16 +138,13 @@
   protected PropertyParser exprParser;
   
   /** The iattrSet/i argument. */
  -public final int attrSet;
  +protected int attrSet;
  +
   /** The ttROBitSet/tt of the iattrSet/i argument. */
   protected ROBitSet attrBitSet;
   
  -/** The ttROBitSet/tt of inherited properties for the
  -iattrSet/i argument. */
  -//protected ROBitSet inheritedBitSet;
  -/** The ttROBitSet/tt of non-inherited properties for the
  -iattrSet/i argument. */
  -//protected ROBitSet nonInheritedBitSet;
  +/** The state flags passed to this node. */
  +protected int stateFlags;
   
   /** Ancestor reference area of this FONode. */
   protected FONode ancestorRefArea = null;
  @@ -141,30 +173,42 @@
* @param parent an ttFONode/tt, the parent node of this node in
* ifoTree/i
* @param event the ttXMLEvent/tt that triggered the creation 

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

2002-11-11 Thread pbwest
pbwest  2002/11/11 09:19:38

  Modified:src/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design FONode.java
  Log:
  Added defaultConstructorArgs .
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.19.2.23 +25 -3 xml-fop/src/org/apache/fop/fo/FONode.java
  
  Index: FONode.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FONode.java,v
  retrieving revision 1.19.2.22
  retrieving revision 1.19.2.23
  diff -u -r1.19.2.22 -r1.19.2.23
  --- FONode.java   5 Nov 2002 14:28:53 -   1.19.2.22
  +++ FONode.java   11 Nov 2002 17:19:38 -  1.19.2.23
  @@ -118,6 +118,24 @@
   protected FONode ancestorRefArea = null;
   
   /**
  + * The default constructor arguments for an FObject. bN.B./b not
  + * all subclasses of ttFONode/tt use this constructor; e.g.
  + * ttFoRoot/tt, ttFoPageSequence/tt amp; ttFoFlow/tt.
  + * Generally these FObjects are not invoked through reflection.  If such
  + * invocation becomes necessary for a particular class, a contructor of
  + * this kind must be added to the class.
  + * pAt present, the only difference is in the addition of the
  + * ttint.class/tt constructor argument.
  + */
  +protected static final Class[] defaultConstructorArgs =
  +new Class[] {
  +FOTree.class
  +,FONode.class
  +,FoXMLEvent.class
  +,int.class
  +};
  +
  +/**
* @param foTree an ttFOTree/tt to which this node belongs
* @param type the fo type of this FONode.
* @param parent an ttFONode/tt, the parent node of this node in
  @@ -133,6 +151,8 @@
   throws TreeException, FOPException, PropertyException
   {
   super(foTree, parent);
  +if (type == FObjectNames.BLOCK)
  +System.out.println(Constructing FONode for FoBlock);
   this.type = type;
   this.attrSet = attrSet;
   this.sparsePropsMap = sparsePropsMap;
  @@ -150,6 +170,8 @@
   // Do not set up the remaining properties now.
   // These will be developed by inheritance or from the initial values
   // as the property values are referenced.
  +if (type == FObjectNames.BLOCK)
  +System.out.println(Finshed constructing FONode for FoBlock);
   }
   
   private void processAttributes() throws FOPException, PropertyException {
  @@ -181,7 +203,7 @@
   if (ptype != PropertyValue.LIST) { 
   property = props.getProperty();
   // Update the propertySet
  -propertySet[props.getProperty()] = props;
  +propertySet[property] = props;
   specifiedProps.set(property);
   // Handle corresponding properties here
   } else { // a list
  
  
  

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




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

2002-11-05 Thread pbwest
pbwest  2002/11/05 06:28:53

  Modified:src/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design FONode.java
  Log:
  Removed event field.  N.B. Important that this not be restored
  without ensuring subclasses handle it correctly.
  Removed foTree and parent fields.  Rely on underlying tree and parent fields.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.19.2.22 +7 -18 xml-fop/src/org/apache/fop/fo/FONode.java
  
  Index: FONode.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FONode.java,v
  retrieving revision 1.19.2.21
  retrieving revision 1.19.2.22
  diff -u -r1.19.2.21 -r1.19.2.22
  --- FONode.java   4 Nov 2002 14:54:56 -   1.19.2.21
  +++ FONode.java   5 Nov 2002 14:28:53 -   1.19.2.22
  @@ -52,12 +52,6 @@
   private static final String tag = $Name$;
   private static final String revision = $Revision$;
   
  -/** The ttFOTree/tt of which this node is a member. */
  -protected FOTree foTree;
  -/** The parent ttFONode/tt of this node. */
  -protected FONode parent;
  -/** The ttXMLEvent/tt which triggered this node. */
  -protected FoXMLEvent event;
   /** The buffer from which parser events are drawn. */
   protected SyncedFoXmlEventsBuffer xmlevents;
   /** The namespaces object associated with ixmlevents/i. */
  @@ -139,17 +133,12 @@
   throws TreeException, FOPException, PropertyException
   {
   super(foTree, parent);
  -this.foTree = foTree;
   this.type = type;
  -this.parent = parent;
  -this.event = event;
   this.attrSet = attrSet;
   this.sparsePropsMap = sparsePropsMap;
   this.sparseIndices = sparseIndices;
   this.numProps = numProps;
   attrBitSet = FOPropertySets.getAttrROBitSet(attrSet);
  -//inheritedBitSet = FOPropertySets.getInheritedROBitSet(attrSet);
  -//nonInheritedBitSet = FOPropertySets.getNonInheritedROBitSet(attrSet);
   xmlevents = foTree.xmlevents;
   namespaces = xmlevents.getNamespaces();
   exprParser = foTree.exprParser;
  @@ -240,7 +229,7 @@
* @return the ttFOTree/tt.
*/
   public FOTree getFOTree() {
  -return foTree;
  +return (FOTree)tree;
   }
   
   /**
  @@ -283,7 +272,7 @@
   {
   if (parent != null)
   return IndirectValue.adjustedPropertyValue
  -(parent.getNearestSpecifiedValue(sourceProperty));
  +(((FONode)parent).getNearestSpecifiedValue(sourceProperty));
   else // root
   return IndirectValue.adjustedPropertyValue
   (PropertyConsts.pconsts.getInitialValue(sourceProperty));
  @@ -312,7 +301,7 @@
   return IndirectValue.adjustedPropertyValue(propertySet[property]);
   if (parent != null)
   return IndirectValue.adjustedPropertyValue
  -(parent.getNearestSpecifiedValue(property));
  +(((FONode)parent).getNearestSpecifiedValue(property));
   else // root
   return IndirectValue.adjustedPropertyValue
   (PropertyConsts.pconsts.getInitialValue(property));
  @@ -354,7 +343,7 @@
   {
   if (parent != null)
   return IndirectValue.adjustedPropertyValue
  -(parent.getPropertyValue(sourceProperty));
  +(((FONode)parent).getPropertyValue(sourceProperty));
   else // root
   return IndirectValue.adjustedPropertyValue
   (PropertyConsts.pconsts.getInitialValue(sourceProperty));
  @@ -397,7 +386,7 @@
   if (parent != null  PropertyConsts.pconsts.isInherited(property))
   return (propertySet[property] =
  IndirectValue.adjustedPropertyValue
  -(parent.getPropertyValue(property)));
  +(((FONode)parent).getPropertyValue(property)));
   else // root
   return (propertySet[property] =
   IndirectValue.adjustedPropertyValue
  
  
  

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




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

2002-11-04 Thread pbwest
pbwest  2002/11/04 06:54:56

  Modified:src/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design FONode.java
FoRoot.java
  Log:
  Node and TreeException extracted from Tree.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.19.2.21 +7 -6  xml-fop/src/org/apache/fop/fo/FONode.java
  
  Index: FONode.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FONode.java,v
  retrieving revision 1.19.2.20
  retrieving revision 1.19.2.21
  diff -u -r1.19.2.20 -r1.19.2.21
  --- FONode.java   30 Oct 2002 14:41:49 -  1.19.2.20
  +++ FONode.java   4 Nov 2002 14:54:56 -   1.19.2.21
  @@ -14,7 +14,8 @@
   import org.apache.fop.datatypes.TextDecorations;
   import org.apache.fop.datatypes.indirect.Inherit;
   import org.apache.fop.datatypes.indirect.IndirectValue;
  -import org.apache.fop.datastructs.Tree;
  +import org.apache.fop.datastructs.Node;
  +import org.apache.fop.datastructs.TreeException;
   import org.apache.fop.datastructs.ROBitSet;
   import org.apache.fop.apps.FOPException;
   import org.apache.fop.xml.FoXMLEvent;
  @@ -46,7 +47,7 @@
* Class for nodes in the FO tree.
*/
   
  -public class FONode extends FOTree.Node{
  +public class FONode extends Node{
   
   private static final String tag = $Name$;
   private static final String revision = $Revision$;
  @@ -135,9 +136,9 @@
   public FONode
   (FOTree foTree, int type, FONode parent, FoXMLEvent event, int attrSet,
   HashMap sparsePropsMap, int[] sparseIndices, int numProps)
  -throws Tree.TreeException, FOPException, PropertyException
  +throws TreeException, FOPException, PropertyException
   {
  -foTree.super(parent);
  +super(foTree, parent);
   this.foTree = foTree;
   this.type = type;
   this.parent = parent;
  
  
  
  1.1.2.13  +6 -6  xml-fop/src/org/apache/fop/fo/Attic/FoRoot.java
  
  Index: FoRoot.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/Attic/FoRoot.java,v
  retrieving revision 1.1.2.12
  retrieving revision 1.1.2.13
  diff -u -r1.1.2.12 -r1.1.2.13
  --- FoRoot.java   30 Oct 2002 14:35:11 -  1.1.2.12
  +++ FoRoot.java   4 Nov 2002 14:54:56 -   1.1.2.13
  @@ -13,7 +13,7 @@
   import org.apache.fop.apps.FOPException;
   import org.apache.fop.fo.FOPropertySets;
   import org.apache.fop.fo.FObjectNames;
  -import org.apache.fop.datastructs.Tree;
  +import org.apache.fop.datastructs.TreeException;
   import org.apache.fop.datatypes.Ints;
   import org.apache.fop.fo.FOTree;
   import org.apache.fop.fo.FONode;
  @@ -78,7 +78,7 @@
*/
   public FoRoot
   (FOTree foTree, FoXMLEvent event)
  -throws Tree.TreeException, FOPException, PropertyException
  +throws TreeException, FOPException, PropertyException
   {
   // This is the root node of the tree; hence the null argument
   super(foTree, FObjectNames.ROOT, null, event, FOPropertySets.ROOT_SET,
  @@ -125,7 +125,7 @@
   layoutMasters = new FoLayoutMasterSet(foTree, this, ev);
   // Clean up the fo:layout-master-set event
   xmlevents.getEndElement(ev);
  -} catch(Tree.TreeException e) {
  +} catch(TreeException e) {
   throw new FOPException(TreeException:  + e.getMessage());
   } catch(PropertyException e) {
   throw new FOPException(PropertyException:  + e.getMessage());
  
  
  

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




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

2002-10-30 Thread pbwest
pbwest  2002/10/30 06:41:50

  Modified:src/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design FONode.java
  Log:
  sparsePropsSet support, including new constructor with
  sparsePropsMap, sparseIndices and numProps.  makeSparsePropsSet().
  getSparsePropValue().  Mods to getProperty for null propertySet.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.19.2.20 +81 -13xml-fop/src/org/apache/fop/fo/FONode.java
  
  Index: FONode.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FONode.java,v
  retrieving revision 1.19.2.19
  retrieving revision 1.19.2.20
  diff -u -r1.19.2.19 -r1.19.2.20
  --- FONode.java   24 Oct 2002 14:51:52 -  1.19.2.19
  +++ FONode.java   30 Oct 2002 14:41:49 -  1.19.2.20
  @@ -7,6 +7,7 @@
   import org.apache.fop.fo.properties.Property;
   import org.apache.fop.fo.expr.PropertyException;
   import org.apache.fop.fo.expr.PropertyParser;
  +import org.apache.fop.datatypes.Ints;
   import org.apache.fop.datatypes.PropertyValue;
   import org.apache.fop.datatypes.PropertyValueList;
   import org.apache.fop.datatypes.Numeric;
  @@ -62,31 +63,62 @@
   protected XMLNamespaces namespaces;
   /** The FO type. */
   public final int type;
  -/** The attributes defined on this node. */
  +
  +/** The attributes defined on this node. When the FO subtree of this
  + * node has been constructed, it will be deleted. */
   public FOAttributes foAttributes;
  -/** The unmodifiable map of properties defined on this node. */
  +/** The map of properties specified on this node. N.B. This
  +  * ttHashMap/tt starts life in FOAttributes.  It is modifiable, and
  +  * will be modified when is contains shorthands or compounds.
  +  * When the FO subtree of this node has been constructed, and the
  +  * ipropertySet/i is complete, it will be deleted. */
   public HashMap foProperties = null;
   /** The sorted keys of ifoProperties/i. */
   protected Integer[] foKeys = null;
   /** The size of ifoKeys/i. */
   private int numAttrs = 0;
  -/** The property expression parser in the FOTree. */
  -protected PropertyParser exprParser;
  -/** The property set for this node. */
  -protected PropertyValue[] propertySet;
  -/** BitSet of properties for which have been specified on this node. */
  +/** BitSet of properties which have been specified on this node. */
   private BitSet specifiedProps =
   new BitSet(PropNames.LAST_PROPERTY_INDEX + 1);
  +
  +/** The property set for this node.  This reference has two lives.
  +During FO subtree building, it holds all values which may potentially
  +be defined on the node.  It must, therefore, be able to accommodate
  +every property.  When FO subtree construction is completed, the
  +isparsePropsSet/i array is constructed for use during Area
  +tree building, and ipropertySet/i is nullified.
  +While isparsePropsSet/i is null,
  +this variable will be a reference to the complete property set. */
  +private PropertyValue[] propertySet;
  +/** The set of properties directly applicable to this node.  Its size is
  +determined by the inumProps/i value passed in to the constructor.
  +*/
  +private PropertyValue[] sparsePropsSet;
  +/** Map of ttInteger/tt indices of isparsePropsSet/i array.
  +It is indexed by the FO index of the FO associated with a given
  +position in the ipropertySet/i array. */
  +private final HashMap sparsePropsMap;
  +/** An array of of the applicable property indices, in property index
  +order. */
  +private final int[] sparseIndices;
  +/** The number of applicable properties. Size of isparsePropsSet/i. */
  +private final int numProps;
  +
  +/** The property expression parser in the FOTree. */
  +protected PropertyParser exprParser;
  +
   /** The iattrSet/i argument. */
   public final int attrSet;
   /** The ttROBitSet/tt of the iattrSet/i argument. */
   protected ROBitSet attrBitSet;
  +
   /** The ttROBitSet/tt of inherited properties for the
   iattrSet/i argument. */
   //protected ROBitSet inheritedBitSet;
   /** The ttROBitSet/tt of non-inherited properties for the
   iattrSet/i argument. */
   //protected ROBitSet nonInheritedBitSet;
  +
   /** Ancestor reference area of this FONode. */
   protected FONode ancestorRefArea = null;
   
  @@ -101,7 +133,8 @@
* node
*/
   public FONode
  -(FOTree foTree, int type, FONode parent, FoXMLEvent event, int attrSet)
  +(FOTree foTree, int type, FONode parent, FoXMLEvent event, int attrSet,
  +HashMap sparsePropsMap, int[] sparseIndices, int numProps)
 

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

2002-10-24 Thread pbwest
pbwest  2002/10/24 07:51:53

  Modified:src/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design FONode.java
FOTree.java
  Log:
  Changed XMLEvent to FoXMLEvent throughout.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.19.2.19 +7 -7  xml-fop/src/org/apache/fop/fo/FONode.java
  
  Index: FONode.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FONode.java,v
  retrieving revision 1.19.2.18
  retrieving revision 1.19.2.19
  diff -u -r1.19.2.18 -r1.19.2.19
  --- FONode.java   21 Oct 2002 15:43:26 -  1.19.2.18
  +++ FONode.java   24 Oct 2002 14:51:52 -  1.19.2.19
  @@ -16,8 +16,8 @@
   import org.apache.fop.datastructs.Tree;
   import org.apache.fop.datastructs.ROBitSet;
   import org.apache.fop.apps.FOPException;
  -import org.apache.fop.xml.XMLEvent;
  -import org.apache.fop.xml.SyncedXmlEventsBuffer;
  +import org.apache.fop.xml.FoXMLEvent;
  +import org.apache.fop.xml.SyncedFoXmlEventsBuffer;
   import org.apache.fop.xml.XMLNamespaces;
   import org.apache.fop.messaging.MessageHandler;
   
  @@ -55,9 +55,9 @@
   /** The parent ttFONode/tt of this node. */
   protected FONode parent;
   /** The ttXMLEvent/tt which triggered this node. */
  -protected XMLEvent event;
  +protected FoXMLEvent event;
   /** The buffer from which parser events are drawn. */
  -protected SyncedXmlEventsBuffer xmlevents;
  +protected SyncedFoXmlEventsBuffer xmlevents;
   /** The namespaces object associated with ixmlevents/i. */
   protected XMLNamespaces namespaces;
   /** The FO type. */
  @@ -101,7 +101,7 @@
* node
*/
   public FONode
  -(FOTree foTree, int type, FONode parent, XMLEvent event, int attrSet)
  +(FOTree foTree, int type, FONode parent, FoXMLEvent event, int attrSet)
   throws Tree.TreeException, FOPException, PropertyException
   {
   foTree.super(parent);
  
  
  
  1.1.2.20  +7 -7  xml-fop/src/org/apache/fop/fo/Attic/FOTree.java
  
  Index: FOTree.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/Attic/FOTree.java,v
  retrieving revision 1.1.2.19
  retrieving revision 1.1.2.20
  diff -u -r1.1.2.19 -r1.1.2.20
  --- FOTree.java   21 Oct 2002 15:45:30 -  1.1.2.19
  +++ FOTree.java   24 Oct 2002 14:51:53 -  1.1.2.20
  @@ -4,9 +4,9 @@
   import org.apache.fop.datatypes.Ints;
   import org.apache.fop.datatypes.Numeric;
   import org.apache.fop.datatypes.PropertyValue;
  -import org.apache.fop.xml.XMLEvent;
  +import org.apache.fop.xml.FoXMLEvent;
   import org.apache.fop.xml.XMLNamespaces;
  -import org.apache.fop.xml.SyncedXmlEventsBuffer;
  +import org.apache.fop.xml.SyncedFoXmlEventsBuffer;
   import org.apache.fop.apps.Driver;
   import org.apache.fop.apps.FOPException;
   import org.apache.fop.configuration.Configuration;
  @@ -50,7 +50,7 @@
* The buffer from which the ttXMLEvent/tts from the parser will
* be read.  ttprotected/tt so that FONode can access it.
*/
  -SyncedXmlEventsBuffer xmlevents;
  +SyncedFoXmlEventsBuffer xmlevents;
   private Thread parserThread;
   private boolean errorDump;
   
  @@ -65,7 +65,7 @@
* @param xmlevents the buffer from which ttXMLEvent/tts from the
* parser are read.
*/
  -public FOTree(SyncedXmlEventsBuffer xmlevents)
  +public FOTree(SyncedFoXmlEventsBuffer xmlevents)
   throws PropertyException
   {
   super();
  @@ -112,7 +112,7 @@
*/
   public void run() {
   FoRoot foRoot;
  -XMLEvent event;
  +FoXMLEvent event;
   try {
   // Dummy only - check the language and country setup
   System.out.println((String)Configuration.getHashMapEntry
  
  
  

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




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

2002-10-08 Thread pbwest

pbwest  2002/10/08 22:57:10

  Modified:src/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design FONode.java
  Log:
  Modified exception handling.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.19.2.16 +4 -4  xml-fop/src/org/apache/fop/fo/FONode.java
  
  Index: FONode.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FONode.java,v
  retrieving revision 1.19.2.15
  retrieving revision 1.19.2.16
  diff -u -r1.19.2.15 -r1.19.2.16
  --- FONode.java   5 Oct 2002 02:44:24 -   1.19.2.15
  +++ FONode.java   9 Oct 2002 05:57:09 -   1.19.2.16
  @@ -184,9 +184,9 @@
 .get(property))
.invoke(null, foTree.args));
   } catch (IllegalAccessException e) {
  -throw new PropertyException (e.getMessage());
  +throw new PropertyException (e);
   } catch (InvocationTargetException e) {
  -throw new PropertyException (e.getMessage());
  +throw new PropertyException (e);
   }
   }
   
  
  
  

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




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

2002-10-04 Thread pbwest

pbwest  2002/10/04 09:28:58

  Modified:src/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design FONode.java
  Log:
  Changed stackedProps to specifiedProps.
  Set inherited and non-inherited properties which had not been specified.
  Removed getParentPropertyValue().
  Added getCurrentFontSize() and getPropertyValue().
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.19.2.14 +83 -44xml-fop/src/org/apache/fop/fo/FONode.java
  
  Index: FONode.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FONode.java,v
  retrieving revision 1.19.2.13
  retrieving revision 1.19.2.14
  diff -u -r1.19.2.13 -r1.19.2.14
  --- FONode.java   3 Oct 2002 13:24:56 -   1.19.2.13
  +++ FONode.java   4 Oct 2002 16:28:57 -   1.19.2.14
  @@ -71,8 +71,8 @@
   protected PropertyParser exprParser;
   /** The property set for this node. */
   protected PropertyValue[] propertySet;
  -/** BitSet of properties for which specified values have been stacked. */
  -private BitSet stackedProps =
  +/** BitSet of properties for which have been specified on this node. */
  +private BitSet specifiedProps =
   new BitSet(PropNames.LAST_PROPERTY_INDEX + 1);
   /** The iattrSet/i argument. */
   public final int attrSet;
  @@ -120,18 +120,16 @@
   }
   // Set up the remaining properties.
   for (int prop = inheritedBitSet.nextSetBit(0);
  - prop = 0;
  - prop = inheritedBitSet.nextSetBit(++prop))
  -{
  -if (parent != null)
  -propertySet[prop] = parent.propertySet[prop];
  -else
  -propertySet[prop] = foTree.getInitialValue(prop);
  -}
  + prop = 0;
  + prop = inheritedBitSet.nextSetBit(++prop)) {
  +System.out.println(...Setting inherited prop  + prop
  +   +   + PropNames.getPropertyName(prop));
  +propertySet[prop] = fromParent(prop);  
  +} 
   
   for (int prop = nonInheritedBitSet.nextSetBit(0);
  - prop = 0;
  - prop = inheritedBitSet.nextSetBit(++prop))
  + prop = 0;
  + prop = inheritedBitSet.nextSetBit(++prop))
   {
   propertySet[prop] = foTree.getInitialValue(prop);
   }
  @@ -210,13 +208,13 @@
   foTree.popPropertyValue(property);
   value.setStackedBy(this);
   foTree.pushPropertyValue(value);
  -stackedProps.set(property);
  +specifiedProps.set(property);
   }
   
   private void unstackValues() throws PropertyException {
  -for (int prop = stackedProps.nextSetBit(0);
  +for (int prop = specifiedProps.nextSetBit(0);
prop =0;
  - prop = stackedProps.nextSetBit(++prop)
  + prop = specifiedProps.nextSetBit(++prop)
) {
   PropertyValue value = foTree.popPropertyValue(prop);
   if (value.getStackedBy() != this)
  @@ -226,15 +224,6 @@
   }
   
   /**
  - * Get the parent's ttPropertyValue/tt for the given property.
  - * @param property - the property of interest.
  - * @return the ttPropertyValue/tt of the parent node.
  - */
  -public PropertyValue getParentPropertyValue(int property) {
  -return parent.propertySet[property];
  -}
  -
  -/**
* Get the ttPropertyValue/tt of the nearest ancestor with a
* specified value for the given property.
* @param property - the property of interest.
  @@ -296,12 +285,12 @@
   }
   
   /**
  - * Get the computed value from the parent FO of the source property.
  + * Get the adjusted value from the parent FO of the source property.
  + * @see #fromParent(init,int)
  + * @see #getPropertyValue(int)
* @param property - the index of both target and source properties.
  - * @return - the computed value from the parent FO node, if it exists.
  - * If not, get the computed initial value.  If no computed
  - * value is available, return an ttInherit/tt object with a reference
  - * to the PropertyTriplet.
  + * @return - the adjusted value from the parent FO node, if it exists.
  + * If not, get the adjusted initial value.
*/
   public PropertyValue fromParent(int property)
   throws PropertyException
  @@ -310,25 +299,75 @@
   }
   
   /**
  - * Get the computed value from the parent FO of the source property.
  + * Get the adjusted ttPropertyValue/tt for the given source property
  + * on the parent ttFONode/tt. If this node is not the root,
  + * call the igetPropertyValue/i method in the parent node, adjust that
  + * that value, and return the 

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

2002-10-03 Thread pbwest

pbwest  2002/10/03 06:24:57

  Modified:src/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design FONode.java
  Log:
  Added inherited and non-inherited bitsets.
  Set inherited and non-inherited properties through bitsets.
  Moved test of specified property against subtree attribute set to
  top of attributes handling.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.19.2.13 +50 -30xml-fop/src/org/apache/fop/fo/FONode.java
  
  Index: FONode.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FONode.java,v
  retrieving revision 1.19.2.12
  retrieving revision 1.19.2.13
  diff -u -r1.19.2.12 -r1.19.2.13
  --- FONode.java   2 Oct 2002 15:14:21 -   1.19.2.12
  +++ FONode.java   3 Oct 2002 13:24:56 -   1.19.2.13
  @@ -2,6 +2,7 @@
   
   import org.apache.fop.fo.FOTree;
   import org.apache.fop.fo.FOAttributes;
  +import org.apache.fop.fo.FObjectNames;
   import org.apache.fop.fo.FOPropertySets;
   import org.apache.fop.fo.expr.PropertyException;
   import org.apache.fop.fo.expr.PropertyParser;
  @@ -76,7 +77,13 @@
   /** The iattrSet/i argument. */
   public final int attrSet;
   /** The ttROBitSet/tt of the iattrSet/i argument. */
  -protected ROBitSet nodeAttrBitSet;
  +protected ROBitSet attrBitSet;
  +/** The ttROBitSet/tt of inherited properties for the
  +iattrSet/i argument. */
  +protected ROBitSet inheritedBitSet;
  +/** The ttROBitSet/tt of non-inherited prperties for the
  +iattrSet/i argument. */
  +protected ROBitSet nonInheritedBitSet;
   /** Ancestor reference area of this FONode. */
   protected FONode ancestorRefArea = null;
   
  @@ -100,7 +107,9 @@
   this.parent = parent;
   this.event = event;
   this.attrSet = attrSet;
  -nodeAttrBitSet = FOPropertySets.getAttrROBitSet(attrSet);
  +attrBitSet = FOPropertySets.getAttrROBitSet(attrSet);
  +inheritedBitSet = FOPropertySets.getInheritedROBitSet(attrSet);
  +nonInheritedBitSet = FOPropertySets.getNonInheritedROBitSet(attrSet);
   xmlevents = foTree.xmlevents;
   namespaces = xmlevents.getNamespaces();
   exprParser = foTree.exprParser;
  @@ -110,6 +119,23 @@
   processAttributes();
   }
   // Set up the remaining properties.
  +for (int prop = inheritedBitSet.nextSetBit(0);
  + prop = 0;
  + prop = inheritedBitSet.nextSetBit(++prop))
  +{
  +if (parent != null)
  +propertySet[prop] = parent.propertySet[prop];
  +else
  +propertySet[prop] = foTree.getInitialValue(prop);
  +}
  +
  +for (int prop = nonInheritedBitSet.nextSetBit(0);
  + prop = 0;
  + prop = inheritedBitSet.nextSetBit(++prop))
  +{
  +propertySet[prop] = foTree.getInitialValue(prop);
  +}
  +
   }
   
   private void processAttributes() throws FOPException, PropertyException {
  @@ -122,43 +148,37 @@
   }
   for (int propx = 0; propx  numAttrs; propx++) {
   PropertyValue props;
  -int type;
  +int ptype;
   int property;
   int prop = foKeys[propx].intValue();
  +if ( ! attrBitSet.get(prop)) {
  +MessageHandler.log(Ignoring 
  +   + PropNames.getPropertyName(prop)
  +   +  on 
  +   + FObjectNames.getFOName(type)
  +   +  for attribute set 
  +   + FOPropertySets.getAttrSetName(attrSet)
  +   + .);
  +continue;
  +}
   String attrValue = foAttributes.getFoAttrValue(prop);
   props = handleAttrValue(prop, attrValue);
  -type = props.getType();
  -if (type != PropertyValue.LIST) { 
  +ptype = props.getType();
  +if (ptype != PropertyValue.LIST) { 
   property = props.getProperty();
  -if ( ! nodeAttrBitSet.get(property)) {
  -MessageHandler.log(Ignoring property 
  -   + PropNames.getPropertyName(property)
  -   +  for attribute set 
  -   + FOPropertySets.getAttrSetName(attrSet)
  -   + .);
  -} else {
  -stackValue(props);
  -// Handle corresponding properties here
  -// Update the propertySet
  -propertySet[props.getProperty()] = props;
  -}
  +stackValue(props);
  +  

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

2002-10-02 Thread pbwest

pbwest  2002/10/02 00:08:26

  Modified:src/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design FONode.java
  Log:
  Ignore properties not in attribute set for this node.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.19.2.11 +31 -10xml-fop/src/org/apache/fop/fo/FONode.java
  
  Index: FONode.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FONode.java,v
  retrieving revision 1.19.2.10
  retrieving revision 1.19.2.11
  diff -u -r1.19.2.10 -r1.19.2.11
  --- FONode.java   1 Oct 2002 16:40:23 -   1.19.2.10
  +++ FONode.java   2 Oct 2002 07:08:26 -   1.19.2.11
  @@ -15,6 +15,7 @@
   import org.apache.fop.xml.XMLEvent;
   import org.apache.fop.xml.SyncedXmlEventsBuffer;
   import org.apache.fop.xml.XMLNamespaces;
  +import org.apache.fop.messaging.MessageHandler;
   
   import org.xml.sax.Attributes;
   
  @@ -99,6 +100,7 @@
   this.parent = parent;
   this.event = event;
   this.attrSet = attrSet;
  +nodeAttrBitSet = FObjects.getAttrROBitSet(attrSet);
   xmlevents = foTree.xmlevents;
   namespaces = xmlevents.getNamespaces();
   exprParser = foTree.exprParser;
  @@ -109,7 +111,7 @@
   }
   }
   
  -private void processAttributes() throws PropertyException {
  +private void processAttributes() throws FOPException, PropertyException {
   // Process the FOAttributes - parse and stack the values
   // Build a HashMap of the properties defined on this node
   foProperties = foAttributes.getFoAttrMap();
  @@ -120,23 +122,42 @@
   for (int propx = 0; propx  numAttrs; propx++) {
   PropertyValue props;
   int type;
  +int property;
   int prop = foKeys[propx].intValue();
   String attrValue = foAttributes.getFoAttrValue(prop);
   props = handleAttrValue(prop, attrValue);
   type = props.getType();
   if (type != PropertyValue.LIST) { 
  -stackValue(props);
  -// Handle corresponding properties here
  -// Update the propertySet
  -propertySet[props.getProperty()] = props;
  +property = props.getProperty();
  +if ( ! nodeAttrBitSet.get(property)) {
  +MessageHandler.log(Ignoring property 
  +   + PropNames.getPropertyName(property)
  +   +  for attribute set 
  +   + FObjects.getAttrSetName(attrSet)
  +   + .);
  +} else {
  +stackValue(props);
  +// Handle corresponding properties here
  +// Update the propertySet
  +propertySet[props.getProperty()] = props;
  +}
   } else { // a list
   PropertyValue value;
   Iterator propvals = ((PropertyValueList)props).iterator();
   while (propvals.hasNext()) {
   value = (PropertyValue)(propvals.next());
  -stackValue(value);
  -// Handle corresponding properties here
  -propertySet[value.getProperty()] = value;
  +property = value.getProperty();
  +if ( ! nodeAttrBitSet.get(property)) {
  +MessageHandler.log(Ignoring property 
  +   + PropNames.getPropertyName(property)
  +   +  for attribute set 
  +   + FObjects.getAttrSetName(attrSet)
  +   + .);
  +} else {
  +stackValue(value);
  +// Handle corresponding properties here
  +propertySet[value.getProperty()] = value;
  +}
   }
   }
   }
  
  
  

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




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

2002-10-02 Thread pbwest

pbwest  2002/10/02 08:14:29

  Modified:src/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design FONode.java
FoRoot.java Properties.java
  Log:
  Moved FObjects to FOPropertySets.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.19.2.12 +8 -7  xml-fop/src/org/apache/fop/fo/FONode.java
  
  Index: FONode.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FONode.java,v
  retrieving revision 1.19.2.11
  retrieving revision 1.19.2.12
  diff -u -r1.19.2.11 -r1.19.2.12
  --- FONode.java   2 Oct 2002 07:08:26 -   1.19.2.11
  +++ FONode.java   2 Oct 2002 15:14:21 -   1.19.2.12
  @@ -2,7 +2,7 @@
   
   import org.apache.fop.fo.FOTree;
   import org.apache.fop.fo.FOAttributes;
  -import org.apache.fop.fo.FObjects;
  +import org.apache.fop.fo.FOPropertySets;
   import org.apache.fop.fo.expr.PropertyException;
   import org.apache.fop.fo.expr.PropertyParser;
   import org.apache.fop.datatypes.PropertyValue;
  @@ -100,15 +100,16 @@
   this.parent = parent;
   this.event = event;
   this.attrSet = attrSet;
  -nodeAttrBitSet = FObjects.getAttrROBitSet(attrSet);
  +nodeAttrBitSet = FOPropertySets.getAttrROBitSet(attrSet);
   xmlevents = foTree.xmlevents;
   namespaces = xmlevents.getNamespaces();
   exprParser = foTree.exprParser;
   propertySet = new PropertyValue[PropNames.LAST_PROPERTY_INDEX + 1];
   foAttributes = new FOAttributes(event, this);
  -if ( ! (attrSet == FObjects.MARKER_SET)) {
  +if ( ! (attrSet == FOPropertySets.MARKER_SET)) {
   processAttributes();
   }
  +// Set up the remaining properties.
   }
   
   private void processAttributes() throws FOPException, PropertyException {
  @@ -133,7 +134,7 @@
   MessageHandler.log(Ignoring property 
  + PropNames.getPropertyName(property)
  +  for attribute set 
  -   + FObjects.getAttrSetName(attrSet)
  +   + FOPropertySets.getAttrSetName(attrSet)
  + .);
   } else {
   stackValue(props);
  @@ -151,7 +152,7 @@
   MessageHandler.log(Ignoring property 
  + PropNames.getPropertyName(property)
  +  for attribute set 
  -   + FObjects.getAttrSetName(attrSet)
  +   + FOPropertySets.getAttrSetName(attrSet)
  + .);
   } else {
   stackValue(value);
  
  
  
  1.1.2.6   +5 -5  xml-fop/src/org/apache/fop/fo/Attic/FoRoot.java
  
  Index: FoRoot.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/Attic/FoRoot.java,v
  retrieving revision 1.1.2.5
  retrieving revision 1.1.2.6
  diff -u -r1.1.2.5 -r1.1.2.6
  --- FoRoot.java   2 Oct 2002 01:25:21 -   1.1.2.5
  +++ FoRoot.java   2 Oct 2002 15:14:21 -   1.1.2.6
  @@ -11,7 +11,7 @@
   package org.apache.fop.fo;
   
   import org.apache.fop.apps.FOPException;
  -import org.apache.fop.fo.FObjects;
  +import org.apache.fop.fo.FOPropertySets;
   import org.apache.fop.fo.FObjectNames;
   import org.apache.fop.datastructs.Tree;
   import org.apache.fop.fo.FOTree;
  @@ -52,7 +52,7 @@
   throws Tree.TreeException, FOPException, PropertyException
   {
   // This is the root node of the tree; hence the null argument
  -super(foTree, FObjectNames.ROOT, null, event, FObjects.ROOT_SET);
  +super(foTree, FObjectNames.ROOT, null, event, FOPropertySets.ROOT_SET);
   }
   
   /**
  
  
  
  1.1.2.30  +4 -4  xml-fop/src/org/apache/fop/fo/Attic/Properties.java
  
  Index: Properties.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/Attic/Properties.java,v
  retrieving revision 1.1.2.29
  retrieving revision 1.1.2.30
  diff -u -r1.1.2.29 -r1.1.2.30
  --- Properties.java   2 Oct 2002 07:06:25 -   1.1.2.29
  +++ Properties.java   2 Oct 2002 15:14:21 -   1.1.2.30
  @@ -25,7 +25,7 @@
   import org.apache.fop.fo.PropertyConsts;
   import org.apache.fop.fo.ShorthandPropSets;
   import org.apache.fop.fo.FOTree;
  -import org.apache.fop.fo.FObjects;
  +import org.apache.fop.fo.FOPropertySets;
   import org.apache.fop.datatypes.PropertyValue;
   import org.apache.fop.datatypes.AbstractPropertyValue;
   import org.apache.fop.datatypes.PropertyValueList;
  
  
  


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

2002-10-01 Thread pbwest

pbwest  2002/10/01 09:40:23

  Modified:src/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design FONode.java
  Log:
  Moved attribute set name constants to FObjects.
  Changed stacks from LinkedList to ArrayList implementation.
  Changed processProperties() to processAttributes().
  Added stackValue() and unstackValues() methods.
  Removed all PropertyTriplet references.  Properties will now be held
  directly.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.19.2.10 +96 -66xml-fop/src/org/apache/fop/fo/FONode.java
  
  Index: FONode.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FONode.java,v
  retrieving revision 1.19.2.9
  retrieving revision 1.19.2.10
  diff -u -r1.19.2.9 -r1.19.2.10
  --- FONode.java   24 Sep 2002 05:28:50 -  1.19.2.9
  +++ FONode.java   1 Oct 2002 16:40:23 -   1.19.2.10
  @@ -7,9 +7,10 @@
   import org.apache.fop.fo.expr.PropertyParser;
   import org.apache.fop.datatypes.PropertyValue;
   import org.apache.fop.datatypes.PropertyValueList;
  -import org.apache.fop.datatypes.PropertyTriplet;
   import org.apache.fop.datastructs.Tree;
  +import org.apache.fop.datastructs.ROBitSet;
   import org.apache.fop.datatypes.indirect.Inherit;
  +import org.apache.fop.datatypes.indirect.IndirectValue;
   import org.apache.fop.apps.FOPException;
   import org.apache.fop.xml.XMLEvent;
   import org.apache.fop.xml.SyncedXmlEventsBuffer;
  @@ -17,7 +18,7 @@
   
   import org.xml.sax.Attributes;
   
  -import java.util.LinkedList;
  +import java.util.BitSet;
   import java.util.Iterator;
   import java.util.ArrayList;
   import java.util.HashMap;
  @@ -44,20 +45,10 @@
   private static final String tag = $Name$;
   private static final String revision = $Revision$;
   
  -/**
  - * Constants for the set of attributes of interest with this FONode
  - */
  -public static final int
  -NONE = 0
  -   ,ROOT = 1
  - ,LAYOUT = 2
  -,PAGESEQ = 3
  -   ,FLOW = 4
  - ,STATIC = 5
  - ,MARKER = 6
  -;
   /** The ttFOTree/tt of which this node is a member. */
   protected FOTree foTree;
  +/** The parent ttFONode/tt of this node. */
  +protected FONode parent;
   /** The ttXMLEvent/tt which triggered this node. */
   protected XMLEvent event;
   /** The buffer from which parser events are drawn. */
  @@ -66,14 +57,25 @@
   protected XMLNamespaces namespaces;
   /** The FO type. */
   public final int type;
  -/** The array of property value stacks */
  -protected LinkedList[] propertyStacks;
   /** The attributes defined on this node. */
   public FOAttributes foAttributes;
  -/** The properties defined on this node. */
  +/** The unmodifiable map of properties defined on this node. */
   public HashMap foProperties = null;
  +/** The sorted keys of ifoProperties/i. */
  +protected Integer[] foKeys = null;
  +/** The size of ifoKeys/i. */
  +private int numAttrs = 0;
   /** The property expression parser in the FOTree. */
   protected PropertyParser exprParser;
  +/** The property set for this node. */
  +protected PropertyValue[] propertySet;
  +/** BitSet of properties for which specified values have been stacked. */
  +private BitSet stackedProps =
  +new BitSet(PropNames.LAST_PROPERTY_INDEX + 1);
  +/** The iattrSet/i argument. */
  +public final int attrSet;
  +/** The ttROBitSet/tt of the iattrSet/i argument. */
  +protected ROBitSet nodeAttrBitSet;
   /** Ancestor reference area of this FONode. */
   protected FONode ancestorRefArea = null;
   
  @@ -94,26 +96,48 @@
   foTree.super(parent);
   this.foTree = foTree;
   this.type = type;
  +this.parent = parent;
   this.event = event;
  +this.attrSet = attrSet;
   xmlevents = foTree.xmlevents;
   namespaces = xmlevents.getNamespaces();
  -propertyStacks = foTree.propertyStacks;
   exprParser = foTree.exprParser;
  +propertySet = new PropertyValue[PropNames.LAST_PROPERTY_INDEX + 1];
   foAttributes = new FOAttributes(event, this);
  -if ( ! (attrSet == MARKER)) {
  -processProperties();
  +if ( ! (attrSet == FObjects.MARKER_SET)) {
  +processAttributes();
   }
   }
   
  -private void processProperties() throws PropertyException {
  +private void processAttributes() throws PropertyException {
   // Process the FOAttributes - parse and stack the values
   // Build a HashMap of the properties defined on this node
   foProperties = foAttributes.getFoAttrMap();
  -PropertyValue props;
  -for (int prop = 1; prop = PropNames.LAST_PROPERTY_INDEX; prop++) {
  -String value 

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

2002-09-23 Thread pbwest

pbwest  2002/09/23 22:28:50

  Modified:src/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design FONode.java
  Log:
  Changed invocation of parse()
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.19.2.9  +4 -4  xml-fop/src/org/apache/fop/fo/FONode.java
  
  Index: FONode.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FONode.java,v
  retrieving revision 1.19.2.8
  retrieving revision 1.19.2.9
  diff -u -r1.19.2.8 -r1.19.2.9
  --- FONode.java   18 Sep 2002 15:42:12 -  1.19.2.8
  +++ FONode.java   24 Sep 2002 05:28:50 -  1.19.2.9
  @@ -123,8 +123,8 @@
   {
   // parse the expression
   exprParser.resetParser();
  -foTree.args[0] = foTree;
  -foTree.args[1] = exprParser.parse(property, attrValue);
  +foTree.args[0] = this;
  +foTree.args[1] = exprParser.parse(this, property, attrValue);
   try {
   return (PropertyValue)
   (((Method)PropertyConsts.refineParsingMethods
  
  
  

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




cvs commit: xml-fop/src/org/apache/fop/fo FONode.java FOTree.java Properties.java PropertyConsts.java PropertySets.java

2002-09-18 Thread pbwest

pbwest  2002/09/18 08:42:13

  Modified:src/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design FONode.java
FOTree.java Properties.java PropertyConsts.java
PropertySets.java
  Log:
  Changes to import names.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.19.2.8  +6 -6  xml-fop/src/org/apache/fop/fo/FONode.java
  
  Index: FONode.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FONode.java,v
  retrieving revision 1.19.2.7
  retrieving revision 1.19.2.8
  diff -u -r1.19.2.7 -r1.19.2.8
  --- FONode.java   18 Sep 2002 06:01:51 -  1.19.2.7
  +++ FONode.java   18 Sep 2002 15:42:12 -  1.19.2.8
  @@ -5,11 +5,11 @@
   import org.apache.fop.fo.FObjects;
   import org.apache.fop.fo.expr.PropertyException;
   import org.apache.fop.fo.expr.PropertyParser;
  -import org.apache.fop.fo.expr.PropertyValue;
  -import org.apache.fop.fo.expr.PropertyValueList;
  -import org.apache.fop.fo.expr.PropertyTriplet;
  +import org.apache.fop.datatypes.PropertyValue;
  +import org.apache.fop.datatypes.PropertyValueList;
  +import org.apache.fop.datatypes.PropertyTriplet;
   import org.apache.fop.datastructs.Tree;
  -import org.apache.fop.datatypes.Inherit;
  +import org.apache.fop.datatypes.indirect.Inherit;
   import org.apache.fop.apps.FOPException;
   import org.apache.fop.xml.XMLEvent;
   import org.apache.fop.xml.SyncedXmlEventsBuffer;
  
  
  
  1.1.2.11  +5 -5  xml-fop/src/org/apache/fop/fo/Attic/FOTree.java
  
  Index: FOTree.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/Attic/FOTree.java,v
  retrieving revision 1.1.2.10
  retrieving revision 1.1.2.11
  diff -u -r1.1.2.10 -r1.1.2.11
  --- FOTree.java   18 Sep 2002 06:06:24 -  1.1.2.10
  +++ FOTree.java   18 Sep 2002 15:42:12 -  1.1.2.11
  @@ -3,7 +3,7 @@
   import org.apache.fop.datastructs.Tree;
   import org.apache.fop.datatypes.Ints;
   import org.apache.fop.datatypes.Numeric;
  -import org.apache.fop.datatypes.Inherit;
  +import org.apache.fop.datatypes.indirect.Inherit;
   import org.apache.fop.datatypes.Auto;
   import org.apache.fop.datatypes.None;
   import org.apache.fop.datatypes.TextDecorations;
  @@ -16,8 +16,8 @@
   import org.apache.fop.fo.Properties;
   import org.apache.fop.fo.PropertyConsts;
   import org.apache.fop.fo.PropNames;
  -import org.apache.fop.fo.expr.PropertyValue;
  -import org.apache.fop.fo.expr.PropertyTriplet;
  +import org.apache.fop.datatypes.PropertyValue;
  +import org.apache.fop.datatypes.PropertyTriplet;
   import org.apache.fop.fo.expr.PropertyException;
   import org.apache.fop.fo.expr.PropertyParser;
   
  
  
  
  1.1.2.24  +11 -10xml-fop/src/org/apache/fop/fo/Attic/Properties.java
  
  Index: Properties.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/Attic/Properties.java,v
  retrieving revision 1.1.2.23
  retrieving revision 1.1.2.24
  diff -u -r1.1.2.23 -r1.1.2.24
  --- Properties.java   15 Sep 2002 05:00:54 -  1.1.2.23
  +++ Properties.java   18 Sep 2002 15:42:12 -  1.1.2.24
  @@ -25,9 +25,9 @@
   import org.apache.fop.fo.PropertyConsts;
   import org.apache.fop.fo.FOTree;
   import org.apache.fop.fo.FObjects;
  -import org.apache.fop.fo.expr.PropertyValue;
  -import org.apache.fop.fo.expr.AbstractPropertyValue;
  -import org.apache.fop.fo.expr.PropertyValueList;
  +import org.apache.fop.datatypes.PropertyValue;
  +import org.apache.fop.datatypes.AbstractPropertyValue;
  +import org.apache.fop.datatypes.PropertyValueList;
   import org.apache.fop.fo.expr.PropertyException;
   import org.apache.fop.fo.expr.PropertyNotImplementedException;
   import org.apache.fop.fo.expr.SystemFontFunction;
  @@ -53,15 +53,15 @@
   import org.apache.fop.datatypes.Literal;
   import org.apache.fop.datatypes.Auto;
   import org.apache.fop.datatypes.None;
  -import org.apache.fop.datatypes.Inherit;
   import org.apache.fop.datatypes.ColorType;
   import org.apache.fop.datatypes.FontFamilySet;
   import org.apache.fop.datatypes.TextDecorations;
   import org.apache.fop.datatypes.TextDecorator;
   import org.apache.fop.datatypes.ShadowEffect;
  -import org.apache.fop.datatypes.FromParent;
  -import org.apache.fop.datatypes.FromNearestSpecified;
   import org.apache.fop.datatypes.Slash;
  +import org.apache.fop.datatypes.indirect.Inherit;
  +import org.apache.fop.datatypes.indirect.FromParent;
  +import org.apache.fop.datatypes.indirect.FromNearestSpecified;
   
   /**
* Parent class for all of the individual property classes.  It also contains
  @@ -4385,7 +4385,8 @@
   // First, check that we have a list
   if (type != PropertyValue.LIST) {
   if ( ! nested  type == PropertyValue.INHERIT) 

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

2002-09-17 Thread pbwest

pbwest  2002/09/17 23:01:51

  Modified:src/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design FONode.java
  Log:
  Added getParentTriplet(), getNearestSpecifiedTriplet(),
  fromNearestSpecified() and fromParent() methods.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.19.2.7  +127 -5xml-fop/src/org/apache/fop/fo/FONode.java
  
  Index: FONode.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FONode.java,v
  retrieving revision 1.19.2.6
  retrieving revision 1.19.2.7
  diff -u -r1.19.2.6 -r1.19.2.7
  --- FONode.java   16 Sep 2002 05:03:03 -  1.19.2.6
  +++ FONode.java   18 Sep 2002 06:01:51 -  1.19.2.7
  @@ -7,7 +7,9 @@
   import org.apache.fop.fo.expr.PropertyParser;
   import org.apache.fop.fo.expr.PropertyValue;
   import org.apache.fop.fo.expr.PropertyValueList;
  +import org.apache.fop.fo.expr.PropertyTriplet;
   import org.apache.fop.datastructs.Tree;
  +import org.apache.fop.datatypes.Inherit;
   import org.apache.fop.apps.FOPException;
   import org.apache.fop.xml.XMLEvent;
   import org.apache.fop.xml.SyncedXmlEventsBuffer;
  @@ -16,6 +18,7 @@
   import org.xml.sax.Attributes;
   
   import java.util.LinkedList;
  +import java.util.Iterator;
   import java.util.ArrayList;
   import java.util.HashMap;
   import java.lang.reflect.Method;
  @@ -63,8 +66,6 @@
   protected XMLNamespaces namespaces;
   /** The FO type. */
   public final int type;
  -/** The node identifier obtained from ttfoTree/tt. */
  -public final int id;
   /** The array of property value stacks */
   protected LinkedList[] propertyStacks;
   /** The attributes defined on this node. */
  @@ -98,7 +99,6 @@
   namespaces = xmlevents.getNamespaces();
   propertyStacks = foTree.propertyStacks;
   exprParser = foTree.exprParser;
  -id = foTree.nextNodeID();
   foAttributes = new FOAttributes(event, this);
   if ( ! (attrSet == MARKER)) {
   processProperties();
  @@ -135,6 +135,128 @@
   } catch (InvocationTargetException e) {
   throw new PropertyException (e.getMessage());
   }
  +}
  +
  +/**
  + * Get the parent's ttPropertyTriplet/tt for the given property.
  + * @param property - the property of interest.
  + * @return the ttPropertyTriplet/tt of the parent node.
  + */
  +public PropertyTriplet getParentTriplet(int property) {
  +PropertyTriplet triplet = null;
  +LinkedList stack = foTree.propertyStacks[property];
  +int size = stack.size();
  +int next = size;
  +// There must be at least one
  +triplet = (PropertyTriplet)(stack.get(--next));
  +// Following equality can't be the case for initial values,
  +// as their stackedBy will be null.
  +if (triplet.getStackedBy() == this) {
  +triplet = (PropertyTriplet)(stack.get(--next));
  +}
  +return triplet;
  +}
  +
  +/**
  + * Get the ttPropertyTriplet/tt of the nearest ancestor with a
  + * specified value for the given property.
  + * @param property - the property of interest.
  + * @return the nearest specified ttPropertyTriplet/tt.
  + */
  +public PropertyTriplet getNearestSpecifiedTriplet(int property)
  +throws PropertyException
  +{
  +PropertyTriplet triplet = null;
  +PropertyValue value = null;
  +Iterator stackp = foTree.propertyStacks[property].iterator();
  +while (stackp.hasNext()) {
  +triplet = (PropertyTriplet)(stackp.next());
  +// Following equality can't be the case for initial values,
  +// as their stackedBy will be null.
  +if (triplet.getStackedBy() == this) continue;
  +if ((value = triplet.getSpecified()) != null) break;
  +}
  +if (value == null)
  +throw new PropertyException
  +(No specified value in stack for  + property + : 
  +  + PropNames.getPropertyName(property));
  +return triplet;
  +}
  +
  +/**
  + * Get the computed value from nearest ancestor with a specified value.
  + * @param property - the index of both target and source properties.
  + * @return - the computed value corresponding to the nearest specified
  + * value (which may be the initial value) if it exists.  If no computed
  + * value is available, return an ttInherit/tt object with a reference
  + * to the PropertyTriplet.
  + */
  +public PropertyValue fromNearestSpecified(int property)
  +throws PropertyException
  +{
  +return fromNearestSpecified(property, property);
  +}
  +
  +/**
  + * Get the computed value from nearest ancestor with a specified value.
  + * 

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

2002-05-06 Thread pbwest

pbwest  02/05/06 22:23:06

  Modified:src/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design FONode.java
  Log:
  Experimental version of FONode
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.19.2.1  +81 -230   xml-fop/src/org/apache/fop/fo/FONode.java
  
  Index: FONode.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FONode.java,v
  retrieving revision 1.19
  retrieving revision 1.19.2.1
  diff -u -r1.19 -r1.19.2.1
  --- FONode.java   1 Aug 2001 23:08:54 -   1.19
  +++ FONode.java   7 May 2002 05:23:06 -   1.19.2.1
  @@ -1,244 +1,95 @@
  +package org.apache.fop.fo;
  +
  +import org.apache.fop.fo.FOTree;
  +import org.apache.fop.fo.FOAttributes;
  +import org.apache.fop.fo.FObjects;
  +import org.apache.fop.fo.expr.PropertyException;
  +import org.apache.fop.fo.expr.PropertyParser;
  +import org.apache.fop.fo.expr.PropertyValue;
  +import org.apache.fop.fo.expr.PropertyValueList;
  +import org.apache.fop.datastructs.Tree;
  +import org.apache.fop.datastructs.SyncedCircularBuffer;
  +import org.apache.fop.apps.FOPException;
  +import org.apache.fop.xml.XMLEvent;
  +
  +import org.xml.sax.Attributes;
  +
  +import java.util.LinkedList;
  +import java.util.ArrayList;
  +
   /*
  - * $Id: FONode.java,v 1.19 2001/08/01 23:08:54 gears Exp $
  + * FONode.java
  + * Created: Sat Nov 10 01:39:37 2001
  + *
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
  + *
  + * @author a href=mailto:[EMAIL PROTECTED];Peter B. West/a
  + * @version $Revision: 1.19.2.1 $ $Name:  $
*/
  -
  -
  -package org.apache.fop.fo;
  -
  -// FOP
  -import org.apache.fop.apps.FOPException;
  -import org.apache.fop.layout.Area;
  -import org.apache.fop.layout.AreaClass;
  -import org.apache.fop.layout.LinkSet;
  -import org.apache.fop.system.BufferManager;
  -import org.apache.fop.fo.flow.Marker;
  -
  -// Java
  -import java.util.Vector;
  -import java.util.Hashtable;
  -
   /**
  - * base class for nodes in the formatting object tree
  - *
  - * Modified by Mark Lillywhite [EMAIL PROTECTED] Made
  - * Vector a protected member. (/me things this should be
  - * a private member with an API for adding children;
  - * this woudl save a lot of memory because the Vector
  - * would not have to be instantiated unless the node had
  - * children).
  + * Class for nodes in the FO tree.
*/
  -abstract public class FONode {
  -
  -protected FObj parent;
  -
  -protected String areaClass = AreaClass.UNASSIGNED;
  -
  -public BufferManager bufferManager;
   
  -protected Vector children = new Vector();// made public for searching for 
id's
  -
  -/**
  - * value of marker before layout begins
  - */
  -public final static int START = -1000;
  -
  -/**
  - * value of marker after break-after
  - */
  -public final static int BREAK_AFTER = -1001;
  +public class FONode extends FOTree.Node{
   
   /**
  - * where the layout was up to.
  - * for FObjs it is the child number
  - * for FOText it is the character number
  + * Constants for the set of attributes of interest with this FONode
*/
  -protected int marker = START;
  -
  -protected boolean isInTableCell = false;
  -
  -protected int forcedStartOffset = 0;
  -protected int forcedWidth = 0;
  -
  -protected int widows = 0;
  -protected int orphans = 0;
  -
  -protected LinkSet linkSet;
  -
  -// count of areas generated-by/returned-by
  -public int areasGenerated = 0;
  -
  -// markers
  -protected Hashtable markers;
  -
  -protected FONode(FObj parent) {
  -this.parent = parent;
  -if (parent != null) {
  -this.bufferManager = parent.bufferManager;
  +public static final int
  +NONE = 0
  +   ,ROOT = 1
  + ,LAYOUT = 2
  +   ,FLOW = 3
  +;
  +
  +/** The ttFOTree/tt of which this node is a member. */
  +protected FOTree foTree;
  +/** The ttXMLEvent/tt which triggered this node. */
  +protected XMLEvent event;
  +/** The buffer from which parser events are drawn. */
  +protected SyncedCircularBuffer xmlevents;
  +/** The array of property value stacks */
  +protected LinkedList[] propertyStacks;
  +/** The attributes defined on this node. */
  +public FOAttributes foAttributes;
  +/** The property expression parser in the FOTree. */
  +protected PropertyParser exprParser;
  +
  +/**
  + * @param foTree an ttFOTree/tt to which this node belongs
  + * @param parent an ttFONode/tt, the parent node of this node in
  + * ifoTree/i
  + * @param event the ttXMLEvent/tt that triggered the creation of this
  + * node
  + */
  +

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

2001-07-16 Thread arved

arved   01/07/16 03:36:48

  Modified:src/org/apache/fop/fo FONode.java FObj.java
  Log:
  AHS: initial marker support
  
  Revision  ChangesPath
  1.16  +36 -2 xml-fop/src/org/apache/fop/fo/FONode.java
  
  Index: FONode.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FONode.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- FONode.java   2001/05/19 00:59:06 1.15
  +++ FONode.java   2001/07/16 10:36:48 1.16
  @@ -1,4 +1,4 @@
  -/*-- $Id: FONode.java,v 1.15 2001/05/19 00:59:06 arved Exp $ -- 
  +/*-- $Id: FONode.java,v 1.16 2001/07/16 10:36:48 arved Exp $ -- 
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the 
* LICENSE file included with these sources.
  @@ -10,11 +10,14 @@
   // FOP
   import org.apache.fop.apps.FOPException;
   import org.apache.fop.layout.Area;
  +import org.apache.fop.layout.AreaClass;
   import org.apache.fop.layout.LinkSet;
   import org.apache.fop.system.BufferManager;
  +import org.apache.fop.fo.flow.Marker;
   
   // Java
   import java.util.Vector;
  +import java.util.Hashtable;
   
   /**
* base class for nodes in the formatting object tree
  @@ -23,6 +26,8 @@
   
   protected FObj parent;
   
  +protected String areaClass = AreaClass.UNASSIGNED;
  +  
public BufferManager bufferManager;

   public Vector children = new Vector();   // made public for searching 
for id's
  @@ -50,11 +55,22 @@
   
   protected LinkSet linkSet;
   
  +// count of areas generated-by/returned-by
  +public int areasGenerated = 0;
  +  
  +// markers
  +protected Hashtable markers;
  +
   protected FONode(FObj parent) {
  - this.parent = parent;
  + this.parent = parent;
if (parent != null) {
this.bufferManager = parent.bufferManager;
}
  + 
  + markers = new Hashtable();
  + 
  + if (null != parent)
  + this.areaClass = parent.areaClass;
   }
   
   public void setIsInTableCell() {
  @@ -202,4 +218,22 @@
}
((FONode) children.elementAt(this.marker)).rollback(snapshot);
}
  +
  +
  +  public void addMarker(Marker marker) throws FOPException {
  +   String mcname = marker.getMarkerClassName();
  +   if (!markers.containsKey(mcname)  children.isEmpty())
  +   markers.put(mcname, marker);
  +   else
  +   throw new FOPException(fo:marker must be an initial child, +
  +   and 'marker-class-name' must be unique for same parent);
  +  }
  +  
  +  public boolean hasMarkers() {
  +   return !markers.isEmpty();
  +  }
  +  
  +  public Vector getMarkers() {
  +   return new Vector(markers.values());
  +  }
   }
  
  
  
  1.18  +1 -3  xml-fop/src/org/apache/fop/fo/FObj.java
  
  Index: FObj.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FObj.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- FObj.java 2001/06/07 06:47:59 1.17
  +++ FObj.java 2001/07/16 10:36:48 1.18
  @@ -1,4 +1,4 @@
  -/* $Id: FObj.java,v 1.17 2001/06/07 06:47:59 keiron Exp $
  +/* $Id: FObj.java,v 1.18 2001/07/16 10:36:48 arved Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
  @@ -158,7 +158,5 @@
 p=parent);
   this.properties.setWritingMode(p.getProperty(writing-mode).getEnum());
 }
  -
  -
   }
   
  
  
  

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