1 51 package org.apache.fop.fo; 52 53 public class BoxPropShorthandParser extends GenericShorthandParser { 54 55 public BoxPropShorthandParser(ListProperty listprop) { 56 super(listprop); 57 } 58 59 protected Property convertValueForProperty(String propName, 63 Property.Maker maker, 64 PropertyList propertyList) { 65 Property p = null; 66 if (propName.indexOf("-top") >= 0) { 67 p = getElement(0); 68 } else if (propName.indexOf("-right") >= 0) { 69 p = getElement(count() > 1 ? 1 : 0); 70 } else if (propName.indexOf("-bottom") >= 0) { 71 p = getElement(count() > 2 ? 2 : 0); 72 } else if (propName.indexOf("-left") >= 0) { 73 p = getElement(count() > 3 ? 3 : (count() > 1 ? 1 : 0)); 74 } 75 if (p != null) { 77 return maker.convertShorthandProperty(propertyList, p, null); 78 } 79 return p; 80 } 81 82 } 83 | Popular Tags |