diff options
author | Finn Bock <bckfnn@apache.org> | 2004-09-22 08:18:42 +0000 |
---|---|---|
committer | Finn Bock <bckfnn@apache.org> | 2004-09-22 08:18:42 +0000 |
commit | 0d5f2c76c44d7d79330588a57ee413b68980b4ec (patch) | |
tree | 9279b3fc792d699b627f5bc67748b6e2ee9c76ce /src/java | |
parent | 34ffd8adb7e91f485e3520079ae74e1dd1f7a532 (diff) | |
download | xmlgraphics-fop-0d5f2c76c44d7d79330588a57ee413b68980b4ec.tar.gz xmlgraphics-fop-0d5f2c76c44d7d79330588a57ee413b68980b4ec.zip |
Use content ipd/bpd instead of allocation width/height.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197956 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java')
-rw-r--r-- | src/java/org/apache/fop/area/BeforeFloat.java | 6 | ||||
-rw-r--r-- | src/java/org/apache/fop/area/Block.java | 4 | ||||
-rw-r--r-- | src/java/org/apache/fop/area/BlockParent.java | 47 | ||||
-rw-r--r-- | src/java/org/apache/fop/area/BodyRegion.java | 3 | ||||
-rw-r--r-- | src/java/org/apache/fop/area/Flow.java | 2 | ||||
-rw-r--r-- | src/java/org/apache/fop/area/LineArea.java | 20 | ||||
-rw-r--r-- | src/java/org/apache/fop/area/inline/FilledArea.java | 2 | ||||
-rw-r--r-- | src/java/org/apache/fop/area/inline/InlineArea.java | 92 |
8 files changed, 7 insertions, 169 deletions
diff --git a/src/java/org/apache/fop/area/BeforeFloat.java b/src/java/org/apache/fop/area/BeforeFloat.java index 4279761e0..d30b287e0 100644 --- a/src/java/org/apache/fop/area/BeforeFloat.java +++ b/src/java/org/apache/fop/area/BeforeFloat.java @@ -53,10 +53,10 @@ public class BeforeFloat extends BlockParent { * * @return the height of the before float including separator */ - public int getHeight() { - int h = super.getHeight(); + public int getBPD() { + int h = super.getBPD(); if (separator != null) { - h += separator.getHeight(); + h += separator.getBPD(); } return h; } diff --git a/src/java/org/apache/fop/area/Block.java b/src/java/org/apache/fop/area/Block.java index 9dc3d300b..b4f770a99 100644 --- a/src/java/org/apache/fop/area/Block.java +++ b/src/java/org/apache/fop/area/Block.java @@ -75,7 +75,7 @@ public class Block extends BlockParent { children = new ArrayList(); } if (autoHeight) { - height += block.getHeight(); + bpd += block.getAllocBPD(); } children.add(block); } @@ -89,7 +89,7 @@ public class Block extends BlockParent { if (children == null) { children = new ArrayList(); } - height += line.getHeight(); + bpd += line.getBPD(); children.add(line); } diff --git a/src/java/org/apache/fop/area/BlockParent.java b/src/java/org/apache/fop/area/BlockParent.java index 052ac0502..e9d6f8897 100644 --- a/src/java/org/apache/fop/area/BlockParent.java +++ b/src/java/org/apache/fop/area/BlockParent.java @@ -43,16 +43,6 @@ public class BlockParent extends Area { protected int yOffset = 0; /** - * The width of this block parent. - */ - protected int width = 0; - - /** - * The height of this block parent. - */ - protected int height = 0; - - /** * The children of this block parent area. */ protected List children = null; @@ -100,24 +90,6 @@ public class BlockParent extends Area { } /** - * Set the width of this block parent area. - * - * @param w the width of the area - */ - public void setWidth(int w) { - width = w; - } - - /** - * Set the height of this block parent area. - * - * @param h the height of the block parent area - */ - public void setHeight(int h) { - height = h; - } - - /** * Get the X offset of this block parent area. * * @return the x offset of the block parent area @@ -134,23 +106,4 @@ public class BlockParent extends Area { public int getYOffset() { return yOffset; } - - /** - * Get the width of this block parent area. - * - * @return the width of the area - */ - public int getWidth() { - return width; - } - - /** - * Get the height of this block parent area. - * - * @return the height of the block parent area - */ - public int getHeight() { - return height; - } - } diff --git a/src/java/org/apache/fop/area/BodyRegion.java b/src/java/org/apache/fop/area/BodyRegion.java index 61484e2ce..97a07bc76 100644 --- a/src/java/org/apache/fop/area/BodyRegion.java +++ b/src/java/org/apache/fop/area/BodyRegion.java @@ -32,9 +32,6 @@ public class BodyRegion extends RegionReference { private int columnGap; private int columnCount; - /** Reference inline progression dimension for the body. */ - private int refIPD; - /** * Create a new body region area. * This sets the region reference area class to BODY. diff --git a/src/java/org/apache/fop/area/Flow.java b/src/java/org/apache/fop/area/Flow.java index 8e9b76e2c..dbaaa2119 100644 --- a/src/java/org/apache/fop/area/Flow.java +++ b/src/java/org/apache/fop/area/Flow.java @@ -25,7 +25,5 @@ package org.apache.fop.area; public class Flow extends BlockParent { // the list of blocks created from the flow private int stacking = TB; - private int width; - } diff --git a/src/java/org/apache/fop/area/LineArea.java b/src/java/org/apache/fop/area/LineArea.java index fa1d586db..2a0896821 100644 --- a/src/java/org/apache/fop/area/LineArea.java +++ b/src/java/org/apache/fop/area/LineArea.java @@ -32,9 +32,7 @@ public class LineArea extends Area { // contains inline areas // has start indent and length, dominant baseline, height private int startIndent; - private int length; - private int lineHeight; // this is the offset for the dominant baseline private int baseLine; @@ -44,24 +42,6 @@ public class LineArea extends Area { private List inlineAreas = new ArrayList(); /** - * Set the height of this line area. - * - * @param height the height of the line area - */ - public void setHeight(int height) { - lineHeight = height; - } - - /** - * Get the height of this line area. - * - * @return the height of the line area - */ - public int getHeight() { - return lineHeight; - } - - /** * Add a child area to this line area. * * @param childArea the inline child area to add diff --git a/src/java/org/apache/fop/area/inline/FilledArea.java b/src/java/org/apache/fop/area/inline/FilledArea.java index ffca54bca..afbcbe73f 100644 --- a/src/java/org/apache/fop/area/inline/FilledArea.java +++ b/src/java/org/apache/fop/area/inline/FilledArea.java @@ -57,7 +57,7 @@ public class FilledArea extends InlineParent { * @return the list of child areas copied to fill the width */ public List getChildAreas() { - int units = (int)(getWidth() / unitWidth); + int units = (int)(getIPD() / unitWidth); List newList = new ArrayList(); for (int count = 0; count < units; count++) { newList.addAll(inlines); diff --git a/src/java/org/apache/fop/area/inline/InlineArea.java b/src/java/org/apache/fop/area/inline/InlineArea.java index b4a0f6e94..2bf60edf3 100644 --- a/src/java/org/apache/fop/area/inline/InlineArea.java +++ b/src/java/org/apache/fop/area/inline/InlineArea.java @@ -19,8 +19,6 @@ package org.apache.fop.area.inline; import org.apache.fop.area.Area; -import org.apache.fop.area.Trait; -import org.apache.fop.traits.BorderProps; /** * Inline Area @@ -28,55 +26,11 @@ import org.apache.fop.traits.BorderProps; * in a line area. */ public class InlineArea extends Area { - // int width; - private int height; - /** - * The content ipd of this inline area - */ - protected int contentIPD = 0; - /** * offset position from top of parent area */ protected int verticalPosition = 0; - /** - * Set the width of this inline area. - * Currently sets the ipd. - * - * @param w the width - */ - public void setWidth(int w) { - contentIPD = w; - } - - /** - * Get the width of this inline area. - * Currently gets the ipd. - * - * @return the width - */ - public int getWidth() { - return contentIPD; - } - - /** - * Set the inline progression dimension of this inline area. - * - * @param ipd the inline progression dimension - */ - public void setIPD(int ipd) { - this.contentIPD = ipd; - } - - /** - * Get the inline progression dimension - * - * @return the inline progression dimension of this area - */ - public int getIPD() { - return this.contentIPD; - } /** * Increase the inline progression dimensions of this area. @@ -85,51 +39,7 @@ public class InlineArea extends Area { * @param ipd the inline progression to increase by */ public void increaseIPD(int ipd) { - this.contentIPD += ipd; - } - - /** - * Set the height of this inline area. - * - * @param h the height value to set - */ - public void setHeight(int h) { - height = h; - } - - /** - * Get the height of this inline area. - * - * @return the height of the inline area - */ - public int getHeight() { - return height; - } - - /** - * Get the allocation inline progression dimension of this area. - * This adds the content, borders and the padding to find the - * total allocated IPD. - * - * @return the total IPD allocation for this area - */ - public int getAllocIPD() { - // If start or end border or padding is non-zero, add to content IPD - int iBP = contentIPD; - Object t; - if ((t = getTrait(Trait.PADDING_START)) != null) { - iBP += ((Integer) t).intValue(); - } - if ((t = getTrait(Trait.PADDING_END)) != null) { - iBP += ((Integer) t).intValue(); - } - if ((t = getTrait(Trait.BORDER_START)) != null) { - iBP += ((BorderProps) t).width; - } - if ((t = getTrait(Trait.BORDER_END)) != null) { - iBP += ((BorderProps) t).width; - } - return iBP; + this.ipd += ipd; } /** |