xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerem...@apache.org
Subject svn commit: r231042 - in /xmlgraphics/fop/branches/inlineblock/src/java/org/apache/fop/layoutmgr: AbstractBreaker.java LayoutContext.java inline/LineLayoutManager.java
Date Tue, 09 Aug 2005 14:35:37 GMT
Author: jeremias
Date: Tue Aug  9 07:35:30 2005
New Revision: 231042

URL: http://svn.apache.org/viewcvs?rev=231042&view=rev
Log:
Bugfix: Introduced a new member variable in LayoutContext holding the alignment in BP direction.
Now that we have mixed inline/block capabilities the alignment must always be properly set
depending on the direction we fetch the element lists for. Holding the BP alignment in the
LayoutContext makes sure this information doesn't get lost when directions are mixed.

Modified:
    xmlgraphics/fop/branches/inlineblock/src/java/org/apache/fop/layoutmgr/AbstractBreaker.java
    xmlgraphics/fop/branches/inlineblock/src/java/org/apache/fop/layoutmgr/LayoutContext.java
    xmlgraphics/fop/branches/inlineblock/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java

Modified: xmlgraphics/fop/branches/inlineblock/src/java/org/apache/fop/layoutmgr/AbstractBreaker.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/branches/inlineblock/src/java/org/apache/fop/layoutmgr/AbstractBreaker.java?rev=231042&r1=231041&r2=231042&view=diff
==============================================================================
--- xmlgraphics/fop/branches/inlineblock/src/java/org/apache/fop/layoutmgr/AbstractBreaker.java
(original)
+++ xmlgraphics/fop/branches/inlineblock/src/java/org/apache/fop/layoutmgr/AbstractBreaker.java
Tue Aug  9 07:35:30 2005
@@ -187,6 +187,7 @@
             alignment = Constants.EN_START;
         }
         alignmentLast = Constants.EN_START;
+        childLC.setBPAlignment(alignment);
 
         BlockSequence blockList;
         blockLists = new java.util.ArrayList();

Modified: xmlgraphics/fop/branches/inlineblock/src/java/org/apache/fop/layoutmgr/LayoutContext.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/branches/inlineblock/src/java/org/apache/fop/layoutmgr/LayoutContext.java?rev=231042&r1=231041&r2=231042&view=diff
==============================================================================
--- xmlgraphics/fop/branches/inlineblock/src/java/org/apache/fop/layoutmgr/LayoutContext.java
(original)
+++ xmlgraphics/fop/branches/inlineblock/src/java/org/apache/fop/layoutmgr/LayoutContext.java
Tue Aug  9 07:35:30 2005
@@ -91,6 +91,9 @@
     /** Current hyphenation context. May be null. */
     private HyphContext hyphContext = null;
 
+    /** Alignment in BP direction */
+    private int bpAlignment = Constants.EN_START;
+    
     /** Stretch or shrink value when making areas. */
     private double ipdAdjust = 0.0;
 
@@ -112,6 +115,7 @@
         this.leadingSpace = parentLC.leadingSpace; //???
         this.trailingSpace = parentLC.trailingSpace; //???
         this.hyphContext = parentLC.hyphContext;
+        this.bpAlignment = parentLC.bpAlignment;
         this.dSpaceAdjust = parentLC.dSpaceAdjust;
         this.ipdAdjust = parentLC.ipdAdjust;
         this.iLineHeight = parentLC.iLineHeight;
@@ -224,6 +228,19 @@
         return ((this.flags & TRY_HYPHENATE) != 0);
     }
 
+    /**
+     * Sets the currently applicable alignment in BP direction.
+     * @param alignment one of EN_START, EN_JUSTIFY etc.
+     */
+    public void setBPAlignment(int alignment) {
+        this.bpAlignment = alignment;
+    }
+    
+    /** @return the currently applicable alignment in BP direction (EN_START, EN_JUSTIFY...)
*/
+    public int getBPAlignment() {
+        return this.bpAlignment;
+    }
+    
     public void setSpaceAdjust(double adjust) {
         dSpaceAdjust = adjust;
     }

Modified: xmlgraphics/fop/branches/inlineblock/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/branches/inlineblock/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java?rev=231042&r1=231041&r2=231042&view=diff
==============================================================================
--- xmlgraphics/fop/branches/inlineblock/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java
(original)
+++ xmlgraphics/fop/branches/inlineblock/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java
Tue Aug  9 07:35:30 2005
@@ -546,6 +546,7 @@
         initialize(); // Normally done when started by parent!
     }
 
+    /** @see org.apache.fop.layoutmgr.LayoutManager */
     public LinkedList getNextKnuthElements(LayoutContext context, int alignment) {
         // Get a break from currently active child LM
         // Set up constraints for inline level managers
@@ -582,7 +583,7 @@
         }
 
         //PHASE 2: Create line breaks
-        return createLineBreaks(alignment);
+        return createLineBreaks(context.getBPAlignment());
         /*
         LineBreakPosition lbp = null;
         if (breakpoints == null) {
@@ -903,7 +904,7 @@
     
     /**
      * Phase 2 of Knuth algorithm: find optimal break points.
-     * @param alignment alignment of the paragraph
+     * @param alignment alignment in BP direction of the paragraph
      * @return a list of Knuth elements representing broken lines
      */
     private LinkedList createLineBreaks(int alignment) {
@@ -1057,6 +1058,11 @@
         return lineLayouts;
     }
 
+    /**
+     * Creates the element list in BP direction for the broken lines.
+     * @param alignment the currently applicable vertical alignment
+     * @return the newly built element list
+     */
     private LinkedList postProcessLineBreaks(int alignment) {
     
         LinkedList returnList = new LinkedList();



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


Mime
View raw message