[FOray-commit] SF.net SVN: foray: [7408] trunk/foray/foray-fotree/src/java/org/foray/fotree
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2006-06-06 02:57:16
|
Revision: 7408 Author: victormote Date: 2006-06-05 09:34:08 -0700 (Mon, 05 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7408&view=rev Log Message: ----------- Consolidate the location of the DIMENSION_AUTO constant. Modified Paths: -------------- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObjScaled.java trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ExternalGraphic.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteDimension.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Dimension.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/RelativeDimension.java Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObjScaled.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObjScaled.java 2006-06-05 16:28:17 UTC (rev 7407) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObjScaled.java 2006-06-05 16:34:08 UTC (rev 7408) @@ -25,7 +25,6 @@ package org.foray.fotree; import org.foray.fotree.fo.prop.ContentDimension; -import org.foray.fotree.fo.prop.Dimension; import org.axsl.common.Constants; import org.axsl.foR.FOTreeException; @@ -115,7 +114,7 @@ * "Constraints", first paragraph, for explanation of logic. */ int viewportIPD = this.traitIPDimensionOpt(parentAreaCR_IPD); - if (viewportIPD == Dimension.DIMENSION_AUTO) { + if (viewportIPD == Constants.DIMENSION_AUTO) { viewportIPD = traitContentWidth(parentAreaCR_IPD, parentAreaCR_BPD); } return viewportIPD; @@ -134,7 +133,7 @@ * "Constraints", first paragraph, for explanation of logic. */ int viewportBPD = this.traitBPDimensionOpt(parentAreaCR_BPD); - if (viewportBPD == Dimension.DIMENSION_AUTO) { + if (viewportBPD == Constants.DIMENSION_AUTO) { viewportBPD = traitContentHeight(parentAreaCR_IPD, parentAreaCR_BPD); } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2006-06-05 16:28:17 UTC (rev 7407) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2006-06-05 16:34:08 UTC (rev 7408) @@ -57,7 +57,6 @@ import org.foray.fotree.fo.prop.Country; import org.foray.fotree.fo.prop.Cue; import org.foray.fotree.fo.prop.DestinationPlacementOffset; -import org.foray.fotree.fo.prop.Dimension; import org.foray.fotree.fo.prop.DisplayAlign; import org.foray.fotree.fo.prop.DominantBaseline; import org.foray.fotree.fo.prop.Elevation; @@ -1512,7 +1511,7 @@ * corresponding dimension of the closest area ancestor that was generated * by a block-level formatting object." Used only when the * relative dimension is expressed as a percentage. - * @return The computed value, or {@link Dimension#DIMENSION_AUTO} for + * @return The computed value, or {@link Constants#DIMENSION_AUTO} for * "auto". */ private int getRelativeDimension(byte relativeAxis, int subProperty, Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ExternalGraphic.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ExternalGraphic.java 2006-06-05 16:28:17 UTC (rev 7407) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ExternalGraphic.java 2006-06-05 16:34:08 UTC (rev 7408) @@ -29,8 +29,8 @@ import org.foray.fotree.FObjScaled; import org.foray.fotree.Namespace; import org.foray.fotree.PropertyList; -import org.foray.fotree.fo.prop.Dimension; +import org.axsl.common.Constants; import org.axsl.foR.FOTreeException; import org.axsl.graphicR.Graphic; import org.axsl.graphicR.GraphicException; @@ -111,7 +111,7 @@ */ protected int intrinsicContentWidth() { if (getGraphic() == null) { - return Dimension.DIMENSION_AUTO; + return Constants.DIMENSION_AUTO; } try { if (getGraphic().absoluteWidth(pixelsPerInch) > 0) { @@ -121,7 +121,7 @@ * 1.0, Section 6.6.5, where this formula is suggested. */ return pixelsToMillipoints(getGraphic().pixelWidth(), 96); } catch (GraphicException e) { - return Dimension.DIMENSION_AUTO; + return Constants.DIMENSION_AUTO; } } @@ -130,7 +130,7 @@ */ protected int intrinsicContentHeight() { if (getGraphic() == null) { - return Dimension.DIMENSION_AUTO; + return Constants.DIMENSION_AUTO; } try { if (getGraphic().absoluteHeight(pixelsPerInch) > 0) { @@ -140,7 +140,7 @@ * 1.0, Section 6.6.5, where this formula is suggested. */ return pixelsToMillipoints(getGraphic().pixelHeight(), 96); } catch (GraphicException e) { - return Dimension.DIMENSION_AUTO; + return Constants.DIMENSION_AUTO; } } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteDimension.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteDimension.java 2006-06-05 16:28:17 UTC (rev 7407) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteDimension.java 2006-06-05 16:34:08 UTC (rev 7408) @@ -95,7 +95,7 @@ short keyword = kw.getValue(); switch (keyword) { case Constants.FOVAL_AUTO: { - return DIMENSION_AUTO; + return Constants.DIMENSION_AUTO; } case Constants.FOVAL_INHERIT: { switch (getPropertyType()) { @@ -133,11 +133,11 @@ switch (getPropertyType()) { case Constants.FOPROP_HEIGHT: case Constants.FOPROP_WIDTH: { - return DIMENSION_AUTO; + return Constants.DIMENSION_AUTO; } case Constants.FOPROP_MAX_HEIGHT: case Constants.FOPROP_MAX_WIDTH: { - return DIMENSION_AUTO; + return Constants.DIMENSION_AUTO; } case Constants.FOPROP_MIN_HEIGHT: case Constants.FOPROP_MIN_WIDTH: { Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Dimension.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Dimension.java 2006-06-05 16:28:17 UTC (rev 7407) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Dimension.java 2006-06-05 16:34:08 UTC (rev 7408) @@ -35,9 +35,6 @@ */ public abstract class Dimension extends Property { - /** Negative values for Dimensions are invalid, so -1 indicates AUTO. */ - public static final byte DIMENSION_AUTO = -1; - public Dimension(PropertyList propertyList, short enumeration) throws PropertyException { super(propertyList, enumeration); Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/RelativeDimension.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/RelativeDimension.java 2006-06-05 16:28:17 UTC (rev 7407) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/RelativeDimension.java 2006-06-05 16:34:08 UTC (rev 7408) @@ -92,11 +92,11 @@ break; } default: { - return DIMENSION_AUTO; + return Constants.DIMENSION_AUTO; } } if (length == null) { - return DIMENSION_AUTO; + return Constants.DIMENSION_AUTO; } return length.getValue(fobj.traitFontSize(), 0); } @@ -106,7 +106,7 @@ } if (this.value instanceof DtPercentage) { if (parentAreaCR_Dimension < 0) { - return DIMENSION_AUTO; + return Constants.DIMENSION_AUTO; } DtPercentage percentage = (DtPercentage) this.value; return Math.round(percentage.getValue() * parentAreaCR_Dimension); @@ -114,7 +114,7 @@ if (this.value instanceof PropertyKeyword) { PropertyKeyword kw = (PropertyKeyword) this.value; if (kw.getValue() == Constants.FOVAL_AUTO) { - return DIMENSION_AUTO; + return Constants.DIMENSION_AUTO; } if (kw.getValue() == Constants.FOVAL_INHERIT) { switch (subProperty) { @@ -141,7 +141,7 @@ } public static int getValueNoInstance() { - return DIMENSION_AUTO; + return Constants.DIMENSION_AUTO; } protected short[] getValidKeywords() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |