return -1;
}
+ /**
+ * Clears the list of child nodes.
+ */
+ public void clearChildNodes() {
+ this.firstChild = null;
+ }
+
/** @return the "id" property. */
public String getId() {
return id;
return (super.toString() + "[@id=" + this.id + "]");
}
-
+ /** Basic {@link FONodeIterator} implementation */
public class FObjIterator implements FONodeIterator {
private static final int F_NONE_ALLOWED = 0;
isFinished = fin;
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void addAreas(PositionIterator posIter, LayoutContext context) {
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public LinkedList getNextKnuthElements(LayoutContext context,
int alignment) {
log.warn("null implementation of getNextKnuthElements() called!");
return null;
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public LinkedList getChangedKnuthElements(List oldList,
int alignment) {
log.warn("null implementation of getChangeKnuthElement() called!");
/**
* Checks to see if the incoming {@link Position}
* is the last one for this LM, and if so, calls
- * {@link #notifyEndOfLayout()}
+ * {@link #notifyEndOfLayout()} and cleans up.
*
* @param pos the {@link Position} to check
*/
if (pos != null
&& pos.getLM() == this
&& this.isLast(pos)) {
+
notifyEndOfLayout();
+
+ /* References to the child LMs are no longer needed
+ */
+ childLMs = null;
+ curChildLM = null;
+ childLMiter = null;
+
+ /* markers that qualify have been transferred to the page
+ */
+ markers = null;
+
+ /* References to the FO's children can be released if the
+ * LM is a descendant of the FlowLM. For static-content
+ * the FO may still be needed on following pages.
+ */
+ LayoutManager lm = this.parentLM;
+ while (!(lm instanceof FlowLayoutManager
+ || lm instanceof PageSequenceLayoutManager)) {
+ lm = lm.getParent();
+ }
+ if (lm instanceof FlowLayoutManager) {
+ fobj.clearChildNodes();
+ fobjIter = null;
+ }
}
}