1 17 18 19 20 package org.apache.fop.area.inline; 21 22 import java.util.List ; 23 import java.util.ListIterator ; 24 import java.util.ArrayList ; 25 import java.util.Iterator ; 26 27 36 public class FilledArea extends InlineParent { 37 private int unitWidth; 38 39 42 public FilledArea() { 43 } 44 45 51 56 57 private void setChildOffset(ListIterator childrenIterator, int v) { 58 while (childrenIterator.hasNext()) { 59 InlineArea child = (InlineArea) childrenIterator.next(); 60 if (child instanceof InlineParent) { 61 setChildOffset(((InlineParent) child).getChildAreas().listIterator(), v); 62 } else if (child instanceof org.apache.fop.area.inline.Viewport) { 63 } else { 65 child.setOffset(v); 66 } 67 } 68 } 69 70 75 public void setUnitWidth(int w) { 76 unitWidth = w; 77 } 78 79 84 public int getUnitWidth() { 85 return unitWidth; 86 } 87 88 91 public int getBPD() { 92 int bpd = 0; 93 for (Iterator childAreaIt = getChildAreas().iterator(); childAreaIt.hasNext();) { 94 InlineArea area = (InlineArea)childAreaIt.next(); 95 if (bpd < area.getBPD()) { 96 bpd = area.getBPD(); 97 } 98 } 99 return bpd; 100 } 101 102 110 public List getChildAreas() { 111 int units = (int)(getIPD() / unitWidth); 112 List newList = new ArrayList (); 113 for (int count = 0; count < units; count++) { 114 newList.addAll(inlines); 115 } 116 return newList; 117 } 118 119 126 public boolean applyVariationFactor(double variationFactor, 127 int lineStretch, int lineShrink) { 128 setIPD(getIPD() + adjustingInfo.applyVariationFactor(variationFactor)); 129 return false; 130 } 131 } 132 133 | Popular Tags |