1 17 18 19 20 package org.apache.fop.layoutmgr.table; 21 22 import org.apache.fop.fo.flow.TableAndCaption; 23 import org.apache.fop.layoutmgr.BlockStackingLayoutManager; 24 import org.apache.fop.layoutmgr.LayoutContext; 25 import org.apache.fop.layoutmgr.PositionIterator; 26 import org.apache.fop.layoutmgr.Position; 27 import org.apache.fop.area.Area; 28 import org.apache.fop.area.Block; 29 30 38 public class TableAndCaptionLayoutManager extends BlockStackingLayoutManager { 39 private TableAndCaption fobj; 40 41 private Block curBlockArea; 42 43 45 49 public TableAndCaptionLayoutManager(TableAndCaption node) { 50 super(node); 51 fobj = node; 52 } 53 54 60 127 128 134 public void addAreas(PositionIterator parentIter, 135 LayoutContext layoutContext) { 136 getParentArea(null); 137 getPSLM().addIDToPage(fobj.getId()); 138 139 153 154 flush(); 155 156 curBlockArea = null; 158 } 159 160 173 public Area getParentArea(Area childArea) { 174 if (curBlockArea == null) { 175 curBlockArea = new Block(); 176 Area parentArea = parentLM.getParentArea(curBlockArea); 179 int referenceIPD = parentArea.getIPD(); 180 curBlockArea.setIPD(referenceIPD); 181 setCurrentArea(curBlockArea); } 184 return curBlockArea; 185 } 186 187 192 public void addChildArea(Area childArea) { 193 if (curBlockArea != null) { 194 curBlockArea.addBlock((Block) childArea); 195 } 196 } 197 198 203 public void resetPosition(Position resetPos) { 204 if (resetPos == null) { 205 reset(null); 206 } 207 } 208 } 209 210 | Popular Tags |