aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/area/Span.java
diff options
context:
space:
mode:
authorGlen Mazza <gmazza@apache.org>2005-05-14 16:41:45 +0000
committerGlen Mazza <gmazza@apache.org>2005-05-14 16:41:45 +0000
commit39229973d4a042d3302a2d0cf50489fe01cdb09d (patch)
treeefb7c749f756eeb12de3f9664e867dbd2db2a49f /src/java/org/apache/fop/area/Span.java
parente67ea113c1dda7b581d767e41d2046da8a10111f (diff)
downloadxmlgraphics-fop-39229973d4a042d3302a2d0cf50489fe01cdb09d.tar.gz
xmlgraphics-fop-39229973d4a042d3302a2d0cf50489fe01cdb09d.zip
Placed the PSLM.curFlowIdx within the area.Span object, and added
a few more convenience accessors to PV. This will give us a little more flexibility in which LM's we place functionality. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198629 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/area/Span.java')
-rw-r--r--src/java/org/apache/fop/area/Span.java39
1 files changed, 38 insertions, 1 deletions
diff --git a/src/java/org/apache/fop/area/Span.java b/src/java/org/apache/fop/area/Span.java
index e080ea599..626719d07 100644
--- a/src/java/org/apache/fop/area/Span.java
+++ b/src/java/org/apache/fop/area/Span.java
@@ -35,7 +35,8 @@ public class Span extends Area {
private int colCount;
private int colGap;
private int colWidth; // width for each normal flow, calculated value
-
+ private int curFlowIdx; // n-f-r-a currently being processed, zero-based
+
/**
* Create a span area with the number of columns for this span area.
*
@@ -48,6 +49,7 @@ public class Span extends Area {
this.colCount = colCount;
this.colGap = colGap;
this.ipd = ipd;
+ curFlowIdx = 0;
createNormalFlows();
}
@@ -108,5 +110,40 @@ public class Span extends Area {
" available.");
}
}
+
+ /**
+ * Get the NormalFlow area currently being processed
+ *
+ * @return the current NormalFlow
+ */
+ public NormalFlow getCurrentFlow() {
+ return getNormalFlow(curFlowIdx);
+ }
+
+ /**
+ * Indicate to the Span that the next column is being
+ * processed.
+ *
+ * @return the new NormalFlow (in the next column)
+ */
+ public NormalFlow moveToNextFlow() {
+ if (hasMoreFlows()) {
+ curFlowIdx++;
+ return getNormalFlow(curFlowIdx);
+ } else {
+ throw new IllegalStateException("(Internal error.)" +
+ " No more flows left in span.");
+ }
+ }
+
+ /**
+ * Indicates if the Span has unprocessed flows.
+ *
+ * @return true if Span can increment to the next flow,
+ * false otherwise.
+ */
+ public boolean hasMoreFlows() {
+ return (curFlowIdx < colCount-1);
+ }
}