1 17 18 19 20 package org.apache.fop.fo.properties; 21 22 import org.apache.fop.fo.PropertyList; 23 import org.apache.fop.fo.expr.PropertyException; 24 import org.apache.fop.fo.properties.NumberProperty.Maker; 25 26 29 public class ReferenceOrientationMaker extends Maker { 30 31 36 public ReferenceOrientationMaker(int propId) { 37 super(propId); 38 } 39 40 45 public Property get(int subpropId, PropertyList propertyList, 46 boolean tryInherit, boolean tryDefault) 47 throws PropertyException { 48 49 Property p = super.get(0, propertyList, tryInherit, tryDefault); 50 int ro = 0; 51 if (p != null) { 52 ro = p.getNumeric().getValue(); 53 } 54 if ((Math.abs(ro) % 90) == 0 && (Math.abs(ro) / 90) <= 3) { 55 return p; 56 } else { 57 throw new PropertyException("Illegal property value: " 58 + "reference-orientation=\"" + ro + "\" " 59 + "on " + propertyList.getFObj().getName()); 60 } 61 } 62 63 } 64 | Popular Tags |