1 17 18 19 20 package org.apache.fop.fo.properties; 21 22 import org.apache.fop.fo.Constants; 23 import org.apache.fop.fo.PropertyList; 24 import org.apache.fop.fo.expr.PropertyException; 25 26 30 public class PageBreakShorthandParser implements ShorthandParser { 31 32 35 public Property getValueForProperty(int propId, 36 Property property, 37 PropertyMaker maker, 38 PropertyList propertyList) 39 throws PropertyException { 40 41 if (propId == Constants.PR_KEEP_WITH_PREVIOUS 42 || propId == Constants.PR_KEEP_WITH_NEXT 43 || propId == Constants.PR_KEEP_TOGETHER) { 44 if (property.getEnum() == Constants.EN_AVOID) { 45 return maker.make(null, Constants.CP_WITHIN_PAGE, 46 propertyList, "always", propertyList.getFObj()); 47 } 48 } else if (propId == Constants.PR_BREAK_BEFORE 49 || propId == Constants.PR_BREAK_AFTER) { 50 switch (property.getEnum()) { 51 case Constants.EN_ALWAYS: 52 return EnumProperty.getInstance(Constants.EN_PAGE, "PAGE"); 53 case Constants.EN_LEFT: 54 return EnumProperty.getInstance(Constants.EN_EVEN_PAGE, "EVEN_PAGE"); 55 case Constants.EN_RIGHT: 56 return EnumProperty.getInstance(Constants.EN_ODD_PAGE, "ODD_PAGE"); 57 case Constants.EN_AVOID: 58 default: 59 } 61 } 62 return null; 63 } 64 65 } 66 | Popular Tags |