1 17 18 19 20 package org.apache.fop.area.inline; 21 22 import org.apache.fop.area.Area; 23 24 import java.util.List ; 25 import java.util.ArrayList ; 26 27 31 public class InlineParent extends InlineArea { 32 35 protected List inlines = new ArrayList (); 36 37 38 protected transient boolean autoSize; 39 40 43 public InlineParent() { 44 } 45 46 51 public void addChildArea(Area childArea) { 52 if (inlines.size() == 0) { 53 autoSize = (getIPD() == 0); 54 } 55 if (childArea instanceof InlineArea) { 56 InlineArea inlineChildArea = (InlineArea) childArea; 57 inlines.add(childArea); 58 inlineChildArea.setParentArea(this); 60 if (autoSize) { 61 increaseIPD(inlineChildArea.getAllocIPD()); 62 } 63 } 64 } 65 66 71 public List getChildAreas() { 72 return inlines; 73 } 74 75 82 public boolean applyVariationFactor(double variationFactor, 83 int lineStretch, int lineShrink) { 84 boolean bUnresolvedAreasPresent = false; 85 for (int i = 0, len = inlines.size(); i < len; i++) { 87 bUnresolvedAreasPresent |= ((InlineArea)inlines.get(i)) 88 .applyVariationFactor(variationFactor, lineStretch, lineShrink); 89 } 90 return bUnresolvedAreasPresent; 91 } 92 } 93 94 | Popular Tags |