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 32 public class DimensionPropertyMaker extends CorrespondingPropertyMaker { 33 int[][] extraCorresponding = null; 34 35 public DimensionPropertyMaker(PropertyMaker baseMaker) { 36 super(baseMaker); 37 } 38 39 public void setExtraCorresponding(int[][] extraCorresponding) { 40 this.extraCorresponding = extraCorresponding; 41 } 42 43 public boolean isCorrespondingForced(PropertyList propertyList) { 44 if (super.isCorrespondingForced(propertyList)) 45 return true; 46 for (int i = 0; i < extraCorresponding.length; i++) { 47 int wmcorr = extraCorresponding[i][0]; if (propertyList.getExplicit(wmcorr) != null) 49 return true; 50 } 51 return false; 52 } 53 54 public Property compute(PropertyList propertyList) throws PropertyException { 55 Property p = super.compute(propertyList); 57 if (p == null) { 58 p = baseMaker.make(propertyList); 59 } 60 61 int wmcorr = propertyList.getWritingMode(extraCorresponding[0][0], 63 extraCorresponding[0][1], 64 extraCorresponding[0][2]); 65 Property subprop = propertyList.getExplicitOrShorthand(wmcorr); 66 if (subprop != null) { 67 baseMaker.setSubprop(p, Constants.CP_MINIMUM, subprop); 68 } 69 70 wmcorr = propertyList.getWritingMode(extraCorresponding[1][0], 72 extraCorresponding[1][1], 73 extraCorresponding[1][2]); 74 subprop = propertyList.getExplicitOrShorthand(wmcorr); 75 if (subprop != null) { 77 baseMaker.setSubprop(p, Constants.CP_MAXIMUM, subprop); 78 } 79 80 return p; 81 } 82 } 83 | Popular Tags |