1 17 18 19 20 package org.apache.fop.layoutmgr; 21 22 import org.apache.fop.area.Area; 23 import org.apache.fop.fo.flow.FootnoteBody; 24 25 import java.util.LinkedList ; 26 27 30 public class FootnoteBodyLayoutManager extends BlockStackingLayoutManager { 31 32 36 public FootnoteBodyLayoutManager(FootnoteBody body) { 37 super(body); 38 } 39 40 41 public void addAreas(PositionIterator parentIter, LayoutContext layoutContext) { 42 LayoutManager childLM = null; 43 LayoutManager lastLM = null; 44 LayoutContext lc = new LayoutContext(0); 45 46 LinkedList positionList = new LinkedList (); 49 Position pos; 50 while (parentIter.hasNext()) { 51 pos = (Position) parentIter.next(); 52 Position innerPosition = pos; 54 if (pos instanceof NonLeafPosition) { 55 innerPosition = ((NonLeafPosition) pos).getPosition(); 56 if (innerPosition.getLM() == this) { 57 } else { 62 positionList.add(innerPosition); 64 lastLM = innerPosition.getLM(); 65 } 67 } 68 } 69 70 StackingIter childPosIter = new StackingIter(positionList.listIterator()); 73 74 while ((childLM = childPosIter.getNextChildLM()) != null) { 75 lc.setFlags(LayoutContext.LAST_AREA, 77 (layoutContext.isLastArea() && childLM == lastLM)); 78 childLM.addAreas(childPosIter, lc); 80 } 81 } 82 83 84 public void addChildArea(Area childArea) { 85 childArea.setAreaClass(Area.CLASS_FOOTNOTE); 86 parentLM.addChildArea(childArea); 87 } 88 89 90 protected FootnoteBody getFootnodeBodyFO() { 91 return (FootnoteBody) fobj; 92 } 93 94 } 95 | Popular Tags |