aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/fo/pagination/Flow.java
diff options
context:
space:
mode:
authorGlen Mazza <gmazza@apache.org>2004-09-04 19:53:07 +0000
committerGlen Mazza <gmazza@apache.org>2004-09-04 19:53:07 +0000
commitce6918191d4a085815a977aa394c8516609e3f91 (patch)
tree1351e72b199c2154ffe22137ce1fbde018dfb1f9 /src/java/org/apache/fop/fo/pagination/Flow.java
parent56969a0f394ee426345412c40d1023318631ed91 (diff)
downloadxmlgraphics-fop-ce6918191d4a085815a977aa394c8516609e3f91.tar.gz
xmlgraphics-fop-ce6918191d4a085815a977aa394c8516609e3f91.zip
1.) validateChildNode() implemented for fo:table-cell.
2.) various code cleanups throughout the FO's. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197901 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo/pagination/Flow.java')
-rw-r--r--src/java/org/apache/fop/fo/pagination/Flow.java81
1 files changed, 26 insertions, 55 deletions
diff --git a/src/java/org/apache/fop/fo/pagination/Flow.java b/src/java/org/apache/fop/fo/pagination/Flow.java
index c756749ca..723911c42 100644
--- a/src/java/org/apache/fop/fo/pagination/Flow.java
+++ b/src/java/org/apache/fop/fo/pagination/Flow.java
@@ -48,9 +48,10 @@ public class Flow extends FObj {
private ArrayList markerSnapshot;
/**
- * flow-name attribute
+ * flow-name attribute: indicates the region the content of this
+ * flow should go to.
*/
- private String flowName;
+ protected String flowName;
/**
* Content-width of current column area during layout
@@ -68,6 +69,25 @@ public class Flow extends FObj {
}
/**
+ * @see org.apache.fop.fo.FObj#addProperties
+ */
+ protected void addProperties(Attributes attlist) throws SAXParseException {
+ super.addProperties(attlist);
+
+ this.pageSequence = (PageSequence) parent;
+
+ flowName = getPropString(PR_FLOW_NAME);
+
+ if (flowName == null || flowName.equals("")) {
+ missingPropertyError("flow-name");
+ }
+
+ // Now done in addChild of page-sequence
+ //pageSequence.addFlow(this);
+ getFOInputHandler().startFlow(this);
+ }
+
+ /**
* @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
* XSL Content Model: marker* (%block;)+
*/
@@ -97,64 +117,12 @@ public class Flow extends FObj {
}
/**
- * @see org.apache.fop.fo.FObj#addProperties
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
- if (parent.getName().equals("fo:page-sequence")) {
- this.pageSequence = (PageSequence) parent;
- } else {
- throw new SAXParseException("flow must be child of "
- + "page-sequence, not " + parent.getName(), locator);
- }
- // according to communication from Paul Grosso (XSL-List,
- // 001228, Number 406), confusion in spec section 6.4.5 about
- // multiplicity of fo:flow in XSL 1.0 is cleared up - one (1)
- // fo:flow per fo:page-sequence only.
-
- /* if (pageSequence.isFlowSet()) {
- if (this.name.equals("fo:flow")) {
- throw new FOPException("Only a single fo:flow permitted"
- + " per fo:page-sequence");
- } else {
- throw new FOPException(this.name
- + " not allowed after fo:flow");
- }
- }
- */
- setFlowName(getProperty(PR_FLOW_NAME).getString());
- // Now done in addChild of page-sequence
- //pageSequence.addFlow(this);
-
- getFOInputHandler().startFlow(this);
- }
-
- /**
- * @param name the name of the flow to set
- * @throws FOPException for an empty name
- */
- protected void setFlowName(String name) throws SAXParseException {
- if (name == null || name.equals("")) {
- throw new SAXParseException("A 'flow-name' is required for "
- + getName(), locator);
- } else {
- flowName = name;
- }
- }
-
- /**
- * @return the name of this flow
- */
- public String getFlowName() {
- return flowName;
- }
-
- /**
* @param contentWidth content width of this flow, in millipoints (??)
*/
protected void setContentWidth(int contentWidth) {
this.contentWidth = contentWidth;
}
+
/**
* @return the content width of this flow (really of the region
* in which it is flowing), in millipoints (??).
@@ -178,6 +146,9 @@ public class Flow extends FObj {
list.add(lm);
}
+ /**
+ * @see org.apache.fop.fo.FObj#getName()
+ */
public String getName() {
return "fo:flow";
}