gmazza      2003/11/09 07:38:27

  Modified:    src/java/org/apache/fop/layoutmgr LayoutContext.java
                        SpaceSpecifier.java
  Log:
  A few more toString() implementations helpful for debugging spacing
  issues in BLM.
  
  Revision  Changes    Path
  1.4       +18 -1     xml-fop/src/java/org/apache/fop/layoutmgr/LayoutContext.java
  
  Index: LayoutContext.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/LayoutContext.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LayoutContext.java        8 Sep 2003 17:00:54 -0000       1.3
  +++ LayoutContext.java        9 Nov 2003 15:38:27 -0000       1.4
  @@ -95,7 +95,6 @@
        */
       MinOptMax stackLimit;
   
  -
       /** True if current top-level reference area is spanning. */
       boolean bIsSpan;
   
  @@ -255,6 +254,24 @@
   
       public int getBaseline() {
           return iBaseline;
  +    }
  +    
  +    public String toString() {
  +        return "Layout Context:" +
  +        "\nStack Limit: \t" + (getStackLimit() == null ? "null" : 
getStackLimit().toString()) +
  +        "\nTrailing Space: \t" + (getTrailingSpace() == null ? "null" : 
getTrailingSpace().toString()) +
  +        "\nLeading Space: \t" + (getLeadingSpace() == null ? "null" : 
getLeadingSpace().toString()) + 
  +        "\nReference IPD: \t" + getRefIPD() +
  +        "\nSpace Adjust: \t" + getSpaceAdjust() + 
  +        "\nIPD Adjust: \t" + getIPDAdjust() +
  +        "\nLine Height: \t" + getLineHeight() +
  +        "\nBaseline: \t" + getBaseline() +
  +        "\nResolve Leading Space: \t" + resolveLeadingSpace() +
  +        "\nSuppress Leading Space: \t" + suppressLeadingSpace() +
  +        "\nIs First Area: \t" + isFirstArea() + 
  +        "\nStarts New Area: \t" + startsNewArea() + 
  +        "\nIs Last Area: \t" + isLastArea() +
  +        "\nTry Hyphenate: \t" + tryHyphenate();
       }
   }
   
  
  
  
  1.4       +12 -4     xml-fop/src/java/org/apache/fop/layoutmgr/SpaceSpecifier.java
  
  Index: SpaceSpecifier.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/SpaceSpecifier.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SpaceSpecifier.java       8 Sep 2003 17:00:54 -0000       1.3
  +++ SpaceSpecifier.java       9 Nov 2003 15:38:27 -0000       1.4
  @@ -63,17 +63,17 @@
   public class SpaceSpecifier implements Cloneable {
   
   
  -    private boolean bStartsRefArea;
  +    private boolean bStartsReferenceArea;
       private boolean bHasForcing = false;
       private List vecSpaceVals = new java.util.ArrayList();
   
   
       /**
        * Creates a new SpaceSpecifier.
  -     * @param bStarts true if it starts anew reference area
  +     * @param bStarts true if it starts a new reference area
        */
       public SpaceSpecifier(boolean bStarts) {
  -        bStartsRefArea = bStarts;
  +        bStartsReferenceArea = bStarts;
       }
   
       /**
  @@ -82,6 +82,8 @@
       public Object clone() {
           try {
               SpaceSpecifier ss = (SpaceSpecifier) super.clone();
  +            ss.bStartsReferenceArea = this.bStartsReferenceArea;
  +            ss.bHasForcing = this.bHasForcing;            
               // Clone the vector, but share the objects in it!
               ss.vecSpaceVals = new ArrayList();
               ss.vecSpaceVals.addAll(this.vecSpaceVals);
  @@ -115,7 +117,7 @@
        * add it to the sequence.
        */
       public void addSpace(SpaceVal moreSpace) {
  -        if (!bStartsRefArea
  +        if (!bStartsReferenceArea
                   || !moreSpace.isConditional()
                   || !vecSpaceVals.isEmpty()) {
               if (moreSpace.isForcing()) {
  @@ -181,5 +183,11 @@
   
           }
           return resSpace;
  +    }
  +    
  +    public String toString() {
  +        return "Space Specifier (resolved at begin/end of ref. area:):\n" +
  +            resolve(false).toString() + "\n" +
  +            resolve(true).toString();
       }
   }
  
  
  

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

Reply via email to