return baseProp;
}
- public Property getSubpropValue(Property baseProp, String subpropName) {
- int subpropId = org.apache.fop.fo.properties.FOPropertyMapping.getSubPropertyId(subpropName);
+ public Property getSubpropValue(Property baseProp, int subpropId) {
</xsl:text>
<xsl:value-of select="datatype"/>
<xsl:text> val = baseProp.get</xsl:text>
package org.apache.fop.datatypes;
import org.apache.fop.fo.Property;
+import org.apache.fop.fo.Constants;
/**
* This interface is used as a base for compound datatypes.
*/
-public interface CompoundDatatype {
+public interface CompoundDatatype extends Constants {
/**
* Sets a component of the compound datatype.
*/
public void setComponent(int cmpId, Property cmpnValue,
boolean bIsDefault) {
- if (cmpId == Constants.CP_LENGTH) {
+ if (cmpId == CP_LENGTH) {
length = cmpnValue;
- } else if (cmpId == Constants.CP_CONDITIONALITY) {
+ } else if (cmpId == CP_CONDITIONALITY) {
conditionality = cmpnValue;
}
}
* @see org.apache.fop.datatypes.CompoundDatatype#getComponent(int)
*/
public Property getComponent(int cmpId) {
- if (cmpId == Constants.CP_LENGTH) {
+ if (cmpId == CP_LENGTH) {
return length;
- } else if (cmpId == Constants.CP_CONDITIONALITY) {
+ } else if (cmpId == CP_CONDITIONALITY) {
return conditionality;
} else {
return null;
*/
public void setComponent(int cmpId, Property cmpnValue,
boolean bIsDefault) {
- if (cmpId == Constants.CP_WITHIN_LINE) {
+ if (cmpId == CP_WITHIN_LINE) {
setWithinLine(cmpnValue, bIsDefault);
- } else if (cmpId == Constants.CP_WITHIN_COLUMN) {
+ } else if (cmpId == CP_WITHIN_COLUMN) {
setWithinColumn(cmpnValue, bIsDefault);
- } else if (cmpId == Constants.CP_WITHIN_PAGE) {
+ } else if (cmpId == CP_WITHIN_PAGE) {
setWithinPage(cmpnValue, bIsDefault);
}
}
* @see org.apache.fop.datatypes.CompoundDatatype#getComponent(int)
*/
public Property getComponent(int cmpId) {
- if (cmpId == Constants.CP_WITHIN_LINE) {
+ if (cmpId == CP_WITHIN_LINE) {
return getWithinLine();
- } else if (cmpId == Constants.CP_WITHIN_COLUMN) {
+ } else if (cmpId == CP_WITHIN_COLUMN) {
return getWithinColumn();
- } else if (cmpId == Constants.CP_WITHIN_PAGE) {
+ } else if (cmpId == CP_WITHIN_PAGE) {
return getWithinPage();
} else {
return null;
*/
public void setComponent(int cmpId, Property cmpnValue,
boolean bIsDefault) {
- if (cmpId == Constants.CP_BLOCK_PROGRESSION_DIRECTION) {
+ if (cmpId == CP_BLOCK_PROGRESSION_DIRECTION) {
bpd = cmpnValue;
- } else if (cmpId == Constants.CP_INLINE_PROGRESSION_DIRECTION) {
+ } else if (cmpId == CP_INLINE_PROGRESSION_DIRECTION) {
ipd = cmpnValue;
}
}
* @see org.apache.fop.datatypes.CompoundDatatype#getComponent(int)
*/
public Property getComponent(int cmpId) {
- if (cmpId == Constants.CP_BLOCK_PROGRESSION_DIRECTION) {
+ if (cmpId == CP_BLOCK_PROGRESSION_DIRECTION) {
return getBPD();
- } else if (cmpId == Constants.CP_INLINE_PROGRESSION_DIRECTION) {
+ } else if (cmpId == CP_INLINE_PROGRESSION_DIRECTION) {
return getIPD();
} else {
return null; // SHOULDN'T HAPPEN
* property.
* @param p A property value for a compound property type such as
* SpaceProperty.
- * @param subprop The name of the component whose value is to be
+ * @param subprop The Constants ID of the component whose value is to be
* returned.
* NOTE: this is only to ease porting when calls are made to
* PropertyList.get() using a component name of a compound property,
* compound properties.
* @return the Property containing the subproperty
*/
- public Property getSubpropValue(Property p, String subprop) {
+ public Property getSubpropValue(Property p, int subpropId) {
return null;
}
/* If the baseProperty has already been created, return it
* e.g. <fo:leader xxxx="120pt" xxxx.maximum="200pt"... />
*/
- int propId = FOPropertyMapping.getPropertyId(basePropName);
- Property baseProperty = getExplicitBaseProp(propId);
+
+ Property baseProperty = (Property) super.get(basePropName);
if (baseProperty != null) {
return baseProperty;
*/
private Property getSubpropValue(Property p, int propId) {
- String subpropName = FOPropertyMapping.getPropertyName(propId &
- Constants.COMPOUND_MASK);
-
Property.Maker maker = findMaker(propId & Constants.PROPERTY_MASK);
if (maker != null) {
- return maker.getSubpropValue(p, subpropName);
+ return maker.getSubpropValue(p, propId & Constants.COMPOUND_MASK);
} else {
return null;
}