]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Constants simplifications in LengthRange and Space.java.
authorGlen Mazza <gmazza@apache.org>
Wed, 7 Jan 2004 21:28:42 +0000 (21:28 +0000)
committerGlen Mazza <gmazza@apache.org>
Wed, 7 Jan 2004 21:28:42 +0000 (21:28 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197145 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/datatypes/LengthRange.java
src/java/org/apache/fop/datatypes/Space.java

index 139fc5326fa65c12a9714ad8dcf1d12becfc73b4..52e224788d1790ac6887b413e00a334ce023e4b6 100644 (file)
@@ -51,7 +51,6 @@
 package org.apache.fop.datatypes;
 
 import org.apache.fop.fo.Property;
-import org.apache.fop.fo.Constants;
 
 /**
  * A "progression-dimension" quantity.
@@ -74,11 +73,11 @@ public class LengthRange implements CompoundDatatype {
      */
     public void setComponent(int cmpId, Property cmpnValue,
                              boolean bIsDefault) {
-        if (cmpId == Constants.CP_MINIMUM) {
+        if (cmpId == CP_MINIMUM) {
             setMinimum(cmpnValue, bIsDefault);
-        } else if (cmpId == Constants.CP_OPTIMUM) {
+        } else if (cmpId == CP_OPTIMUM) {
             setOptimum(cmpnValue, bIsDefault);
-        } else if (cmpId == Constants.CP_MAXIMUM) {
+        } else if (cmpId == CP_MAXIMUM) {
             setMaximum(cmpnValue, bIsDefault);
         }
     }
@@ -87,11 +86,11 @@ public class LengthRange implements CompoundDatatype {
      * @see org.apache.fop.datatypes.CompoundDatatype#getComponent(int)
      */
     public Property getComponent(int cmpId) {
-        if (cmpId == Constants.CP_MINIMUM) {
+        if (cmpId == CP_MINIMUM) {
             return getMinimum();
-        } else if (cmpId == Constants.CP_OPTIMUM) {
+        } else if (cmpId == CP_OPTIMUM) {
             return getOptimum();
-        } else if (cmpId == Constants.CP_MAXIMUM) {
+        } else if (cmpId == CP_MAXIMUM) {
             return getMaximum();
         } else {
             return null;    // SHOULDN'T HAPPEN
index c4879f7d4829a7e6caab3f2072152f9b9e7fca4f..b7421cafdc3714eb3d70b5a8b300bc1c33be35b6 100644 (file)
@@ -51,7 +51,6 @@
 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)
@@ -66,9 +65,9 @@ public class Space extends LengthRange {
      */
     public void setComponent(int cmpId, Property cmpnValue,
                              boolean bIsDefault) {
-        if (cmpId == Constants.CP_PRECEDENCE) {
+        if (cmpId == CP_PRECEDENCE) {
             setPrecedence(cmpnValue, bIsDefault);
-        } else if (cmpId == Constants.CP_CONDITIONALITY) {
+        } else if (cmpId == CP_CONDITIONALITY) {
             setConditionality(cmpnValue, bIsDefault);
         } else {
             super.setComponent(cmpId, cmpnValue, bIsDefault);
@@ -79,9 +78,9 @@ public class Space extends LengthRange {
      * @see org.apache.fop.datatypes.CompoundDatatype#getComponent(int)
      */
     public Property getComponent(int cmpId) {
-        if (cmpId == Constants.CP_PRECEDENCE) {
+        if (cmpId == CP_PRECEDENCE) {
             return getPrecedence();
-        } else if (cmpId == Constants.CP_CONDITIONALITY) {
+        } else if (cmpId == CP_CONDITIONALITY) {
             return getConditionality();
         } else {
             return super.getComponent(cmpId);