aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop
diff options
context:
space:
mode:
authorGlen Mazza <gmazza@apache.org>2004-01-06 00:49:40 +0000
committerGlen Mazza <gmazza@apache.org>2004-01-06 00:49:40 +0000
commit596a99559b12770c03ce9fa6b3ae88091856f021 (patch)
treed72a47138b5091a06b74fc91c5e7f5c6a0c6c2d5 /src/java/org/apache/fop
parent3ec512a82e22dab1b9b844d6f4284bd8072025d0 (diff)
downloadxmlgraphics-fop-596a99559b12770c03ce9fa6b3ae88091856f021.tar.gz
xmlgraphics-fop-596a99559b12770c03ce9fa6b3ae88091856f021.zip
More String->Int conversions.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197143 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop')
-rw-r--r--src/java/org/apache/fop/datatypes/CompoundDatatype.java8
-rw-r--r--src/java/org/apache/fop/datatypes/CondLength.java16
-rw-r--r--src/java/org/apache/fop/datatypes/Keep.java26
-rw-r--r--src/java/org/apache/fop/datatypes/LengthPair.java24
-rw-r--r--src/java/org/apache/fop/datatypes/LengthRange.java28
-rw-r--r--src/java/org/apache/fop/datatypes/Space.java26
6 files changed, 54 insertions, 74 deletions
diff --git a/src/java/org/apache/fop/datatypes/CompoundDatatype.java b/src/java/org/apache/fop/datatypes/CompoundDatatype.java
index 137911497..097b966d4 100644
--- a/src/java/org/apache/fop/datatypes/CompoundDatatype.java
+++ b/src/java/org/apache/fop/datatypes/CompoundDatatype.java
@@ -59,16 +59,16 @@ public interface CompoundDatatype {
/**
* Sets a component of the compound datatype.
- * @param sCmpnName name of the component
+ * @param Constants ID of the component
* @param cmpnValue value of the component
* @param bIsDefault Indicates if it's the default value
*/
- void setComponent(String sCmpnName, Property cmpnValue, boolean bIsDefault);
+ void setComponent(int cmpId, Property cmpnValue, boolean bIsDefault);
/**
* Returns a component of the compound datatype.
- * @param sCmpnName name of the component
+ * @param Constants ID of the component
* @return the value of the component
*/
- Property getComponent(String sCmpnName);
+ Property getComponent(int cmpId);
}
diff --git a/src/java/org/apache/fop/datatypes/CondLength.java b/src/java/org/apache/fop/datatypes/CondLength.java
index 4ae19cdc7..75c37e6f7 100644
--- a/src/java/org/apache/fop/datatypes/CondLength.java
+++ b/src/java/org/apache/fop/datatypes/CondLength.java
@@ -63,24 +63,24 @@ public class CondLength implements CompoundDatatype {
private Property conditionality;
/**
- * @see org.apache.fop.datatypes.CompoundDatatype#setComponent(String, Property, boolean)
+ * @see org.apache.fop.datatypes.CompoundDatatype#setComponent(int, Property, boolean)
*/
- public void setComponent(String sCmpnName, Property cmpnValue,
+ public void setComponent(int cmpId, Property cmpnValue,
boolean bIsDefault) {
- if (sCmpnName.equals("length")) {
+ if (cmpId == Constants.CP_LENGTH) {
length = cmpnValue;
- } else if (sCmpnName.equals("conditionality")) {
+ } else if (cmpId == Constants.CP_CONDITIONALITY) {
conditionality = cmpnValue;
}
}
/**
- * @see org.apache.fop.datatypes.CompoundDatatype#getComponent(String)
+ * @see org.apache.fop.datatypes.CompoundDatatype#getComponent(int)
*/
- public Property getComponent(String sCmpnName) {
- if (sCmpnName.equals("length")) {
+ public Property getComponent(int cmpId) {
+ if (cmpId == Constants.CP_LENGTH) {
return length;
- } else if (sCmpnName.equals("conditionality")) {
+ } else if (cmpId == Constants.CP_CONDITIONALITY) {
return conditionality;
} else {
return null;
diff --git a/src/java/org/apache/fop/datatypes/Keep.java b/src/java/org/apache/fop/datatypes/Keep.java
index 43606c7b9..9089c5d46 100644
--- a/src/java/org/apache/fop/datatypes/Keep.java
+++ b/src/java/org/apache/fop/datatypes/Keep.java
@@ -51,6 +51,7 @@
package org.apache.fop.datatypes;
import org.apache.fop.fo.Property;
+import org.apache.fop.fo.Constants;
/**
* XSL FO Keep Property datatype (keep-together, etc)
@@ -68,33 +69,28 @@ public class Keep implements CompoundDatatype {
/**
- * From CompoundDatatype
- * @param sCmpnName name of compound property to set
- * @param cmpnValue property containing value to be set
- * @param bIsDefault not used (??)
+ * @see org.apache.fop.datatypes.CompoundDatatype#setComponent(int, Property, boolean)
*/
- public void setComponent(String sCmpnName, Property cmpnValue,
+ public void setComponent(int cmpId, Property cmpnValue,
boolean bIsDefault) {
- if (sCmpnName.equals("within-line")) {
+ if (cmpId == Constants.CP_WITHIN_LINE) {
setWithinLine(cmpnValue, bIsDefault);
- } else if (sCmpnName.equals("within-column")) {
+ } else if (cmpId == Constants.CP_WITHIN_COLUMN) {
setWithinColumn(cmpnValue, bIsDefault);
- } else if (sCmpnName.equals("within-page")) {
+ } else if (cmpId == Constants.CP_WITHIN_PAGE) {
setWithinPage(cmpnValue, bIsDefault);
}
}
/**
- * From CompoundDatatype
- * @param sCmpnName compound property name
- * @return property corresponding to compound property string
+ * @see org.apache.fop.datatypes.CompoundDatatype#getComponent(int)
*/
- public Property getComponent(String sCmpnName) {
- if (sCmpnName.equals("within-line")) {
+ public Property getComponent(int cmpId) {
+ if (cmpId == Constants.CP_WITHIN_LINE) {
return getWithinLine();
- } else if (sCmpnName.equals("within-column")) {
+ } else if (cmpId == Constants.CP_WITHIN_COLUMN) {
return getWithinColumn();
- } else if (sCmpnName.equals("within-page")) {
+ } else if (cmpId == Constants.CP_WITHIN_PAGE) {
return getWithinPage();
} else {
return null;
diff --git a/src/java/org/apache/fop/datatypes/LengthPair.java b/src/java/org/apache/fop/datatypes/LengthPair.java
index c16941c72..21863d2a1 100644
--- a/src/java/org/apache/fop/datatypes/LengthPair.java
+++ b/src/java/org/apache/fop/datatypes/LengthPair.java
@@ -51,6 +51,7 @@
package org.apache.fop.datatypes;
import org.apache.fop.fo.Property;
+import org.apache.fop.fo.Constants;
/**
* Models a pair of lengths, one specifiying the dimensions for the
@@ -63,31 +64,24 @@ public class LengthPair implements CompoundDatatype {
private Property bpd;
/**
- * From CompoundDatatype
- * @param sCmpnName component name ("block-progression-direction" or
- * "inline-progression-direction") which is being set
- * @param cmpnValue Property containing the value to be set
- * @param bIsDefault true if this is the default property (??)
+ * @see org.apache.fop.datatypes.CompoundDatatype#setComponent(int, Property, boolean)
*/
- public void setComponent(String sCmpnName, Property cmpnValue,
+ public void setComponent(int cmpId, Property cmpnValue,
boolean bIsDefault) {
- if (sCmpnName.equals("block-progression-direction")) {
+ if (cmpId == Constants.CP_BLOCK_PROGRESSION_DIRECTION) {
bpd = cmpnValue;
- } else if (sCmpnName.equals("inline-progression-direction")) {
+ } else if (cmpId == Constants.CP_INLINE_PROGRESSION_DIRECTION) {
ipd = cmpnValue;
}
}
/**
- * From CompoundDatatype
- * @param sCmpnName component name ("block-progression-direction" or
- * "inline-progression-direction") for which the length is sought
- * @return Property containing the length sought
+ * @see org.apache.fop.datatypes.CompoundDatatype#getComponent(int)
*/
- public Property getComponent(String sCmpnName) {
- if (sCmpnName.equals("block-progression-direction")) {
+ public Property getComponent(int cmpId) {
+ if (cmpId == Constants.CP_BLOCK_PROGRESSION_DIRECTION) {
return getBPD();
- } else if (sCmpnName.equals("inline-progression-direction")) {
+ } else if (cmpId == Constants.CP_INLINE_PROGRESSION_DIRECTION) {
return getIPD();
} else {
return null; // SHOULDN'T HAPPEN
diff --git a/src/java/org/apache/fop/datatypes/LengthRange.java b/src/java/org/apache/fop/datatypes/LengthRange.java
index 1fca6f28e..139fc5326 100644
--- a/src/java/org/apache/fop/datatypes/LengthRange.java
+++ b/src/java/org/apache/fop/datatypes/LengthRange.java
@@ -51,6 +51,7 @@
package org.apache.fop.datatypes;
import org.apache.fop.fo.Property;
+import org.apache.fop.fo.Constants;
/**
* A "progression-dimension" quantity.
@@ -69,35 +70,28 @@ public class LengthRange implements CompoundDatatype {
private boolean bChecked = false;
/**
- * From CompoundDatatype
- * @param sCmpnName component name ("minimum", "maximum", or "optimum")
- * which is being set
- * @param cmpnValue Property object to be set
- * @param bIsDefault true of this is the default value (??)
+ * @see org.apache.fop.datatypes.CompoundDatatype#setComponent(int, Property, boolean)
*/
- public void setComponent(String sCmpnName, Property cmpnValue,
+ public void setComponent(int cmpId, Property cmpnValue,
boolean bIsDefault) {
- if (sCmpnName.equals("minimum")) {
+ if (cmpId == Constants.CP_MINIMUM) {
setMinimum(cmpnValue, bIsDefault);
- } else if (sCmpnName.equals("optimum")) {
+ } else if (cmpId == Constants.CP_OPTIMUM) {
setOptimum(cmpnValue, bIsDefault);
- } else if (sCmpnName.equals("maximum")) {
+ } else if (cmpId == Constants.CP_MAXIMUM) {
setMaximum(cmpnValue, bIsDefault);
}
}
/**
- * From CompoundDatatype
- * @param sCmpnName component name ("minimum", "maximum", or "optimum")
- * for which the length is sought
- * @return the requested Property, or null if the component name is invalid
+ * @see org.apache.fop.datatypes.CompoundDatatype#getComponent(int)
*/
- public Property getComponent(String sCmpnName) {
- if (sCmpnName.equals("minimum")) {
+ public Property getComponent(int cmpId) {
+ if (cmpId == Constants.CP_MINIMUM) {
return getMinimum();
- } else if (sCmpnName.equals("optimum")) {
+ } else if (cmpId == Constants.CP_OPTIMUM) {
return getOptimum();
- } else if (sCmpnName.equals("maximum")) {
+ } else if (cmpId == Constants.CP_MAXIMUM) {
return getMaximum();
} else {
return null; // SHOULDN'T HAPPEN
diff --git a/src/java/org/apache/fop/datatypes/Space.java b/src/java/org/apache/fop/datatypes/Space.java
index b3469c513..c4879f7d4 100644
--- a/src/java/org/apache/fop/datatypes/Space.java
+++ b/src/java/org/apache/fop/datatypes/Space.java
@@ -51,6 +51,7 @@
package org.apache.fop.datatypes;
import org.apache.fop.fo.Property;
+import org.apache.fop.fo.Constants;
/**
* a space quantity in XSL (space-before, space-after)
@@ -61,34 +62,29 @@ public class Space extends LengthRange {
private Property conditionality;
/**
- * From CompoundDatatype
- * @param sCmpnName name of component
- * @param cmpnValue Property object for the component
- * @param bIsDefault true if this is the default (??)
+ * @see org.apache.fop.datatypes.CompoundDatatype#setComponent(int, Property, boolean)
*/
- public void setComponent(String sCmpnName, Property cmpnValue,
+ public void setComponent(int cmpId, Property cmpnValue,
boolean bIsDefault) {
- if (sCmpnName.equals("precedence")) {
+ if (cmpId == Constants.CP_PRECEDENCE) {
setPrecedence(cmpnValue, bIsDefault);
- } else if (sCmpnName.equals("conditionality")) {
+ } else if (cmpId == Constants.CP_CONDITIONALITY) {
setConditionality(cmpnValue, bIsDefault);
} else {
- super.setComponent(sCmpnName, cmpnValue, bIsDefault);
+ super.setComponent(cmpId, cmpnValue, bIsDefault);
}
}
/**
- * From CompoundDatatype
- * @param sCmpnName name of component
- * @return Property matching the component name
+ * @see org.apache.fop.datatypes.CompoundDatatype#getComponent(int)
*/
- public Property getComponent(String sCmpnName) {
- if (sCmpnName.equals("precedence")) {
+ public Property getComponent(int cmpId) {
+ if (cmpId == Constants.CP_PRECEDENCE) {
return getPrecedence();
- } else if (sCmpnName.equals("conditionality")) {
+ } else if (cmpId == Constants.CP_CONDITIONALITY) {
return getConditionality();
} else {
- return super.getComponent(sCmpnName);
+ return super.getComponent(cmpId);
}
}