<property>
<name>marker-class-name</name>
<inherited>false</inherited>
- <datatype>ToBeImplemented</datatype>
+ <datatype>String</datatype>
<default></default>
</property>
<property>
<name>retrieve-class-name</name>
<inherited>false</inherited>
- <datatype>ToBeImplemented</datatype>
+ <datatype>String</datatype>
<default></default>
</property>
<property>
<name>retrieve-position</name>
<inherited>false</inherited>
- <datatype>ToBeImplemented</datatype>
+ <datatype>Enum</datatype>
+ <enumeration>
+ <value const="FSWP">first-starting-within-page</value>
+ <value const="FIC">first-including-carryover</value>
+ <value const="LSWP">last-starting-within-page</value>
+ <value const="LEWP">last-ending-within-page</value>
+ </enumeration>
<default>first-starting-within-page</default>
</property>
<property>
<name>retrieve-boundary</name>
<inherited>false</inherited>
- <datatype>ToBeImplemented</datatype>
+ <datatype>Enum</datatype>
+ <enumeration>
+ <value const="PAGE">page</value>
+ <value const="PAGE_SEQUENCE">page-sequence</value>
+ <value const="DOCUMENT">document</value>
+ </enumeration>
<default>page-sequence</default>
</property>
// FOP
import org.apache.fop.apps.FOPException;
import org.apache.fop.layout.Area;
+import org.apache.fop.layout.AreaClass;
import org.apache.fop.layout.LinkSet;
import org.apache.fop.system.BufferManager;
+import org.apache.fop.fo.flow.Marker;
// Java
import java.util.Vector;
+import java.util.Hashtable;
/**
* base class for nodes in the formatting object tree
protected FObj parent;
+ protected String areaClass = AreaClass.UNASSIGNED;
+
public BufferManager bufferManager;
public Vector children = new Vector(); // made public for searching for id's
protected LinkSet linkSet;
+ // count of areas generated-by/returned-by
+ public int areasGenerated = 0;
+
+ // markers
+ protected Hashtable markers;
+
protected FONode(FObj parent) {
- this.parent = parent;
+ this.parent = parent;
if (parent != null) {
this.bufferManager = parent.bufferManager;
}
+
+ markers = new Hashtable();
+
+ if (null != parent)
+ this.areaClass = parent.areaClass;
}
public void setIsInTableCell() {
}
((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
+ 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());
+ }
}
p=parent);
this.properties.setWritingMode(p.getProperty("writing-mode").getEnum());
}
-
-
}
this.blockArea = new BlockArea(propMgr.getFontState(area.getFontInfo()), area.getAllocationWidth(),
area.spaceLeft(), startIndent, endIndent, textIndent,
align, alignLast, lineHeight);
+ this.blockArea.generatedBy = this;
+ this.areasGenerated++;
+ if (this.areasGenerated == 1)
+ this.blockArea.isFirst = true;
+ // for normal areas this should be the only pair
+ this.blockArea.addLineagePair(this, this.areasGenerated);
+
+ // markers
+ if (this.hasMarkers())
+ this.blockArea.addMarkers(this.getMarkers());
+
this.blockArea.setParent(area); // BasicLink needs it
blockArea.setPage(area.getPage());
blockArea.setBackgroundColor(backgroundColor);
}
//MessageHandler.error(" b:OK" + marker + " ");
+ this.blockArea.isLast = true;
return new Status(Status.OK);
}