You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by pb...@apache.org on 2004/06/03 15:32:03 UTC
cvs commit: xml-fop/src/java/org/apache/fop/fo/flow FoStaticContent.java
pbwest 2004/06/03 06:32:03
Modified: src/java/org/apache/fop/fo/flow Tag: FOP_0-20-0_Alt-Design
FoStaticContent.java
Log:
Added some features corresponding to fo:flow
Revision Changes Path
No revision
No revision
1.1.2.14 +36 -4 xml-fop/src/java/org/apache/fop/fo/flow/Attic/FoStaticContent.java
Index: FoStaticContent.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Attic/FoStaticContent.java,v
retrieving revision 1.1.2.13
retrieving revision 1.1.2.14
diff -u -r1.1.2.13 -r1.1.2.14
--- FoStaticContent.java 30 May 2004 16:46:40 -0000 1.1.2.13
+++ FoStaticContent.java 3 Jun 2004 13:32:03 -0000 1.1.2.14
@@ -29,6 +29,7 @@
import org.apache.fop.apps.FOPException;
import org.apache.fop.area.Area;
+import org.apache.fop.area.Page;
import org.apache.fop.datastructs.TreeException;
import org.apache.fop.datatypes.NCName;
import org.apache.fop.fo.FONode;
@@ -152,14 +153,45 @@
public String getFlowName() {
return flowName;
}
+//
+// public Area getReferenceRectangle() throws FOPException {
+// // TODO Reference rectangle is assumed to be the content rectangle of
+// // the first region into which the content is flowed. For region-body
+// // it is normal-flow reference-area; for other regions it is the
+// // region-reference-area. See
+// // 7.3 Reference Rectangle for Percentage Computations
+// throw new FOPException("Called from FoStaticContent");
+// }
- public Area getReferenceRectangle() throws FOPException {
+ public Area getReferenceRectangle() {
// TODO Reference rectangle is assumed to be the content rectangle of
// the first region into which the content is flowed. For region-body
// it is normal-flow reference-area; for other regions it is the
// region-reference-area. See
// 7.3 Reference Rectangle for Percentage Computations
- throw new FOPException("Called from FoStaticContent");
+ // The difficulty is that there may be multiple attempts to layout the
+ // flow. Each attempt will generate its own page set, only the first
+ // of which contains a region-body-reference-area which qualifies as
+ // the reference rectangle for percentages defined on the flow.
+ //
+ // Get the first page of the page-sequence
+ // TODO check whether the current page from the page-sequence will be
+ // enough
+ Page page = pageSequence.getCurr1stPage();
+ if (page == null) return null;
+ return page.getNormalFlowRefArea();
+ }
+
+ public Area getLayoutContext() {
+ // The layout context for fo:flow is
+ // the first normal-flow-reference-area.
+ return getReferenceRectangle();
+ }
+
+ public Area getChildrensLayoutContext() {
+ // The layout context for the █ children of fo:flow is
+ // the current normal-flow-reference-area.
+ return pageSequence.getPage().getNormalFlowRefArea();
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org