Re: cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr BlockLayoutManager.java

2005-01-17 Thread Glen Mazza
Yes, I think that's my fault. I believe that was
related to the space-before and space-after properties
which I was trying (unsuccessfully) to fix.  This is a
very complex portion of the code.

Glen

--- [EMAIL PROTECTED] wrote:

 jeremias2005/01/17 10:59:50
 
   Modified:src/java/org/apache/fop/layoutmgr
 BlockLayoutManager.java
   Log:
   Adding todo item for a static variable.
   
   Revision  ChangesPath
   1.37  +1 -4 

xml-fop/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java
   
   Index: BlockLayoutManager.java
  

===
   RCS file:

/home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java,v
   retrieving revision 1.36
   retrieving revision 1.37
   diff -u -r1.36 -r1.37
   --- BlockLayoutManager.java 12 Jan 2005 12:03:00
 - 1.36
   +++ BlockLayoutManager.java 17 Jan 2005 18:59:50
 - 1.37
   @@ -22,13 +22,9 @@
import java.util.List;

import org.apache.fop.datatypes.PercentBase;
   -import org.apache.fop.fo.FONode;
   -import org.apache.fop.fo.FObj;
   -import
 org.apache.fop.fo.properties.CommonMarginBlock;
import org.apache.fop.fonts.Font;
import org.apache.fop.area.Area;
import org.apache.fop.area.Block;
   -import org.apache.fop.area.BlockParent;
import org.apache.fop.area.LineArea;
import org.apache.fop.traits.SpaceVal;
import org.apache.fop.traits.MinOptMax;
   @@ -54,6 +50,7 @@
*/
private MinOptMax foBlockSpaceBefore = null;
// need to retain foBlockSpaceAfter from
 previous instantiation
   +//TODO this is very bad for multi-threading.
 fix me!
private static MinOptMax foBlockSpaceAfter =
 null;
private MinOptMax prevFoBlockSpaceAfter =
 null;

   
   
   
 

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



Re: cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr BlockLayoutManager.java

2005-01-17 Thread Jeremias Maerki
No problem. I stumbled upon it when I realized that I wasn't handling
space-before|after correctly in in-flow block-containers. I'll see if I
can do something about it.

On 17.01.2005 20:17:35 Glen Mazza wrote:
 Yes, I think that's my fault. I believe that was
 related to the space-before and space-after properties
 which I was trying (unsuccessfully) to fix.  This is a
 very complex portion of the code.


Jeremias Maerki



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

2003-12-30 Thread gmazza
gmazza  2003/12/30 15:11:00

  Modified:src/java/org/apache/fop/layoutmgr BlockLayoutManager.java
  Log:
  Bug #25813 (Patch by Finn Bock):  Calculation change in setBlockTextInfo().
  
  Revision  ChangesPath
  1.11  +1 -1  
xml-fop/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java
  
  Index: BlockLayoutManager.java
  ===
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- BlockLayoutManager.java   24 Nov 2003 19:07:35 -  1.10
  +++ BlockLayoutManager.java   30 Dec 2003 23:11:00 -  1.11
  @@ -170,7 +170,7 @@
   
   public void setBlockTextInfo(TextInfo ti) {
   lead = ti.fs.getAscender();
  -follow = ti.fs.getDescender();
  +follow = -ti.fs.getDescender();
   lineHeight = ti.lineHeight;
   }
   
  
  
  

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



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

2003-11-11 Thread gmazza
gmazza  2003/11/11 05:50:00

  Modified:src/java/org/apache/fop/layoutmgr BlockLayoutManager.java
  Log:
  Partial implementation of space-after functionality--mostly working, but
  some remaining problems:
  
  1.) relying on a static variable to carry space-after value from previous
  block to current.  (BlockLayoutManager is be instantiated for each block
  instead of being in memory for all blocks--bad design?)
  
  2.) The space-after of a block ending at the bottom of the page is not
  currently being added to the beginning of the subsequent page.
  
  Revision  ChangesPath
  1.9   +12 -3 
xml-fop/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java
  
  Index: BlockLayoutManager.java
  ===
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- BlockLayoutManager.java   11 Nov 2003 04:40:12 -  1.8
  +++ BlockLayoutManager.java   11 Nov 2003 13:50:00 -  1.9
  @@ -85,7 +85,9 @@
  used in rendering the fo:block.
   */
   private MinOptMax foBlockSpaceBefore = null;
  -private MinOptMax foBlockSpaceAfter = null;  // not currently implemented
  +// need to retain foBlockSpaceAfter from previous instantiation
  +private static MinOptMax foBlockSpaceAfter = null;
  +private MinOptMax prevFoBlockSpaceAfter = null;
   
   private int lead = 12000;
   private int lineHeight = 14000;
  @@ -181,6 +183,7 @@
   borderProps = pm.getBorderAndPadding();
   backgroundProps = pm.getBackgroundProps();
   foBlockSpaceBefore = layoutProps.spaceBefore.getSpace();
  +prevFoBlockSpaceAfter = foBlockSpaceAfter;
   }
   
   public BreakPoss getNextBreakPoss(LayoutContext context) {
  @@ -190,9 +193,14 @@
   
   MinOptMax stackSize = new MinOptMax();
   
  +if (prevFoBlockSpaceAfter != null) {
  +stackSize.add(prevFoBlockSpaceAfter);
  +prevFoBlockSpaceAfter = null;
  +}
  +
   if (foBlockSpaceBefore != null) {
   // this function called before addAreas(), so
  -// setting foBlockSpaceBefore = null *in* addAreas()
  +// resetting foBlockSpaceBefore = null in addAreas()
   stackSize.add(foBlockSpaceBefore);
   }
   
  @@ -308,7 +316,8 @@
   flush();
   
   // if adjusted space after
  -addBlockSpacing(adjust, layoutProps.spaceAfter.getSpace());
  +foBlockSpaceAfter = layoutProps.spaceAfter.getSpace();
  +addBlockSpacing(adjust, foBlockSpaceAfter);
   
   curBlockArea = null;
   }
  
  
  

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



Re: cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr BlockLayoutManager.java

2003-11-11 Thread J.Pietschmann
[EMAIL PROTECTED] wrote:
  2.) The space-after of a block ending at the bottom of the page is not
  currently being added to the beginning of the subsequent page.
It shouldn't unless it is explicitely forced.

J.Pietschmann




Re: cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr BlockLayoutManager.java

2003-11-11 Thread Glen Mazza
I don't think I wrote that clearly--our current
implementation in BLM: 

(1) in addAreas(), adds empty blocks to represent
space-before  space-after in one method, and 

(2) in getNextBreakPoss(), reduces the stackSize
(BPD or vertical allowable writing area) to
compensate for (1) above when generating subsequent
text in another method.  

(2) sometimes happens without (1), resulting in the
stackSize being reduced (i.e., fewer lines of text on
the page) and an empty space occurring at the bottom. 
The implementation needs improvement, such that (1)
and (2) either both occur or neither occur, depending
on the force parameter you mention below.

Also, just to make sure I understand clearly--when you
say force I think you're referring to
conditionality (retain/discard), not precedence
(the latter of which does have a force value, but I
don't think that what's intended here.)

Here's the space-before  space-after definitions:
http://www.w3.org/TR/2001/REC-xsl-20011015/slice7.html#space-before

The (vague?) definitions of conditionality and
precedence are here:
http://www.w3.org/TR/2001/REC-xsl-20011015/slice4.html#spacecond

Thanks,
Glen

--- J.Pietschmann [EMAIL PROTECTED] wrote:
 [EMAIL PROTECTED] wrote:
2.) The space-after of a block ending at the
 bottom of the page is not
currently being added to the beginning of the
 subsequent page.
 
 It shouldn't unless it is explicitely forced.
 
 J.Pietschmann
 
 


__
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree


Re: cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr BlockLayoutManager.java

2003-11-11 Thread J.Pietschmann
Glen Mazza wrote:
Also, just to make sure I understand clearly--when you
say force I think you're referring to
conditionality (retain/discard),
Yes.
IIRC, by default, space-after is discarded if it would
be placed at the end of a reference area (something not
properly done in 0.20.5).
Thanks for the clarification and for getting things moved
in general.
J.Pietschmann




cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr BlockLayoutManager.java BlockStackingLayoutManager.java

2003-11-10 Thread gmazza
gmazza  2003/11/10 20:40:12

  Modified:src/java/org/apache/fop/layoutmgr BlockLayoutManager.java
BlockStackingLayoutManager.java
  Log:
  fo:block space-before property now activated only on the first Area.Block object used
  in rendering the fo:block.  (Previous implementation repeated space-before at the
  top of every page.)  Suggestion from Chris Bowditch.
  
  (Space-after property still needs work:  renders at the correct places but
  results in subsequent text overrunning region borders.)
  
  Revision  ChangesPath
  1.8   +21 -4 
xml-fop/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java
  
  Index: BlockLayoutManager.java
  ===
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- BlockLayoutManager.java   12 Sep 2003 18:57:34 -  1.7
  +++ BlockLayoutManager.java   11 Nov 2003 04:40:12 -  1.8
  @@ -76,6 +76,17 @@
   private CommonBorderAndPadding borderProps;
   private CommonBackground backgroundProps;
   
  +/* holds the (one-time use) fo:block space-before
  +   and -after properties.  Large fo:blocks are split 
  +   into multiple Area.Blocks to accomodate the subsequent
  +   regions (pages) they are placed on.  space-before 
  +   is applied at the beginning of the first
  +   Block and space-after at the end of the last Block
  +   used in rendering the fo:block.
  +*/
  +private MinOptMax foBlockSpaceBefore = null;
  +private MinOptMax foBlockSpaceAfter = null;  // not currently implemented
  +
   private int lead = 12000;
   private int lineHeight = 14000;
   private int follow = 2000;
  @@ -169,6 +180,7 @@
   layoutProps = pm.getLayoutProps();
   borderProps = pm.getBorderAndPadding();
   backgroundProps = pm.getBackgroundProps();
  +foBlockSpaceBefore = layoutProps.spaceBefore.getSpace();
   }
   
   public BreakPoss getNextBreakPoss(LayoutContext context) {
  @@ -177,9 +189,13 @@
   int ipd = context.getRefIPD();
   
   MinOptMax stackSize = new MinOptMax();
  -// if starting add space before
  -stackSize.add(layoutProps.spaceBefore.getSpace());
   
  +if (foBlockSpaceBefore != null) {
  +// this function called before addAreas(), so
  +// setting foBlockSpaceBefore = null *in* addAreas()
  +stackSize.add(foBlockSpaceBefore);
  +}
  +
   BreakPoss lastPos = null;
   
   while ((curLM = getChildLM()) != null) {
  @@ -261,8 +277,9 @@
   
   // if adjusted space before
   double adjust = layoutContext.getSpaceAdjust();
  -addBlockSpacing(adjust, layoutProps.spaceBefore.getSpace());
  -
  +addBlockSpacing(adjust, foBlockSpaceBefore);
  +foBlockSpaceBefore = null;
  +
   addID();
   addMarkers(true, true);
   
  
  
  
  1.4   +3 -0  
xml-fop/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
  
  Index: BlockStackingLayoutManager.java
  ===
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- BlockStackingLayoutManager.java   8 Sep 2003 17:00:54 -   1.3
  +++ BlockStackingLayoutManager.java   11 Nov 2003 04:40:12 -  1.4
  @@ -106,6 +106,9 @@
* @param minoptmax the min/opt/max value of the spacing
*/
   public void addBlockSpacing(double adjust, MinOptMax minoptmax) {
  +if (minoptmax == null) {
  +return;
  +}
   int sp = minoptmax.opt;
   if (adjust  0) {
   sp = sp + (int)(adjust * (minoptmax.max - minoptmax.opt));
  
  
  

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