diff options
author | Dirk-Willem van Gulik <dirkx@apache.org> | 1999-11-08 19:12:49 +0000 |
---|---|---|
committer | Dirk-Willem van Gulik <dirkx@apache.org> | 1999-11-08 19:12:49 +0000 |
commit | 10070e8383ff94f3f256e346b8c4a2a493533cfb (patch) | |
tree | 59080d7faae7c0bd9ff4e5a48f4df4394d468a02 /src/org/apache/fop/svg/SVGLength.java | |
parent | b510e7f15a798e944bb138993f2b586413adecbe (diff) | |
download | xmlgraphics-fop-10070e8383ff94f3f256e346b8c4a2a493533cfb.tar.gz xmlgraphics-fop-10070e8383ff94f3f256e346b8c4a2a493533cfb.zip |
Initial revision
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193213 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/svg/SVGLength.java')
-rw-r--r-- | src/org/apache/fop/svg/SVGLength.java | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/src/org/apache/fop/svg/SVGLength.java b/src/org/apache/fop/svg/SVGLength.java new file mode 100644 index 000000000..252946046 --- /dev/null +++ b/src/org/apache/fop/svg/SVGLength.java @@ -0,0 +1,77 @@ +package org.apache.xml.fop.svg; + +// FOP +import org.apache.xml.fop.fo.*; +import org.apache.xml.fop.datatypes.*; +import org.apache.xml.fop.apps.FOPException; + +/** + * a class representing all the length properties in SVG + */ +public class SVGLength extends Property { + + /** + * inner class for making SVG Length objects. + */ + public static class Maker extends Property.Maker { + + /** + * whether this property is inherited or not. + * + * @return is this inherited? + */ + public boolean isInherited() { return false; } + + /** + * make an SVG Length property with the given value. + * + * @param propertyList the property list this is a member of + * @param value the explicit string value of the property + */ + public Property make(PropertyList propertyList, String value) + throws FOPException { + return new SVGLength(propertyList, new Length(value)); + } + + /** + * make an SVG Length property with the default value. + * + * @param propertyList the property list the property is a member of + */ + public Property make(PropertyList propertyList) throws FOPException { + return make(propertyList, "0pt"); + } + } + + /** + * returns the maker for this object. + * + * @return the maker for SVG Length objects + */ + public static Property.Maker maker() { + return new SVGLength.Maker(); + } + + /** the length as a Length object */ + protected Length value; + + /** + * construct an SVG length (called by the Maker). + * + * @param propertyList the property list this is a member of + * @param explicitValue the explicit value as a Length object + */ + protected SVGLength(PropertyList propertyList, Length explicitValue) { + this.propertyList = propertyList; + this.value = explicitValue; + } + + /** + * get the length + * + * @return the length as a Length object + */ + public Length getLength() { + return this.value; + } +} |