You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by gm...@apache.org on 2004/01/07 22:10:39 UTC
cvs commit: xml-fop/src/java/org/apache/fop/fo Property.java PropertyList.java
gmazza 2004/01/07 13:10:39
Modified: src/codegen properties.xsl
src/java/org/apache/fop/datatypes CompoundDatatype.java
CondLength.java Keep.java LengthPair.java
src/java/org/apache/fop/fo Property.java PropertyList.java
Log:
Last of string->int conversions (more structural improvements still can be
done in PropertyList from Finn's patch, however). Made Constants values
inherent to CompoundDatatype class.
Revision Changes Path
1.28 +2 -3 xml-fop/src/codegen/properties.xsl
Index: properties.xsl
===================================================================
RCS file: /home/cvs/xml-fop/src/codegen/properties.xsl,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- properties.xsl 6 Jan 2004 00:49:40 -0000 1.27
+++ properties.xsl 7 Jan 2004 21:10:36 -0000 1.28
@@ -576,8 +576,7 @@
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>
1.3 +2 -1 xml-fop/src/java/org/apache/fop/datatypes/CompoundDatatype.java
Index: CompoundDatatype.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/datatypes/CompoundDatatype.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- CompoundDatatype.java 6 Jan 2004 00:49:40 -0000 1.2
+++ CompoundDatatype.java 7 Jan 2004 21:10:36 -0000 1.3
@@ -51,11 +51,12 @@
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.
1.5 +4 -4 xml-fop/src/java/org/apache/fop/datatypes/CondLength.java
Index: CondLength.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/datatypes/CondLength.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- CondLength.java 6 Jan 2004 00:49:40 -0000 1.4
+++ CondLength.java 7 Jan 2004 21:10:36 -0000 1.5
@@ -67,9 +67,9 @@
*/
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;
}
}
@@ -78,9 +78,9 @@
* @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;
1.6 +6 -6 xml-fop/src/java/org/apache/fop/datatypes/Keep.java
Index: Keep.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/datatypes/Keep.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Keep.java 6 Jan 2004 00:49:40 -0000 1.5
+++ Keep.java 7 Jan 2004 21:10:36 -0000 1.6
@@ -73,11 +73,11 @@
*/
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);
}
}
@@ -86,11 +86,11 @@
* @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;
1.5 +4 -4 xml-fop/src/java/org/apache/fop/datatypes/LengthPair.java
Index: LengthPair.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/datatypes/LengthPair.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- LengthPair.java 6 Jan 2004 00:49:40 -0000 1.4
+++ LengthPair.java 7 Jan 2004 21:10:37 -0000 1.5
@@ -68,9 +68,9 @@
*/
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;
}
}
@@ -79,9 +79,9 @@
* @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
1.11 +2 -2 xml-fop/src/java/org/apache/fop/fo/Property.java
Index: Property.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/Property.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- Property.java 5 Jan 2004 22:13:19 -0000 1.10
+++ Property.java 7 Jan 2004 21:10:38 -0000 1.11
@@ -155,7 +155,7 @@
* 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,
@@ -165,7 +165,7 @@
* compound properties.
* @return the Property containing the subproperty
*/
- public Property getSubpropValue(Property p, String subprop) {
+ public Property getSubpropValue(Property p, int subpropId) {
return null;
}
1.22 +3 -6 xml-fop/src/java/org/apache/fop/fo/PropertyList.java
Index: PropertyList.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/PropertyList.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- PropertyList.java 5 Jan 2004 22:02:47 -0000 1.21
+++ PropertyList.java 7 Jan 2004 21:10:38 -0000 1.22
@@ -521,8 +521,8 @@
/* 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;
@@ -588,13 +588,10 @@
*/
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;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org