gmazza 2004/08/07 06:01:17
Modified: src/java/org/apache/fop/fo FONode.java
src/java/org/apache/fop/fo/flow BasicLink.java
BidiOverride.java Block.java
InstreamForeignObject.java ListItem.java
src/java/org/apache/fop/fo/pagination Declarations.java
Flow.java LayoutMasterSet.java PageSequence.java
PageSequenceMaster.java
RepeatablePageMasterAlternatives.java Root.java
StaticContent.java
src/java/org/apache/fop/layoutmgr AddLMVisitor.java
BidiLayoutManager.java
src/java/org/apache/fop/layoutmgr/list
ListItemLayoutManager.java
Added: src/java/org/apache/fop/layoutmgr
BasicLinkLayoutManager.java
Log:
1. new FONode.invalidChildError method added that will takes a "ruleViolated"
string for more detailed error messages.
2. FO_URI added to FONode to decrease the number of imports of FOElementMapping
within the FONode subclasses.
3. Layout logic moved from fo.flow.BasicLink to a new BasicLinkLayoutManager class.
4. BidiLayoutManager constructor modified, now needs the flow.BidiOverride object.
5. ListItemLayoutManager setup moved from AddLMManager to flow.Listitem and
layoutmgr.list.ListItemLayoutManager.
Revision Changes Path
1.38 +19 -2 xml-fop/src/java/org/apache/fop/fo/FONode.java
Index: FONode.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FONode.java,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- FONode.java 6 Aug 2004 04:22:14 -0000 1.37
+++ FONode.java 7 Aug 2004 13:01:15 -0000 1.38
@@ -40,6 +40,8 @@
*/
public abstract class FONode {
+ protected static String FO_URI = FOElementMapping.URI;
+
/** Parent FO node */
protected FONode parent;
@@ -277,10 +279,25 @@
*/
protected void invalidChildError(Locator loc, String nsURI, String lName)
throws SAXParseException {
- throw new SAXParseException (errorText(loc) + getNodeString(nsURI, lName) +
- " is not a valid child element of " + getName() + ".", loc);
+ invalidChildError(loc, nsURI, lName, null);
}
+ /**
+ * Helper function to return "invalid child" exceptions with more
+ * complex validation rules (i.e., needing more explanation of the problem)
+ * @param loc org.xml.sax.Locator object of the error (*not* parent node)
+ * @param nsURI namespace URI of incoming invalid node
+ * @param lName local name (i.e., no prefix) of incoming node
+ * @param ruleViolated text explanation of problem
+ */
+ protected void invalidChildError(Locator loc, String nsURI, String lName,
+ String ruleViolated)
+ throws SAXParseException {
+ throw new SAXParseException (errorText(loc) + getNodeString(nsURI, lName) +
+ " is not a valid child element of " + getName()
+ + ((ruleViolated != null) ? ": " + ruleViolated : "."), loc);
+ }
+
/**
* Helper function to return missing child element errors
* (e.g., fo:layout-master-set not having any page-master child element)
1.23 +46 -63 xml-fop/src/java/org/apache/fop/fo/flow/BasicLink.java
Index: BasicLink.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/BasicLink.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- BasicLink.java 6 Aug 2004 15:41:10 -0000 1.22
+++ BasicLink.java 7 Aug 2004 13:01:15 -0000 1.23
@@ -27,33 +27,25 @@
import org.xml.sax.SAXParseException;
// FOP
-import org.apache.fop.area.inline.InlineArea;
-import org.apache.fop.area.inline.InlineParent;
-import org.apache.fop.area.LinkResolver;
-import org.apache.fop.area.PageViewport;
-import org.apache.fop.area.Trait;
-import org.apache.fop.fo.FOElementMapping;
import org.apache.fop.fo.FONode;
-import org.apache.fop.layoutmgr.LayoutManager;
-import org.apache.fop.layoutmgr.LMiter;
-import org.apache.fop.layoutmgr.InlineStackingLayoutManager;
-import org.apache.fop.fo.properties.CommonAccessibility;
-import org.apache.fop.fo.properties.CommonAural;
-import org.apache.fop.fo.properties.CommonBorderAndPadding;
-import org.apache.fop.fo.properties.CommonBackground;
-import org.apache.fop.fo.properties.CommonMarginInline;
-import org.apache.fop.fo.properties.CommonRelativePosition;
+import org.apache.fop.layoutmgr.BasicLinkLayoutManager;
/**
- * The basic link.
- * This sets the basic link trait on the inline parent areas
- * that are created by the fo element.
+ * The fo:basic-link formatting object.
+ *
+ * This class contains the logic to determine the link represented by this FO,
+ * and whether that link is external (uses a URI) or internal (an id
+ * reference).
*/
public class BasicLink extends Inline {
+
+ // link represented by this FO
private String link = null;
- private boolean external = false;
+
+ // indicator of whether link is internal or external
+ private boolean isExternalLink = false;
- // used for FO validation
+ // used only for FO validation
private boolean blockOrInlineItemFound = false;
/**
@@ -68,17 +60,18 @@
*/
protected void addProperties(Attributes attlist) throws SAXParseException {
super.addProperties(attlist);
-
setupID();
+
+ // This logic is for determining the link represented by this FO.
String ext = propertyList.get(PR_EXTERNAL_DESTINATION).getString();
String internal = propertyList.get(PR_INTERNAL_DESTINATION).getString();
- // per spec, internal takes precedence if both specified
- if (internal.length() > 0) {
+ // per spec, internal takes precedence if both specified
+ if (internal.length() > 0) {
link = internal;
} else if (ext.length() > 0) {
link = ext;
- external = true;
+ isExternalLink = true;
} else {
// slightly stronger than spec "should be specified"
attributeError("Missing attribute: Either external-destination or " +
@@ -94,7 +87,7 @@
*/
protected void validateChildNode(Locator loc, String nsURI, String localName)
throws SAXParseException {
- if (nsURI == FOElementMapping.URI && localName.equals("marker")) {
+ if (nsURI == FO_URI && localName.equals("marker")) {
if (blockOrInlineItemFound) {
nodesOutOfOrderError(loc, "fo:marker", "(#PCDATA|%inline;|%block;)");
}
@@ -114,49 +107,39 @@
}
/**
- * @return true (BasicLink can contain Markers)
- */
- protected boolean containsMarkers() {
- return true;
- }
-
- /**
* @see org.apache.fop.fo.FObj#addLayoutManager(List)
- * @todo create a subclass for InlineStackingLayoutManager, moving the
formatting
- * logic to the layoutmgr package
- */
+ */
public void addLayoutManager(List list) {
- InlineStackingLayoutManager lm;
- lm = new InlineStackingLayoutManager(this) {
- protected InlineParent createArea() {
- InlineParent area = super.createArea();
- setupBasicLinkArea(parentLM, area);
- return area;
- }
- };
- lm.setLMiter(new LMiter(lm, getChildNodes()));
+ BasicLinkLayoutManager lm = new BasicLinkLayoutManager(this);
list.add(lm);
}
-
- protected void setupBasicLinkArea(LayoutManager parentLM,
- InlineParent area) {
- if (link == null) {
- return;
- }
- if (external) {
- area.addTrait(Trait.EXTERNAL_LINK, link);
- } else {
- PageViewport page = parentLM.resolveRefID(link);
- if (page != null) {
- area.addTrait(Trait.INTERNAL_LINK, page.getKey());
- } else {
- LinkResolver res = new LinkResolver(link, area);
- parentLM.addUnresolvedArea(link, res);
- }
- }
- }
-
+
+ /**
+ * @return link represented by this fo:basic-link
+ */
+ public String getLink() {
+ return link;
+ }
+
+ /**
+ * @return true if link is external, false if internal
+ */
+ public boolean isExternalLink() {
+ return isExternalLink;
+ }
+
+ /**
+ * @see org.apache.fop.fo.FObj#getName()
+ */
public String getName() {
return "fo:basic-link";
+ }
+
+ /**
+ * @return true (BasicLink can contain Markers)
+ * @todo see if can remove in favor of a BitSet for all FO's
+ */
+ protected boolean containsMarkers() {
+ return true;
}
}
1.14 +25 -20 xml-fop/src/java/org/apache/fop/fo/flow/BidiOverride.java
Index: BidiOverride.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/BidiOverride.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- BidiOverride.java 6 Aug 2004 15:41:10 -0000 1.13
+++ BidiOverride.java 7 Aug 2004 13:01:15 -0000 1.14
@@ -28,15 +28,11 @@
import org.xml.sax.SAXParseException;
// FOP
-import org.apache.fop.fo.FOElementMapping;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObjMixed;
import org.apache.fop.layoutmgr.BidiLayoutManager;
import org.apache.fop.layoutmgr.InlineStackingLayoutManager;
import org.apache.fop.layoutmgr.LayoutManager;
-import org.apache.fop.fo.properties.CommonAural;
-import org.apache.fop.fo.properties.CommonRelativePosition;
-
/**
* fo:bidi-override element.
@@ -77,6 +73,8 @@
/**
* @see org.apache.fop.fo.FObj#addProperties
+ * @todo see if can use a BitSet to determine if an FO should
+ * have its ID setup; then move setupID() instances to FObj.
*/
protected void addProperties(Attributes attlist) throws SAXParseException {
super.addProperties(attlist);
@@ -93,7 +91,7 @@
*/
protected void validateChildNode(Locator loc, String nsURI, String localName)
throws SAXParseException {
- if (nsURI == FOElementMapping.URI && localName.equals("marker")) {
+ if (nsURI == FO_URI && localName.equals("marker")) {
if (blockOrInlineItemFound) {
nodesOutOfOrderError(loc, "fo:marker",
"(#PCDATA|%inline;|%block;)");
@@ -101,25 +99,20 @@
} else if (!isBlockOrInlineItem(nsURI, localName)) {
invalidChildError(loc, nsURI, localName);
} else if (!canHaveBlockLevelChildren && isBlockItem(nsURI, localName)) {
- invalidChildError(loc, nsURI, localName);
+ String ruleViolated = "An fo:bidi-override" +
+ " that is a descendant of an fo:leader or of the fo:inline child" +
+ " of an fo:footnote may not have block-level children, unless it" +
+ " has a nearer ancestor that is an fo:inline-container.";
+ invalidChildError(loc, nsURI, localName, ruleViolated);
} else {
blockOrInlineItemFound = true;
}
}
- public String getName() {
- return "fo:bidi-override";
- }
-
- /**
- * @return true (BidiOverride can contain Markers)
- */
- protected boolean containsMarkers() {
- return true;
- }
-
/**
* @see org.apache.fop.fo.FObj#addLayoutManager(List)
+ * @todo see if can/should move the child iteration logic
+ * to BidiLayoutManager
*/
public void addLayoutManager(List list) {
if (false) {
@@ -130,8 +123,8 @@
for (int count = childList.size() - 1; count >= 0; count--) {
LayoutManager lm = (LayoutManager) childList.get(count);
if (lm.generatesInlineAreas()) {
- LayoutManager blm = new
BidiLayoutManager((InlineStackingLayoutManager) lm);
- blm.setFObj(this);
+ LayoutManager blm = new BidiLayoutManager(this,
+ (InlineStackingLayoutManager) lm);
list.add(blm);
} else {
list.add(lm);
@@ -140,5 +133,17 @@
}
}
-
+ /**
+ * @see org.apache.fop.fo.FObj#getName()
+ */
+ public String getName() {
+ return "fo:bidi-override";
+ }
+
+ /**
+ * @return true (BidiOverride can contain Markers)
+ */
+ protected boolean containsMarkers() {
+ return true;
+ }
}
1.29 +7 -8 xml-fop/src/java/org/apache/fop/fo/flow/Block.java
Index: Block.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Block.java,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- Block.java 6 Aug 2004 15:41:10 -0000 1.28
+++ Block.java 7 Aug 2004 13:01:15 -0000 1.29
@@ -142,13 +142,6 @@
}
/**
- * @return true (Block can contain Markers)
- */
- protected boolean containsMarkers() {
- return true;
- }
-
- /**
* @return span for this Block, in millipoints (??)
*/
public int getSpan() {
@@ -347,8 +340,14 @@
list.add(blm);
}
- public String getName() {
+ public String getName() {
return "fo:block";
}
+ /**
+ * @return true (Block can contain Markers)
+ */
+ protected boolean containsMarkers() {
+ return true;
+ }
}
1.18 +1 -2
xml-fop/src/java/org/apache/fop/fo/flow/InstreamForeignObject.java
Index: InstreamForeignObject.java
===================================================================
RCS file:
/home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/InstreamForeignObject.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- InstreamForeignObject.java 6 Aug 2004 04:22:16 -0000 1.17
+++ InstreamForeignObject.java 7 Aug 2004 13:01:15 -0000 1.18
@@ -26,7 +26,6 @@
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.LMVisited;
-import org.apache.fop.fo.FOElementMapping;
import org.apache.fop.layoutmgr.AddLMVisitor;
import org.apache.fop.fo.FObj;
@@ -54,7 +53,7 @@
*/
protected void validateChildNode(Locator loc, String nsURI, String localName)
throws SAXParseException {
- if (nsURI == FOElementMapping.URI) {
+ if (nsURI == FO_URI) {
invalidChildError(loc, nsURI, localName);
} else if (hasNonXSLNamespaceElement) {
tooManyNodesError(loc, "child element");
1.22 +18 -39 xml-fop/src/java/org/apache/fop/fo/flow/ListItem.java
Index: ListItem.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/ListItem.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- ListItem.java 6 Aug 2004 04:22:16 -0000 1.21
+++ ListItem.java 7 Aug 2004 13:01:15 -0000 1.22
@@ -18,28 +18,23 @@
package org.apache.fop.fo.flow;
+// Java
+import java.util.List;
+
// XML
import org.xml.sax.Attributes;
import org.xml.sax.SAXParseException;
// FOP
-import org.apache.fop.apps.FOPException;
import org.apache.fop.fo.FONode;
-import org.apache.fop.layoutmgr.AddLMVisitor;
import org.apache.fop.fo.FObj;
-import org.apache.fop.fo.properties.CommonAccessibility;
-import org.apache.fop.fo.properties.CommonAural;
-import org.apache.fop.fo.properties.CommonBackground;
-import org.apache.fop.fo.properties.CommonBorderAndPadding;
-import org.apache.fop.fo.properties.CommonMarginBlock;
-import org.apache.fop.fo.properties.CommonRelativePosition;
-import org.apache.fop.fo.LMVisited;
+import org.apache.fop.layoutmgr.list.ListItemLayoutManager;
/**
* Class modelling the fo:list-item object. See Sec. 6.8.3 of the XSL-FO
* Standard.
*/
-public class ListItem extends FObj implements LMVisited {
+public class ListItem extends FObj {
private ListItemLabel label = null;
private ListItemBody body = null;
@@ -70,31 +65,7 @@
}
private void setup() {
-
- // Common Accessibility Properties
- CommonAccessibility mAccProps = propMgr.getAccessibilityProps();
-
- // Common Aural Properties
- CommonAural mAurProps = propMgr.getAuralProps();
-
- // Common Border, Padding, and Background Properties
- CommonBorderAndPadding bap = propMgr.getBorderAndPadding();
- CommonBackground bProps = propMgr.getBackgroundProps();
-
- // Common Margin Properties-Block
- CommonMarginBlock mProps = propMgr.getMarginProps();
-
- // Common Relative Position Properties
- CommonRelativePosition mRelProps = propMgr.getRelativePositionProps();
-
- // this.propertyList.get("break-after");
- // this.propertyList.get("break-before");
setupID();
- // this.propertyList.get("keep-together");
- // this.propertyList.get("keep-with-next");
- // this.propertyList.get("keep-with-previous");
- // this.propertyList.get("relative-align");
-
this.align = this.propertyList.get(PR_TEXT_ALIGN).getEnum();
this.alignLast = this.propertyList.get(PR_TEXT_ALIGN_LAST).getEnum();
this.lineHeight =
@@ -103,7 +74,6 @@
this.propertyList.get(PR_SPACE_BEFORE |
CP_OPTIMUM).getLength().getValue();
this.spaceAfter =
this.propertyList.get(PR_SPACE_AFTER |
CP_OPTIMUM).getLength().getValue();
-
}
/**
@@ -135,16 +105,25 @@
return true;
}
+ /**
+ * @see org.apache.fop.fo.FObj#addLayoutManager(List)
+ * @todo remove checks for non-nulls after validateChildNode() added
+ */
+ public void addLayoutManager(List list) {
+ if (label != null && body != null) {
+ ListItemLayoutManager blm = new ListItemLayoutManager(this);
+ list.add(blm);
+ } else {
+ getLogger().error("list-item requires list-item-label and
list-item-body");
+ }
+ }
+
public ListItemLabel getLabel() {
return label;
}
public ListItemBody getBody() {
return body;
- }
-
- public void acceptVisitor(AddLMVisitor aLMV) {
- aLMV.serveListItem(this);
}
protected void endOfNode() throws SAXParseException {
1.16 +2 -3 xml-fop/src/java/org/apache/fop/fo/pagination/Declarations.java
Index: Declarations.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/Declarations.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- Declarations.java 4 Aug 2004 22:50:58 -0000 1.15
+++ Declarations.java 7 Aug 2004 13:01:16 -0000 1.16
@@ -29,7 +29,6 @@
import org.xml.sax.SAXParseException;
// FOP
-import org.apache.fop.fo.FOElementMapping;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
import org.apache.fop.fo.XMLObj;
@@ -62,7 +61,7 @@
*/
protected void validateChildNode(Locator loc, String nsURI, String localName)
throws SAXParseException {
- if (nsURI == FOElementMapping.URI) {
+ if (nsURI == FO_URI) {
if (!localName.equals("color-profile")) {
invalidChildError(loc, nsURI, localName);
}
1.25 +2 -3 xml-fop/src/java/org/apache/fop/fo/pagination/Flow.java
Index: Flow.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/Flow.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- Flow.java 6 Aug 2004 15:41:12 -0000 1.24
+++ Flow.java 7 Aug 2004 13:01:16 -0000 1.25
@@ -30,7 +30,6 @@
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
-import org.apache.fop.fo.FOElementMapping;
import org.apache.fop.layoutmgr.FlowLayoutManager;
/**
@@ -74,7 +73,7 @@
*/
protected void validateChildNode(Locator loc, String nsURI, String localName)
throws SAXParseException {
- if (nsURI == FOElementMapping.URI && localName.equals("marker")) {
+ if (nsURI == FO_URI && localName.equals("marker")) {
if (blockItemFound) {
nodesOutOfOrderError(loc, "fo:marker", "(%block;)");
}
1.20 +1 -2
xml-fop/src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java
Index: LayoutMasterSet.java
===================================================================
RCS file:
/home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- LayoutMasterSet.java 4 Aug 2004 22:50:58 -0000 1.19
+++ LayoutMasterSet.java 7 Aug 2004 13:01:16 -0000 1.20
@@ -30,7 +30,6 @@
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
-import org.apache.fop.fo.FOElementMapping;
import org.apache.fop.apps.FOPException;
/**
@@ -60,7 +59,7 @@
*/
protected void validateChildNode(Locator loc, String nsURI, String localName)
throws SAXParseException {
- if (nsURI == FOElementMapping.URI) {
+ if (nsURI == FO_URI) {
if (!localName.equals("simple-page-master")
&& !localName.equals("page-sequence-master")) {
invalidChildError(loc, nsURI, localName);
1.35 +1 -3 xml-fop/src/java/org/apache/fop/fo/pagination/PageSequence.java
Index: PageSequence.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/PageSequence.java,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- PageSequence.java 4 Aug 2004 22:50:58 -0000 1.34
+++ PageSequence.java 7 Aug 2004 13:01:16 -0000 1.35
@@ -30,8 +30,6 @@
import org.apache.fop.apps.FOPException;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
-import org.apache.fop.fo.FOElementMapping;
-import org.apache.fop.apps.FOPException;
/**
* This provides pagination of flows onto pages. Much of the
@@ -139,7 +137,7 @@
*/
protected void validateChildNode(Locator loc, String nsURI, String localName)
throws SAXParseException {
- if (nsURI == FOElementMapping.URI) {
+ if (nsURI == FO_URI) {
if (localName.equals("title")) {
if (titleFO != null) {
tooManyNodesError(loc, "fo:title");
1.17 +1 -2
xml-fop/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java
Index: PageSequenceMaster.java
===================================================================
RCS file:
/home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- PageSequenceMaster.java 4 Aug 2004 22:50:58 -0000 1.16
+++ PageSequenceMaster.java 7 Aug 2004 13:01:16 -0000 1.17
@@ -30,7 +30,6 @@
import org.apache.fop.fo.Constants;
import org.apache.fop.fo.FObj;
import org.apache.fop.fo.FONode;
-import org.apache.fop.fo.FOElementMapping;
import org.apache.fop.apps.FOPException;
/**
@@ -69,7 +68,7 @@
*/
protected void validateChildNode(Locator loc, String nsURI, String localName)
throws SAXParseException {
- if (nsURI == FOElementMapping.URI) {
+ if (nsURI == FO_URI) {
if (!localName.equals("single-page-master-reference")
&& !localName.equals("repeatable-page-master-reference")
&& !localName.equals("repeatable-page-master-alternatives")) {
1.15 +1 -2
xml-fop/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java
Index: RepeatablePageMasterAlternatives.java
===================================================================
RCS file:
/home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- RepeatablePageMasterAlternatives.java 4 Aug 2004 22:50:58 -0000 1.14
+++ RepeatablePageMasterAlternatives.java 7 Aug 2004 13:01:16 -0000 1.15
@@ -27,7 +27,6 @@
import org.xml.sax.SAXParseException;
// FOP
-import org.apache.fop.fo.FOElementMapping;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
@@ -64,7 +63,7 @@
*/
protected void validateChildNode(Locator loc, String nsURI, String localName)
throws SAXParseException {
- if (!(nsURI == FOElementMapping.URI &&
+ if (!(nsURI == FO_URI &&
localName.equals("conditional-page-master-reference"))) {
invalidChildError(loc, nsURI, localName);
}
1.21 +1 -2 xml-fop/src/java/org/apache/fop/fo/pagination/Root.java
Index: Root.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/Root.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- Root.java 4 Aug 2004 22:50:58 -0000 1.20
+++ Root.java 7 Aug 2004 13:01:16 -0000 1.21
@@ -28,7 +28,6 @@
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
-import org.apache.fop.fo.FOElementMapping;
import org.apache.fop.fo.extensions.ExtensionElementMapping;
import org.apache.fop.fo.extensions.Bookmarks;
import org.apache.fop.fo.FOInputHandler;
@@ -75,7 +74,7 @@
*/
protected void validateChildNode(Locator loc, String nsURI, String localName)
throws SAXParseException {
- if (nsURI == FOElementMapping.URI) {
+ if (nsURI == FO_URI) {
if (localName.equals("layout-master-set")) {
if (layoutMasterSet != null) {
tooManyNodesError(loc, "fo:layout-master-set");
1.19 +1 -2 xml-fop/src/java/org/apache/fop/fo/pagination/StaticContent.java
Index: StaticContent.java
===================================================================
RCS file:
/home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/StaticContent.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- StaticContent.java 6 Aug 2004 04:22:18 -0000 1.18
+++ StaticContent.java 7 Aug 2004 13:01:16 -0000 1.19
@@ -24,7 +24,6 @@
import org.xml.sax.SAXParseException;
// FOP
-import org.apache.fop.fo.FOElementMapping;
import org.apache.fop.fo.FONode;
/**
1.50 +1 -33 xml-fop/src/java/org/apache/fop/layoutmgr/AddLMVisitor.java
Index: AddLMVisitor.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/AddLMVisitor.java,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- AddLMVisitor.java 6 Aug 2004 15:41:12 -0000 1.49
+++ AddLMVisitor.java 7 Aug 2004 13:01:17 -0000 1.50
@@ -45,9 +45,6 @@
import org.apache.fop.fo.flow.Inline;
import org.apache.fop.fo.flow.InstreamForeignObject;
import org.apache.fop.fo.flow.Leader;
-import org.apache.fop.fo.flow.ListItem;
-import org.apache.fop.fo.flow.ListItemBody;
-import org.apache.fop.fo.flow.ListItemLabel;
import org.apache.fop.fo.flow.PageNumber;
import org.apache.fop.fo.flow.RetrieveMarker;
import org.apache.fop.fo.flow.Table;
@@ -62,8 +59,6 @@
import org.apache.fop.fo.pagination.Title;
import org.apache.fop.fo.properties.CommonBackground;
import org.apache.fop.fo.properties.CommonBorderAndPadding;
-import org.apache.fop.layoutmgr.list.Item;
-import org.apache.fop.layoutmgr.list.ListItemLayoutManager;
import org.apache.fop.layoutmgr.table.Body;
import org.apache.fop.layoutmgr.table.Column;
import org.apache.fop.layoutmgr.table.TableLayoutManager;
@@ -420,33 +415,6 @@
areaCurrent.setOffset(0);
return areaCurrent;
- }
-
- public void serveListItem(ListItem node) {
- if (node.getLabel() != null && node.getBody() != null) {
- ListItemLayoutManager blm = new ListItemLayoutManager(node);
- blm.setLabel(getListItemLabelLayoutManager(node.getLabel()));
- blm.setBody(getListItemBodyLayoutManager(node.getBody()));
- currentLMList.add(blm);
- } else {
- node.getLogger().error("list-item requires list-item-label and
list-item-body");
- }
- }
-
- /**
- * @return this object's Item layout manager
- */
- public Item getListItemLabelLayoutManager(ListItemLabel node) {
- Item itemLabel = new Item(node);
- return itemLabel;
- }
-
- /**
- * @return Item layout manager
- */
- public Item getListItemBodyLayoutManager(ListItemBody node) {
- Item item = new Item(node);
- return item;
}
/**
1.6 +4 -2 xml-fop/src/java/org/apache/fop/layoutmgr/BidiLayoutManager.java
Index: BidiLayoutManager.java
===================================================================
RCS file:
/home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/BidiLayoutManager.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- BidiLayoutManager.java 6 Aug 2004 04:22:18 -0000 1.5
+++ BidiLayoutManager.java 7 Aug 2004 13:01:17 -0000 1.6
@@ -22,6 +22,7 @@
import java.util.List;
import org.apache.fop.area.inline.InlineArea;
+import org.apache.fop.fo.flow.BidiOverride;
/**
@@ -33,8 +34,9 @@
private List children;
- public BidiLayoutManager(InlineStackingLayoutManager cLM) {
+ public BidiLayoutManager(BidiOverride node, InlineStackingLayoutManager cLM) {
children = new ArrayList();
+ setFObj(node);
/*
for (int count = cLM.size() - 1; count >= 0; count--) {
InlineArea ia = cLM.get(count);
1.1
xml-fop/src/java/org/apache/fop/layoutmgr/BasicLinkLayoutManager.java
Index: BasicLinkLayoutManager.java
===================================================================
/*
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id: BasicLinkLayoutManager.java,v 1.1 2004/08/07 13:01:17 gmazza Exp $ */
package org.apache.fop.layoutmgr;
import org.apache.fop.fo.flow.BasicLink;
import org.apache.fop.area.inline.InlineParent;
import org.apache.fop.area.Trait;
import org.apache.fop.area.LinkResolver;
import org.apache.fop.area.PageViewport;
/**
* LayoutManager for the fo:basic-link formatting object
*/
public class BasicLinkLayoutManager extends InlineStackingLayoutManager {
private String link;
private boolean isExternalLink = false;
/**
* Create an fo:basic-link layout manager.
*
* @param node the formatting object that creates the area
*/
public BasicLinkLayoutManager(BasicLink node) {
super(node);
setLMiter(new LMiter(this, node.getChildNodes()));
link = node.getLink();
isExternalLink = node.isExternalLink();
}
protected InlineParent createArea() {
InlineParent area = super.createArea();
setupBasicLinkArea(parentLM, area);
return area;
}
private void setupBasicLinkArea(LayoutManager parentLM,
InlineParent area) {
if (isExternalLink) {
area.addTrait(Trait.EXTERNAL_LINK, link);
} else {
PageViewport page = parentLM.resolveRefID(link);
if (page != null) {
area.addTrait(Trait.INTERNAL_LINK, page.getKey());
} else {
LinkResolver res = new LinkResolver(link, area);
parentLM.addUnresolvedArea(link, res);
}
}
}
}
1.12 +14 -9
xml-fop/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java
Index: ListItemLayoutManager.java
===================================================================
RCS file:
/home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- ListItemLayoutManager.java 12 Jun 2004 18:03:47 -0000 1.11
+++ ListItemLayoutManager.java 7 Aug 2004 13:01:17 -0000 1.12
@@ -19,6 +19,9 @@
package org.apache.fop.layoutmgr.list;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.flow.ListItem;
+import org.apache.fop.fo.flow.ListItemBody;
+import org.apache.fop.fo.flow.ListItemLabel;
import org.apache.fop.fo.PropertyManager;
import org.apache.fop.layoutmgr.BlockStackingLayoutManager;
import org.apache.fop.layoutmgr.LayoutManager;
@@ -65,8 +68,10 @@
* Create a new list item layout manager.
*
*/
- public ListItemLayoutManager(FObj node) {
+ public ListItemLayoutManager(ListItem node) {
super(node);
+ setLabel(node.getLabel());
+ setBody(node.getBody());
}
/**
@@ -79,20 +84,20 @@
}
/**
- * Sets the label of the list item
- * @param item the label item
+ * Create a LM for the fo:list-item-label object
+ * @param node the fo:list-item-label FO
*/
- public void setLabel(Item item) {
- label = item;
+ public void setLabel(ListItemLabel node) {
+ label = new Item(node);
label.setParent(this);
}
/**
- * Sets the body of the list item
- * @param item the body item
+ * Create a LM for the fo:list-item-body object
+ * @param node the fo:list-item-body FO
*/
- public void setBody(Item item) {
- body = item;
+ public void setBody(ListItemBody node) {
+ body = new Item(node);
body.setParent(this);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]