import org.apache.fop.layout.Area;
import org.apache.fop.layout.AreaClass;
import org.apache.fop.layout.LinkSet;
-import org.apache.fop.fo.flow.Marker;
// Avalon
import org.apache.avalon.framework.logger.Logger;
// count of areas generated-by/returned-by
public int areasGenerated = 0;
- // markers
- protected Hashtable markers;
-
protected Logger log;
protected FONode(FObj parent) {
this.parent = parent;
- markers = new Hashtable();
-
- if (null != parent)
+ if (parent != null) {
this.areaClass = parent.areaClass;
+ log = parent.log;
+ }
}
public void setLogger(Logger logger) {
((FONode)children.elementAt(this.marker)).rollback(snapshot);
}
-
- public void addMarker(Marker marker) throws FOPException {
- String mcname = marker.getMarkerClassName();
- if (!markers.containsKey(mcname) && children.isEmpty()) {
- markers.put(mcname, marker);
- } else {
- log.error("fo:marker must be an initial child,"
- + "and 'marker-class-name' must be unique for same parent");
- throw new FOPException("fo:marker must be an initial child,"
- + "and 'marker-class-name' must be unique for same parent");
- }
- }
-
- public boolean hasMarkers() {
- return !markers.isEmpty();
- }
-
- public Vector getMarkers() {
- return new Vector(markers.values());
- }
-
}
import org.apache.fop.layout.Area;
import org.apache.fop.apps.FOPException;
import org.apache.fop.datatypes.IDReferences;
+import org.apache.fop.fo.flow.Marker;
// Java
import java.util.Hashtable;
import java.util.Enumeration;
+import java.util.Vector;
/**
* base class for representation of formatting objects and their processing
public PropertyList properties;
protected PropertyManager propMgr;
+ // markers
+ private Hashtable markers;
+
protected String name;
protected FObj(FObj parent, PropertyList propertyList) {
this.properties.setWritingMode(p.getProperty("writing-mode").getEnum());
}
+
+ public void addMarker(Marker marker) throws FOPException {
+ String mcname = marker.getMarkerClassName();
+ if (!children.isEmpty()) {
+ throw new FOPException("A fo:marker must be an initial child of '"
+ + getName());
+ }
+ if (markers==null) {
+ markers = new Hashtable();
+ markers.put(mcname, marker);
+ } else if (!markers.containsKey(mcname) ) {
+ markers.put(mcname, marker);
+ } else {
+ throw new FOPException("marker-class-name '"
+ + mcname
+ + "' already exists for this parent");
+ }
+ }
+
+ public boolean hasMarkers() {
+ return markers!=null;
+ }
+
+ public Vector getMarkers() {
+ if (markers==null) {
+ log.debug("GetMarkers failed (no markers). Should not happen.");
+ return null;
+ } else {
+ return new Vector(markers.values());
+ }
+ }
}
protected void setFlowName(String name) throws FOPException {
if (name == null || name.equals("")) {
log.warn("A 'flow-name' is required for "
- + getElementName()
- + ". This constraint will be enforced in future versions of FOP");
+ + getElementName()
+ + ". This constraint will be enforced in future versions of FOP");
_flowName = "xsl-region-body";
} else {
_flowName = name;
return this.fontInfo;
}
- public Page getNextPage(Page current, boolean isWithinPageSequence,
- boolean isFirstCall) {
- return streamRenderer.getNextPage(current, isWithinPageSequence,isFirstCall);
- }
+// public Page getNextPage(Page current, boolean isWithinPageSequence,
+// boolean isFirstCall) {
+// return streamRenderer.getNextPage(current, isWithinPageSequence,isFirstCall);
+// }
public Page getPreviousPage(Page current, boolean isWithinPageSequence,
boolean isFirstCall) {