aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/area/BodyRegion.java
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2005-06-29 12:41:31 +0000
committerJeremias Maerki <jeremias@apache.org>2005-06-29 12:41:31 +0000
commit83f9038f807b87dbb77e6b119a1026f9cd0b278f (patch)
tree2923cbe40e9df05c81a57009ebed2e76c05427ea /src/java/org/apache/fop/area/BodyRegion.java
parent8ec1a0e041948fe0fc4686a19b84ceee6f7fb9a1 (diff)
downloadxmlgraphics-fop-83f9038f807b87dbb77e6b119a1026f9cd0b278f.tar.gz
xmlgraphics-fop-83f9038f807b87dbb77e6b119a1026f9cd0b278f.zip
notifyFlowsFinished() indirectly used by multi-column layout to determine the restart point after span changes.
getRemainingBPD() is used by the page breaking process in multi-column layout (multiple spans). git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@202361 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/area/BodyRegion.java')
-rw-r--r--src/java/org/apache/fop/area/BodyRegion.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/java/org/apache/fop/area/BodyRegion.java b/src/java/org/apache/fop/area/BodyRegion.java
index ceb28b043..1138f3089 100644
--- a/src/java/org/apache/fop/area/BodyRegion.java
+++ b/src/java/org/apache/fop/area/BodyRegion.java
@@ -18,6 +18,8 @@
package org.apache.fop.area;
+import java.util.List;
+
import org.apache.fop.fo.pagination.RegionBody;
/**
@@ -36,6 +38,8 @@ public class BodyRegion extends RegionReference {
/**
* Constructor which can read traits directly
* from an fo:region-body formatting object.
+ * @param rb the region-body FO node
+ * @param parent the parent region viewport
*/
public BodyRegion(RegionBody rb, RegionViewport parent) {
super(rb, parent);
@@ -104,6 +108,20 @@ public class BodyRegion extends RegionReference {
}
/**
+ * @return the available BPD in the main reference area after the previous span reference
+ * areas are subtracted.
+ */
+ public int getRemainingBPD() {
+ int usedBPD = 0;
+ List spans = getMainReference().getSpans();
+ int previousSpanCount = spans.size() - 1;
+ for (int i = 0; i < previousSpanCount; i++) {
+ usedBPD += ((Span)spans.get(i)).getHeight();
+ }
+ return getBPD() - usedBPD;
+ }
+
+ /**
* Clone this object.
*
* @return a shallow copy of this object