1 17 18 19 20 package org.apache.fop.datatypes; 21 22 import org.apache.fop.fo.FObj; 23 24 27 public class SimplePercentBaseContext implements PercentBaseContext { 28 29 private PercentBaseContext parentContext; 30 private int lengthBase; 31 private int lengthBaseValue; 32 33 39 public SimplePercentBaseContext(PercentBaseContext parentContext, 40 int lengthBase, 41 int lengthBaseValue) { 42 this.parentContext = parentContext; 43 this.lengthBase = lengthBase; 44 this.lengthBaseValue = lengthBaseValue; 45 } 46 47 51 public int getBaseLength(int lengthBase, FObj fobj) { 52 if (lengthBase == this.lengthBase) { 54 return lengthBaseValue; 55 } else if (parentContext != null) { 56 return parentContext.getBaseLength(lengthBase, fobj); 57 } 58 return -1; 59 } 60 61 } 62 | Popular Tags |