cvs commit: xml-fop/src/org/apache/fop/layout BlockArea.java

2003-03-02 Thread pietsch
pietsch 2003/03/02 05:47:44

  Modified:src/org/apache/fop/fo/flow Tag: fop-0_20_2-maintain
Block.java
   src/org/apache/fop/layout Tag: fop-0_20_2-maintain
BlockArea.java
  Log:
  Set currentLine to null after adding it in BlockArea.
  Some cosmetical rearrangements.
  PR: 17472 and several postings
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.41.2.16 +16 -41xml-fop/src/org/apache/fop/fo/flow/Block.java
  
  Index: Block.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Block.java,v
  retrieving revision 1.41.2.15
  retrieving revision 1.41.2.16
  diff -u -r1.41.2.15 -r1.41.2.16
  --- Block.java25 Feb 2003 12:57:00 -  1.41.2.15
  +++ Block.java2 Mar 2003 13:47:44 -   1.41.2.16
  @@ -185,8 +185,9 @@
   area.end();
   }
   
  -if (area.getIDReferences() != null)
  +if (area.getIDReferences() != null) {
   area.getIDReferences().createID(id);
  +}
   
   this.marker = 0;
   
  @@ -221,9 +222,6 @@
   this.areasGenerated++;
   if (this.areasGenerated == 1)
   blockArea.isFirst(true);
  -// for normal areas this should be the only pair
  -//blockArea.addLineagePair(this, this.areasGenerated);
  -
   // markers
   // if (this.hasMarkers())
   // blockArea.addMarkers(this.getMarkers());
  @@ -243,37 +241,25 @@
   int numChildren = this.children.size();
   for (int i = this.marker; i  numChildren; i++) {
   FONode fo = (FONode)children.get(i);
  -int status;
  -if (Status.isIncomplete(status = fo.layout(blockArea))) {
  +int status = fo.layout(blockArea);
  +if (Status.isIncomplete(status)) {
   this.marker = i;
  -// this block was modified by
  -// Hani Elabed 11/27/2000
  -// if ((i != 0)  (status.getCode() == Status.AREA_FULL_NONE))
  -// {
  -// status = new Status(Status.AREA_FULL_SOME);
  -// }
  -
  -// new block to replace the one above
  -// Hani Elabed 11/27/2000
   if (status == Status.AREA_FULL_NONE) {
  -// something has already been laid out
  -if ((i != 0)) {
  -status = Status.AREA_FULL_SOME;
  +if (i == 0) {
  +// Nothing was laid out.
  +anythingLaidOut = false;
  +return status;
  +} else {
  +// A previous child has already been laid out.
   area.addChild(blockArea);
   area.setMaxHeight(area.getMaxHeight() - spaceLeft
 + blockArea.getMaxHeight());
   area.increaseHeight(blockArea.getHeight());
   anythingLaidOut = true;
  -
  -return status;
  -} else// i == 0 nothing was laid out..
  -{
  -anythingLaidOut = false;
  -return status;
  +return Status.AREA_FULL_SOME;
   }
   }
  -
  -// blockArea.end();
  +// Something has been laid out.
   area.addChild(blockArea);
   area.setMaxHeight(area.getMaxHeight() - spaceLeft
 + blockArea.getMaxHeight());
  @@ -285,13 +271,10 @@
   }
   
   blockArea.end();
  -
  +blockArea.isLast(true);
  +area.addChild(blockArea);
   area.setMaxHeight(area.getMaxHeight() - spaceLeft
 + blockArea.getMaxHeight());
  -
  -area.addChild(blockArea);
  -
  -/* should this be combined into above? */
   area.increaseHeight(blockArea.getHeight());
   
   if (spaceAfter != 0) {
  @@ -301,8 +284,6 @@
   if (area instanceof BlockArea) {
   area.start();
   }
  -// This is not needed any more and it consumes a LOT
  -// of memory. So we release it for the GC.
   areaHeight= blockArea.getHeight();
   contentWidth= blockArea.getContentWidth();
   
  @@ -311,18 +292,12 @@
   int breakAfterStatus = propMgr.checkBreakAfter(area);
   if (breakAfterStatus != Status.OK) {
   this.marker = BREAK_AFTER;
  -blockArea = null; //Faster GC - BlockArea is big
  +blockArea = null;
   return breakAfterStatus;
   }
  -
   

cvs commit: xml-fop/src/org/apache/fop/layout BlockArea.java LineArea.java

2003-02-02 Thread pietsch
pietsch 2003/02/02 13:17:41

  Modified:src/org/apache/fop/fo Tag: fop-0_20_2-maintain FOText.java
   src/org/apache/fop/fo/flow Tag: fop-0_20_2-maintain
Leader.java
   src/org/apache/fop/layout Tag: fop-0_20_2-maintain
BlockArea.java LineArea.java
  Log:
  Fixed leader generation to be more conformant with common expectations.
  Everything assuming leaders automatically expand as much as possible
  is broken now, leaders expand ONLY due to text justification.
  Expanding multiple leaders on a line is simplistic.
  Fixed leader-alignment=reference to some extend. Leaders may be
  still misaligned if text justification causes spaces to expand, i.e.
  slack space was not taken completely by leaders.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.24.2.6  +1 -2  xml-fop/src/org/apache/fop/fo/FOText.java
  
  Index: FOText.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FOText.java,v
  retrieving revision 1.24.2.5
  retrieving revision 1.24.2.6
  diff -u -r1.24.2.5 -r1.24.2.6
  --- FOText.java   22 Nov 2002 15:10:44 -  1.24.2.5
  +++ FOText.java   2 Feb 2003 21:17:40 -   1.24.2.6
  @@ -230,7 +230,6 @@
   ba.setupLinkSet(ls);
   
   start = la.addText(data, start, end, ls, textState);
  -// this.hasLines = true;
   
   while ( start != -1) {
   la = ba.createNextLineArea();
  
  
  
  No   revision
  
  
  No   revision
  
  
  1.13.2.5  +23 -12xml-fop/src/org/apache/fop/fo/flow/Leader.java
  
  Index: Leader.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Leader.java,v
  retrieving revision 1.13.2.4
  retrieving revision 1.13.2.5
  diff -u -r1.13.2.4 -r1.13.2.5
  --- Leader.java   22 Nov 2002 15:10:46 -  1.13.2.4
  +++ Leader.java   2 Feb 2003 21:17:41 -   1.13.2.5
  @@ -108,17 +108,29 @@
   // determines the pattern of leader; allowed values: space, rule,dots, 
use-content
   int leaderPattern = this.properties.get(leader-pattern).getEnum();
   // length of the leader
  -int leaderLengthOptimum =
  -this.properties.get(leader-length.optimum).getLength().mvalue();
  -int leaderLengthMinimum =
  -this.properties.get(leader-length.minimum).getLength().mvalue();
  -Length maxlength = this.properties.get(leader-length.maximum).getLength();
  +Length length = this.properties.get(leader-length.minimum).getLength();
  +int leaderLengthMinimum;
  +if (length instanceof PercentLength) {
  +leaderLengthMinimum = (int)(((PercentLength)length).value()
  +* area.getAllocationWidth());
  +} else {
  +leaderLengthMinimum = length.mvalue();
  +}
  +length = this.properties.get(leader-length.optimum).getLength();
  +int leaderLengthOptimum;
  +if (length instanceof PercentLength) {
  +leaderLengthOptimum = (int)(((PercentLength)length).value()
  +  * area.getAllocationWidth());
  +} else {
  +leaderLengthOptimum = length.mvalue();
  +}
  +length = this.properties.get(leader-length.maximum).getLength();
   int leaderLengthMaximum;
  -if(maxlength instanceof PercentLength) {
  -leaderLengthMaximum = (int)(((PercentLength)maxlength).value()
  +if (length instanceof PercentLength) {
  +leaderLengthMaximum = (int)(((PercentLength)length).value()
 * area.getAllocationWidth());
   } else {
  -leaderLengthMaximum = maxlength.mvalue();
  +leaderLengthMaximum = length.mvalue();
   }
   // the following properties only apply for leader-pattern = rule
   int ruleThickness =
  @@ -177,7 +189,7 @@
   // in the xsl:fo spec: User agents may choose to use the value of 
'leader-length.optimum'
   // to determine where to break the line (7.20.4)
   // if leader is longer then create a new LineArea and put leader there
  -if (leaderLengthOptimum = (la.getRemainingWidth())) {
  +if (leaderLengthOptimum = la.getRemainingWidth()) {
   la.addLeader(leaderPattern, leaderLengthMinimum,
leaderLengthOptimum, leaderLengthMaximum, ruleStyle,
ruleThickness, leaderPatternWidth, leaderAlignment);
  @@ -200,12 +212,11 @@
   } else {
   log.error(Leader doesn't fit into line, it will be clipped to 
fit.);
   la.addLeader(leaderPattern, la.getRemainingWidth(),
  

cvs commit: xml-fop/src/org/apache/fop/layout BlockArea.java

2001-10-14 Thread klease

klease  01/10/14 13:44:37

  Modified:src/org/apache/fop/layout BlockArea.java
  Log:
  Account for padding and border when calculating space remaining for content
  
  Revision  ChangesPath
  1.31  +12 -2 xml-fop/src/org/apache/fop/layout/BlockArea.java
  
  Index: BlockArea.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/layout/BlockArea.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- BlockArea.java2001/07/30 20:29:27 1.30
  +++ BlockArea.java2001/10/14 20:44:37 1.31
  @@ -1,5 +1,5 @@
   /*
  - * $Id: BlockArea.java,v 1.30 2001/07/30 20:29:27 tore Exp $
  + * $Id: BlockArea.java,v 1.31 2001/10/14 20:44:37 klease 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.
  @@ -201,8 +201,18 @@
- endIndent;
   }
   
  +/**
  + * Return the maximum space remaining for this area's content in
  + * the block-progression-dimension.
  + * Remove top and bottom padding and spacing since these reduce
  + * available space for content and they are not yet accounted for
  + * in the positioning of the object.
  + */
   public int spaceLeft() {
  -return maxHeight - currentHeight;
  +// return maxHeight - currentHeight ;
  +return maxHeight - currentHeight -
  + (getPaddingTop() + getPaddingBottom()
  +  + getBorderTopWidth() + getBorderBottomWidth());
   }
   
   public int getHalfLeading() {
  
  
  

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




cvs commit: xml-fop/src/org/apache/fop/layout BlockArea.java

2001-07-04 Thread klease

klease  01/07/04 14:10:47

  Modified:src/org/apache/fop/layout BlockArea.java
  Log:
  Fix a bug which caused FOP to overestimate the space available for the first line of 
a Block
  
  Revision  ChangesPath
  1.29  +2 -2  xml-fop/src/org/apache/fop/layout/BlockArea.java
  
  Index: BlockArea.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/layout/BlockArea.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- BlockArea.java2001/06/12 11:37:37 1.28
  +++ BlockArea.java2001/07/04 21:10:47 1.29
  @@ -1,4 +1,4 @@
  -/* $Id: BlockArea.java,v 1.28 2001/06/12 11:37:37 keiron Exp $
  +/* $Id: BlockArea.java,v 1.29 2001/07/04 21:10:47 klease 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.
  @@ -122,7 +122,7 @@
* @return the line area to be used to add inlie objects
*/
   public LineArea getCurrentLineArea() {
  -if (currentHeight + this.currentLineArea.getHeight()  maxHeight) {
  + if (currentHeight + lineHeight  maxHeight) {
   return null;
   }
   this.currentLineArea.changeHyphenation(hyphProps);
  
  
  

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