1 51 package org.apache.fop.fo.expr; 52 53 import java.util.Stack ; 54 55 import org.apache.fop.fo.Property; 56 import org.apache.fop.fo.PropertyList; 57 import org.apache.fop.fo.FObj; 58 import org.apache.fop.datatypes.PercentBase; 59 60 61 67 public class PropertyInfo { 68 private Property.Maker maker; 69 private PropertyList plist; 70 private FObj fo; 71 private Stack stkFunction; 73 public PropertyInfo(Property.Maker maker, PropertyList plist, FObj fo) { 74 this.maker = maker; 75 this.plist = plist; 76 this.fo = fo; 77 } 78 79 85 public boolean inheritsSpecified() { 86 return maker.inheritsSpecified(); 87 } 88 89 95 public PercentBase getPercentBase() { 96 PercentBase pcbase = getFunctionPercentBase(); 97 return (pcbase != null) ? pcbase : maker.getPercentBase(fo, plist); 98 } 99 100 103 public int currentFontSize() { 104 return plist.get("font-size").getLength().mvalue(); 105 } 106 107 public FObj getFO() { 108 return fo; 109 } 110 111 public PropertyList getPropertyList() { 112 return plist; 113 } 114 115 public void pushFunction(Function func) { 116 if (stkFunction == null) { 117 stkFunction = new Stack (); 118 } 119 stkFunction.push(func); 120 } 121 122 public void popFunction() { 123 if (stkFunction != null) 124 stkFunction.pop(); 125 } 126 127 private PercentBase getFunctionPercentBase() { 128 if (stkFunction != null) { 129 Function f = (Function)stkFunction.peek(); 130 if (f != null) { 131 return f.getPercentBase(); 132 } 133 } 134 return null; 135 } 136 137 } 138 | Popular Tags |