1 17 18 19 20 package org.apache.fop.fo.pagination; 21 22 import java.awt.Rectangle ; 24 25 import org.apache.fop.apps.FOPException; 26 import org.apache.fop.datatypes.PercentBaseContext; 27 import org.apache.fop.fo.FONode; 28 import org.apache.fop.fo.PropertyList; 29 30 33 public abstract class RegionBA extends SideRegion { 34 private int precedence; 36 38 41 protected RegionBA(FONode parent) { 42 super(parent); 43 } 44 45 48 public void bind(PropertyList pList) throws FOPException { 49 super.bind(pList); 50 precedence = pList.get(PR_PRECEDENCE).getEnum(); 51 } 52 53 56 public int getPrecedence() { 57 return precedence; 58 } 59 60 70 protected void adjustIPD(Rectangle vpRefRect, int wm, PercentBaseContext siblingContext) { 71 int offset = 0; 72 RegionStart start = (RegionStart) getSiblingRegion(FO_REGION_START); 73 if (start != null) { 74 offset = start.getExtent().getValue(siblingContext); 75 vpRefRect.translate(offset, 0); } 77 RegionEnd end = (RegionEnd) getSiblingRegion(FO_REGION_END); 78 if (end != null) { 79 offset += end.getExtent().getValue(siblingContext); 80 } 81 if (offset > 0) { 82 if (wm == EN_LR_TB || wm == EN_RL_TB) { 83 vpRefRect.width -= offset; 84 } else { 85 vpRefRect.height -= offset; 86 } 87 } 88 } 89 } 90 91 | Popular Tags |