1 17 18 19 20 package org.apache.fop.fo.properties; 21 22 import java.util.List ; 23 import org.apache.fop.fo.Constants; 24 import org.apache.fop.fo.PropertyList; 25 import org.apache.fop.fo.expr.PropertyException; 26 27 30 31 public class BackgroundPositionShorthandParser extends GenericShorthandParser { 32 33 36 public Property getValueForProperty(int propId, 37 Property property, 38 PropertyMaker maker, 39 PropertyList propertyList) 40 throws PropertyException { 41 42 int index = -1; 43 List propList = property.getList(); 44 if (propId == Constants.PR_BACKGROUND_POSITION_HORIZONTAL) { 45 index = 0; 46 } else if (propId == Constants.PR_BACKGROUND_POSITION_VERTICAL) { 47 index = 1; 48 if (propList.size() == 1) { 49 53 return maker.make(propertyList, "50%", propertyList.getParentFObj()); 54 } 55 } 56 if (index >= 0) { 57 return (Property) propList.get(index); 58 } return null; 60 } 61 } 62 | Popular Tags |