]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Phase 3 (last) of bug 26434.
authorFinn Bock <bckfnn@apache.org>
Mon, 2 Feb 2004 16:08:27 +0000 (16:08 +0000)
committerFinn Bock <bckfnn@apache.org>
Mon, 2 Feb 2004 16:08:27 +0000 (16:08 +0000)
- Move the property classes to fop.fo.properties.

PR: 26434

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197314 13f79535-47bb-0310-9956-ffa450edef68

88 files changed:
src/java/org/apache/fop/datatypes/AutoLength.java [deleted file]
src/java/org/apache/fop/datatypes/CompoundDatatype.java
src/java/org/apache/fop/datatypes/FixedLength.java [deleted file]
src/java/org/apache/fop/datatypes/LinearCombinationLength.java [deleted file]
src/java/org/apache/fop/datatypes/MixedLength.java [deleted file]
src/java/org/apache/fop/datatypes/PercentLength.java [deleted file]
src/java/org/apache/fop/datatypes/TableColLength.java [deleted file]
src/java/org/apache/fop/datatypes/ToBeImplementedProperty.java [deleted file]
src/java/org/apache/fop/fo/BoxPropShorthandParser.java
src/java/org/apache/fop/fo/CharacterProperty.java [deleted file]
src/java/org/apache/fop/fo/ColorTypeProperty.java [deleted file]
src/java/org/apache/fop/fo/CondLengthProperty.java [deleted file]
src/java/org/apache/fop/fo/EnumProperty.java [deleted file]
src/java/org/apache/fop/fo/FOPropertyMapping.java
src/java/org/apache/fop/fo/FObj.java
src/java/org/apache/fop/fo/GenericShorthandParser.java
src/java/org/apache/fop/fo/KeepProperty.java [deleted file]
src/java/org/apache/fop/fo/LengthPairProperty.java [deleted file]
src/java/org/apache/fop/fo/LengthProperty.java [deleted file]
src/java/org/apache/fop/fo/LengthRangeProperty.java [deleted file]
src/java/org/apache/fop/fo/ListProperty.java [deleted file]
src/java/org/apache/fop/fo/NumberProperty.java [deleted file]
src/java/org/apache/fop/fo/Property.java [deleted file]
src/java/org/apache/fop/fo/PropertyList.java
src/java/org/apache/fop/fo/PropertyManager.java
src/java/org/apache/fop/fo/ShorthandParser.java
src/java/org/apache/fop/fo/SpaceProperty.java [deleted file]
src/java/org/apache/fop/fo/StringProperty.java [deleted file]
src/java/org/apache/fop/fo/expr/AbsFunction.java
src/java/org/apache/fop/fo/expr/BodyStartFunction.java
src/java/org/apache/fop/fo/expr/CeilingFunction.java
src/java/org/apache/fop/fo/expr/FloorFunction.java
src/java/org/apache/fop/fo/expr/FopPropValFunction.java
src/java/org/apache/fop/fo/expr/FromParentFunction.java
src/java/org/apache/fop/fo/expr/FromTableColumnFunction.java
src/java/org/apache/fop/fo/expr/Function.java
src/java/org/apache/fop/fo/expr/InheritedPropFunction.java
src/java/org/apache/fop/fo/expr/LabelEndFunction.java
src/java/org/apache/fop/fo/expr/MaxFunction.java
src/java/org/apache/fop/fo/expr/MinFunction.java
src/java/org/apache/fop/fo/expr/NCnameProperty.java
src/java/org/apache/fop/fo/expr/NearestSpecPropFunction.java
src/java/org/apache/fop/fo/expr/NumericProperty.java
src/java/org/apache/fop/fo/expr/PPColWidthFunction.java
src/java/org/apache/fop/fo/expr/PropertyParser.java
src/java/org/apache/fop/fo/expr/RGBColorFunction.java
src/java/org/apache/fop/fo/expr/RoundFunction.java
src/java/org/apache/fop/fo/flow/ExternalGraphic.java
src/java/org/apache/fop/fo/flow/Leader.java
src/java/org/apache/fop/fo/flow/Table.java
src/java/org/apache/fop/fo/flow/TableColumn.java
src/java/org/apache/fop/fo/flow/TableRow.java
src/java/org/apache/fop/fo/pagination/RegionBody.java
src/java/org/apache/fop/fo/pagination/Title.java
src/java/org/apache/fop/fo/properties/AutoLength.java [new file with mode: 0644]
src/java/org/apache/fop/fo/properties/BorderWidthPropertyMaker.java
src/java/org/apache/fop/fo/properties/CharacterProperty.java [new file with mode: 0644]
src/java/org/apache/fop/fo/properties/ColorTypeProperty.java [new file with mode: 0644]
src/java/org/apache/fop/fo/properties/CommonBorderAndPadding.java
src/java/org/apache/fop/fo/properties/CompoundPropertyMaker.java
src/java/org/apache/fop/fo/properties/CondLengthProperty.java [new file with mode: 0644]
src/java/org/apache/fop/fo/properties/CorrespondingPropertyMaker.java
src/java/org/apache/fop/fo/properties/DimensionPropertyMaker.java
src/java/org/apache/fop/fo/properties/EnumProperty.java [new file with mode: 0644]
src/java/org/apache/fop/fo/properties/FixedLength.java [new file with mode: 0644]
src/java/org/apache/fop/fo/properties/IndentPropertyMaker.java
src/java/org/apache/fop/fo/properties/KeepProperty.java [new file with mode: 0644]
src/java/org/apache/fop/fo/properties/LengthPairProperty.java [new file with mode: 0644]
src/java/org/apache/fop/fo/properties/LengthProperty.java [new file with mode: 0644]
src/java/org/apache/fop/fo/properties/LengthRangeProperty.java [new file with mode: 0644]
src/java/org/apache/fop/fo/properties/LineHeightPropertyMaker.java
src/java/org/apache/fop/fo/properties/LinearCombinationLength.java [new file with mode: 0644]
src/java/org/apache/fop/fo/properties/ListProperty.java [new file with mode: 0644]
src/java/org/apache/fop/fo/properties/MixedLength.java [new file with mode: 0644]
src/java/org/apache/fop/fo/properties/NumberProperty.java [new file with mode: 0644]
src/java/org/apache/fop/fo/properties/PercentLength.java [new file with mode: 0644]
src/java/org/apache/fop/fo/properties/Property.java [new file with mode: 0644]
src/java/org/apache/fop/fo/properties/PropertyMaker.java
src/java/org/apache/fop/fo/properties/SpaceProperty.java [new file with mode: 0644]
src/java/org/apache/fop/fo/properties/StringProperty.java [new file with mode: 0644]
src/java/org/apache/fop/fo/properties/TableColLength.java [new file with mode: 0644]
src/java/org/apache/fop/fo/properties/ToBeImplementedProperty.java [new file with mode: 0644]
src/java/org/apache/fop/render/rtf/ListAttributesConverter.java
src/java/org/apache/fop/render/rtf/PageAttributesConverter.java
src/java/org/apache/fop/render/rtf/RTFHandler.java
src/java/org/apache/fop/render/rtf/TableAttributesConverter.java
src/java/org/apache/fop/render/rtf/TextAttributesConverter.java
src/java/org/apache/fop/traits/SpaceVal.java

diff --git a/src/java/org/apache/fop/datatypes/AutoLength.java b/src/java/org/apache/fop/datatypes/AutoLength.java
deleted file mode 100644 (file)
index cafe3a3..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * $Id: AutoLength.java,v 1.3 2003/03/05 20:38:23 jeremias Exp $
- * ============================================================================
- *                    The Apache Software License, Version 1.1
- * ============================================================================
- * 
- * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without modifica-
- * tion, are permitted provided that the following conditions are met:
- * 
- * 1. Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- * 
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- * 
- * 3. The end-user documentation included with the redistribution, if any, must
- *    include the following acknowledgment: "This product includes software
- *    developed by the Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself, if
- *    and wherever such third-party acknowledgments normally appear.
- * 
- * 4. The names "FOP" and "Apache Software Foundation" must not be used to
- *    endorse or promote products derived from this software without prior
- *    written permission. For written permission, please contact
- *    apache@apache.org.
- * 
- * 5. Products derived from this software may not be called "Apache", nor may
- *    "Apache" appear in their name, without prior written permission of the
- *    Apache Software Foundation.
- * 
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
- * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * ============================================================================
- * 
- * This software consists of voluntary contributions made by many individuals
- * on behalf of the Apache Software Foundation and was originally created by
- * James Tauber <jtauber@jtauber.com>. For more information on the Apache
- * Software Foundation, please see <http://www.apache.org/>.
- */ 
-package org.apache.fop.datatypes;
-
-import org.apache.fop.fo.LengthProperty;
-
-/**
- * A length quantity in XSL which is specified as "auto".
- */
-public class AutoLength extends LengthProperty {
-
-    /**
-     * @see org.apache.fop.datatypes.Length#isAuto()
-     */
-    public boolean isAuto() {
-        return true;
-    }
-
-    // Should we do something intelligent here to set the actual size?
-    // Would need a reference object!
-    //    protected void computeValue() {
-    //    }
-
-    /**
-     * @see org.apache.fop.fo.Property#getString()
-     */
-    public String getString() {
-        return "auto";
-    }
-
-}
index 14e32b711022988bae2ed65a2b4468564cba2fcb..77473cef0ca844513aad8b733d188046e5556884 100644 (file)
@@ -50,8 +50,8 @@
  */ 
 package org.apache.fop.datatypes;
 
-import org.apache.fop.fo.Property;
 import org.apache.fop.fo.Constants;
+import org.apache.fop.fo.properties.Property;
 
 /**
  * This interface is used as a base for compound datatypes.
diff --git a/src/java/org/apache/fop/datatypes/FixedLength.java b/src/java/org/apache/fop/datatypes/FixedLength.java
deleted file mode 100644 (file)
index 7572c1c..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * $Id: FixedLength.java,v 1.4 2003/03/05 20:38:23 jeremias Exp $
- * ============================================================================
- *                    The Apache Software License, Version 1.1
- * ============================================================================
- *
- * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modifica-
- * tion, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- *    include the following acknowledgment: "This product includes software
- *    developed by the Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself, if
- *    and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "FOP" and "Apache Software Foundation" must not be used to
- *    endorse or promote products derived from this software without prior
- *    written permission. For written permission, please contact
- *    apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache", nor may
- *    "Apache" appear in their name, without prior written permission of the
- *    Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
- * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * ============================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of the Apache Software Foundation and was originally created by
- * James Tauber <jtauber@jtauber.com>. For more information on the Apache
- * Software Foundation, please see <http://www.apache.org/>.
- */
-package org.apache.fop.datatypes;
-
-import org.apache.fop.fo.LengthProperty;
-import org.apache.fop.fo.expr.NumericProperty;
-
-/**
- * a length quantity in XSL
- */
-public class FixedLength extends LengthProperty {
-
-    /**
-     * Set the length given
-     * @param numRelUnits the number of relative units
-     * @param iCurFontSize the current font size in base units.
-     */
-    public FixedLength(double numRelUnits, int iCurFontSize) {
-        setComputedValue((int)(numRelUnits * (double)iCurFontSize));
-    }
-
-    /**
-     * Set the length given a number of units and a unit name.
-     * @param numUnits quantity of input units
-     * @param units input unit specifier (in, cm, etc.)
-     */
-    public FixedLength(double numUnits, String units) {
-        convert(numUnits, units);
-    }
-
-    /**
-     * @param baseUnits the length as a number of base units (millipoints)
-     */
-    public FixedLength(int baseUnits) {
-        setComputedValue(baseUnits);
-    }
-
-    /**
-     * Convert the given length to a dimensionless integer representing
-     * a whole number of base units (milli-points).
-     * @param dvalue quantity of input units
-     * @param unit input unit specifier (in, cm, etc.)
-     */
-    protected void convert(double dvalue, String unit) {
-
-        int assumedResolution = 1;    // points/pixel
-
-        if (unit.equals("in")) {
-            dvalue = dvalue * 72;
-        } else if (unit.equals("cm")) {
-            dvalue = dvalue * 28.3464567;
-        } else if (unit.equals("mm")) {
-            dvalue = dvalue * 2.83464567;
-        } else if (unit.equals("pt")) {
-            // Do nothing.
-            // dvalue = dvalue;
-        } else if (unit.equals("pc")) {
-            dvalue = dvalue * 12;
-            /*
-             * } else if (unit.equals("em")) {
-             * dvalue = dvalue * fontsize;
-             */
-        } else if (unit.equals("px")) {
-            dvalue = dvalue * assumedResolution;
-        } else {
-            dvalue = 0;
-            //log.error("unknown length unit '" + unit
-            //                       + "'");
-        }
-        setComputedValue((int)(dvalue * 1000));
-    }
-
-    /**
-     * @return Numeric equivalent of this
-     */
-    public NumericProperty asNumeric() {
-        return new NumericProperty(this);
-    }
-}
-
diff --git a/src/java/org/apache/fop/datatypes/LinearCombinationLength.java b/src/java/org/apache/fop/datatypes/LinearCombinationLength.java
deleted file mode 100644 (file)
index a853417..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * $Id: LinearCombinationLength.java,v 1.4 2003/03/05 20:38:24 jeremias Exp $
- * ============================================================================
- *                    The Apache Software License, Version 1.1
- * ============================================================================
- *
- * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modifica-
- * tion, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- *    include the following acknowledgment: "This product includes software
- *    developed by the Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself, if
- *    and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "FOP" and "Apache Software Foundation" must not be used to
- *    endorse or promote products derived from this software without prior
- *    written permission. For written permission, please contact
- *    apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache", nor may
- *    "Apache" appear in their name, without prior written permission of the
- *    Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
- * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * ============================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of the Apache Software Foundation and was originally created by
- * James Tauber <jtauber@jtauber.com>. For more information on the Apache
- * Software Foundation, please see <http://www.apache.org/>.
- */
-package org.apache.fop.datatypes;
-
-import java.util.Vector;
-
-import org.apache.fop.fo.LengthProperty;
-
-/**
- * Class modelling lengths that are build up by combining other lengths
- */
-public class LinearCombinationLength extends LengthProperty {
-
-    /** Collection of factors (1-1 correspondence with {@link #lengths} */
-    protected Vector factors;
-    /** Collection of Length objects (1-1 correspondence with {@link #factors} */
-    protected Vector lengths;
-
-    /**
-     * Constructor. Creates no content. Use {link #addTerm} to build content.
-     */
-    public LinearCombinationLength() {
-        factors = new Vector();
-        lengths = new Vector();
-    }
-
-    /**
-     * Add an item to this
-     * @param factor the factor to be added
-     * @param length the Length to be added
-     */
-    public void addTerm(double factor, LengthProperty length) {
-        factors.addElement(new Double(factor));
-        lengths.addElement(length);
-    }
-
-    /**
-     * Sets the computed value in millipoints.
-     */
-    protected void computeValue() {
-        int result = 0;
-        int numFactors = factors.size();
-        for (int i = 0; i < numFactors; ++i) {
-            result +=
-                (int)(((Double)factors.elementAt(i)).doubleValue()
-                      * (double)((Length)lengths.elementAt(i)).getValue());
-        }
-        setComputedValue(result);
-    }
-
-}
diff --git a/src/java/org/apache/fop/datatypes/MixedLength.java b/src/java/org/apache/fop/datatypes/MixedLength.java
deleted file mode 100644 (file)
index bc7dd15..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * $Id: MixedLength.java,v 1.6 2003/03/05 20:38:23 jeremias Exp $
- * ============================================================================
- *                    The Apache Software License, Version 1.1
- * ============================================================================
- *
- * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modifica-
- * tion, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- *    include the following acknowledgment: "This product includes software
- *    developed by the Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself, if
- *    and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "FOP" and "Apache Software Foundation" must not be used to
- *    endorse or promote products derived from this software without prior
- *    written permission. For written permission, please contact
- *    apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache", nor may
- *    "Apache" appear in their name, without prior written permission of the
- *    Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
- * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * ============================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of the Apache Software Foundation and was originally created by
- * James Tauber <jtauber@jtauber.com>. For more information on the Apache
- * Software Foundation, please see <http://www.apache.org/>.
- */
-package org.apache.fop.datatypes;
-
-import java.util.Enumeration;
-import java.util.Vector;
-
-import org.apache.fop.fo.LengthProperty;
-import org.apache.fop.fo.expr.NumericProperty;
-import org.apache.fop.fo.expr.PropertyException;
-
-/**
- * A length quantity in XSL which is specified with a mixture
- * of absolute and relative and/or percent components.
- * The actual value may not be computable before layout is done.
- */
-public class MixedLength extends LengthProperty {
-
-    /** The collection of Length objects comprising this MixedLength object */
-    private Vector lengths ;
-
-    /**
-     * Constructor
-     * @param lengths the collection of Length objects which comprise the new
-     * MixedLength object
-     */
-    public MixedLength(Vector lengths) {
-        this.lengths = lengths;
-    }
-
-    /**
-     * Iterates through each internal component, computing and
-     * summarizing the values, then setting the value for this
-     */
-    protected void computeValue() {
-        int computedValue = 0;
-        boolean bAllComputed = true;
-        Enumeration e = lengths.elements();
-        while (e.hasMoreElements()) {
-            LengthProperty l = (LengthProperty) e.nextElement();
-            computedValue += l.getValue();
-            if (!l.isComputed()) {
-                bAllComputed = false;
-            }
-        }
-        setComputedValue(computedValue, bAllComputed);
-    }
-
-
-    public double getTableUnits() {
-        double tableUnits = 0.0;
-        Enumeration e = lengths.elements();
-        while (e.hasMoreElements()) {
-            tableUnits += ((LengthProperty) e.nextElement()).getTableUnits();
-        }
-        return tableUnits;
-    }
-
-    public void resolveTableUnit(double dTableUnit) {
-        Enumeration e = lengths.elements();
-        while (e.hasMoreElements()) {
-            ((LengthProperty) e.nextElement()).resolveTableUnit(dTableUnit);
-        }
-    }
-
-    /**
-     * @return String equivalent of this
-     */
-    public String toString() {
-        StringBuffer sbuf = new StringBuffer();
-        Enumeration e = lengths.elements();
-        while (e.hasMoreElements()) {
-            if (sbuf.length() > 0) {
-                sbuf.append('+');
-            }
-            sbuf.append(e.nextElement().toString());
-        }
-        return sbuf.toString();
-    }
-
-    /**
-     * @return Numeric equivalent of this
-     */
-    public NumericProperty asNumeric() {
-        NumericProperty numeric = null;
-        for (Enumeration e = lengths.elements(); e.hasMoreElements();) {
-            LengthProperty l = (LengthProperty) e.nextElement();
-            if (numeric == null) {
-                numeric = l.asNumeric();
-            } else {
-                try {
-                    NumericProperty sum = numeric.add(l.asNumeric());
-                    numeric = sum;
-                } catch (PropertyException pe) {
-                    System.err.println(
-                      "Can't convert MixedLength to Numeric: " + pe);
-                }
-            }
-        }
-        return numeric;
-    }
-}
-
diff --git a/src/java/org/apache/fop/datatypes/PercentLength.java b/src/java/org/apache/fop/datatypes/PercentLength.java
deleted file mode 100644 (file)
index 9d96e79..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * $Id: PercentLength.java,v 1.6 2003/03/05 20:38:23 jeremias Exp $
- * ============================================================================
- *                    The Apache Software License, Version 1.1
- * ============================================================================
- *
- * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modifica-
- * tion, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- *    include the following acknowledgment: "This product includes software
- *    developed by the Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself, if
- *    and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "FOP" and "Apache Software Foundation" must not be used to
- *    endorse or promote products derived from this software without prior
- *    written permission. For written permission, please contact
- *    apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache", nor may
- *    "Apache" appear in their name, without prior written permission of the
- *    Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
- * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * ============================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of the Apache Software Foundation and was originally created by
- * James Tauber <jtauber@jtauber.com>. For more information on the Apache
- * Software Foundation, please see <http://www.apache.org/>.
- */
-package org.apache.fop.datatypes;
-
-import org.apache.fop.fo.LengthProperty;
-import org.apache.fop.fo.expr.NumericProperty;
-
-/**
- * a percent specified length quantity in XSL
- */
-public class PercentLength extends LengthProperty {
-
-    /**
-     * The percentage itself, expressed as a decimal value, e.g. for 95%, set
-     * the value to .95
-     */
-    private double factor;
-
-    /**
-     * A PercentBase implementation that contains the base length to which the
-     * {@link #factor} should be applied to compute the actual length
-     */
-    private PercentBase lbase = null;
-
-    /**
-     * Main constructor. Construct an object based on a factor (the percent,
-     * as a factor) and an object which has a method to return the Length which
-     * provides the "base" for the actual length that is modeled.
-     * @param factor the percentage factor, expressed as a decimal (e.g. use
-     * .95 to represent 95%)
-     * @param lbase base property to which the factor should be applied
-     */
-    public PercentLength(double factor, PercentBase lbase) {
-        this.factor = factor;
-        this.lbase = lbase;
-    }
-
-    /**
-     * Convenience constructor when only the factor is known
-     * @param factor the percentage factor, expressed as a decimal (e.g. use
-     * .95 to represent 95%)
-     */
-    public PercentLength(double factor) {
-        this(factor, null);
-    }
-
-    /**
-     * @param lbase the base to set
-     */
-    public void setBaseLength(PercentBase lbase) {
-        this.lbase = lbase;
-    }
-
-    /**
-     * @return the base
-     */
-    public PercentBase getBaseLength() {
-        return this.lbase;
-    }
-
-    /**
-     * Return the computed value in millipoints. This assumes that the
-     * base length has been resolved to an absolute length value.
-     */
-    protected void computeValue() {
-        setComputedValue((int)(factor * (double)lbase.getBaseLength()));
-    }
-
-    /**
-     *
-     * @return the factor
-     */
-    public double value() {
-        return factor;
-    }
-
-    /**
-     * @return the String equivalent of this
-     */
-    public String toString() {
-        // TODO: What about the base value?
-        return (new Double(factor * 100.0).toString()) + "%";
-    }
-
-    /**
-     * @return new Numeric object that is equivalent to this
-     */
-    public NumericProperty asNumeric() {
-        return new NumericProperty(this);
-    }
-
-}
diff --git a/src/java/org/apache/fop/datatypes/TableColLength.java b/src/java/org/apache/fop/datatypes/TableColLength.java
deleted file mode 100644 (file)
index 28b9ec4..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * $Id: TableColLength.java,v 1.6 2003/03/05 20:38:24 jeremias Exp $
- * ============================================================================
- *                    The Apache Software License, Version 1.1
- * ============================================================================
- *
- * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modifica-
- * tion, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- *    include the following acknowledgment: "This product includes software
- *    developed by the Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself, if
- *    and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "FOP" and "Apache Software Foundation" must not be used to
- *    endorse or promote products derived from this software without prior
- *    written permission. For written permission, please contact
- *    apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache", nor may
- *    "Apache" appear in their name, without prior written permission of the
- *    Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
- * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * ============================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of the Apache Software Foundation and was originally created by
- * James Tauber <jtauber@jtauber.com>. For more information on the Apache
- * Software Foundation, please see <http://www.apache.org/>.
- */
-package org.apache.fop.datatypes;
-
-import org.apache.fop.fo.LengthProperty;
-import org.apache.fop.fo.expr.NumericProperty;
-
-/**
- * A table-column width specification, possibly including some
- * number of proportional "column-units". The absolute size of a
- * column-unit depends on the fixed and proportional sizes of all
- * columns in the table, and on the overall size of the table.
- * It can't be calculated until all columns have been specified and until
- * the actual width of the table is known. Since this can be specified
- * as a percent of its parent containing width, the calculation is done
- * during layout.
- * NOTE: this is only supposed to be allowed if table-layout=fixed.
- */
-public class TableColLength extends LengthProperty {
-
-    /**
-     * Number of table-column proportional units
-     */
-    private double tcolUnits;
-
-    /**
-     * Construct an object with tcolUnits of proportional measure.
-     * @param tcolUnits number of table-column proportional units
-     */
-    public TableColLength(double tcolUnits) {
-        this.tcolUnits = tcolUnits;
-    }
-
-    /**
-     * Override the method in Length
-     * @return the number of specified proportional table-column units.
-     */
-    public double getTableUnits() {
-        return tcolUnits;
-    }
-
-    /**
-     * Calculate the number of millipoints and set it.
-     * @param mpointsPerUnit density of millipoints per unit
-     */
-    public void resolveTableUnit(double mpointsPerUnit) {
-        setComputedValue((int)(tcolUnits * mpointsPerUnit));
-    }
-
-    //If the table-unit can be resolved, set the computed value
-    /*protected void computeValue() {
-        if (tblUnitBase.canResolveUnit()) {
-            rslt += (int)(tcolUnits * (double)tblUnitBase.getUnitValue());
-            setComputedValue(rslt);
-        }
-    }*/
-
-    /**
-     * Convert this to a String
-     * @return the string representation of this
-     */
-    public String toString() {
-        return (Double.toString(tcolUnits) + " table-column-units");
-    }
-
-    /**
-     * Converts this to a new Numeric object
-     * @return the Numeric object
-     */
-    public NumericProperty asNumeric() {
-        return new NumericProperty(this);
-    }
-}
-
diff --git a/src/java/org/apache/fop/datatypes/ToBeImplementedProperty.java b/src/java/org/apache/fop/datatypes/ToBeImplementedProperty.java
deleted file mode 100644 (file)
index 8cafe9c..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * $Id: ToBeImplementedProperty.java,v 1.6 2003/03/05 20:38:23 jeremias Exp $
- * ============================================================================
- *                    The Apache Software License, Version 1.1
- * ============================================================================
- *
- * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modifica-
- * tion, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- *    include the following acknowledgment: "This product includes software
- *    developed by the Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself, if
- *    and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "FOP" and "Apache Software Foundation" must not be used to
- *    endorse or promote products derived from this software without prior
- *    written permission. For written permission, please contact
- *    apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache", nor may
- *    "Apache" appear in their name, without prior written permission of the
- *    Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
- * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * ============================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of the Apache Software Foundation and was originally created by
- * James Tauber <jtauber@jtauber.com>. For more information on the Apache
- * Software Foundation, please see <http://www.apache.org/>.
- */
-package org.apache.fop.datatypes;
-
-import org.apache.fop.fo.FObj;
-import org.apache.fop.fo.Property;
-import org.apache.fop.fo.PropertyList;
-import org.apache.fop.fo.properties.PropertyMaker;
-
-public class ToBeImplementedProperty extends Property {
-
-    public static class Maker extends PropertyMaker {
-
-        public Maker(int propId) {
-            super(propId);
-        }
-
-        public Property convertProperty(Property p,
-                                        PropertyList propertyList, FObj fo) {
-            if (p instanceof ToBeImplementedProperty) {
-                return p;
-            }
-
-            ToBeImplementedProperty val =
-                new ToBeImplementedProperty(getPropId());
-            return val;
-        }
-    }
-
-    /**
-     * Constructor
-     * @param propName name of Property
-     */
-    public ToBeImplementedProperty(int propId) {
-
-        //XXX: (mjg@recalldesign.com) This is a bit of a kluge, perhaps an
-        //UnimplementedPropertyException or something similar should
-        //get thrown here instead.
-
-//         Logger log = Hierarchy.getDefaultHierarchy().getLoggerFor("fop");
-//         log.warn("property - \"" + propName
-//                                + "\" is not implemented yet.");
-    }
-}
-
index 4a35cba64a3001e2bce06f75e77566b394844e10..51c8f061058fb13837a3eceb0dc08ff9c8f76447 100644 (file)
@@ -50,6 +50,8 @@
  */
 package org.apache.fop.fo;
 
+import org.apache.fop.fo.properties.ListProperty;
+import org.apache.fop.fo.properties.Property;
 import org.apache.fop.fo.properties.PropertyMaker;
 
 /**
diff --git a/src/java/org/apache/fop/fo/CharacterProperty.java b/src/java/org/apache/fop/fo/CharacterProperty.java
deleted file mode 100644 (file)
index 4a95c8a..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * $Id: CharacterProperty.java,v 1.3 2003/03/05 21:48:02 jeremias Exp $
- * ============================================================================
- *                    The Apache Software License, Version 1.1
- * ============================================================================
- *
- * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modifica-
- * tion, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- *    include the following acknowledgment: "This product includes software
- *    developed by the Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself, if
- *    and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "FOP" and "Apache Software Foundation" must not be used to
- *    endorse or promote products derived from this software without prior
- *    written permission. For written permission, please contact
- *    apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache", nor may
- *    "Apache" appear in their name, without prior written permission of the
- *    Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
- * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * ============================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of the Apache Software Foundation and was originally created by
- * James Tauber <jtauber@jtauber.com>. For more information on the Apache
- * Software Foundation, please see <http://www.apache.org/>.
- */
-package org.apache.fop.fo;
-
-import org.apache.fop.fo.properties.PropertyMaker;
-
-/**
- * Superclass for properties that wrap a character value
- */
-public class CharacterProperty extends Property {
-
-    /**
-     * Inner class for creating instances of CharacterProperty
-     */
-    public static class Maker extends PropertyMaker {
-
-        /**
-         * @param propName name of property for which a Maker should be created
-         */
-        public Maker(int propId) {
-            super(propId);
-        }
-
-        public Property make(PropertyList propertyList, String value,
-                             FObj fo) {
-            char c = value.charAt(0);
-            return new CharacterProperty(c);
-        }
-
-    }    // end Charakter.Maker
-
-    private char character;
-
-    /**
-     * @param character character value to be wrapped in this property
-     */
-    public CharacterProperty(char character) {
-        this.character = character;
-    }
-
-    /**
-     * @return this.character cast as an Object
-     */
-    public Object getObject() {
-        return new Character(character);
-    }
-
-    /**
-     * @return this.character
-     */
-    public char getCharacter() {
-        return this.character;
-    }
-
-    /**
-     * @return this.character cast as a String
-     */
-    public String getString() {
-        return new Character(character).toString();
-    }
-
-}
diff --git a/src/java/org/apache/fop/fo/ColorTypeProperty.java b/src/java/org/apache/fop/fo/ColorTypeProperty.java
deleted file mode 100644 (file)
index 125e1db..0000000
+++ /dev/null
@@ -1,809 +0,0 @@
-/*
- * $Id: ColorTypeProperty.java,v 1.5 2003/03/05 21:48:02 jeremias Exp $
- * ============================================================================
- *                    The Apache Software License, Version 1.1
- * ============================================================================
- *
- * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modifica-
- * tion, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- *    include the following acknowledgment: "This product includes software
- *    developed by the Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself, if
- *    and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "FOP" and "Apache Software Foundation" must not be used to
- *    endorse or promote products derived from this software without prior
- *    written permission. For written permission, please contact
- *    apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache", nor may
- *    "Apache" appear in their name, without prior written permission of the
- *    Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
- * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * ============================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of the Apache Software Foundation and was originally created by
- * James Tauber <jtauber@jtauber.com>. For more information on the Apache
- * Software Foundation, please see <http://www.apache.org/>.
- */
-package org.apache.fop.fo;
-
-import java.awt.Color;
-import java.util.StringTokenizer;
-
-import org.apache.fop.datatypes.ColorType;
-import org.apache.fop.fo.properties.PropertyMaker;
-
-/**
- * Superclass for properties that wrap ColorType values
- */
-public class ColorTypeProperty extends Property implements ColorType {
-    /**
-     * the red component
-     */
-    protected float red = 0f;
-
-    /**
-     * the green component
-     */
-    protected float green = 0f;
-
-    /**
-     * the blue component
-     */
-    protected float blue = 0f;
-
-    /**
-     * the alpha component (indicator of opaque-ness)
-     * 0.0 - 1.0; 0.0 is completely transparent; 1.0 is completely opaque
-     * see definition at http://java.sun.com/j2se/1.3/docs/api/java/awt/Color.html
-     */
-    protected float alpha = 1f;
-
-    /**
-     * Inner class for creating instances of ColorTypeProperty
-     */
-    public static class Maker extends PropertyMaker {
-
-        /**
-         * @param propName name of property for which a Maker should be created
-         */
-        public Maker(int propId) {
-            super(propId);
-        }
-
-        public Property convertProperty(Property p,
-                                        PropertyList propertyList, FObj fo) {
-            if (p instanceof ColorTypeProperty) {
-                return p;
-            }
-            ColorTypeProperty val = p.getColorType();
-            if (val != null) {
-                return val;
-            }
-            return convertPropertyDatatype(p, propertyList, fo);
-        }
-
-    }
-
-    /**
-     * Main constructor
-     * @param red red component
-     * @param green green component
-     * @param blue blue component
-     */
-    public ColorTypeProperty(float red, float green, float blue) {
-        this.red = red;
-        this.green = green;
-        this.blue = blue;
-    }
-
-    /**
-     * Set the colour given a particular String specifying either a
-     * colour name or #RGB or #RRGGBB
-     * @param value RGB value as String to be parsed
-     */
-    public ColorTypeProperty(String value) {
-        if (value.startsWith("#")) {
-            try {
-                if (value.length() == 4) {
-                    // note: divide by 15 so F = FF = 1 and so on
-                    this.red = Integer.parseInt(value.substring(1, 2), 16)
-                    / 15f;
-                    this.green = Integer.parseInt(value.substring(2, 3), 16)
-                    / 15f;
-                    this.blue = Integer.parseInt(value.substring(3), 16)
-                    / 15f;
-                } else if (value.length() == 7) {
-                    // note: divide by 255 so FF = 1
-                    this.red = Integer.parseInt(value.substring(1, 3), 16)
-                    / 255f;
-                    this.green = Integer.parseInt(value.substring(3, 5), 16)
-                    / 255f;
-                    this.blue = Integer.parseInt(value.substring(5), 16)
-                    / 255f;
-                } else {
-                    this.red = 0;
-                    this.green = 0;
-                    this.blue = 0;
-                    //log.error("unknown colour format. Must be #RGB or #RRGGBB");
-                }
-            } catch (Exception e) {
-                this.red = 0;
-                this.green = 0;
-                this.blue = 0;
-                //log.error("unknown colour format. Must be #RGB or #RRGGBB");
-            }
-        } else if (value.startsWith("rgb(")) {
-            int poss = value.indexOf("(");
-            int pose = value.indexOf(")");
-            if (poss != -1 && pose != -1) {
-                value = value.substring(poss + 1, pose);
-                StringTokenizer st = new StringTokenizer(value, ",");
-                try {
-                    if (st.hasMoreTokens()) {
-                        String str = st.nextToken().trim();
-                        if (str.endsWith("%")) {
-                            this.red =
-                            Integer.parseInt(str.substring(0, str.length() - 1))
-                            * 2.55f;
-                        } else {
-                            this.red = Integer.parseInt(str) / 255f;
-                        }
-                    }
-                    if (st.hasMoreTokens()) {
-                        String str = st.nextToken().trim();
-                        if (str.endsWith("%")) {
-                            this.green =
-                            Integer.parseInt(str.substring(0, str.length() - 1))
-                            * 2.55f;
-                        } else {
-                            this.green = Integer.parseInt(str) / 255f;
-                        }
-                    }
-                    if (st.hasMoreTokens()) {
-                        String str = st.nextToken().trim();
-                        if (str.endsWith("%")) {
-                            this.blue =
-                            Integer.parseInt(str.substring(0, str.length() - 1))
-                            * 2.55f;
-                        } else {
-                            this.blue = Integer.parseInt(str) / 255f;
-                        }
-                    }
-                } catch (Exception e) {
-                    this.red = 0;
-                    this.green = 0;
-                    this.blue = 0;
-                    //log.error("unknown colour format. Must be #RGB or #RRGGBB");
-                }
-            }
-        } else if (value.startsWith("url(")) {
-            // refers to a gradient
-        } else {
-            if (value.toLowerCase().equals("transparent")) {
-                this.red = 0;
-                this.green = 0;
-                this.blue = 0;
-                this.alpha = 0;
-            } else {
-                boolean found = false;
-                for (int count = 0; count < NAMES.length; count++) {
-                    if (value.toLowerCase().equals(NAMES[count])) {
-                        this.red = VALUES[count][0] / 255f;
-                        this.green = VALUES[count][1] / 255f;
-                        this.blue = VALUES[count][2] / 255f;
-                        found = true;
-                        break;
-                    }
-                }
-                if (!found) {
-                    this.red = 0;
-                    this.green = 0;
-                    this.blue = 0;
-                    //log.error("unknown colour name: "
-                    //                       + value);
-                }
-            }
-        }
-    }
-
-    /**
-     * Returns the blue component of the color.
-     * @return float a value between 0.0 and 1.0
-     */
-    public float getBlue() {
-        return this.blue;
-    }
-
-    /**
-     * Returns the green component of the color.
-     * @return float a value between 0.0 and 1.0
-     */
-    public float getGreen() {
-        return this.green;
-    }
-
-    /**
-     * Returns the red component of the color.
-     * @return float a value between 0.0 and 1.0
-     */
-    public float getRed() {
-        return this.red;
-    }
-
-    /**
-     * Returns the alpha (degree of opaque-ness) component of the color.
-     * @return float a value between 0.0 (fully transparent) and 1.0 (fully opaque)
-     */
-    public float getAlpha() {
-        return this.alpha;
-    }
-
-    /**
-     * Returns an AWT instance of this color
-     * @return float the AWT color represented by this ColorType instance
-     */
-    public Color getAWTColor() {
-        return new Color(this.red, this.green, this.blue, this.alpha);
-    }
-
-    /**
-     * @param floatValue value (between 0.0 and 1.0) of color channel
-     * @return integer equivalent (between 0 and 255)
-     */
-    public static int convertChannelToInteger (float floatValue) {
-        if (floatValue > 1.0) {
-            floatValue = 1.0f;
-        }
-        if (floatValue < 0) {
-            floatValue = 0;
-        }
-        return (int) (floatValue * 255);
-    }
-
-    /**
-     * @see java.lang.Object#toString()
-     */
-    public String toString() {
-        StringBuffer sbuf = new StringBuffer(8);
-        sbuf.append('#');
-        String s = Integer.toHexString((int)(red * 255.0));
-        if (s.length() == 1) {
-            sbuf.append('0');
-        }
-        sbuf.append(s);
-        s = Integer.toHexString((int)(green * 255.0));
-        if (s.length() == 1) {
-            sbuf.append('0');
-        }
-        sbuf.append(s);
-        s = Integer.toHexString((int)(blue * 255.0));
-        if (s.length() == 1) {
-            sbuf.append('0');
-        }
-        sbuf.append(s);
-        return sbuf.toString();
-    }
-
-    /** The names of the predefined colors */
-    protected static final String[] NAMES = {
-                "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige",
-                "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown",
-                "burlywood", "cadetblue", "chartreuse", "chocolate", "coral",
-                "cornflowerblue", "cornsilk", "crimson", "cyan", "darkblue",
-                "darkcyan", "darkgoldenrod", "darkgray", "darkgreen", "darkgrey",
-                "darkkhaki", "darkmagenta", "darkolivegreen", "darkorange",
-                "darkorchid", "darkred", "darksalmon", "darkseagreen",
-                "darkslateblue", "darkslategray", "darkslategrey", "darkturquoise",
-                "darkviolet", "deeppink", "deepskyblue", "dimgray", "dimgrey",
-                "dodgerblue", "firebrick", "floralwhite", "forestgreen", "fuchsia",
-                "gainsboro", "lightpink", "lightsalmon", "lightseagreen",
-                "lightskyblue", "lightslategray", "lightslategrey", "lightsteelblue",
-                "lightyellow", "lime", "limegreen", "linen", "magenta", "maroon",
-                "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple",
-                "mediumseagreen", "mediumslateblue", "mediumspringgreen",
-                "mediumturquoise", "mediumvioletred", "midnightblue", "mintcream",
-                "mistyrose", "moccasin", "navajowhite", "navy", "oldlace", "olive",
-                "olivedrab", "orange", "orangered", "orchid", "palegoldenrod",
-                "palegreen", "paleturquoise", "palevioletred", "papayawhip",
-                "peachpuff", "peru", "pink", "plum", "powderblue", "purple", "red",
-                "rosybrown", "royalblue", "saddlebrown", "salmon", "ghostwhite",
-                "gold", "goldenrod", "gray", "grey", "green", "greenyellow",
-                "honeydew", "hotpink", "indianred", "indigo", "ivory", "khaki",
-                "lavender", "lavenderblush", "lawngreen", "lemonchiffon",
-                "lightblue", "lightcoral", "lightcyan", "lightgoldenrodyellow",
-                "lightgray", "lightgreen", "lightgrey", "sandybrown", "seagreen",
-                "seashell", "sienna", "silver", "skyblue", "slateblue", "slategray",
-                "slategrey", "snow", "springgreen", "steelblue", "tan", "teal",
-                "thistle", "tomato", "turquoise", "violet", "wheat", "white",
-                "whitesmoke", "yellow", "yellowgreen"
-    };
-
-    /** The color values for the predefined colors */
-    protected static final int[][] VALUES = {
-                {
-                            240, 248, 255
-                        }, {
-                            250, 235, 215
-                        }, {
-                            0, 255, 255
-                        }, {
-                            127, 255, 212
-                        }, {
-                            240, 255, 255
-                        }, {
-                            245, 245, 220
-                        }, {
-                            255, 228, 196
-                        }, {
-                            0, 0, 0
-                        }, {
-                            255, 235, 205
-                        }, {
-                            0, 0, 255
-                        }, {
-                            138, 43, 226
-                        }, {
-                            165, 42, 42
-                        }, {
-                            222, 184, 135
-                        }, {
-                            95, 158, 160
-                        }, {
-                            127, 255, 0
-                        }, {
-                            210, 105, 30
-                        }, {
-                            255, 127, 80
-                        }, {
-                            100, 149, 237
-                        }, {
-                            255, 248, 220
-                        }, {
-                            220, 20, 60
-                        }, {
-                            0, 255, 255
-                        }, {
-                            0, 0, 139
-                        }, {
-                            0, 139, 139
-                        }, {
-                            184, 134, 11
-                        }, {
-                            169, 169, 169
-                        }, {
-                            0, 100, 0
-                        }, {
-                            169, 169, 169
-                        }, {
-                            189, 183, 107
-                        }, {
-                            139, 0, 139
-                        }, {
-                            85, 107, 47
-                        }, {
-                            255, 140, 0
-                        }, {
-                            153, 50, 204
-                        }, {
-                            139, 0, 0
-                        }, {
-                            233, 150, 122
-                        }, {
-                            143, 188, 143
-                        }, {
-                            72, 61, 139
-                        }, {
-                            47, 79, 79
-                        }, {
-                            47, 79, 79
-                        }, {
-                            0, 206, 209
-                        }, {
-                            148, 0, 211
-                        }, {
-                            255, 20, 147
-                        }, {
-                            0, 191, 255
-                        }, {
-                            105, 105, 105
-                        }, {
-                            105, 105, 105
-                        }, {
-                            30, 144, 255
-                        }, {
-                            178, 34, 34
-                        }, {
-                            255, 250, 240
-                        }, {
-                            34, 139, 34
-                        }, {
-                            255, 0, 255
-                        }, {
-                            220, 220, 220
-                        }, {
-                            255, 182, 193
-                        }, {
-                            255, 160, 122
-                        }, {
-                            32, 178, 170
-                        }, {
-                            135, 206, 250
-                        }, {
-                            119, 136, 153
-                        }, {
-                            119, 136, 153
-                        }, {
-                            176, 196, 222
-                        }, {
-                            255, 255, 224
-                        }, {
-                            0, 255, 0
-                        }, {
-                            50, 205, 50
-                        }, {
-                            250, 240, 230
-                        }, {
-                            255, 0, 255
-                        }, {
-                            128, 0, 0
-                        }, {
-                            102, 205, 170
-                        }, {
-                            0, 0, 205
-                        }, {
-                            186, 85, 211
-                        }, {
-                            147, 112, 219
-                        }, {
-                            60, 179, 113
-                        }, {
-                            123, 104, 238
-                        }, {
-                            0, 250, 154
-                        }, {
-                            72, 209, 204
-                        }, {
-                            199, 21, 133
-                        }, {
-                            25, 25, 112
-                        }, {
-                            245, 255, 250
-                        }, {
-                            255, 228, 225
-                        }, {
-                            255, 228, 181
-                        }, {
-                            255, 222, 173
-                        }, {
-                            0, 0, 128
-                        }, {
-                            253, 245, 230
-                        }, {
-                            128, 128, 0
-                        }, {
-                            107, 142, 35
-                        }, {
-                            255, 165, 0
-                        }, {
-                            255, 69, 0
-                        }, {
-                            218, 112, 214
-                        }, {
-                            238, 232, 170
-                        }, {
-                            152, 251, 152
-                        }, {
-                            175, 238, 238
-                        }, {
-                            219, 112, 147
-                        }, {
-                            255, 239, 213
-                        }, {
-                            255, 218, 185
-                        }, {
-                            205, 133, 63
-                        }, {
-                            255, 192, 203
-                        }, {
-                            221, 160, 221
-                        }, {
-                            176, 224, 230
-                        }, {
-                            128, 0, 128
-                        }, {
-                            255, 0, 0
-                        }, {
-                            188, 143, 143
-                        }, {
-                            65, 105, 225
-                        }, {
-                            139, 69, 19
-                        }, {
-                            250, 128, 114
-                        }, {
-                            248, 248, 255
-                        }, {
-                            255, 215, 0
-                        }, {
-                            218, 165, 32
-                        }, {
-                            128, 128, 128
-                        }, {
-                            128, 128, 128
-                        }, {
-                            0, 128, 0
-                        }, {
-                            173, 255, 47
-                        }, {
-                            240, 255, 240
-                        }, {
-                            255, 105, 180
-                        }, {
-                            205, 92, 92
-                        }, {
-                            75, 0, 130
-                        }, {
-                            255, 255, 240
-                        }, {
-                            240, 230, 140
-                        }, {
-                            230, 230, 250
-                        }, {
-                            255, 240, 245
-                        }, {
-                            124, 252, 0
-                        }, {
-                            255, 250, 205
-                        }, {
-                            173, 216, 230
-                        }, {
-                            240, 128, 128
-                        }, {
-                            224, 255, 255
-                        }, {
-                            250, 250, 210
-                        }, {
-                            211, 211, 211
-                        }, {
-                            144, 238, 144
-                        }, {
-                            211, 211, 211
-                        }, {
-                            244, 164, 96
-                        }, {
-                            46, 139, 87
-                        }, {
-                            255, 245, 238
-                        }, {
-                            160, 82, 45
-                        }, {
-                            192, 192, 192
-                        }, {
-                            135, 206, 235
-                        }, {
-                            106, 90, 205
-                        }, {
-                            112, 128, 144
-                        }, {
-                            112, 128, 144
-                        }, {
-                            255, 250, 250
-                        }, {
-                            0, 255, 127
-                        }, {
-                            70, 130, 180
-                        }, {
-                            210, 180, 140
-                        }, {
-                            0, 128, 128
-                        }, {
-                            216, 191, 216
-                        }, {
-                            255, 99, 71
-                        }, {
-                            64, 224, 208
-                        }, {
-                            238, 130, 238
-                        }, {
-                            245, 222, 179
-                        }, {
-                            255, 255, 255
-                        }, {
-                            245, 245, 245
-                        }, {
-                            255, 255, 0
-                        }, {
-                            154, 205, 50
-                        }
-    };
-
-    /*
-     * aliceblue rgb(240, 248, 255)
-     * antiquewhite rgb(250, 235, 215)
-     * aqua rgb( 0, 255, 255)
-     * aquamarine rgb(127, 255, 212)
-     * azure rgb(240, 255, 255)
-     * beige rgb(245, 245, 220)
-     * bisque rgb(255, 228, 196)
-     * black rgb( 0, 0, 0)
-     * blanchedalmond rgb(255, 235, 205)
-     * blue rgb( 0, 0, 255)
-     * blueviolet rgb(138, 43, 226)
-     * brown rgb(165, 42, 42)
-     * burlywood rgb(222, 184, 135)
-     * cadetblue rgb( 95, 158, 160)
-     * chartreuse rgb(127, 255, 0)
-     * chocolate rgb(210, 105, 30)
-     * coral rgb(255, 127, 80)
-     * cornflowerblue rgb(100, 149, 237)
-     * cornsilk rgb(255, 248, 220)
-     * crimson rgb(220, 20, 60)
-     * cyan rgb( 0, 255, 255)
-     * darkblue rgb( 0, 0, 139)
-     * darkcyan rgb( 0, 139, 139)
-     * darkgoldenrod rgb(184, 134, 11)
-     * darkgray rgb(169, 169, 169)
-     * darkgreen rgb( 0, 100, 0)
-     * darkgrey rgb(169, 169, 169)
-     * darkkhaki rgb(189, 183, 107)
-     * darkmagenta rgb(139, 0, 139)
-     * darkolivegreen rgb( 85, 107, 47)
-     * darkorange rgb(255, 140, 0)
-     * darkorchid rgb(153, 50, 204)
-     * darkred rgb(139, 0, 0)
-     * darksalmon rgb(233, 150, 122)
-     * darkseagreen rgb(143, 188, 143)
-     * darkslateblue rgb( 72, 61, 139)
-     * darkslategray rgb( 47, 79, 79)
-     * darkslategrey rgb( 47, 79, 79)
-     * darkturquoise rgb( 0, 206, 209)
-     * darkviolet rgb(148, 0, 211)
-     * deeppink rgb(255, 20, 147)
-     * deepskyblue rgb( 0, 191, 255)
-     * dimgray rgb(105, 105, 105)
-     * dimgrey rgb(105, 105, 105)
-     * dodgerblue rgb( 30, 144, 255)
-     * firebrick rgb(178, 34, 34)
-     * floralwhite rgb(255, 250, 240)
-     * forestgreen rgb( 34, 139, 34)
-     * fuchsia rgb(255, 0, 255)
-     * gainsboro rgb(220, 220, 220)
-     * lightpink rgb(255, 182, 193)
-     * lightsalmon rgb(255, 160, 122)
-     * lightseagreen rgb( 32, 178, 170)
-     * lightskyblue rgb(135, 206, 250)
-     * lightslategray rgb(119, 136, 153)
-     * lightslategrey rgb(119, 136, 153)
-     * lightsteelblue rgb(176, 196, 222)
-     * lightyellow rgb(255, 255, 224)
-     * lime rgb( 0, 255, 0)
-     * limegreen rgb( 50, 205, 50)
-     * linen rgb(250, 240, 230)
-     * magenta rgb(255, 0, 255)
-     * maroon rgb(128, 0, 0)
-     * mediumaquamarine rgb(102, 205, 170)
-     * mediumblue rgb( 0, 0, 205)
-     * mediumorchid rgb(186, 85, 211)
-     * mediumpurple rgb(147, 112, 219)
-     * mediumseagreen rgb( 60, 179, 113)
-     * mediumslateblue rgb(123, 104, 238)
-     * mediumspringgreen rgb( 0, 250, 154)
-     * mediumturquoise rgb( 72, 209, 204)
-     * mediumvioletred rgb(199, 21, 133)
-     * midnightblue rgb( 25, 25, 112)
-     * mintcream rgb(245, 255, 250)
-     * mistyrose rgb(255, 228, 225)
-     * moccasin rgb(255, 228, 181)
-     * navajowhite rgb(255, 222, 173)
-     * navy rgb( 0, 0, 128)
-     * oldlace rgb(253, 245, 230)
-     * olive rgb(128, 128, 0)
-     * olivedrab rgb(107, 142, 35)
-     * orange rgb(255, 165, 0)
-     * orangered rgb(255, 69, 0)
-     * orchid rgb(218, 112, 214)
-     * palegoldenrod rgb(238, 232, 170)
-     * palegreen rgb(152, 251, 152)
-     * paleturquoise rgb(175, 238, 238)
-     * palevioletred rgb(219, 112, 147)
-     * papayawhip rgb(255, 239, 213)
-     * peachpuff rgb(255, 218, 185)
-     * peru rgb(205, 133, 63)
-     * pink rgb(255, 192, 203)
-     * plum rgb(221, 160, 221)
-     * powderblue rgb(176, 224, 230)
-     * purple rgb(128, 0, 128)
-     * red rgb(255, 0, 0)
-     * rosybrown rgb(188, 143, 143)
-     * royalblue rgb( 65, 105, 225)
-     * saddlebrown rgb(139, 69, 19)
-     * salmon rgb(250, 128, 114)
-     * ghostwhite rgb(248, 248, 255)
-     * gold rgb(255, 215, 0)
-     * goldenrod rgb(218, 165, 32)
-     * gray rgb(128, 128, 128)
-     * grey rgb(128, 128, 128)
-     * green rgb( 0, 128, 0)
-     * greenyellow rgb(173, 255, 47)
-     * honeydew rgb(240, 255, 240)
-     * hotpink rgb(255, 105, 180)
-     * indianred rgb(205, 92, 92)
-     * indigo rgb( 75, 0, 130)
-     * ivory rgb(255, 255, 240)
-     * khaki rgb(240, 230, 140)
-     * lavender rgb(230, 230, 250)
-     * lavenderblush rgb(255, 240, 245)
-     * lawngreen rgb(124, 252, 0)
-     * lemonchiffon rgb(255, 250, 205)
-     * lightblue rgb(173, 216, 230)
-     * lightcoral rgb(240, 128, 128)
-     * lightcyan rgb(224, 255, 255)
-     * lightgoldenrodyellow rgb(250, 250, 210)
-     * lightgray rgb(211, 211, 211)
-     * lightgreen rgb(144, 238, 144)
-     * lightgrey rgb(211, 211, 211)
-     * sandybrown rgb(244, 164, 96)
-     * seagreen rgb( 46, 139, 87)
-     * seashell rgb(255, 245, 238)
-     * sienna rgb(160, 82, 45)
-     * silver rgb(192, 192, 192)
-     * skyblue rgb(135, 206, 235)
-     * slateblue rgb(106, 90, 205)
-     * slategray rgb(112, 128, 144)
-     * slategrey rgb(112, 128, 144)
-     * snow rgb(255, 250, 250)
-     * springgreen rgb( 0, 255, 127)
-     * steelblue rgb( 70, 130, 180)
-     * tan rgb(210, 180, 140)
-     * teal rgb( 0, 128, 128)
-     * thistle rgb(216, 191, 216)
-     * tomato rgb(255, 99, 71)
-     * turquoise rgb( 64, 224, 208)
-     * violet rgb(238, 130, 238)
-     * wheat rgb(245, 222, 179)
-     * white rgb(255, 255, 255)
-     * whitesmoke rgb(245, 245, 245)
-     * yellow rgb(255, 255, 0)
-     * yellowgreen rgb(154, 205, 50)
-     */
-
-    /**
-     * Can't convert to any other types
-     * @return this.colorType
-     */
-    public ColorTypeProperty getColorType() {
-        return this;
-    }
-
-    /**
-     * @return this.colorType cast as an Object
-     */
-    public Object getObject() {
-        return this;
-    }
-}
-
diff --git a/src/java/org/apache/fop/fo/CondLengthProperty.java b/src/java/org/apache/fop/fo/CondLengthProperty.java
deleted file mode 100644 (file)
index aa2260a..0000000
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * $Id: CondLengthProperty.java,v 1.5 2003/03/05 21:48:01 jeremias Exp $
- * ============================================================================
- *                    The Apache Software License, Version 1.1
- * ============================================================================
- *
- * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modifica-
- * tion, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- *    include the following acknowledgment: "This product includes software
- *    developed by the Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself, if
- *    and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "FOP" and "Apache Software Foundation" must not be used to
- *    endorse or promote products derived from this software without prior
- *    written permission. For written permission, please contact
- *    apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache", nor may
- *    "Apache" appear in their name, without prior written permission of the
- *    Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
- * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * ============================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of the Apache Software Foundation and was originally created by
- * James Tauber <jtauber@jtauber.com>. For more information on the Apache
- * Software Foundation, please see <http://www.apache.org/>.
- */
-package org.apache.fop.fo;
-
-import org.apache.fop.apps.FOPException;
-import org.apache.fop.datatypes.CompoundDatatype;
-import org.apache.fop.fo.properties.CompoundPropertyMaker;
-
-/**
- * Superclass for properties that have conditional lengths
- */
-public class CondLengthProperty extends Property implements CompoundDatatype {
-    private Property length;
-    private Property conditionality;
-
-    /**
-     * Inner class for creating instances of CondLengthProperty
-     */
-    public static class Maker extends CompoundPropertyMaker {
-
-        /**
-         * @param name of property for which a Maker should be created
-         */
-        public Maker(int propId) {
-            super(propId);
-        }
-
-        /**
-         * Create a new empty instance of CondLengthProperty.
-         * @return the new instance. 
-         */
-        public Property makeNewProperty() {
-            return new CondLengthProperty();
-        }
-
-        /**
-         * @see CompoundPropertyMaker#convertProperty
-         */        
-        public Property convertProperty(Property p, PropertyList propertyList, FObj fo)
-            throws FOPException
-        {
-            if (p instanceof KeepProperty) {
-                return p;
-            }
-            return super.convertProperty(p, propertyList, fo);
-        }
-    }
-
-    /**
-     * @see org.apache.fop.datatypes.CompoundDatatype#setComponent(int, Property, boolean)
-     */
-    public void setComponent(int cmpId, Property cmpnValue,
-                             boolean bIsDefault) {
-        if (cmpId == CP_LENGTH) {
-            length = cmpnValue;
-        } else if (cmpId == CP_CONDITIONALITY) {
-            conditionality = cmpnValue;
-        }
-    }
-
-    /**
-     * @see org.apache.fop.datatypes.CompoundDatatype#getComponent(int)
-     */
-    public Property getComponent(int cmpId) {
-        if (cmpId == CP_LENGTH) {
-            return length;
-        } else if (cmpId == CP_CONDITIONALITY) {
-            return conditionality;
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     * Returns the conditionality.
-     * @return the conditionality
-     */
-    public Property getConditionality() {
-        return this.conditionality;
-    }
-
-    /**
-     * Returns the length.
-     * @return the length
-     */
-    public Property getLengthComponent() {
-        return this.length;
-    }
-
-    /**
-     * Indicates if the length can be discarded on certain conditions.
-     * @return true if the length can be discarded.
-     */
-    public boolean isDiscard() {
-        return this.conditionality.getEnum() == Constants.DISCARD;
-    }
-
-    /**
-     * Returns the computed length value.
-     * @return the length in millipoints
-     */
-    public int getLengthValue() {
-        return this.length.getLength().getValue();
-    }
-
-    public String toString() {
-        return "CondLength[" + (isDiscard() ? "discard, " : "") +
-        length.getObject().toString() + "]";
-    }    
-
-
-    /**
-     * @return this.condLength
-     */
-    public CondLengthProperty getCondLength() {
-        return this;
-    }
-
-    /**
-     * TODO: Should we allow this?
-     * @return this.condLength cast as a Length
-     */
-    public LengthProperty getLength() {
-        return length.getLength();
-    }
-
-    /**
-     * @return this.condLength cast as an Object
-     */
-    public Object getObject() {
-        return this;
-    }
-
-}
diff --git a/src/java/org/apache/fop/fo/EnumProperty.java b/src/java/org/apache/fop/fo/EnumProperty.java
deleted file mode 100644 (file)
index 5d09de9..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * $Id: EnumProperty.java,v 1.8 2003/03/05 21:48:01 jeremias Exp $
- * ============================================================================
- *                    The Apache Software License, Version 1.1
- * ============================================================================
- *
- * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modifica-
- * tion, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- *    include the following acknowledgment: "This product includes software
- *    developed by the Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself, if
- *    and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "FOP" and "Apache Software Foundation" must not be used to
- *    endorse or promote products derived from this software without prior
- *    written permission. For written permission, please contact
- *    apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache", nor may
- *    "Apache" appear in their name, without prior written permission of the
- *    Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
- * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * ============================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of the Apache Software Foundation and was originally created by
- * James Tauber <jtauber@jtauber.com>. For more information on the Apache
- * Software Foundation, please see <http://www.apache.org/>.
- */
-package org.apache.fop.fo;
-
-import org.apache.fop.apps.FOPException;
-import org.apache.fop.fo.properties.PropertyMaker;
-
-/**
- * Superclass for properties that wrap an enumeration value
- */
-public class EnumProperty extends Property {
-
-    /**
-     * Inner class for creating EnumProperty instances
-     */
-    public static class Maker extends PropertyMaker {
-
-        /**
-         * @param propName name of property for which a Maker should be created
-         */
-        public Maker(int propId) {
-            super(propId);
-        }
-
-        /**
-         * Called by subclass if no match found.
-         * @param value string containing the value to be checked
-         * @return null (indicates that an appropriate match was not found)
-         */
-        public Property checkEnumValues(String value) {
-            //log.error("Unknown enumerated value for property '"
-            //                       + getPropName() + "': " + value);
-            return super.checkEnumValues(value);
-        }
-
-        protected Property findConstant(String value) {
-            return null;
-        }
-
-        public Property convertProperty(Property p,
-                                        PropertyList propertyList,
-                                        FObj fo) throws FOPException {
-            if (p instanceof EnumProperty) {
-                return p;
-            } else {
-                return super.convertProperty(p, propertyList, fo);
-            }
-        }
-    }
-
-    private int value;
-
-    /**
-     * @param explicitValue enumerated value to be set for this property
-     */
-    public EnumProperty(int explicitValue) {
-        this.value = explicitValue;
-    }
-
-    /**
-     * @return this.value
-     */
-    public int getEnum() {
-        return this.value;
-    }
-
-    /**
-     * @return this.value cast as an Object
-     */
-    public Object getObject() {
-        // TODO return String value: property must reference maker
-        // return maker.getEnumValue(this.value);
-        return new Integer(this.value);
-    }
-
-}
-
index ddb892e6c0261961aed0993b4eaa7c7c7517584d..a2424352791f34248fa9c6f14c107692ca1d882d 100644 (file)
@@ -54,13 +54,26 @@ import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.fop.datatypes.LengthBase;
-import org.apache.fop.datatypes.ToBeImplementedProperty;
 import org.apache.fop.fo.properties.BorderWidthPropertyMaker;
+import org.apache.fop.fo.properties.CharacterProperty;
+import org.apache.fop.fo.properties.ColorTypeProperty;
+import org.apache.fop.fo.properties.CondLengthProperty;
 import org.apache.fop.fo.properties.CorrespondingPropertyMaker;
 import org.apache.fop.fo.properties.DimensionPropertyMaker;
+import org.apache.fop.fo.properties.EnumProperty;
 import org.apache.fop.fo.properties.IndentPropertyMaker;
+import org.apache.fop.fo.properties.KeepProperty;
+import org.apache.fop.fo.properties.LengthPairProperty;
+import org.apache.fop.fo.properties.LengthProperty;
+import org.apache.fop.fo.properties.LengthRangeProperty;
 import org.apache.fop.fo.properties.LineHeightPropertyMaker;
+import org.apache.fop.fo.properties.ListProperty;
+import org.apache.fop.fo.properties.NumberProperty;
+import org.apache.fop.fo.properties.Property;
 import org.apache.fop.fo.properties.PropertyMaker;
+import org.apache.fop.fo.properties.SpaceProperty;
+import org.apache.fop.fo.properties.StringProperty;
+import org.apache.fop.fo.properties.ToBeImplementedProperty;
 
 /**
  * This class creates and returns an array of Property.Maker instances
index 8576e29b9d169d6a5ea388e1f2cc4a33719523ab..6d61dce3bcce28abd081a82f8c376e17a8a438e3 100644 (file)
@@ -59,6 +59,7 @@ import java.util.Set;
 
 import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.flow.Marker;
+import org.apache.fop.fo.properties.Property;
 import org.apache.fop.fo.properties.PropertyMaker;
 import org.xml.sax.Attributes;
 import org.xml.sax.Locator;
index 8591c98327dc9c933725129b33ff83a2b0134526..ad63007957ef379af82d693dc2ef07702ea01ea6 100644 (file)
@@ -52,6 +52,8 @@ package org.apache.fop.fo;
 
 import java.util.Enumeration;
 
+import org.apache.fop.fo.properties.ListProperty;
+import org.apache.fop.fo.properties.Property;
 import org.apache.fop.fo.properties.PropertyMaker;
 
 public class GenericShorthandParser implements ShorthandParser {
diff --git a/src/java/org/apache/fop/fo/KeepProperty.java b/src/java/org/apache/fop/fo/KeepProperty.java
deleted file mode 100644 (file)
index a7d659d..0000000
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * $Id: KeepProperty.java,v 1.3 2003/03/05 21:48:01 jeremias Exp $
- * ============================================================================
- *                    The Apache Software License, Version 1.1
- * ============================================================================
- *
- * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modifica-
- * tion, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- *    include the following acknowledgment: "This product includes software
- *    developed by the Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself, if
- *    and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "FOP" and "Apache Software Foundation" must not be used to
- *    endorse or promote products derived from this software without prior
- *    written permission. For written permission, please contact
- *    apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache", nor may
- *    "Apache" appear in their name, without prior written permission of the
- *    Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
- * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * ============================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of the Apache Software Foundation and was originally created by
- * James Tauber <jtauber@jtauber.com>. For more information on the Apache
- * Software Foundation, please see <http://www.apache.org/>.
- */
-package org.apache.fop.fo;
-
-import org.apache.fop.apps.FOPException;
-import org.apache.fop.datatypes.CompoundDatatype;
-import org.apache.fop.fo.properties.CompoundPropertyMaker;
-
-/**
- * Superclass for properties that wrap Keep values
- */
-public class KeepProperty extends Property implements CompoundDatatype {
-    private Property withinLine;
-    private Property withinColumn;
-    private Property withinPage;
-
-    /**
-     * Inner class for creating instances of KeepProperty
-     */
-    public static class Maker extends CompoundPropertyMaker {
-
-        /**
-         * @param name name of property for which Maker should be created
-         */
-        protected Maker(int propId) {
-            super(propId);
-        }
-
-        /**
-         * Create a new empty instance of KeepProperty.
-         * @return the new instance. 
-         */
-        public Property makeNewProperty() {
-            return new KeepProperty();
-        }
-
-        /**
-         * @see CompoundPropertyMaker#convertProperty
-         */        
-        public Property convertProperty(Property p, PropertyList propertyList, FObj fo)
-            throws FOPException
-        {
-            if (p instanceof KeepProperty) {
-                return p;
-            }
-            return super.convertProperty(p, propertyList, fo);
-        }
-    }
-
-    /**
-     * @see org.apache.fop.datatypes.CompoundDatatype#setComponent(int, Property, boolean)
-     */
-    public void setComponent(int cmpId, Property cmpnValue,
-                             boolean bIsDefault) {
-        if (cmpId == CP_WITHIN_LINE) {
-            setWithinLine(cmpnValue, bIsDefault);
-        } else if (cmpId == CP_WITHIN_COLUMN) {
-            setWithinColumn(cmpnValue, bIsDefault);
-        } else if (cmpId == CP_WITHIN_PAGE) {
-            setWithinPage(cmpnValue, bIsDefault);
-        }
-    }
-
-    /**
-     * @see org.apache.fop.datatypes.CompoundDatatype#getComponent(int)
-     */
-    public Property getComponent(int cmpId) {
-        if (cmpId == CP_WITHIN_LINE) {
-            return getWithinLine();
-        } else if (cmpId == CP_WITHIN_COLUMN) {
-            return getWithinColumn();
-        } else if (cmpId == CP_WITHIN_PAGE) {
-            return getWithinPage();
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     * @param withinLine withinLine property to set
-     * @param bIsDefault not used (??)
-     */
-    public void setWithinLine(Property withinLine, boolean bIsDefault) {
-        this.withinLine = withinLine;
-    }
-
-    /**
-     * @param withinColumn withinColumn property to set
-     * @param bIsDefault not used (??)
-     */
-    protected void setWithinColumn(Property withinColumn,
-                                   boolean bIsDefault) {
-        this.withinColumn = withinColumn;
-    }
-
-    /**
-     * @param withinPage withinPage property to set
-     * @param bIsDefault not used (??)
-     */
-    public void setWithinPage(Property withinPage, boolean bIsDefault) {
-        this.withinPage = withinPage;
-    }
-
-    /**
-     * @return the withinLine property
-     */
-    public Property getWithinLine() {
-        return this.withinLine;
-    }
-
-    /**
-     * @return the withinColumn property
-     */
-    public Property getWithinColumn() {
-        return this.withinColumn;
-    }
-
-    /**
-     * @return the withinPage property
-     */
-    public Property getWithinPage() {
-        return this.withinPage;
-    }
-
-    /**
-     * Not sure what to do here. There isn't really a meaningful single value.
-     * @return String representation
-     */
-    public String toString() {
-        return "Keep[" + 
-            "withinLine:" + getWithinLine().getObject() + 
-            ", withinColumn:" + getWithinColumn().getObject() + 
-            ", withinPage:" + getWithinPage().getObject() + "]";
-    }
-
-    /**
-     * @return this.keep
-     */
-    public KeepProperty getKeep() {
-        return this;
-    }
-
-    /**
-     * @return this.keep cast as Object
-     */
-    public Object getObject() {
-        return this;
-    }
-
-}
diff --git a/src/java/org/apache/fop/fo/LengthPairProperty.java b/src/java/org/apache/fop/fo/LengthPairProperty.java
deleted file mode 100644 (file)
index e56bcab..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * $Id: LengthPairProperty.java,v 1.3 2003/03/05 21:48:02 jeremias Exp $
- * ============================================================================
- *                    The Apache Software License, Version 1.1
- * ============================================================================
- *
- * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modifica-
- * tion, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- *    include the following acknowledgment: "This product includes software
- *    developed by the Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself, if
- *    and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "FOP" and "Apache Software Foundation" must not be used to
- *    endorse or promote products derived from this software without prior
- *    written permission. For written permission, please contact
- *    apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache", nor may
- *    "Apache" appear in their name, without prior written permission of the
- *    Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
- * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * ============================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of the Apache Software Foundation and was originally created by
- * James Tauber <jtauber@jtauber.com>. For more information on the Apache
- * Software Foundation, please see <http://www.apache.org/>.
- */
-package org.apache.fop.fo;
-
-import org.apache.fop.apps.FOPException;
-import org.apache.fop.datatypes.CompoundDatatype;
-import org.apache.fop.fo.properties.CompoundPropertyMaker;
-
-/**
- * Superclass for properties wrapping a LengthPair value
- */
-public class LengthPairProperty extends Property implements CompoundDatatype {
-    private Property ipd;
-    private Property bpd;
-
-    /**
-     * Inner class for creating instances of LengthPairProperty
-     */
-    public static class Maker extends CompoundPropertyMaker {
-
-        /**
-         * @param name name of property for which this Maker should be created
-         */
-        protected Maker(int propId) {
-            super(propId);
-        }
-
-        /**
-         * Create a new empty instance of LengthPairProperty.
-         * @return the new instance. 
-         */
-        public Property makeNewProperty() {
-            return new LengthPairProperty();
-        }
-
-        /**
-         * @see CompoundPropertyMaker#convertProperty
-         */        
-        public Property convertProperty(Property p, PropertyList propertyList, FObj fo)
-            throws FOPException
-        {
-            if (p instanceof LengthPairProperty) {
-                return p;
-            }
-            return super.convertProperty(p, propertyList, fo);
-        }
-    }
-
-    /**
-     * @see org.apache.fop.datatypes.CompoundDatatype#setComponent(int, Property, boolean)
-     */
-    public void setComponent(int cmpId, Property cmpnValue,
-                             boolean bIsDefault) {
-        if (cmpId == CP_BLOCK_PROGRESSION_DIRECTION) {
-            bpd = cmpnValue;
-        } else if (cmpId == CP_INLINE_PROGRESSION_DIRECTION) {
-            ipd = cmpnValue;
-        }
-    }
-
-    /**
-     * @see org.apache.fop.datatypes.CompoundDatatype#getComponent(int)
-     */
-    public Property getComponent(int cmpId) {
-        if (cmpId == CP_BLOCK_PROGRESSION_DIRECTION) {
-            return getBPD();
-        } else if (cmpId == CP_INLINE_PROGRESSION_DIRECTION) {
-            return getIPD();
-        } else {
-            return null;    // SHOULDN'T HAPPEN
-        }
-    }
-
-    /**
-     * @return Property holding the ipd length
-     */
-    public Property getIPD() {
-        return this.ipd;
-    }
-
-    /**
-     * @return Property holding the bpd length
-     */
-    public Property getBPD() {
-        return this.bpd;
-    }
-
-    public String toString() {
-        return "LengthPair[" + 
-        "ipd:" + getIPD().getObject() + 
-        ", bpd:" + getBPD().getObject() + "]";
-    }
-
-    /**
-     * @return this.lengthPair
-     */
-    public LengthPairProperty getLengthPair() {
-        return this;
-    }
-
-    /**
-     * @return this.lengthPair cast as an Object
-     */
-    public Object getObject() {
-        return this;
-    }
-
-}
diff --git a/src/java/org/apache/fop/fo/LengthProperty.java b/src/java/org/apache/fop/fo/LengthProperty.java
deleted file mode 100644 (file)
index fd69848..0000000
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * $Id: LengthProperty.java,v 1.7 2003/03/05 21:48:01 jeremias Exp $
- * ============================================================================
- *                    The Apache Software License, Version 1.1
- * ============================================================================
- *
- * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modifica-
- * tion, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- *    include the following acknowledgment: "This product includes software
- *    developed by the Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself, if
- *    and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "FOP" and "Apache Software Foundation" must not be used to
- *    endorse or promote products derived from this software without prior
- *    written permission. For written permission, please contact
- *    apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache", nor may
- *    "Apache" appear in their name, without prior written permission of the
- *    Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
- * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * ============================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of the Apache Software Foundation and was originally created by
- * James Tauber <jtauber@jtauber.com>. For more information on the Apache
- * Software Foundation, please see <http://www.apache.org/>.
- */
-package org.apache.fop.fo;
-
-import org.apache.fop.apps.FOPException;
-import org.apache.fop.datatypes.AutoLength;
-import org.apache.fop.datatypes.Length;
-import org.apache.fop.fo.expr.NumericProperty;
-import org.apache.fop.fo.properties.PropertyMaker;
-
-/**
- * Superclass for properties wrapping a Length value.
- */
-public class LengthProperty extends Property implements Length {
-    /** Holds the length in millipoints. */
-    protected int millipoints = 0;
-    /** Indicates if the value has been computed, or not. */
-    protected boolean bIsComputed = false;
-
-    /**
-     * Inner class for making instances of LengthProperty
-     */
-    public static class Maker extends PropertyMaker {
-        private boolean autoOk = false;
-
-        /**
-         * @param name name of property for which Maker should be created
-         */
-        public Maker(int propId) {
-            super(propId);
-        }
-
-        /**
-         * protected Property checkPropertyKeywords(String value) {
-         * if (isAutoLengthAllowed() && value.equals("auto")) {
-         * return new LengthProperty(Length.AUTO);
-         * }
-         * return null;
-         * }
-         */
-
-        /**
-         * @return false (auto-length is not allowed for Length values)
-         */
-        protected boolean isAutoLengthAllowed() {
-            return autoOk;
-        }
-
-        /**
-         * Set the auto length flag.
-         * @param inherited
-         */
-        public void setAutoOk(boolean autoOk) {
-            this.autoOk = autoOk;
-        }
-
-        /**
-         * @see Property.Maker#convertProperty
-         */
-        public Property convertProperty(Property p,
-                                        PropertyList propertyList,
-                                        FObj fo) throws FOPException {
-            Property prop = super.convertProperty(p, propertyList, fo);
-            if (prop != null) {
-                return prop;
-            }
-            if (isAutoLengthAllowed()) {
-                String pval = p.getString();
-                if (pval != null && pval.equals("auto")) {
-                    return new AutoLength();
-                }
-            }
-            if (p instanceof LengthProperty) {
-                return p;
-            }
-            LengthProperty val = p.getLength();
-            if (val != null) {
-                return val;
-            }
-            return convertPropertyDatatype(p, propertyList, fo);
-        }
-
-    }
-
-
-    /**
-     * Returns the length in 1/1000ths of a point (millipoints)
-     * @return the length in millipoints
-     */
-    public int getValue() {
-        if (!bIsComputed) {
-            computeValue();
-        }
-        return millipoints;
-    }
-
-    /**
-     * Computes the value.
-     */
-    protected void computeValue() {
-    }
-
-
-    /**
-     * Sets the computed value.
-     * @param millipoints the length in millipoints
-     */
-    protected void setComputedValue(int millipoints) {
-        setComputedValue(millipoints, true);
-    }
-
-    /**
-     * Sets the computed value.
-     * @param millipoints the length in millipoints
-     * @param bSetComputed True if the isComputed flag should be set.
-     */
-    protected void setComputedValue(int millipoints, boolean bSetComputed) {
-        this.millipoints = millipoints;
-        this.bIsComputed = bSetComputed;
-    }
-
-    /**
-     * Indicates if the length has the "auto" value.
-     * @return True if the length is set to "auto"
-     */
-    public boolean isAuto() {
-        return false;
-    }
-
-    /**
-     * Indicates if the length has been computed.
-     * @return True if the length has been computed
-     */
-    public boolean isComputed() {
-        return this.bIsComputed;
-    }
-
-    /**
-     * Return the number of table units which are included in this
-     * length specification.
-     * This will always be 0 unless the property specification used
-     * the proportional-column-width() function (only only table
-     * column FOs).
-     * <p>If this value is not 0, the actual value of the Length cannot
-     * be known without looking at all of the columns in the table to
-     * determine the value of a "table-unit".
-     * @return The number of table units which are included in this
-     * length specification.
-     */
-    public double getTableUnits() {
-        return 0.0;
-    }
-
-    public void resolveTableUnit(double dTableUnit) {
-    }
-
-    /**
-     * @return null (cannot be converted to a Numeric ??)
-     */
-    public NumericProperty asNumeric() {
-        return null;
-    }
-
-    /**
-     * @see java.lang.Object#toString()
-     */
-    public String toString() {
-        String s = millipoints + "mpt";
-        return s;
-    }
-
-    /**
-     * @return this.lenght cast as a Numeric
-     */
-    public NumericProperty getNumeric() {
-        return asNumeric() ;
-    }
-
-    /**
-     * @return this.length
-     */
-    public LengthProperty getLength() {
-        return this;
-    }
-
-    /**
-     * @return this.length cast as an Object
-     */
-    public Object getObject() {
-        return this;
-    }
-
-}
-
diff --git a/src/java/org/apache/fop/fo/LengthRangeProperty.java b/src/java/org/apache/fop/fo/LengthRangeProperty.java
deleted file mode 100644 (file)
index 218cf55..0000000
+++ /dev/null
@@ -1,278 +0,0 @@
-/*
- * $Id: LengthRangeProperty.java,v 1.5 2003/03/05 21:48:02 jeremias Exp $
- * ============================================================================
- *                    The Apache Software License, Version 1.1
- * ============================================================================
- *
- * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modifica-
- * tion, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- *    include the following acknowledgment: "This product includes software
- *    developed by the Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself, if
- *    and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "FOP" and "Apache Software Foundation" must not be used to
- *    endorse or promote products derived from this software without prior
- *    written permission. For written permission, please contact
- *    apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache", nor may
- *    "Apache" appear in their name, without prior written permission of the
- *    Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
- * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * ============================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of the Apache Software Foundation and was originally created by
- * James Tauber <jtauber@jtauber.com>. For more information on the Apache
- * Software Foundation, please see <http://www.apache.org/>.
- */
-package org.apache.fop.fo;
-
-import org.apache.fop.apps.FOPException;
-import org.apache.fop.datatypes.CompoundDatatype;
-import org.apache.fop.fo.properties.CompoundPropertyMaker;
-
-/**
- * Superclass for properties that contain LengthRange values
- */
-public class LengthRangeProperty extends Property implements CompoundDatatype {
-    private Property minimum;
-    private Property optimum;
-    private Property maximum;
-    private static final int MINSET = 1;
-    private static final int OPTSET = 2;
-    private static final int MAXSET = 4;
-    private int bfSet = 0;    // bit field
-    private boolean bChecked = false;
-
-    /**
-     * Inner class for a Maker for LengthProperty objects
-     */
-    public static class Maker extends CompoundPropertyMaker {
-
-        /**
-         * @param name name of property for which to create Maker
-         */
-        protected Maker(int propId) {
-            super(propId);
-        }
-
-        /**
-         * Create a new empty instance of LengthRangeProperty.
-         * @return the new instance. 
-         */
-        public Property makeNewProperty() {
-            return new LengthRangeProperty();
-        }
-
-        /**
-         * @see CompoundPropertyMaker#convertProperty
-         */        
-        public Property convertProperty(Property p, PropertyList propertyList, FObj fo)
-            throws FOPException
-        {
-            if (p instanceof LengthRangeProperty) {
-                return p;
-            }
-            return super.convertProperty(p, propertyList, fo);
-        }
-    }
-
-
-
-    /**
-     * @see org.apache.fop.datatypes.CompoundDatatype#setComponent(int, Property, boolean)
-     */
-    public void setComponent(int cmpId, Property cmpnValue,
-                             boolean bIsDefault) {
-        if (cmpId == CP_MINIMUM) {
-            setMinimum(cmpnValue, bIsDefault);
-        } else if (cmpId == CP_OPTIMUM) {
-            setOptimum(cmpnValue, bIsDefault);
-        } else if (cmpId == CP_MAXIMUM) {
-            setMaximum(cmpnValue, bIsDefault);
-        }
-    }
-
-    /**
-     * @see org.apache.fop.datatypes.CompoundDatatype#getComponent(int)
-     */
-    public Property getComponent(int cmpId) {
-        if (cmpId == CP_MINIMUM) {
-            return getMinimum();
-        } else if (cmpId == CP_OPTIMUM) {
-            return getOptimum();
-        } else if (cmpId == CP_MAXIMUM) {
-            return getMaximum();
-        } else {
-            return null;    // SHOULDN'T HAPPEN
-        }
-    }
-
-    /**
-     * Set minimum value to min.
-     * @param minimum A Length value specifying the minimum value for this
-     * LengthRange.
-     * @param bIsDefault If true, this is set as a "default" value
-     * and not a user-specified explicit value.
-     */
-    protected void setMinimum(Property minimum, boolean bIsDefault) {
-        this.minimum = minimum;
-        if (!bIsDefault) {
-            bfSet |= MINSET;
-        }
-    }
-
-
-    /**
-     * Set maximum value to max if it is >= optimum or optimum isn't set.
-     * @param max A Length value specifying the maximum value for this
-     * @param bIsDefault If true, this is set as a "default" value
-     * and not a user-specified explicit value.
-     */
-    protected void setMaximum(Property max, boolean bIsDefault) {
-        maximum = max;
-        if (!bIsDefault) {
-            bfSet |= MAXSET;
-        }
-    }
-
-
-    /**
-     * Set the optimum value.
-     * @param opt A Length value specifying the optimum value for this
-     * @param bIsDefault If true, this is set as a "default" value
-     * and not a user-specified explicit value.
-     */
-    protected void setOptimum(Property opt, boolean bIsDefault) {
-        optimum = opt;
-        if (!bIsDefault) {
-            bfSet |= OPTSET;
-        }
-    }
-
-    // Minimum is prioritaire, if explicit
-    private void checkConsistency() {
-        if (bChecked) {
-            return;
-        }
-        // Make sure max >= min
-        // Must also control if have any allowed enum values!
-
-        /**
-         * *******************
-         * if (minimum.mvalue() > maximum.mvalue()) {
-         * if ((bfSet&MINSET)!=0) {
-         * // if minimum is explicit, force max to min
-         * if ((bfSet&MAXSET)!=0) {
-         * // Warning: min>max, resetting max to min
-         * log.error("forcing max to min in LengthRange");
-         * }
-         * maximum = minimum ;
-         * }
-         * else {
-         * minimum = maximum; // minimum was default value
-         * }
-         * }
-         * // Now make sure opt <= max and opt >= min
-         * if (optimum.mvalue() > maximum.mvalue()) {
-         * if ((bfSet&OPTSET)!=0) {
-         * if ((bfSet&MAXSET)!=0) {
-         * // Warning: opt > max, resetting opt to max
-         * log.error("forcing opt to max in LengthRange");
-         * optimum = maximum ;
-         * }
-         * else {
-         * maximum = optimum; // maximum was default value
-         * }
-         * }
-         * else {
-         * // opt is default and max is explicit or default
-         * optimum = maximum ;
-         * }
-         * }
-         * else if (optimum.mvalue() < minimum.mvalue()) {
-         * if ((bfSet&MINSET)!=0) {
-         * // if minimum is explicit, force opt to min
-         * if ((bfSet&OPTSET)!=0) {
-         * log.error("forcing opt to min in LengthRange");
-         * }
-         * optimum = minimum ;
-         * }
-         * else {
-         * minimum = optimum; // minimum was default value
-         * }
-         * }
-         * *******$*******
-         */
-        bChecked = true;
-    }
-
-    /**
-     * @return minimum length
-     */
-    public Property getMinimum() {
-        checkConsistency();
-        return this.minimum;
-    }
-
-    /**
-     * @return maximum length
-     */
-    public Property getMaximum() {
-        checkConsistency();
-        return this.maximum;
-    }
-
-    /**
-     * @return optimum length
-     */
-    public Property getOptimum() {
-        checkConsistency();
-        return this.optimum;
-    }
-
-    public String toString() {
-        return "LengthRange[" +
-        "min:" + getMinimum().getObject() + 
-        ", max:" + getMaximum().getObject() + 
-        ", opt:" + getOptimum().getObject() + "]";
-    }
-
-    /**
-     * @return this.lengthRange
-     */
-    public LengthRangeProperty getLengthRange() {
-        return this;
-    }
-
-    /**
-     * @return this.lengthRange cast as an Object
-     */
-    public Object getObject() {
-        return this;
-    }
-
-}
diff --git a/src/java/org/apache/fop/fo/ListProperty.java b/src/java/org/apache/fop/fo/ListProperty.java
deleted file mode 100644 (file)
index 1ec8b9d..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * $Id: ListProperty.java,v 1.3 2003/03/05 21:48:01 jeremias Exp $
- * ============================================================================
- *                    The Apache Software License, Version 1.1
- * ============================================================================
- *
- * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modifica-
- * tion, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- *    include the following acknowledgment: "This product includes software
- *    developed by the Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself, if
- *    and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "FOP" and "Apache Software Foundation" must not be used to
- *    endorse or promote products derived from this software without prior
- *    written permission. For written permission, please contact
- *    apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache", nor may
- *    "Apache" appear in their name, without prior written permission of the
- *    Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
- * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * ============================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of the Apache Software Foundation and was originally created by
- * James Tauber <jtauber@jtauber.com>. For more information on the Apache
- * Software Foundation, please see <http://www.apache.org/>.
- */
-package org.apache.fop.fo;
-
-import java.util.Vector;
-
-import org.apache.fop.fo.properties.PropertyMaker;
-
-/**
- * Superclass for properties that are lists of other properties
- */
-public class ListProperty extends Property {
-
-    /**
-     * Inner class for creating instances of ListProperty
-     */
-    public static class Maker extends PropertyMaker {
-
-        /**
-         * @param name name of property for which Maker should be created
-         */
-        public Maker(int propId) {
-            super(propId);
-        }
-
-        /**
-         * @see Property.Maker#convertProperty
-         */
-        public Property convertProperty(Property p,
-                                        PropertyList propertyList, FObj fo) {
-            if (p instanceof ListProperty) {
-                return p;
-            } else {
-                return new ListProperty(p);
-            }
-        }
-
-    }
-
-    /** Vector containing the list of sub-properties */
-    protected Vector list;
-
-    /**
-     * @param prop the first Property to be added to the list
-     */
-    public ListProperty(Property prop) {
-        list = new Vector();
-        list.addElement(prop);
-    }
-
-    /**
-     * Add a new property to the list
-     * @param prop Property to be added to the list
-     */
-    public void addProperty(Property prop) {
-        list.addElement(prop);
-    }
-
-    /**
-     * @return this.list
-     */
-    public Vector getList() {
-        return list;
-    }
-
-    /**
-     * @return this.list cast as an Object
-     */
-    public Object getObject() {
-        return list;
-    }
-
-}
diff --git a/src/java/org/apache/fop/fo/NumberProperty.java b/src/java/org/apache/fop/fo/NumberProperty.java
deleted file mode 100644 (file)
index 9288cb8..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * $Id: NumberProperty.java,v 1.6 2003/03/05 21:48:01 jeremias Exp $
- * ============================================================================
- *                    The Apache Software License, Version 1.1
- * ============================================================================
- *
- * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modifica-
- * tion, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- *    include the following acknowledgment: "This product includes software
- *    developed by the Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself, if
- *    and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "FOP" and "Apache Software Foundation" must not be used to
- *    endorse or promote products derived from this software without prior
- *    written permission. For written permission, please contact
- *    apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache", nor may
- *    "Apache" appear in their name, without prior written permission of the
- *    Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
- * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * ============================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of the Apache Software Foundation and was originally created by
- * James Tauber <jtauber@jtauber.com>. For more information on the Apache
- * Software Foundation, please see <http://www.apache.org/>.
- */
-package org.apache.fop.fo;
-
-import org.apache.fop.fo.expr.NumericProperty;
-import org.apache.fop.fo.properties.PropertyMaker;
-
-/**
- * Class for handling numeric properties
- */
-public class NumberProperty extends Property {
-
-    /**
-     * Inner class for making NumberProperty objects
-     */
-    public static class Maker extends PropertyMaker {
-
-        /**
-         * Constructor for NumberProperty.Maker
-         * @param propName the name of the property
-         */
-        public Maker(int propId) {
-            super(propId);
-        }
-
-        /**
-         * @see Property.Maker#convertProperty
-         */
-        public Property convertProperty(Property p,
-                                        PropertyList propertyList, FObj fo) {
-            if (p instanceof NumberProperty) {
-                return p;
-            }
-            Number val = p.getNumber();
-            if (val != null) {
-                return new NumberProperty(val);
-            }
-            return convertPropertyDatatype(p, propertyList, fo);
-        }
-
-    }
-
-    private Number number;
-
-    /**
-     * Constructor for Number input
-     * @param num Number object value for property
-     */
-    public NumberProperty(Number num) {
-        this.number = num;
-    }
-
-    /**
-     * Constructor for double input
-     * @param num double numeric value for property
-     */
-    public NumberProperty(double num) {
-        this.number = new Double(num);
-    }
-
-    /**
-     * Constructor for integer input
-     * @param num integer numeric value for property
-     */
-    public NumberProperty(int num) {
-        this.number = new Integer(num);
-    }
-
-    /**
-     * @return this.number cast as a Number
-     */
-    public Number getNumber() {
-        return this.number;
-    }
-
-    /**
-     * public Double getDouble() {
-     * return new Double(this.number.doubleValue());
-     * }
-     * public Integer getInteger() {
-     * return new Integer(this.number.intValue());
-     * }
-     */
-
-    /**
-     * @return this.number cast as an Object
-     */
-    public Object getObject() {
-        return this.number;
-    }
-
-    /**
-     * Convert NumberProperty to Numeric object
-     * @return Numeric object corresponding to this
-     */
-    public NumericProperty getNumeric() {
-        return new NumericProperty(this.number);
-    }
-
-    /**
-     * Convert NumberProperty to a ColorType. Not sure why this is needed.
-     * @return ColorType that corresponds to black
-     */
-    public ColorTypeProperty getColorType() {
-        // Convert numeric value to color ???
-        // Convert to hexadecimal and then try to make it into a color?
-        return new ColorTypeProperty((float)0.0, (float)0.0, (float)0.0);
-    }
-
-}
diff --git a/src/java/org/apache/fop/fo/Property.java b/src/java/org/apache/fop/fo/Property.java
deleted file mode 100644 (file)
index 80b68d4..0000000
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * $Id: Property.java,v 1.22 2003/03/05 21:48:02 jeremias Exp $
- * ============================================================================
- *                    The Apache Software License, Version 1.1
- * ============================================================================
- *
- * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modifica-
- * tion, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- *    include the following acknowledgment: "This product includes software
- *    developed by the Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself, if
- *    and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "FOP" and "Apache Software Foundation" must not be used to
- *    endorse or promote products derived from this software without prior
- *    written permission. For written permission, please contact
- *    apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache", nor may
- *    "Apache" appear in their name, without prior written permission of the
- *    Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
- * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * ============================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of the Apache Software Foundation and was originally created by
- * James Tauber <jtauber@jtauber.com>. For more information on the Apache
- * Software Foundation, please see <http://www.apache.org/>.
- */
-package org.apache.fop.fo;
-
-import org.apache.fop.fo.expr.NumericProperty;
-import java.util.Vector;
-
-/**
- * Base class for all property objects
- * @author unascribed
- */
-public class Property {
-
-    /**
-     * The original specified value for properties which inherit
-     * specified values.
-     */
-    private String specVal;
-
-    /**
-     * Set the original value specified for the property attribute.
-     * @param specVal The specified value.
-     */
-    public void setSpecifiedValue(String specVal) {
-        this.specVal = specVal;
-    }
-
-    /**
-     * Return the original value specified for the property attribute.
-     * @return The specified value as a String.
-     */
-    public String getSpecifiedValue() {
-        return specVal;
-    }
-
-/*
- * This section contains accessor functions for all possible Property datatypes
- */
-
-
-    /**
-     * This method expects to be overridden by subclasses
-     * @return Length property value
-     */
-    public LengthProperty getLength() {
-        return null;
-    }
-
-    /**
-     * This method expects to be overridden by subclasses
-     * @return ColorType property value
-     */
-    public ColorTypeProperty getColorType() {
-        return null;
-    }
-
-    /**
-     * This method expects to be overridden by subclasses
-     * @return CondLength property value
-     */
-    public CondLengthProperty getCondLength() {
-        return null;
-    }
-
-    /**
-     * This method expects to be overridden by subclasses
-     * @return LenghtRange property value
-     */
-    public LengthRangeProperty getLengthRange() {
-        return null;
-    }
-
-    /**
-     * This method expects to be overridden by subclasses
-     * @return LengthPair property value
-     */
-    public LengthPairProperty getLengthPair() {
-        return null;
-    }
-
-    /**
-     * This method expects to be overridden by subclasses
-     * @return Space property value
-     */
-    public SpaceProperty getSpace() {
-        return null;
-    }
-
-    /**
-     * This method expects to be overridden by subclasses
-     * @return Keep property value
-     */
-    public KeepProperty getKeep() {
-        return null;
-    }
-
-    /**
-     * This method expects to be overridden by subclasses
-     * @return integer equivalent of enumerated property value
-     */
-    public int getEnum() {
-        return 0;
-    }
-
-    /**
-     * This method expects to be overridden by subclasses
-     * @return char property value
-     */
-    public char getCharacter() {
-        return 0;
-    }
-
-    /**
-     * This method expects to be overridden by subclasses
-     * @return collection of other property (sub-property) objects
-     */
-    public Vector getList() {
-        return null;
-    }
-
-    /**
-     * This method expects to be overridden by subclasses
-     * @return Number property value
-     */
-    public Number getNumber() {
-        return null;
-    }
-
-    /**
-     * This method expects to be overridden by subclasses
-     * @return Numeric property value
-     */
-    public NumericProperty getNumeric() {
-        return null;
-    }
-
-    /**
-     * This method expects to be overridden by subclasses
-     * @return NCname property value
-     */
-    public String getNCname() {
-        return null;
-    }
-
-    /**
-     * This method expects to be overridden by subclasses
-     * @return Object property value
-     */
-    public Object getObject() {
-        return null;
-    }
-
-    /**
-     * This method expects to be overridden by subclasses.
-     * @return String property value
-     */
-    public String getString() {
-        return null;
-    }
-
-    /**
-     * Return a string representation of the property value. Only used
-     * for debugging.
-     */
-    public String toString() {
-        return getString();
-    }
-}
index 68c843da7ac9ae2d3ad92903e65f44aec9eb07fb..39f989e0adcfc97215d7df033cff619b3f5cad96 100644 (file)
@@ -56,6 +56,7 @@ import org.xml.sax.Attributes;
 
 // FOP
 import org.apache.fop.apps.FOPException;
+import org.apache.fop.fo.properties.Property;
 import org.apache.fop.fo.properties.PropertyMaker;
 
 /**
index 467254442507a4bfa0b8f3a15fa385d569307b4c..4c25add9e4711ea888eea7f46212c88173609237 100644 (file)
@@ -52,6 +52,7 @@ package org.apache.fop.fo;
 
 // FOP
 import org.apache.fop.fonts.Font;
+import org.apache.fop.fo.properties.Property;
 import org.apache.fop.fo.properties.CommonBorderAndPadding;
 import org.apache.fop.fo.properties.CommonMarginBlock;
 import org.apache.fop.fo.properties.CommonMarginInline;
index b690abe95387658e983f95ffabf0277761c3a7ef..5d9f901ec8c099415e4dfe16f69a513421cda875 100644 (file)
@@ -50,6 +50,8 @@
  */
 package org.apache.fop.fo;
 
+import org.apache.fop.fo.properties.ListProperty;
+import org.apache.fop.fo.properties.Property;
 import org.apache.fop.fo.properties.PropertyMaker;
 
 /**
diff --git a/src/java/org/apache/fop/fo/SpaceProperty.java b/src/java/org/apache/fop/fo/SpaceProperty.java
deleted file mode 100644 (file)
index 7f2c154..0000000
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * $Id: SpaceProperty.java,v 1.5 2003/03/05 21:48:01 jeremias Exp $
- * ============================================================================
- *                    The Apache Software License, Version 1.1
- * ============================================================================
- *
- * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modifica-
- * tion, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- *    include the following acknowledgment: "This product includes software
- *    developed by the Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself, if
- *    and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "FOP" and "Apache Software Foundation" must not be used to
- *    endorse or promote products derived from this software without prior
- *    written permission. For written permission, please contact
- *    apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache", nor may
- *    "Apache" appear in their name, without prior written permission of the
- *    Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
- * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * ============================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of the Apache Software Foundation and was originally created by
- * James Tauber <jtauber@jtauber.com>. For more information on the Apache
- * Software Foundation, please see <http://www.apache.org/>.
- */
-package org.apache.fop.fo;
-
-import org.apache.fop.apps.FOPException;
-import org.apache.fop.fo.properties.CompoundPropertyMaker;
-
-/**
- * Base class used for handling properties of the fo:space-before and
- * fo:space-after variety. It is extended by org.apache.fop.fo.properties.GenericSpace,
- * which is extended by many other properties.
- */
-public class SpaceProperty extends LengthRangeProperty {
-    private Property precedence;
-    private Property conditionality;
-
-    /**
-     * Inner class used to create new instances of SpaceProperty
-     */
-    public static class Maker extends CompoundPropertyMaker {
-
-        /**
-         * @param name name of the property whose Maker is to be created
-         */
-        protected Maker(int propId) {
-            super(propId);
-        }
-
-        /**
-         * Create a new empty instance of SpaceProperty.
-         * @return the new instance. 
-         */
-        public Property makeNewProperty() {
-            return new SpaceProperty();
-        }
-
-        /**
-         * @see CompoundPropertyMaker#convertProperty
-         */
-        public Property convertProperty(Property p,
-                                        PropertyList propertyList,
-                                        FObj fo) throws FOPException {
-            if (p instanceof SpaceProperty) {
-                return p;
-            }
-            return super.convertProperty(p, propertyList, fo);
-        }
-    }
-
-
-
-    /**
-     * @see org.apache.fop.datatypes.CompoundDatatype#setComponent(int, Property, boolean)
-     */
-    public void setComponent(int cmpId, Property cmpnValue,
-                             boolean bIsDefault) {
-        if (cmpId == CP_PRECEDENCE) {
-            setPrecedence(cmpnValue, bIsDefault);
-        } else if (cmpId == CP_CONDITIONALITY) {
-            setConditionality(cmpnValue, bIsDefault);
-        } else {
-            super.setComponent(cmpId, cmpnValue, bIsDefault);
-        }
-    }
-
-    /**
-     * @see org.apache.fop.datatypes.CompoundDatatype#getComponent(int)
-     */
-    public Property getComponent(int cmpId) {
-        if (cmpId == CP_PRECEDENCE) {
-            return getPrecedence();
-        } else if (cmpId == CP_CONDITIONALITY) {
-            return getConditionality();
-        } else {
-            return super.getComponent(cmpId);
-        }
-    }
-
-    /**
-     *
-     * @param precedence precedence Property to set
-     * @param bIsDefault (is not used anywhere)
-     */
-    protected void setPrecedence(Property precedence, boolean bIsDefault) {
-        this.precedence = precedence;
-    }
-
-    /**
-     *
-     * @param conditionality conditionality Property to set
-     * @param bIsDefault (is not used anywhere)
-     */
-    protected void setConditionality(Property conditionality,
-                                     boolean bIsDefault) {
-        this.conditionality = conditionality;
-    }
-
-    /**
-     * @return precedence Property
-     */
-    public Property getPrecedence() {
-        return this.precedence;
-    }
-
-    /**
-     * @return conditionality Property
-     */
-    public Property getConditionality() {
-        return this.conditionality;
-    }
-
-    public String toString() {
-        return "Space[" +
-        "min:" + getMinimum().getObject() + 
-        ", max:" + getMaximum().getObject() + 
-        ", opt:" + getOptimum().getObject() + 
-        ", precedence:" + precedence.getObject() + 
-        ", conditionality:" + conditionality.getObject() + "]";
-    }
-
-    /**
-     * @return the Space (datatype) object contained here
-     */
-    public SpaceProperty getSpace() {
-        return this;
-    }
-
-    /**
-     * Space extends LengthRange.
-     * @return the Space (datatype) object contained here
-     */
-    public LengthRangeProperty getLengthRange() {
-        return this;
-    }
-
-    /**
-     * @return the Space (datatype) object contained here
-     */
-    public Object getObject() {
-        return this;
-    }
-
-}
diff --git a/src/java/org/apache/fop/fo/StringProperty.java b/src/java/org/apache/fop/fo/StringProperty.java
deleted file mode 100644 (file)
index 612e419..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * $Id: StringProperty.java,v 1.4 2003/03/05 21:48:01 jeremias Exp $
- * ============================================================================
- *                    The Apache Software License, Version 1.1
- * ============================================================================
- *
- * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modifica-
- * tion, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- *    include the following acknowledgment: "This product includes software
- *    developed by the Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself, if
- *    and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "FOP" and "Apache Software Foundation" must not be used to
- *    endorse or promote products derived from this software without prior
- *    written permission. For written permission, please contact
- *    apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache", nor may
- *    "Apache" appear in their name, without prior written permission of the
- *    Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
- * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * ============================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of the Apache Software Foundation and was originally created by
- * James Tauber <jtauber@jtauber.com>. For more information on the Apache
- * Software Foundation, please see <http://www.apache.org/>.
- */
-package org.apache.fop.fo;
-
-import org.apache.fop.fo.properties.PropertyMaker;
-
-/**
- * Exists primarily as a container for its Maker inner class, which is
- * extended by many string-based FO property classes.
- */
-public class StringProperty extends Property {
-
-    /**
-     * Inner class for making instances of StringProperty
-     */
-    public static class Maker extends PropertyMaker {
-
-        /**
-         * @param propName name of property for which to create a Maker
-         */
-        public Maker(int propId) {
-            super(propId);
-        }
-
-        /**
-         * Make a new StringProperty object
-         * @param propertyList not used
-         * @param value String value of the new object
-         * @param fo not used
-         * @return the StringProperty object
-         */
-        public Property make(PropertyList propertyList, String value,
-                             FObj fo) {
-            // Work around the fact that most String properties are not
-            // specified as actual String literals (with "" or '') since
-            // the attribute values themselves are Strings!
-            // If the value starts with ' or ", make sure it also ends with
-            // this character
-            // Otherwise, just take the whole value as the String
-            int vlen = value.length() - 1;
-            if (vlen > 0) {
-                char q1 = value.charAt(0);
-                if (q1 == '"' || q1 == '\'') {
-                    if (value.charAt(vlen) == q1) {
-                        return new StringProperty(value.substring(1, vlen));
-                    }
-                    System.err.println("Warning String-valued property starts with quote"
-                                       + " but doesn't end with quote: "
-                                       + value);
-                    // fall through and use the entire value, including first quote
-                }
-                String str = checkValueKeywords(value);
-                if (str != null) {
-                    value = str;
-                }
-            }
-            return new StringProperty(value);
-        }
-
-    }    // end String.Maker
-
-    private String str;
-
-    /**
-     * @param str String value to place in this object
-     */
-    public StringProperty(String str) {
-        this.str = str;
-        // System.err.println("Set StringProperty: " + str);
-    }
-
-    /**
-     * @return the Object equivalent of this property
-     */
-    public Object getObject() {
-        return this.str;
-    }
-
-    /**
-     * @return the String equivalent of this property
-     */
-    public String getString() {
-        return this.str;
-    }
-
-}
index f29bb8c6cbfc1253f16aa8baee1f49950e0a1b82..a6494eb5be1cac930f35bbaec2c8377dd6a21614 100644 (file)
@@ -50,7 +50,7 @@
  */
 package org.apache.fop.fo.expr;
 
-import org.apache.fop.fo.Property;
+import org.apache.fop.fo.properties.Property;
 
 /**
  * Class modelling the abs Number Function. See Sec. 5.10.1 of the XSL-FO spec.
index 69416d77018c83a9ec4844991ec54860e6c86e7e..d5abfd064694c7cbe034e336f70755eb69e32f97 100644 (file)
@@ -51,9 +51,9 @@
 package org.apache.fop.fo.expr;
 
 import org.apache.fop.fo.Constants;
-import org.apache.fop.fo.Property;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.flow.ListItem;
+import org.apache.fop.fo.properties.Property;
 
 /**
  * Class corresponding to the body-start Property Value function. See Sec.
index f43544e388228a218cdbcf67c8bb898d54ee6b5a..5ec166b8ea5050721929ef9d07e2d5e195c32e1c 100644 (file)
@@ -50,8 +50,8 @@
  */ 
 package org.apache.fop.fo.expr;
 
-import org.apache.fop.fo.Property;
-import org.apache.fop.fo.NumberProperty;
+import org.apache.fop.fo.properties.NumberProperty;
+import org.apache.fop.fo.properties.Property;
 
 class CeilingFunction extends FunctionBase {
 
index 48913dd95946aec04231ef845719bdf91afce190..aafcc36e3b1f19ee3904b3fcdd424dc3c8221476 100644 (file)
@@ -50,8 +50,8 @@
  */ 
 package org.apache.fop.fo.expr;
 
-import org.apache.fop.fo.Property;
-import org.apache.fop.fo.NumberProperty;
+import org.apache.fop.fo.properties.NumberProperty;
+import org.apache.fop.fo.properties.Property;
 
 
 class FloorFunction extends FunctionBase {
index 2d2581587d81146afa9f2fbfa414b045b849a433..2d65461df66f441a4428a235675955ee2a8b69d8 100644 (file)
@@ -50,8 +50,8 @@
  */
 package org.apache.fop.fo.expr;
 
-import org.apache.fop.fo.Property;
 import org.apache.fop.fo.FOPropertyMapping;
+import org.apache.fop.fo.properties.Property;
 
 
 /**
index c6bf0dd5fb693017fe20fa5b2a01fef1bb485ba6..654aa2ce8e2899ad477a93ece75670058d7eb5a1 100644 (file)
@@ -50,8 +50,8 @@
  */
 package org.apache.fop.fo.expr;
 
-import org.apache.fop.fo.Property;
 import org.apache.fop.fo.FOPropertyMapping;
+import org.apache.fop.fo.properties.Property;
 
 
 /**
index e6241ff16e8123f38ca25dcd7fce0d870304a9fc..3a798660fc0d72a23f9f3fc183d8406b49cc3357 100644 (file)
@@ -50,7 +50,7 @@
  */
 package org.apache.fop.fo.expr;
 
-import org.apache.fop.fo.Property;
+import org.apache.fop.fo.properties.Property;
 
 /**
  * Class modelling the from-table-column Property Value function. See Sec.
index 0910ec173eb30c0103b853283d72c8be82cd8fd3..a66523d8b499cfcd6bfc1daec4a8485c6b61b1ae 100644 (file)
@@ -50,7 +50,7 @@
  */
 package org.apache.fop.fo.expr;
 
-import org.apache.fop.fo.Property;
+import org.apache.fop.fo.properties.Property;
 import org.apache.fop.datatypes.PercentBase;
 
 /**
index 08c8d96d496166bcb81738c96878aa7c7c9711db..31ef3a763c8ebcd9bc30a3487b5e2bcabc807608 100644 (file)
@@ -50,8 +50,8 @@
  */
 package org.apache.fop.fo.expr;
 
-import org.apache.fop.fo.Property;
 import org.apache.fop.fo.FOPropertyMapping;
+import org.apache.fop.fo.properties.Property;
 
 /**
  * Class modelling the inherited-property-value Property Value function. See
index e44b29951b38776305cdc13c83fe87e0a033151d..7b2277511f578e000b3cb8bbded14775c2354535 100644 (file)
 package org.apache.fop.fo.expr;
 
 import org.apache.fop.datatypes.LengthBase;
-import org.apache.fop.datatypes.LinearCombinationLength;
-import org.apache.fop.datatypes.PercentLength;
 import org.apache.fop.fo.Constants;
-import org.apache.fop.fo.Property;
-import org.apache.fop.fo.LengthProperty;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.flow.ListItem;
+import org.apache.fop.fo.properties.LengthProperty;
+import org.apache.fop.fo.properties.LinearCombinationLength;
+import org.apache.fop.fo.properties.PercentLength;
+import org.apache.fop.fo.properties.Property;
 
 /**
  * Class modelling the label-end Property Value function. See Sec. 5.10.4 of the
index 40c8a407a0c9507a1982d852f49489545fb51b40..1127bcc975b569e4d7cc22be2db70ce20e9aaf9a 100644 (file)
@@ -50,7 +50,7 @@
  */
 package org.apache.fop.fo.expr;
 
-import org.apache.fop.fo.Property;
+import org.apache.fop.fo.properties.Property;
 
 /**
  * Class for managing the "max" Number Function. See Sec. 5.10.1 in the XSL-FO
index cdb9f25a31f186b889161732fbf6fc4d2d8043c0..6ddaa0ba3ccd294aa583d8b0b93139b469bb0b07 100644 (file)
@@ -50,7 +50,7 @@
  */
 package org.apache.fop.fo.expr;
 
-import org.apache.fop.fo.Property;
+import org.apache.fop.fo.properties.Property;
 
 /**
  * Class for managing the "min" Number Function. See Sec. 5.10.1 in the XSL-FO
index 7fff73df2764ca69c38c7951a01aaf1e5901d460..7fd8801de1384abae98763a33b1d58e922715e6b 100644 (file)
@@ -50,7 +50,7 @@
  */
 package org.apache.fop.fo.expr;
 
-import org.apache.fop.fo.Property;
+import org.apache.fop.fo.properties.Property;
 import org.apache.fop.datatypes.ColorType;
 
 /**
index 6ac4dc743d50c9c9c8a2ad804dca7f9efe0c753f..a52a4a0c4d51c26430951e81b40ef02bcd77713a 100644 (file)
@@ -50,8 +50,8 @@
  */
 package org.apache.fop.fo.expr;
 
-import org.apache.fop.fo.Property;
 import org.apache.fop.fo.FOPropertyMapping;
+import org.apache.fop.fo.properties.Property;
 
 /**
  * Class modelling the from-nearest-specified-value function. See Sec. 5.10.4
index 3d9028cba66cfa512de58499a0f976ba36dc81bf..70de2fa444f6a4dfd9aa3ae2f2ccc1529b685825 100644 (file)
@@ -53,14 +53,14 @@ package org.apache.fop.fo.expr;
 import java.util.Vector;
 
 import org.apache.fop.datatypes.PercentBase;
-import org.apache.fop.datatypes.FixedLength;
-import org.apache.fop.datatypes.TableColLength;
-import org.apache.fop.datatypes.PercentLength;
-import org.apache.fop.datatypes.MixedLength;
-
-import org.apache.fop.fo.ColorTypeProperty;
-import org.apache.fop.fo.LengthProperty;
-import org.apache.fop.fo.Property;
+
+import org.apache.fop.fo.properties.ColorTypeProperty;
+import org.apache.fop.fo.properties.FixedLength;
+import org.apache.fop.fo.properties.LengthProperty;
+import org.apache.fop.fo.properties.MixedLength;
+import org.apache.fop.fo.properties.PercentLength;
+import org.apache.fop.fo.properties.Property;
+import org.apache.fop.fo.properties.TableColLength;
 
 public class NumericProperty extends Property {
     // Bit fields
index 4d2ce74fc128e4cd47c5ec051489b07602cbe7eb..06edf8d4106452fced05f214b7e7278e51c32006 100644 (file)
@@ -51,8 +51,8 @@
 package org.apache.fop.fo.expr;
 
 
-import org.apache.fop.fo.Property;
-import org.apache.fop.datatypes.TableColLength;
+import org.apache.fop.fo.properties.Property;
+import org.apache.fop.fo.properties.TableColLength;
 
 /**
  * Class modelling the proportional-column-width function. See Sec. 5.10.4 of
index 4a2bcca09ac9e89245a49e037000d76c25fa10f1..a2663027753ac21e2218c203f457ffa3971f3a30 100644 (file)
  */
 package org.apache.fop.fo.expr;
 
-import org.apache.fop.datatypes.FixedLength;
 import org.apache.fop.datatypes.PercentBase;
-import org.apache.fop.datatypes.PercentLength;
-import org.apache.fop.fo.Property;
-import org.apache.fop.fo.ColorTypeProperty;
-import org.apache.fop.fo.ListProperty;
-import org.apache.fop.fo.LengthProperty;
-import org.apache.fop.fo.NumberProperty;
-import org.apache.fop.fo.StringProperty;
+import org.apache.fop.fo.properties.ColorTypeProperty;
+import org.apache.fop.fo.properties.FixedLength;
+import org.apache.fop.fo.properties.LengthProperty;
+import org.apache.fop.fo.properties.ListProperty;
+import org.apache.fop.fo.properties.NumberProperty;
+import org.apache.fop.fo.properties.PercentLength;
+import org.apache.fop.fo.properties.Property;
+import org.apache.fop.fo.properties.StringProperty;
 
 import java.util.HashMap;
 
index 00b58a35925d42dee279151284cb7172ba74272b..69d92c9c05af04f08d131033a5ce045b624c6f34 100644 (file)
@@ -51,8 +51,8 @@
 package org.apache.fop.fo.expr;
 
 
-import org.apache.fop.fo.Property;
-import org.apache.fop.fo.ColorTypeProperty;
+import org.apache.fop.fo.properties.ColorTypeProperty;
+import org.apache.fop.fo.properties.Property;
 import org.apache.fop.datatypes.PercentBase;
 
 class RGBColorFunction extends FunctionBase {
index 1877c87f2a9de3950de481fbfdbded14aa5f46a0..3980704d16e3eb818befa3c9a5efbc49c98a61e4 100644 (file)
@@ -51,8 +51,8 @@
 package org.apache.fop.fo.expr;
 
 
-import org.apache.fop.fo.Property;
-import org.apache.fop.fo.NumberProperty;
+import org.apache.fop.fo.properties.NumberProperty;
+import org.apache.fop.fo.properties.Property;
 
 class RoundFunction extends FunctionBase {
     public int nbArgs() {
index 06141c98311618871a742a828cb87e6a29f440bd..3e51896bec21280411f4e87bb8a7eb15422aad19 100644 (file)
@@ -58,7 +58,7 @@ import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.FOTreeVisitor;
-import org.apache.fop.fo.LengthProperty;
+import org.apache.fop.fo.properties.LengthProperty;
 import org.apache.fop.image.ImageFactory;
 import org.apache.fop.image.FopImage;
 // Java
index bcb745399c36f03d3dabefebdc062ce37afd64c4..e7cb39d1ebb493866ed9bd5d3b360cf83a419f29 100644 (file)
@@ -52,7 +52,6 @@ package org.apache.fop.fo.flow;
 
 import org.apache.fop.datatypes.ColorType;
 import org.apache.fop.datatypes.Length;
-import org.apache.fop.datatypes.PercentLength;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FOTreeVisitor;
 import org.apache.fop.fo.FObjMixed;
@@ -62,6 +61,7 @@ import org.apache.fop.fo.properties.CommonBackground;
 import org.apache.fop.fo.properties.CommonBorderAndPadding;
 import org.apache.fop.fo.properties.CommonMarginInline;
 import org.apache.fop.fo.properties.CommonRelativePosition;
+import org.apache.fop.fo.properties.PercentLength;
 import org.apache.fop.fonts.Font;
 
 /**
index ad531aa6f0a6336ec8d48da3b6c2cba2ecc114e9..1a621b39c3ee4b463e97d0db8dd0a2c284938495 100644 (file)
@@ -59,7 +59,6 @@ import org.xml.sax.Attributes;
 // FOP
 import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.ColorType;
-import org.apache.fop.fo.LengthRangeProperty;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.FOTreeVisitor;
@@ -69,6 +68,7 @@ import org.apache.fop.fo.properties.CommonBackground;
 import org.apache.fop.fo.properties.CommonBorderAndPadding;
 import org.apache.fop.fo.properties.CommonMarginBlock;
 import org.apache.fop.fo.properties.CommonRelativePosition;
+import org.apache.fop.fo.properties.LengthRangeProperty;
 
 /**
  * Class modelling the fo:table object. See Sec. 6.7.3 of the XSL-FO Standard.
index 4d6eb7a782275ce10245d56d6a1df6b900451996..76a96077197bce7ba65685ee194f20119f2c98b5 100644 (file)
@@ -60,10 +60,10 @@ import org.apache.fop.datatypes.Length;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.FOTreeVisitor;
-import org.apache.fop.fo.Property;
 
 import org.apache.fop.fo.properties.CommonBackground;
 import org.apache.fop.fo.properties.CommonBorderAndPadding;
+import org.apache.fop.fo.properties.Property;
 
 /**
  * Class modelling the fo:table-column object. See Sec. 6.7.4 of the XSL-FO
index 39bac72ed8e38429d391353c166fc51fb896352b..a8806d8d9ad122d9e3e40f678771a384bb064be7 100644 (file)
@@ -59,7 +59,6 @@ import org.apache.fop.datatypes.ColorType;
 import org.apache.fop.datatypes.KeepValue;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
-import org.apache.fop.fo.Property;
 import org.apache.fop.fo.FOTreeVisitor;
 import org.apache.fop.fo.Constants;
 
@@ -68,6 +67,7 @@ import org.apache.fop.fo.properties.CommonAural;
 import org.apache.fop.fo.properties.CommonBackground;
 import org.apache.fop.fo.properties.CommonBorderAndPadding;
 import org.apache.fop.fo.properties.CommonRelativePosition;
+import org.apache.fop.fo.properties.Property;
 
 
 /**
index fd89cc6702605291c6814f6e87f3b595fdf80bc6..1a55e7838a284f13bb9d9ebc1ac8720f74584b25 100644 (file)
@@ -57,9 +57,9 @@ import org.apache.fop.datatypes.FODimension;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FOTreeVisitor;
 import org.apache.fop.fo.FObj;
-import org.apache.fop.fo.Property;
 import org.apache.fop.fo.PropertyList;
 import org.apache.fop.fo.properties.CommonMarginBlock;
+import org.apache.fop.fo.properties.Property;
 import org.apache.fop.fo.FOPropertyMapping;
 
 /**
index 3fbe8c67b7ae70f9a808353840eaa66a4cc81b2d..6036893fc3fe2088336c4b969a4c095b79b492c7 100644 (file)
@@ -53,16 +53,16 @@ package org.apache.fop.fo.pagination;
 // FOP
 import org.apache.fop.datatypes.ColorType;
 import org.apache.fop.datatypes.Length;
-import org.apache.fop.fo.EnumProperty;
 import org.apache.fop.fo.FObjMixed;
 import org.apache.fop.fo.FONode;
-import org.apache.fop.fo.LengthProperty;
-import org.apache.fop.fo.Property;
 import org.apache.fop.fo.FOTreeVisitor;
 import org.apache.fop.fo.properties.CommonAccessibility;
 import org.apache.fop.fo.properties.CommonAural;
 import org.apache.fop.fo.properties.CommonBackground;
 import org.apache.fop.fo.properties.CommonBorderAndPadding;
+import org.apache.fop.fo.properties.EnumProperty;
+import org.apache.fop.fo.properties.LengthProperty;
+import org.apache.fop.fo.properties.Property;
 import org.apache.fop.fonts.Font;
 import org.apache.fop.fo.properties.CommonMarginInline;
 
diff --git a/src/java/org/apache/fop/fo/properties/AutoLength.java b/src/java/org/apache/fop/fo/properties/AutoLength.java
new file mode 100644 (file)
index 0000000..0730a28
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * $Id$
+ * ============================================================================
+ *                    The Apache Software License, Version 1.1
+ * ============================================================================
+ * 
+ * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, are permitted provided that the following conditions are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution, if any, must
+ *    include the following acknowledgment: "This product includes software
+ *    developed by the Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself, if
+ *    and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ *    endorse or promote products derived from this software without prior
+ *    written permission. For written permission, please contact
+ *    apache@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache", nor may
+ *    "Apache" appear in their name, without prior written permission of the
+ *    Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ============================================================================
+ * 
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the Apache Software Foundation and was originally created by
+ * James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */ 
+package org.apache.fop.fo.properties;
+
+
+/**
+ * A length quantity in XSL which is specified as "auto".
+ */
+public class AutoLength extends LengthProperty {
+
+    /**
+     * @see org.apache.fop.datatypes.Length#isAuto()
+     */
+    public boolean isAuto() {
+        return true;
+    }
+
+    // Should we do something intelligent here to set the actual size?
+    // Would need a reference object!
+    //    protected void computeValue() {
+    //    }
+
+    /**
+     * @see org.apache.fop.fo.Property#getString()
+     */
+    public String getString() {
+        return "auto";
+    }
+
+}
index 637a62845e3b82bc3b7bd311f13cfafb7aea9ae7..ff68496962f0656e1174ed69aa9060bb5bdcbdf6 100644 (file)
@@ -52,8 +52,6 @@ package org.apache.fop.fo.properties;
 
 import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.Constants;
-import org.apache.fop.fo.LengthProperty;
-import org.apache.fop.fo.Property;
 import org.apache.fop.fo.PropertyList;
 
 /**
diff --git a/src/java/org/apache/fop/fo/properties/CharacterProperty.java b/src/java/org/apache/fop/fo/properties/CharacterProperty.java
new file mode 100644 (file)
index 0000000..4931887
--- /dev/null
@@ -0,0 +1,111 @@
+/*
+ * $Id$
+ * ============================================================================
+ *                    The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any, must
+ *    include the following acknowledgment: "This product includes software
+ *    developed by the Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself, if
+ *    and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ *    endorse or promote products derived from this software without prior
+ *    written permission. For written permission, please contact
+ *    apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache", nor may
+ *    "Apache" appear in their name, without prior written permission of the
+ *    Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ============================================================================
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the Apache Software Foundation and was originally created by
+ * James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
+package org.apache.fop.fo.properties;
+
+import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.PropertyList;
+
+/**
+ * Superclass for properties that wrap a character value
+ */
+public class CharacterProperty extends Property {
+
+    /**
+     * Inner class for creating instances of CharacterProperty
+     */
+    public static class Maker extends PropertyMaker {
+
+        /**
+         * @param propName name of property for which a Maker should be created
+         */
+        public Maker(int propId) {
+            super(propId);
+        }
+
+        public Property make(PropertyList propertyList, String value,
+                             FObj fo) {
+            char c = value.charAt(0);
+            return new CharacterProperty(c);
+        }
+
+    }    // end Charakter.Maker
+
+    private char character;
+
+    /**
+     * @param character character value to be wrapped in this property
+     */
+    public CharacterProperty(char character) {
+        this.character = character;
+    }
+
+    /**
+     * @return this.character cast as an Object
+     */
+    public Object getObject() {
+        return new Character(character);
+    }
+
+    /**
+     * @return this.character
+     */
+    public char getCharacter() {
+        return this.character;
+    }
+
+    /**
+     * @return this.character cast as a String
+     */
+    public String getString() {
+        return new Character(character).toString();
+    }
+
+}
diff --git a/src/java/org/apache/fop/fo/properties/ColorTypeProperty.java b/src/java/org/apache/fop/fo/properties/ColorTypeProperty.java
new file mode 100644 (file)
index 0000000..f85154e
--- /dev/null
@@ -0,0 +1,810 @@
+/*
+ * $Id$
+ * ============================================================================
+ *                    The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any, must
+ *    include the following acknowledgment: "This product includes software
+ *    developed by the Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself, if
+ *    and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ *    endorse or promote products derived from this software without prior
+ *    written permission. For written permission, please contact
+ *    apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache", nor may
+ *    "Apache" appear in their name, without prior written permission of the
+ *    Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ============================================================================
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the Apache Software Foundation and was originally created by
+ * James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
+package org.apache.fop.fo.properties;
+
+import java.awt.Color;
+import java.util.StringTokenizer;
+
+import org.apache.fop.datatypes.ColorType;
+import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.PropertyList;
+
+/**
+ * Superclass for properties that wrap ColorType values
+ */
+public class ColorTypeProperty extends Property implements ColorType {
+    /**
+     * the red component
+     */
+    protected float red = 0f;
+
+    /**
+     * the green component
+     */
+    protected float green = 0f;
+
+    /**
+     * the blue component
+     */
+    protected float blue = 0f;
+
+    /**
+     * the alpha component (indicator of opaque-ness)
+     * 0.0 - 1.0; 0.0 is completely transparent; 1.0 is completely opaque
+     * see definition at http://java.sun.com/j2se/1.3/docs/api/java/awt/Color.html
+     */
+    protected float alpha = 1f;
+
+    /**
+     * Inner class for creating instances of ColorTypeProperty
+     */
+    public static class Maker extends PropertyMaker {
+
+        /**
+         * @param propName name of property for which a Maker should be created
+         */
+        public Maker(int propId) {
+            super(propId);
+        }
+
+        public Property convertProperty(Property p,
+                                        PropertyList propertyList, FObj fo) {
+            if (p instanceof ColorTypeProperty) {
+                return p;
+            }
+            ColorTypeProperty val = p.getColorType();
+            if (val != null) {
+                return val;
+            }
+            return convertPropertyDatatype(p, propertyList, fo);
+        }
+
+    }
+
+    /**
+     * Main constructor
+     * @param red red component
+     * @param green green component
+     * @param blue blue component
+     */
+    public ColorTypeProperty(float red, float green, float blue) {
+        this.red = red;
+        this.green = green;
+        this.blue = blue;
+    }
+
+    /**
+     * Set the colour given a particular String specifying either a
+     * colour name or #RGB or #RRGGBB
+     * @param value RGB value as String to be parsed
+     */
+    public ColorTypeProperty(String value) {
+        if (value.startsWith("#")) {
+            try {
+                if (value.length() == 4) {
+                    // note: divide by 15 so F = FF = 1 and so on
+                    this.red = Integer.parseInt(value.substring(1, 2), 16)
+                    / 15f;
+                    this.green = Integer.parseInt(value.substring(2, 3), 16)
+                    / 15f;
+                    this.blue = Integer.parseInt(value.substring(3), 16)
+                    / 15f;
+                } else if (value.length() == 7) {
+                    // note: divide by 255 so FF = 1
+                    this.red = Integer.parseInt(value.substring(1, 3), 16)
+                    / 255f;
+                    this.green = Integer.parseInt(value.substring(3, 5), 16)
+                    / 255f;
+                    this.blue = Integer.parseInt(value.substring(5), 16)
+                    / 255f;
+                } else {
+                    this.red = 0;
+                    this.green = 0;
+                    this.blue = 0;
+                    //log.error("unknown colour format. Must be #RGB or #RRGGBB");
+                }
+            } catch (Exception e) {
+                this.red = 0;
+                this.green = 0;
+                this.blue = 0;
+                //log.error("unknown colour format. Must be #RGB or #RRGGBB");
+            }
+        } else if (value.startsWith("rgb(")) {
+            int poss = value.indexOf("(");
+            int pose = value.indexOf(")");
+            if (poss != -1 && pose != -1) {
+                value = value.substring(poss + 1, pose);
+                StringTokenizer st = new StringTokenizer(value, ",");
+                try {
+                    if (st.hasMoreTokens()) {
+                        String str = st.nextToken().trim();
+                        if (str.endsWith("%")) {
+                            this.red =
+                            Integer.parseInt(str.substring(0, str.length() - 1))
+                            * 2.55f;
+                        } else {
+                            this.red = Integer.parseInt(str) / 255f;
+                        }
+                    }
+                    if (st.hasMoreTokens()) {
+                        String str = st.nextToken().trim();
+                        if (str.endsWith("%")) {
+                            this.green =
+                            Integer.parseInt(str.substring(0, str.length() - 1))
+                            * 2.55f;
+                        } else {
+                            this.green = Integer.parseInt(str) / 255f;
+                        }
+                    }
+                    if (st.hasMoreTokens()) {
+                        String str = st.nextToken().trim();
+                        if (str.endsWith("%")) {
+                            this.blue =
+                            Integer.parseInt(str.substring(0, str.length() - 1))
+                            * 2.55f;
+                        } else {
+                            this.blue = Integer.parseInt(str) / 255f;
+                        }
+                    }
+                } catch (Exception e) {
+                    this.red = 0;
+                    this.green = 0;
+                    this.blue = 0;
+                    //log.error("unknown colour format. Must be #RGB or #RRGGBB");
+                }
+            }
+        } else if (value.startsWith("url(")) {
+            // refers to a gradient
+        } else {
+            if (value.toLowerCase().equals("transparent")) {
+                this.red = 0;
+                this.green = 0;
+                this.blue = 0;
+                this.alpha = 0;
+            } else {
+                boolean found = false;
+                for (int count = 0; count < NAMES.length; count++) {
+                    if (value.toLowerCase().equals(NAMES[count])) {
+                        this.red = VALUES[count][0] / 255f;
+                        this.green = VALUES[count][1] / 255f;
+                        this.blue = VALUES[count][2] / 255f;
+                        found = true;
+                        break;
+                    }
+                }
+                if (!found) {
+                    this.red = 0;
+                    this.green = 0;
+                    this.blue = 0;
+                    //log.error("unknown colour name: "
+                    //                       + value);
+                }
+            }
+        }
+    }
+
+    /**
+     * Returns the blue component of the color.
+     * @return float a value between 0.0 and 1.0
+     */
+    public float getBlue() {
+        return this.blue;
+    }
+
+    /**
+     * Returns the green component of the color.
+     * @return float a value between 0.0 and 1.0
+     */
+    public float getGreen() {
+        return this.green;
+    }
+
+    /**
+     * Returns the red component of the color.
+     * @return float a value between 0.0 and 1.0
+     */
+    public float getRed() {
+        return this.red;
+    }
+
+    /**
+     * Returns the alpha (degree of opaque-ness) component of the color.
+     * @return float a value between 0.0 (fully transparent) and 1.0 (fully opaque)
+     */
+    public float getAlpha() {
+        return this.alpha;
+    }
+
+    /**
+     * Returns an AWT instance of this color
+     * @return float the AWT color represented by this ColorType instance
+     */
+    public Color getAWTColor() {
+        return new Color(this.red, this.green, this.blue, this.alpha);
+    }
+
+    /**
+     * @param floatValue value (between 0.0 and 1.0) of color channel
+     * @return integer equivalent (between 0 and 255)
+     */
+    public static int convertChannelToInteger (float floatValue) {
+        if (floatValue > 1.0) {
+            floatValue = 1.0f;
+        }
+        if (floatValue < 0) {
+            floatValue = 0;
+        }
+        return (int) (floatValue * 255);
+    }
+
+    /**
+     * @see java.lang.Object#toString()
+     */
+    public String toString() {
+        StringBuffer sbuf = new StringBuffer(8);
+        sbuf.append('#');
+        String s = Integer.toHexString((int)(red * 255.0));
+        if (s.length() == 1) {
+            sbuf.append('0');
+        }
+        sbuf.append(s);
+        s = Integer.toHexString((int)(green * 255.0));
+        if (s.length() == 1) {
+            sbuf.append('0');
+        }
+        sbuf.append(s);
+        s = Integer.toHexString((int)(blue * 255.0));
+        if (s.length() == 1) {
+            sbuf.append('0');
+        }
+        sbuf.append(s);
+        return sbuf.toString();
+    }
+
+    /** The names of the predefined colors */
+    protected static final String[] NAMES = {
+                "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige",
+                "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown",
+                "burlywood", "cadetblue", "chartreuse", "chocolate", "coral",
+                "cornflowerblue", "cornsilk", "crimson", "cyan", "darkblue",
+                "darkcyan", "darkgoldenrod", "darkgray", "darkgreen", "darkgrey",
+                "darkkhaki", "darkmagenta", "darkolivegreen", "darkorange",
+                "darkorchid", "darkred", "darksalmon", "darkseagreen",
+                "darkslateblue", "darkslategray", "darkslategrey", "darkturquoise",
+                "darkviolet", "deeppink", "deepskyblue", "dimgray", "dimgrey",
+                "dodgerblue", "firebrick", "floralwhite", "forestgreen", "fuchsia",
+                "gainsboro", "lightpink", "lightsalmon", "lightseagreen",
+                "lightskyblue", "lightslategray", "lightslategrey", "lightsteelblue",
+                "lightyellow", "lime", "limegreen", "linen", "magenta", "maroon",
+                "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple",
+                "mediumseagreen", "mediumslateblue", "mediumspringgreen",
+                "mediumturquoise", "mediumvioletred", "midnightblue", "mintcream",
+                "mistyrose", "moccasin", "navajowhite", "navy", "oldlace", "olive",
+                "olivedrab", "orange", "orangered", "orchid", "palegoldenrod",
+                "palegreen", "paleturquoise", "palevioletred", "papayawhip",
+                "peachpuff", "peru", "pink", "plum", "powderblue", "purple", "red",
+                "rosybrown", "royalblue", "saddlebrown", "salmon", "ghostwhite",
+                "gold", "goldenrod", "gray", "grey", "green", "greenyellow",
+                "honeydew", "hotpink", "indianred", "indigo", "ivory", "khaki",
+                "lavender", "lavenderblush", "lawngreen", "lemonchiffon",
+                "lightblue", "lightcoral", "lightcyan", "lightgoldenrodyellow",
+                "lightgray", "lightgreen", "lightgrey", "sandybrown", "seagreen",
+                "seashell", "sienna", "silver", "skyblue", "slateblue", "slategray",
+                "slategrey", "snow", "springgreen", "steelblue", "tan", "teal",
+                "thistle", "tomato", "turquoise", "violet", "wheat", "white",
+                "whitesmoke", "yellow", "yellowgreen"
+    };
+
+    /** The color values for the predefined colors */
+    protected static final int[][] VALUES = {
+                {
+                            240, 248, 255
+                        }, {
+                            250, 235, 215
+                        }, {
+                            0, 255, 255
+                        }, {
+                            127, 255, 212
+                        }, {
+                            240, 255, 255
+                        }, {
+                            245, 245, 220
+                        }, {
+                            255, 228, 196
+                        }, {
+                            0, 0, 0
+                        }, {
+                            255, 235, 205
+                        }, {
+                            0, 0, 255
+                        }, {
+                            138, 43, 226
+                        }, {
+                            165, 42, 42
+                        }, {
+                            222, 184, 135
+                        }, {
+                            95, 158, 160
+                        }, {
+                            127, 255, 0
+                        }, {
+                            210, 105, 30
+                        }, {
+                            255, 127, 80
+                        }, {
+                            100, 149, 237
+                        }, {
+                            255, 248, 220
+                        }, {
+                            220, 20, 60
+                        }, {
+                            0, 255, 255
+                        }, {
+                            0, 0, 139
+                        }, {
+                            0, 139, 139
+                        }, {
+                            184, 134, 11
+                        }, {
+                            169, 169, 169
+                        }, {
+                            0, 100, 0
+                        }, {
+                            169, 169, 169
+                        }, {
+                            189, 183, 107
+                        }, {
+                            139, 0, 139
+                        }, {
+                            85, 107, 47
+                        }, {
+                            255, 140, 0
+                        }, {
+                            153, 50, 204
+                        }, {
+                            139, 0, 0
+                        }, {
+                            233, 150, 122
+                        }, {
+                            143, 188, 143
+                        }, {
+                            72, 61, 139
+                        }, {
+                            47, 79, 79
+                        }, {
+                            47, 79, 79
+                        }, {
+                            0, 206, 209
+                        }, {
+                            148, 0, 211
+                        }, {
+                            255, 20, 147
+                        }, {
+                            0, 191, 255
+                        }, {
+                            105, 105, 105
+                        }, {
+                            105, 105, 105
+                        }, {
+                            30, 144, 255
+                        }, {
+                            178, 34, 34
+                        }, {
+                            255, 250, 240
+                        }, {
+                            34, 139, 34
+                        }, {
+                            255, 0, 255
+                        }, {
+                            220, 220, 220
+                        }, {
+                            255, 182, 193
+                        }, {
+                            255, 160, 122
+                        }, {
+                            32, 178, 170
+                        }, {
+                            135, 206, 250
+                        }, {
+                            119, 136, 153
+                        }, {
+                            119, 136, 153
+                        }, {
+                            176, 196, 222
+                        }, {
+                            255, 255, 224
+                        }, {
+                            0, 255, 0
+                        }, {
+                            50, 205, 50
+                        }, {
+                            250, 240, 230
+                        }, {
+                            255, 0, 255
+                        }, {
+                            128, 0, 0
+                        }, {
+                            102, 205, 170
+                        }, {
+                            0, 0, 205
+                        }, {
+                            186, 85, 211
+                        }, {
+                            147, 112, 219
+                        }, {
+                            60, 179, 113
+                        }, {
+                            123, 104, 238
+                        }, {
+                            0, 250, 154
+                        }, {
+                            72, 209, 204
+                        }, {
+                            199, 21, 133
+                        }, {
+                            25, 25, 112
+                        }, {
+                            245, 255, 250
+                        }, {
+                            255, 228, 225
+                        }, {
+                            255, 228, 181
+                        }, {
+                            255, 222, 173
+                        }, {
+                            0, 0, 128
+                        }, {
+                            253, 245, 230
+                        }, {
+                            128, 128, 0
+                        }, {
+                            107, 142, 35
+                        }, {
+                            255, 165, 0
+                        }, {
+                            255, 69, 0
+                        }, {
+                            218, 112, 214
+                        }, {
+                            238, 232, 170
+                        }, {
+                            152, 251, 152
+                        }, {
+                            175, 238, 238
+                        }, {
+                            219, 112, 147
+                        }, {
+                            255, 239, 213
+                        }, {
+                            255, 218, 185
+                        }, {
+                            205, 133, 63
+                        }, {
+                            255, 192, 203
+                        }, {
+                            221, 160, 221
+                        }, {
+                            176, 224, 230
+                        }, {
+                            128, 0, 128
+                        }, {
+                            255, 0, 0
+                        }, {
+                            188, 143, 143
+                        }, {
+                            65, 105, 225
+                        }, {
+                            139, 69, 19
+                        }, {
+                            250, 128, 114
+                        }, {
+                            248, 248, 255
+                        }, {
+                            255, 215, 0
+                        }, {
+                            218, 165, 32
+                        }, {
+                            128, 128, 128
+                        }, {
+                            128, 128, 128
+                        }, {
+                            0, 128, 0
+                        }, {
+                            173, 255, 47
+                        }, {
+                            240, 255, 240
+                        }, {
+                            255, 105, 180
+                        }, {
+                            205, 92, 92
+                        }, {
+                            75, 0, 130
+                        }, {
+                            255, 255, 240
+                        }, {
+                            240, 230, 140
+                        }, {
+                            230, 230, 250
+                        }, {
+                            255, 240, 245
+                        }, {
+                            124, 252, 0
+                        }, {
+                            255, 250, 205
+                        }, {
+                            173, 216, 230
+                        }, {
+                            240, 128, 128
+                        }, {
+                            224, 255, 255
+                        }, {
+                            250, 250, 210
+                        }, {
+                            211, 211, 211
+                        }, {
+                            144, 238, 144
+                        }, {
+                            211, 211, 211
+                        }, {
+                            244, 164, 96
+                        }, {
+                            46, 139, 87
+                        }, {
+                            255, 245, 238
+                        }, {
+                            160, 82, 45
+                        }, {
+                            192, 192, 192
+                        }, {
+                            135, 206, 235
+                        }, {
+                            106, 90, 205
+                        }, {
+                            112, 128, 144
+                        }, {
+                            112, 128, 144
+                        }, {
+                            255, 250, 250
+                        }, {
+                            0, 255, 127
+                        }, {
+                            70, 130, 180
+                        }, {
+                            210, 180, 140
+                        }, {
+                            0, 128, 128
+                        }, {
+                            216, 191, 216
+                        }, {
+                            255, 99, 71
+                        }, {
+                            64, 224, 208
+                        }, {
+                            238, 130, 238
+                        }, {
+                            245, 222, 179
+                        }, {
+                            255, 255, 255
+                        }, {
+                            245, 245, 245
+                        }, {
+                            255, 255, 0
+                        }, {
+                            154, 205, 50
+                        }
+    };
+
+    /*
+     * aliceblue rgb(240, 248, 255)
+     * antiquewhite rgb(250, 235, 215)
+     * aqua rgb( 0, 255, 255)
+     * aquamarine rgb(127, 255, 212)
+     * azure rgb(240, 255, 255)
+     * beige rgb(245, 245, 220)
+     * bisque rgb(255, 228, 196)
+     * black rgb( 0, 0, 0)
+     * blanchedalmond rgb(255, 235, 205)
+     * blue rgb( 0, 0, 255)
+     * blueviolet rgb(138, 43, 226)
+     * brown rgb(165, 42, 42)
+     * burlywood rgb(222, 184, 135)
+     * cadetblue rgb( 95, 158, 160)
+     * chartreuse rgb(127, 255, 0)
+     * chocolate rgb(210, 105, 30)
+     * coral rgb(255, 127, 80)
+     * cornflowerblue rgb(100, 149, 237)
+     * cornsilk rgb(255, 248, 220)
+     * crimson rgb(220, 20, 60)
+     * cyan rgb( 0, 255, 255)
+     * darkblue rgb( 0, 0, 139)
+     * darkcyan rgb( 0, 139, 139)
+     * darkgoldenrod rgb(184, 134, 11)
+     * darkgray rgb(169, 169, 169)
+     * darkgreen rgb( 0, 100, 0)
+     * darkgrey rgb(169, 169, 169)
+     * darkkhaki rgb(189, 183, 107)
+     * darkmagenta rgb(139, 0, 139)
+     * darkolivegreen rgb( 85, 107, 47)
+     * darkorange rgb(255, 140, 0)
+     * darkorchid rgb(153, 50, 204)
+     * darkred rgb(139, 0, 0)
+     * darksalmon rgb(233, 150, 122)
+     * darkseagreen rgb(143, 188, 143)
+     * darkslateblue rgb( 72, 61, 139)
+     * darkslategray rgb( 47, 79, 79)
+     * darkslategrey rgb( 47, 79, 79)
+     * darkturquoise rgb( 0, 206, 209)
+     * darkviolet rgb(148, 0, 211)
+     * deeppink rgb(255, 20, 147)
+     * deepskyblue rgb( 0, 191, 255)
+     * dimgray rgb(105, 105, 105)
+     * dimgrey rgb(105, 105, 105)
+     * dodgerblue rgb( 30, 144, 255)
+     * firebrick rgb(178, 34, 34)
+     * floralwhite rgb(255, 250, 240)
+     * forestgreen rgb( 34, 139, 34)
+     * fuchsia rgb(255, 0, 255)
+     * gainsboro rgb(220, 220, 220)
+     * lightpink rgb(255, 182, 193)
+     * lightsalmon rgb(255, 160, 122)
+     * lightseagreen rgb( 32, 178, 170)
+     * lightskyblue rgb(135, 206, 250)
+     * lightslategray rgb(119, 136, 153)
+     * lightslategrey rgb(119, 136, 153)
+     * lightsteelblue rgb(176, 196, 222)
+     * lightyellow rgb(255, 255, 224)
+     * lime rgb( 0, 255, 0)
+     * limegreen rgb( 50, 205, 50)
+     * linen rgb(250, 240, 230)
+     * magenta rgb(255, 0, 255)
+     * maroon rgb(128, 0, 0)
+     * mediumaquamarine rgb(102, 205, 170)
+     * mediumblue rgb( 0, 0, 205)
+     * mediumorchid rgb(186, 85, 211)
+     * mediumpurple rgb(147, 112, 219)
+     * mediumseagreen rgb( 60, 179, 113)
+     * mediumslateblue rgb(123, 104, 238)
+     * mediumspringgreen rgb( 0, 250, 154)
+     * mediumturquoise rgb( 72, 209, 204)
+     * mediumvioletred rgb(199, 21, 133)
+     * midnightblue rgb( 25, 25, 112)
+     * mintcream rgb(245, 255, 250)
+     * mistyrose rgb(255, 228, 225)
+     * moccasin rgb(255, 228, 181)
+     * navajowhite rgb(255, 222, 173)
+     * navy rgb( 0, 0, 128)
+     * oldlace rgb(253, 245, 230)
+     * olive rgb(128, 128, 0)
+     * olivedrab rgb(107, 142, 35)
+     * orange rgb(255, 165, 0)
+     * orangered rgb(255, 69, 0)
+     * orchid rgb(218, 112, 214)
+     * palegoldenrod rgb(238, 232, 170)
+     * palegreen rgb(152, 251, 152)
+     * paleturquoise rgb(175, 238, 238)
+     * palevioletred rgb(219, 112, 147)
+     * papayawhip rgb(255, 239, 213)
+     * peachpuff rgb(255, 218, 185)
+     * peru rgb(205, 133, 63)
+     * pink rgb(255, 192, 203)
+     * plum rgb(221, 160, 221)
+     * powderblue rgb(176, 224, 230)
+     * purple rgb(128, 0, 128)
+     * red rgb(255, 0, 0)
+     * rosybrown rgb(188, 143, 143)
+     * royalblue rgb( 65, 105, 225)
+     * saddlebrown rgb(139, 69, 19)
+     * salmon rgb(250, 128, 114)
+     * ghostwhite rgb(248, 248, 255)
+     * gold rgb(255, 215, 0)
+     * goldenrod rgb(218, 165, 32)
+     * gray rgb(128, 128, 128)
+     * grey rgb(128, 128, 128)
+     * green rgb( 0, 128, 0)
+     * greenyellow rgb(173, 255, 47)
+     * honeydew rgb(240, 255, 240)
+     * hotpink rgb(255, 105, 180)
+     * indianred rgb(205, 92, 92)
+     * indigo rgb( 75, 0, 130)
+     * ivory rgb(255, 255, 240)
+     * khaki rgb(240, 230, 140)
+     * lavender rgb(230, 230, 250)
+     * lavenderblush rgb(255, 240, 245)
+     * lawngreen rgb(124, 252, 0)
+     * lemonchiffon rgb(255, 250, 205)
+     * lightblue rgb(173, 216, 230)
+     * lightcoral rgb(240, 128, 128)
+     * lightcyan rgb(224, 255, 255)
+     * lightgoldenrodyellow rgb(250, 250, 210)
+     * lightgray rgb(211, 211, 211)
+     * lightgreen rgb(144, 238, 144)
+     * lightgrey rgb(211, 211, 211)
+     * sandybrown rgb(244, 164, 96)
+     * seagreen rgb( 46, 139, 87)
+     * seashell rgb(255, 245, 238)
+     * sienna rgb(160, 82, 45)
+     * silver rgb(192, 192, 192)
+     * skyblue rgb(135, 206, 235)
+     * slateblue rgb(106, 90, 205)
+     * slategray rgb(112, 128, 144)
+     * slategrey rgb(112, 128, 144)
+     * snow rgb(255, 250, 250)
+     * springgreen rgb( 0, 255, 127)
+     * steelblue rgb( 70, 130, 180)
+     * tan rgb(210, 180, 140)
+     * teal rgb( 0, 128, 128)
+     * thistle rgb(216, 191, 216)
+     * tomato rgb(255, 99, 71)
+     * turquoise rgb( 64, 224, 208)
+     * violet rgb(238, 130, 238)
+     * wheat rgb(245, 222, 179)
+     * white rgb(255, 255, 255)
+     * whitesmoke rgb(245, 245, 245)
+     * yellow rgb(255, 255, 0)
+     * yellowgreen rgb(154, 205, 50)
+     */
+
+    /**
+     * Can't convert to any other types
+     * @return this.colorType
+     */
+    public ColorTypeProperty getColorType() {
+        return this;
+    }
+
+    /**
+     * @return this.colorType cast as an Object
+     */
+    public Object getObject() {
+        return this;
+    }
+}
+
index aa72ad6de93ee1f8e48093e1ef12ca43d4a61145..80ff56d61142631bf07de55acea49855191c96d9 100644 (file)
@@ -52,7 +52,6 @@ package org.apache.fop.fo.properties;
 
 import org.apache.fop.datatypes.ColorType;
 import org.apache.fop.fo.Constants;
-import org.apache.fop.fo.CondLengthProperty;
 
 /**
  * Stores all common border and padding properties.
index 9a116807293d4936d826f5fc40d8b6d12f499876..96cc148e7edeb4c91eca5013177e3e2ba100eaa8 100644 (file)
@@ -53,9 +53,7 @@ package org.apache.fop.fo.properties;
 import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.CompoundDatatype;
 import org.apache.fop.fo.Constants;
-import org.apache.fop.fo.EnumProperty;
 import org.apache.fop.fo.FObj;
-import org.apache.fop.fo.Property;
 import org.apache.fop.fo.PropertyList;
 
 /**
diff --git a/src/java/org/apache/fop/fo/properties/CondLengthProperty.java b/src/java/org/apache/fop/fo/properties/CondLengthProperty.java
new file mode 100644 (file)
index 0000000..6eca744
--- /dev/null
@@ -0,0 +1,184 @@
+/*
+ * $Id$
+ * ============================================================================
+ *                    The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any, must
+ *    include the following acknowledgment: "This product includes software
+ *    developed by the Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself, if
+ *    and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ *    endorse or promote products derived from this software without prior
+ *    written permission. For written permission, please contact
+ *    apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache", nor may
+ *    "Apache" appear in their name, without prior written permission of the
+ *    Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ============================================================================
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the Apache Software Foundation and was originally created by
+ * James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
+package org.apache.fop.fo.properties;
+
+import org.apache.fop.apps.FOPException;
+import org.apache.fop.datatypes.CompoundDatatype;
+import org.apache.fop.fo.Constants;
+import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.PropertyList;
+
+/**
+ * Superclass for properties that have conditional lengths
+ */
+public class CondLengthProperty extends Property implements CompoundDatatype {
+    private Property length;
+    private Property conditionality;
+
+    /**
+     * Inner class for creating instances of CondLengthProperty
+     */
+    public static class Maker extends CompoundPropertyMaker {
+
+        /**
+         * @param name of property for which a Maker should be created
+         */
+        public Maker(int propId) {
+            super(propId);
+        }
+
+        /**
+         * Create a new empty instance of CondLengthProperty.
+         * @return the new instance. 
+         */
+        public Property makeNewProperty() {
+            return new CondLengthProperty();
+        }
+
+        /**
+         * @see CompoundPropertyMaker#convertProperty
+         */        
+        public Property convertProperty(Property p, PropertyList propertyList, FObj fo)
+            throws FOPException
+        {
+            if (p instanceof KeepProperty) {
+                return p;
+            }
+            return super.convertProperty(p, propertyList, fo);
+        }
+    }
+
+    /**
+     * @see org.apache.fop.datatypes.CompoundDatatype#setComponent(int, Property, boolean)
+     */
+    public void setComponent(int cmpId, Property cmpnValue,
+                             boolean bIsDefault) {
+        if (cmpId == CP_LENGTH) {
+            length = cmpnValue;
+        } else if (cmpId == CP_CONDITIONALITY) {
+            conditionality = cmpnValue;
+        }
+    }
+
+    /**
+     * @see org.apache.fop.datatypes.CompoundDatatype#getComponent(int)
+     */
+    public Property getComponent(int cmpId) {
+        if (cmpId == CP_LENGTH) {
+            return length;
+        } else if (cmpId == CP_CONDITIONALITY) {
+            return conditionality;
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Returns the conditionality.
+     * @return the conditionality
+     */
+    public Property getConditionality() {
+        return this.conditionality;
+    }
+
+    /**
+     * Returns the length.
+     * @return the length
+     */
+    public Property getLengthComponent() {
+        return this.length;
+    }
+
+    /**
+     * Indicates if the length can be discarded on certain conditions.
+     * @return true if the length can be discarded.
+     */
+    public boolean isDiscard() {
+        return this.conditionality.getEnum() == Constants.DISCARD;
+    }
+
+    /**
+     * Returns the computed length value.
+     * @return the length in millipoints
+     */
+    public int getLengthValue() {
+        return this.length.getLength().getValue();
+    }
+
+    public String toString() {
+        return "CondLength[" + (isDiscard() ? "discard, " : "") +
+        length.getObject().toString() + "]";
+    }    
+
+
+    /**
+     * @return this.condLength
+     */
+    public CondLengthProperty getCondLength() {
+        return this;
+    }
+
+    /**
+     * TODO: Should we allow this?
+     * @return this.condLength cast as a Length
+     */
+    public LengthProperty getLength() {
+        return length.getLength();
+    }
+
+    /**
+     * @return this.condLength cast as an Object
+     */
+    public Object getObject() {
+        return this;
+    }
+
+}
index 568e3a599b58451e8078a288bc27c0748391562e..6852b77ae0e8941d7da1ebd338b2478cd949d7e4 100644 (file)
@@ -52,7 +52,6 @@ package org.apache.fop.fo.properties;
 
 import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FObj;
-import org.apache.fop.fo.Property;
 import org.apache.fop.fo.PropertyList;
 
 /**
index c1c324cde3afd85aeb3fabd676843e923e12196b..50d03ea2086e37190d1a1b71ec15ca6d4a4c8f31 100644 (file)
@@ -52,7 +52,6 @@ package org.apache.fop.fo.properties;
 
 import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.Constants;
-import org.apache.fop.fo.Property;
 import org.apache.fop.fo.PropertyList;
 
 /**
diff --git a/src/java/org/apache/fop/fo/properties/EnumProperty.java b/src/java/org/apache/fop/fo/properties/EnumProperty.java
new file mode 100644 (file)
index 0000000..600cd8c
--- /dev/null
@@ -0,0 +1,126 @@
+/*
+ * $Id$
+ * ============================================================================
+ *                    The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any, must
+ *    include the following acknowledgment: "This product includes software
+ *    developed by the Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself, if
+ *    and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ *    endorse or promote products derived from this software without prior
+ *    written permission. For written permission, please contact
+ *    apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache", nor may
+ *    "Apache" appear in their name, without prior written permission of the
+ *    Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ============================================================================
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the Apache Software Foundation and was originally created by
+ * James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
+package org.apache.fop.fo.properties;
+
+import org.apache.fop.apps.FOPException;
+import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.PropertyList;
+
+/**
+ * Superclass for properties that wrap an enumeration value
+ */
+public class EnumProperty extends Property {
+
+    /**
+     * Inner class for creating EnumProperty instances
+     */
+    public static class Maker extends PropertyMaker {
+
+        /**
+         * @param propName name of property for which a Maker should be created
+         */
+        public Maker(int propId) {
+            super(propId);
+        }
+
+        /**
+         * Called by subclass if no match found.
+         * @param value string containing the value to be checked
+         * @return null (indicates that an appropriate match was not found)
+         */
+        public Property checkEnumValues(String value) {
+            //log.error("Unknown enumerated value for property '"
+            //                       + getPropName() + "': " + value);
+            return super.checkEnumValues(value);
+        }
+
+        protected Property findConstant(String value) {
+            return null;
+        }
+
+        public Property convertProperty(Property p,
+                                        PropertyList propertyList,
+                                        FObj fo) throws FOPException {
+            if (p instanceof EnumProperty) {
+                return p;
+            } else {
+                return super.convertProperty(p, propertyList, fo);
+            }
+        }
+    }
+
+    private int value;
+
+    /**
+     * @param explicitValue enumerated value to be set for this property
+     */
+    public EnumProperty(int explicitValue) {
+        this.value = explicitValue;
+    }
+
+    /**
+     * @return this.value
+     */
+    public int getEnum() {
+        return this.value;
+    }
+
+    /**
+     * @return this.value cast as an Object
+     */
+    public Object getObject() {
+        // TODO return String value: property must reference maker
+        // return maker.getEnumValue(this.value);
+        return new Integer(this.value);
+    }
+
+}
+
diff --git a/src/java/org/apache/fop/fo/properties/FixedLength.java b/src/java/org/apache/fop/fo/properties/FixedLength.java
new file mode 100644 (file)
index 0000000..c6f2a4b
--- /dev/null
@@ -0,0 +1,127 @@
+/*
+ * $Id$
+ * ============================================================================
+ *                    The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any, must
+ *    include the following acknowledgment: "This product includes software
+ *    developed by the Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself, if
+ *    and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ *    endorse or promote products derived from this software without prior
+ *    written permission. For written permission, please contact
+ *    apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache", nor may
+ *    "Apache" appear in their name, without prior written permission of the
+ *    Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ============================================================================
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the Apache Software Foundation and was originally created by
+ * James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
+package org.apache.fop.fo.properties;
+
+import org.apache.fop.fo.expr.NumericProperty;
+
+/**
+ * a length quantity in XSL
+ */
+public class FixedLength extends LengthProperty {
+
+    /**
+     * Set the length given
+     * @param numRelUnits the number of relative units
+     * @param iCurFontSize the current font size in base units.
+     */
+    public FixedLength(double numRelUnits, int iCurFontSize) {
+        setComputedValue((int)(numRelUnits * (double)iCurFontSize));
+    }
+
+    /**
+     * Set the length given a number of units and a unit name.
+     * @param numUnits quantity of input units
+     * @param units input unit specifier (in, cm, etc.)
+     */
+    public FixedLength(double numUnits, String units) {
+        convert(numUnits, units);
+    }
+
+    /**
+     * @param baseUnits the length as a number of base units (millipoints)
+     */
+    public FixedLength(int baseUnits) {
+        setComputedValue(baseUnits);
+    }
+
+    /**
+     * Convert the given length to a dimensionless integer representing
+     * a whole number of base units (milli-points).
+     * @param dvalue quantity of input units
+     * @param unit input unit specifier (in, cm, etc.)
+     */
+    protected void convert(double dvalue, String unit) {
+
+        int assumedResolution = 1;    // points/pixel
+
+        if (unit.equals("in")) {
+            dvalue = dvalue * 72;
+        } else if (unit.equals("cm")) {
+            dvalue = dvalue * 28.3464567;
+        } else if (unit.equals("mm")) {
+            dvalue = dvalue * 2.83464567;
+        } else if (unit.equals("pt")) {
+            // Do nothing.
+            // dvalue = dvalue;
+        } else if (unit.equals("pc")) {
+            dvalue = dvalue * 12;
+            /*
+             * } else if (unit.equals("em")) {
+             * dvalue = dvalue * fontsize;
+             */
+        } else if (unit.equals("px")) {
+            dvalue = dvalue * assumedResolution;
+        } else {
+            dvalue = 0;
+            //log.error("unknown length unit '" + unit
+            //                       + "'");
+        }
+        setComputedValue((int)(dvalue * 1000));
+    }
+
+    /**
+     * @return Numeric equivalent of this
+     */
+    public NumericProperty asNumeric() {
+        return new NumericProperty(this);
+    }
+}
+
index 7a19e784ebc4437dd3e8e30ca8586e3abfc60242..80344e2b2733167c0b82a5cbe7f626c91d2f7987 100644 (file)
@@ -51,9 +51,7 @@
 package org.apache.fop.fo.properties;
 
 import org.apache.fop.apps.FOPException;
-import org.apache.fop.datatypes.FixedLength;
 import org.apache.fop.fo.FOPropertyMapping;
-import org.apache.fop.fo.Property;
 import org.apache.fop.fo.PropertyList;
 import org.apache.fop.fo.expr.NumericProperty;
 
diff --git a/src/java/org/apache/fop/fo/properties/KeepProperty.java b/src/java/org/apache/fop/fo/properties/KeepProperty.java
new file mode 100644 (file)
index 0000000..fb34f7d
--- /dev/null
@@ -0,0 +1,199 @@
+/*
+ * $Id$
+ * ============================================================================
+ *                    The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any, must
+ *    include the following acknowledgment: "This product includes software
+ *    developed by the Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself, if
+ *    and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ *    endorse or promote products derived from this software without prior
+ *    written permission. For written permission, please contact
+ *    apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache", nor may
+ *    "Apache" appear in their name, without prior written permission of the
+ *    Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ============================================================================
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the Apache Software Foundation and was originally created by
+ * James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
+package org.apache.fop.fo.properties;
+
+import org.apache.fop.apps.FOPException;
+import org.apache.fop.datatypes.CompoundDatatype;
+import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.PropertyList;
+
+/**
+ * Superclass for properties that wrap Keep values
+ */
+public class KeepProperty extends Property implements CompoundDatatype {
+    private Property withinLine;
+    private Property withinColumn;
+    private Property withinPage;
+
+    /**
+     * Inner class for creating instances of KeepProperty
+     */
+    public static class Maker extends CompoundPropertyMaker {
+
+        /**
+         * @param name name of property for which Maker should be created
+         */
+        public Maker(int propId) {
+            super(propId);
+        }
+
+        /**
+         * Create a new empty instance of KeepProperty.
+         * @return the new instance. 
+         */
+        public Property makeNewProperty() {
+            return new KeepProperty();
+        }
+
+        /**
+         * @see CompoundPropertyMaker#convertProperty
+         */        
+        public Property convertProperty(Property p, PropertyList propertyList, FObj fo)
+            throws FOPException
+        {
+            if (p instanceof KeepProperty) {
+                return p;
+            }
+            return super.convertProperty(p, propertyList, fo);
+        }
+    }
+
+    /**
+     * @see org.apache.fop.datatypes.CompoundDatatype#setComponent(int, Property, boolean)
+     */
+    public void setComponent(int cmpId, Property cmpnValue,
+                             boolean bIsDefault) {
+        if (cmpId == CP_WITHIN_LINE) {
+            setWithinLine(cmpnValue, bIsDefault);
+        } else if (cmpId == CP_WITHIN_COLUMN) {
+            setWithinColumn(cmpnValue, bIsDefault);
+        } else if (cmpId == CP_WITHIN_PAGE) {
+            setWithinPage(cmpnValue, bIsDefault);
+        }
+    }
+
+    /**
+     * @see org.apache.fop.datatypes.CompoundDatatype#getComponent(int)
+     */
+    public Property getComponent(int cmpId) {
+        if (cmpId == CP_WITHIN_LINE) {
+            return getWithinLine();
+        } else if (cmpId == CP_WITHIN_COLUMN) {
+            return getWithinColumn();
+        } else if (cmpId == CP_WITHIN_PAGE) {
+            return getWithinPage();
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * @param withinLine withinLine property to set
+     * @param bIsDefault not used (??)
+     */
+    public void setWithinLine(Property withinLine, boolean bIsDefault) {
+        this.withinLine = withinLine;
+    }
+
+    /**
+     * @param withinColumn withinColumn property to set
+     * @param bIsDefault not used (??)
+     */
+    protected void setWithinColumn(Property withinColumn,
+                                   boolean bIsDefault) {
+        this.withinColumn = withinColumn;
+    }
+
+    /**
+     * @param withinPage withinPage property to set
+     * @param bIsDefault not used (??)
+     */
+    public void setWithinPage(Property withinPage, boolean bIsDefault) {
+        this.withinPage = withinPage;
+    }
+
+    /**
+     * @return the withinLine property
+     */
+    public Property getWithinLine() {
+        return this.withinLine;
+    }
+
+    /**
+     * @return the withinColumn property
+     */
+    public Property getWithinColumn() {
+        return this.withinColumn;
+    }
+
+    /**
+     * @return the withinPage property
+     */
+    public Property getWithinPage() {
+        return this.withinPage;
+    }
+
+    /**
+     * Not sure what to do here. There isn't really a meaningful single value.
+     * @return String representation
+     */
+    public String toString() {
+        return "Keep[" + 
+            "withinLine:" + getWithinLine().getObject() + 
+            ", withinColumn:" + getWithinColumn().getObject() + 
+            ", withinPage:" + getWithinPage().getObject() + "]";
+    }
+
+    /**
+     * @return this.keep
+     */
+    public KeepProperty getKeep() {
+        return this;
+    }
+
+    /**
+     * @return this.keep cast as Object
+     */
+    public Object getObject() {
+        return this;
+    }
+
+}
diff --git a/src/java/org/apache/fop/fo/properties/LengthPairProperty.java b/src/java/org/apache/fop/fo/properties/LengthPairProperty.java
new file mode 100644 (file)
index 0000000..861346b
--- /dev/null
@@ -0,0 +1,157 @@
+/*
+ * $Id$
+ * ============================================================================
+ *                    The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any, must
+ *    include the following acknowledgment: "This product includes software
+ *    developed by the Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself, if
+ *    and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ *    endorse or promote products derived from this software without prior
+ *    written permission. For written permission, please contact
+ *    apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache", nor may
+ *    "Apache" appear in their name, without prior written permission of the
+ *    Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ============================================================================
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the Apache Software Foundation and was originally created by
+ * James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
+package org.apache.fop.fo.properties;
+
+import org.apache.fop.apps.FOPException;
+import org.apache.fop.datatypes.CompoundDatatype;
+import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.PropertyList;
+
+/**
+ * Superclass for properties wrapping a LengthPair value
+ */
+public class LengthPairProperty extends Property implements CompoundDatatype {
+    private Property ipd;
+    private Property bpd;
+
+    /**
+     * Inner class for creating instances of LengthPairProperty
+     */
+    public static class Maker extends CompoundPropertyMaker {
+
+        /**
+         * @param name name of property for which this Maker should be created
+         */
+        public Maker(int propId) {
+            super(propId);
+        }
+
+        /**
+         * Create a new empty instance of LengthPairProperty.
+         * @return the new instance. 
+         */
+        public Property makeNewProperty() {
+            return new LengthPairProperty();
+        }
+
+        /**
+         * @see CompoundPropertyMaker#convertProperty
+         */        
+        public Property convertProperty(Property p, PropertyList propertyList, FObj fo)
+            throws FOPException
+        {
+            if (p instanceof LengthPairProperty) {
+                return p;
+            }
+            return super.convertProperty(p, propertyList, fo);
+        }
+    }
+
+    /**
+     * @see org.apache.fop.datatypes.CompoundDatatype#setComponent(int, Property, boolean)
+     */
+    public void setComponent(int cmpId, Property cmpnValue,
+                             boolean bIsDefault) {
+        if (cmpId == CP_BLOCK_PROGRESSION_DIRECTION) {
+            bpd = cmpnValue;
+        } else if (cmpId == CP_INLINE_PROGRESSION_DIRECTION) {
+            ipd = cmpnValue;
+        }
+    }
+
+    /**
+     * @see org.apache.fop.datatypes.CompoundDatatype#getComponent(int)
+     */
+    public Property getComponent(int cmpId) {
+        if (cmpId == CP_BLOCK_PROGRESSION_DIRECTION) {
+            return getBPD();
+        } else if (cmpId == CP_INLINE_PROGRESSION_DIRECTION) {
+            return getIPD();
+        } else {
+            return null;    // SHOULDN'T HAPPEN
+        }
+    }
+
+    /**
+     * @return Property holding the ipd length
+     */
+    public Property getIPD() {
+        return this.ipd;
+    }
+
+    /**
+     * @return Property holding the bpd length
+     */
+    public Property getBPD() {
+        return this.bpd;
+    }
+
+    public String toString() {
+        return "LengthPair[" + 
+        "ipd:" + getIPD().getObject() + 
+        ", bpd:" + getBPD().getObject() + "]";
+    }
+
+    /**
+     * @return this.lengthPair
+     */
+    public LengthPairProperty getLengthPair() {
+        return this;
+    }
+
+    /**
+     * @return this.lengthPair cast as an Object
+     */
+    public Object getObject() {
+        return this;
+    }
+
+}
diff --git a/src/java/org/apache/fop/fo/properties/LengthProperty.java b/src/java/org/apache/fop/fo/properties/LengthProperty.java
new file mode 100644 (file)
index 0000000..2588f6f
--- /dev/null
@@ -0,0 +1,242 @@
+/*
+ * $Id$
+ * ============================================================================
+ *                    The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any, must
+ *    include the following acknowledgment: "This product includes software
+ *    developed by the Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself, if
+ *    and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ *    endorse or promote products derived from this software without prior
+ *    written permission. For written permission, please contact
+ *    apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache", nor may
+ *    "Apache" appear in their name, without prior written permission of the
+ *    Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ============================================================================
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the Apache Software Foundation and was originally created by
+ * James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
+package org.apache.fop.fo.properties;
+
+import org.apache.fop.apps.FOPException;
+import org.apache.fop.datatypes.Length;
+import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.expr.NumericProperty;
+
+/**
+ * Superclass for properties wrapping a Length value.
+ */
+public class LengthProperty extends Property implements Length {
+    /** Holds the length in millipoints. */
+    protected int millipoints = 0;
+    /** Indicates if the value has been computed, or not. */
+    protected boolean bIsComputed = false;
+
+    /**
+     * Inner class for making instances of LengthProperty
+     */
+    public static class Maker extends PropertyMaker {
+        private boolean autoOk = false;
+
+        /**
+         * @param name name of property for which Maker should be created
+         */
+        public Maker(int propId) {
+            super(propId);
+        }
+
+        /**
+         * protected Property checkPropertyKeywords(String value) {
+         * if (isAutoLengthAllowed() && value.equals("auto")) {
+         * return new LengthProperty(Length.AUTO);
+         * }
+         * return null;
+         * }
+         */
+
+        /**
+         * @return false (auto-length is not allowed for Length values)
+         */
+        protected boolean isAutoLengthAllowed() {
+            return autoOk;
+        }
+
+        /**
+         * Set the auto length flag.
+         * @param inherited
+         */
+        public void setAutoOk(boolean autoOk) {
+            this.autoOk = autoOk;
+        }
+
+        /**
+         * @see Property.Maker#convertProperty
+         */
+        public Property convertProperty(Property p,
+                                        PropertyList propertyList,
+                                        FObj fo) throws FOPException {
+            Property prop = super.convertProperty(p, propertyList, fo);
+            if (prop != null) {
+                return prop;
+            }
+            if (isAutoLengthAllowed()) {
+                String pval = p.getString();
+                if (pval != null && pval.equals("auto")) {
+                    return new AutoLength();
+                }
+            }
+            if (p instanceof LengthProperty) {
+                return p;
+            }
+            LengthProperty val = p.getLength();
+            if (val != null) {
+                return val;
+            }
+            return convertPropertyDatatype(p, propertyList, fo);
+        }
+
+    }
+
+
+    /**
+     * Returns the length in 1/1000ths of a point (millipoints)
+     * @return the length in millipoints
+     */
+    public int getValue() {
+        if (!bIsComputed) {
+            computeValue();
+        }
+        return millipoints;
+    }
+
+    /**
+     * Computes the value.
+     */
+    protected void computeValue() {
+    }
+
+
+    /**
+     * Sets the computed value.
+     * @param millipoints the length in millipoints
+     */
+    protected void setComputedValue(int millipoints) {
+        setComputedValue(millipoints, true);
+    }
+
+    /**
+     * Sets the computed value.
+     * @param millipoints the length in millipoints
+     * @param bSetComputed True if the isComputed flag should be set.
+     */
+    protected void setComputedValue(int millipoints, boolean bSetComputed) {
+        this.millipoints = millipoints;
+        this.bIsComputed = bSetComputed;
+    }
+
+    /**
+     * Indicates if the length has the "auto" value.
+     * @return True if the length is set to "auto"
+     */
+    public boolean isAuto() {
+        return false;
+    }
+
+    /**
+     * Indicates if the length has been computed.
+     * @return True if the length has been computed
+     */
+    public boolean isComputed() {
+        return this.bIsComputed;
+    }
+
+    /**
+     * Return the number of table units which are included in this
+     * length specification.
+     * This will always be 0 unless the property specification used
+     * the proportional-column-width() function (only only table
+     * column FOs).
+     * <p>If this value is not 0, the actual value of the Length cannot
+     * be known without looking at all of the columns in the table to
+     * determine the value of a "table-unit".
+     * @return The number of table units which are included in this
+     * length specification.
+     */
+    public double getTableUnits() {
+        return 0.0;
+    }
+
+    public void resolveTableUnit(double dTableUnit) {
+    }
+
+    /**
+     * @return null (cannot be converted to a Numeric ??)
+     */
+    public NumericProperty asNumeric() {
+        return null;
+    }
+
+    /**
+     * @see java.lang.Object#toString()
+     */
+    public String toString() {
+        String s = millipoints + "mpt";
+        return s;
+    }
+
+    /**
+     * @return this.lenght cast as a Numeric
+     */
+    public NumericProperty getNumeric() {
+        return asNumeric() ;
+    }
+
+    /**
+     * @return this.length
+     */
+    public LengthProperty getLength() {
+        return this;
+    }
+
+    /**
+     * @return this.length cast as an Object
+     */
+    public Object getObject() {
+        return this;
+    }
+
+}
+
diff --git a/src/java/org/apache/fop/fo/properties/LengthRangeProperty.java b/src/java/org/apache/fop/fo/properties/LengthRangeProperty.java
new file mode 100644 (file)
index 0000000..3907d0f
--- /dev/null
@@ -0,0 +1,279 @@
+/*
+ * $Id$
+ * ============================================================================
+ *                    The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any, must
+ *    include the following acknowledgment: "This product includes software
+ *    developed by the Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself, if
+ *    and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ *    endorse or promote products derived from this software without prior
+ *    written permission. For written permission, please contact
+ *    apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache", nor may
+ *    "Apache" appear in their name, without prior written permission of the
+ *    Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ============================================================================
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the Apache Software Foundation and was originally created by
+ * James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
+package org.apache.fop.fo.properties;
+
+import org.apache.fop.apps.FOPException;
+import org.apache.fop.datatypes.CompoundDatatype;
+import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.PropertyList;
+
+/**
+ * Superclass for properties that contain LengthRange values
+ */
+public class LengthRangeProperty extends Property implements CompoundDatatype {
+    private Property minimum;
+    private Property optimum;
+    private Property maximum;
+    private static final int MINSET = 1;
+    private static final int OPTSET = 2;
+    private static final int MAXSET = 4;
+    private int bfSet = 0;    // bit field
+    private boolean bChecked = false;
+
+    /**
+     * Inner class for a Maker for LengthProperty objects
+     */
+    public static class Maker extends CompoundPropertyMaker {
+
+        /**
+         * @param name name of property for which to create Maker
+         */
+        public Maker(int propId) {
+            super(propId);
+        }
+
+        /**
+         * Create a new empty instance of LengthRangeProperty.
+         * @return the new instance. 
+         */
+        public Property makeNewProperty() {
+            return new LengthRangeProperty();
+        }
+
+        /**
+         * @see CompoundPropertyMaker#convertProperty
+         */        
+        public Property convertProperty(Property p, PropertyList propertyList, FObj fo)
+            throws FOPException
+        {
+            if (p instanceof LengthRangeProperty) {
+                return p;
+            }
+            return super.convertProperty(p, propertyList, fo);
+        }
+    }
+
+
+
+    /**
+     * @see org.apache.fop.datatypes.CompoundDatatype#setComponent(int, Property, boolean)
+     */
+    public void setComponent(int cmpId, Property cmpnValue,
+                             boolean bIsDefault) {
+        if (cmpId == CP_MINIMUM) {
+            setMinimum(cmpnValue, bIsDefault);
+        } else if (cmpId == CP_OPTIMUM) {
+            setOptimum(cmpnValue, bIsDefault);
+        } else if (cmpId == CP_MAXIMUM) {
+            setMaximum(cmpnValue, bIsDefault);
+        }
+    }
+
+    /**
+     * @see org.apache.fop.datatypes.CompoundDatatype#getComponent(int)
+     */
+    public Property getComponent(int cmpId) {
+        if (cmpId == CP_MINIMUM) {
+            return getMinimum();
+        } else if (cmpId == CP_OPTIMUM) {
+            return getOptimum();
+        } else if (cmpId == CP_MAXIMUM) {
+            return getMaximum();
+        } else {
+            return null;    // SHOULDN'T HAPPEN
+        }
+    }
+
+    /**
+     * Set minimum value to min.
+     * @param minimum A Length value specifying the minimum value for this
+     * LengthRange.
+     * @param bIsDefault If true, this is set as a "default" value
+     * and not a user-specified explicit value.
+     */
+    protected void setMinimum(Property minimum, boolean bIsDefault) {
+        this.minimum = minimum;
+        if (!bIsDefault) {
+            bfSet |= MINSET;
+        }
+    }
+
+
+    /**
+     * Set maximum value to max if it is >= optimum or optimum isn't set.
+     * @param max A Length value specifying the maximum value for this
+     * @param bIsDefault If true, this is set as a "default" value
+     * and not a user-specified explicit value.
+     */
+    protected void setMaximum(Property max, boolean bIsDefault) {
+        maximum = max;
+        if (!bIsDefault) {
+            bfSet |= MAXSET;
+        }
+    }
+
+
+    /**
+     * Set the optimum value.
+     * @param opt A Length value specifying the optimum value for this
+     * @param bIsDefault If true, this is set as a "default" value
+     * and not a user-specified explicit value.
+     */
+    protected void setOptimum(Property opt, boolean bIsDefault) {
+        optimum = opt;
+        if (!bIsDefault) {
+            bfSet |= OPTSET;
+        }
+    }
+
+    // Minimum is prioritaire, if explicit
+    private void checkConsistency() {
+        if (bChecked) {
+            return;
+        }
+        // Make sure max >= min
+        // Must also control if have any allowed enum values!
+
+        /**
+         * *******************
+         * if (minimum.mvalue() > maximum.mvalue()) {
+         * if ((bfSet&MINSET)!=0) {
+         * // if minimum is explicit, force max to min
+         * if ((bfSet&MAXSET)!=0) {
+         * // Warning: min>max, resetting max to min
+         * log.error("forcing max to min in LengthRange");
+         * }
+         * maximum = minimum ;
+         * }
+         * else {
+         * minimum = maximum; // minimum was default value
+         * }
+         * }
+         * // Now make sure opt <= max and opt >= min
+         * if (optimum.mvalue() > maximum.mvalue()) {
+         * if ((bfSet&OPTSET)!=0) {
+         * if ((bfSet&MAXSET)!=0) {
+         * // Warning: opt > max, resetting opt to max
+         * log.error("forcing opt to max in LengthRange");
+         * optimum = maximum ;
+         * }
+         * else {
+         * maximum = optimum; // maximum was default value
+         * }
+         * }
+         * else {
+         * // opt is default and max is explicit or default
+         * optimum = maximum ;
+         * }
+         * }
+         * else if (optimum.mvalue() < minimum.mvalue()) {
+         * if ((bfSet&MINSET)!=0) {
+         * // if minimum is explicit, force opt to min
+         * if ((bfSet&OPTSET)!=0) {
+         * log.error("forcing opt to min in LengthRange");
+         * }
+         * optimum = minimum ;
+         * }
+         * else {
+         * minimum = optimum; // minimum was default value
+         * }
+         * }
+         * *******$*******
+         */
+        bChecked = true;
+    }
+
+    /**
+     * @return minimum length
+     */
+    public Property getMinimum() {
+        checkConsistency();
+        return this.minimum;
+    }
+
+    /**
+     * @return maximum length
+     */
+    public Property getMaximum() {
+        checkConsistency();
+        return this.maximum;
+    }
+
+    /**
+     * @return optimum length
+     */
+    public Property getOptimum() {
+        checkConsistency();
+        return this.optimum;
+    }
+
+    public String toString() {
+        return "LengthRange[" +
+        "min:" + getMinimum().getObject() + 
+        ", max:" + getMaximum().getObject() + 
+        ", opt:" + getOptimum().getObject() + "]";
+    }
+
+    /**
+     * @return this.lengthRange
+     */
+    public LengthRangeProperty getLengthRange() {
+        return this;
+    }
+
+    /**
+     * @return this.lengthRange cast as an Object
+     */
+    public Object getObject() {
+        return this;
+    }
+
+}
index b5bf98a762c94d4d27e5d3359249de10e77ae2e2..7437861946c5e0a8073a5b16767f5513b83914b0 100644 (file)
 package org.apache.fop.fo.properties;
 
 import org.apache.fop.apps.FOPException;
-import org.apache.fop.datatypes.PercentLength;
 import org.apache.fop.fo.FObj;
-import org.apache.fop.fo.LengthProperty;
-import org.apache.fop.fo.Property;
 import org.apache.fop.fo.PropertyList;
 
 /**
diff --git a/src/java/org/apache/fop/fo/properties/LinearCombinationLength.java b/src/java/org/apache/fop/fo/properties/LinearCombinationLength.java
new file mode 100644 (file)
index 0000000..898bf45
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * $Id$
+ * ============================================================================
+ *                    The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any, must
+ *    include the following acknowledgment: "This product includes software
+ *    developed by the Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself, if
+ *    and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ *    endorse or promote products derived from this software without prior
+ *    written permission. For written permission, please contact
+ *    apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache", nor may
+ *    "Apache" appear in their name, without prior written permission of the
+ *    Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ============================================================================
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the Apache Software Foundation and was originally created by
+ * James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
+package org.apache.fop.fo.properties;
+
+import java.util.Vector;
+
+import org.apache.fop.datatypes.Length;
+
+/**
+ * Class modelling lengths that are build up by combining other lengths
+ */
+public class LinearCombinationLength extends LengthProperty {
+
+    /** Collection of factors (1-1 correspondence with {@link #lengths} */
+    protected Vector factors;
+    /** Collection of Length objects (1-1 correspondence with {@link #factors} */
+    protected Vector lengths;
+
+    /**
+     * Constructor. Creates no content. Use {link #addTerm} to build content.
+     */
+    public LinearCombinationLength() {
+        factors = new Vector();
+        lengths = new Vector();
+    }
+
+    /**
+     * Add an item to this
+     * @param factor the factor to be added
+     * @param length the Length to be added
+     */
+    public void addTerm(double factor, LengthProperty length) {
+        factors.addElement(new Double(factor));
+        lengths.addElement(length);
+    }
+
+    /**
+     * Sets the computed value in millipoints.
+     */
+    protected void computeValue() {
+        int result = 0;
+        int numFactors = factors.size();
+        for (int i = 0; i < numFactors; ++i) {
+            result +=
+                (int)(((Double)factors.elementAt(i)).doubleValue()
+                      * (double)((Length)lengths.elementAt(i)).getValue());
+        }
+        setComputedValue(result);
+    }
+
+}
diff --git a/src/java/org/apache/fop/fo/properties/ListProperty.java b/src/java/org/apache/fop/fo/properties/ListProperty.java
new file mode 100644 (file)
index 0000000..7ed6ac0
--- /dev/null
@@ -0,0 +1,122 @@
+/*
+ * $Id$
+ * ============================================================================
+ *                    The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any, must
+ *    include the following acknowledgment: "This product includes software
+ *    developed by the Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself, if
+ *    and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ *    endorse or promote products derived from this software without prior
+ *    written permission. For written permission, please contact
+ *    apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache", nor may
+ *    "Apache" appear in their name, without prior written permission of the
+ *    Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ============================================================================
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the Apache Software Foundation and was originally created by
+ * James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
+package org.apache.fop.fo.properties;
+
+import java.util.Vector;
+
+import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.PropertyList;
+
+/**
+ * Superclass for properties that are lists of other properties
+ */
+public class ListProperty extends Property {
+
+    /**
+     * Inner class for creating instances of ListProperty
+     */
+    public static class Maker extends PropertyMaker {
+
+        /**
+         * @param name name of property for which Maker should be created
+         */
+        public Maker(int propId) {
+            super(propId);
+        }
+
+        /**
+         * @see Property.Maker#convertProperty
+         */
+        public Property convertProperty(Property p,
+                                        PropertyList propertyList, FObj fo) {
+            if (p instanceof ListProperty) {
+                return p;
+            } else {
+                return new ListProperty(p);
+            }
+        }
+
+    }
+
+    /** Vector containing the list of sub-properties */
+    protected Vector list;
+
+    /**
+     * @param prop the first Property to be added to the list
+     */
+    public ListProperty(Property prop) {
+        list = new Vector();
+        list.addElement(prop);
+    }
+
+    /**
+     * Add a new property to the list
+     * @param prop Property to be added to the list
+     */
+    public void addProperty(Property prop) {
+        list.addElement(prop);
+    }
+
+    /**
+     * @return this.list
+     */
+    public Vector getList() {
+        return list;
+    }
+
+    /**
+     * @return this.list cast as an Object
+     */
+    public Object getObject() {
+        return list;
+    }
+
+}
diff --git a/src/java/org/apache/fop/fo/properties/MixedLength.java b/src/java/org/apache/fop/fo/properties/MixedLength.java
new file mode 100644 (file)
index 0000000..9719911
--- /dev/null
@@ -0,0 +1,150 @@
+/*
+ * $Id$
+ * ============================================================================
+ *                    The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any, must
+ *    include the following acknowledgment: "This product includes software
+ *    developed by the Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself, if
+ *    and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ *    endorse or promote products derived from this software without prior
+ *    written permission. For written permission, please contact
+ *    apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache", nor may
+ *    "Apache" appear in their name, without prior written permission of the
+ *    Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ============================================================================
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the Apache Software Foundation and was originally created by
+ * James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
+package org.apache.fop.fo.properties;
+
+import java.util.Enumeration;
+import java.util.Vector;
+
+import org.apache.fop.fo.expr.NumericProperty;
+import org.apache.fop.fo.expr.PropertyException;
+
+/**
+ * A length quantity in XSL which is specified with a mixture
+ * of absolute and relative and/or percent components.
+ * The actual value may not be computable before layout is done.
+ */
+public class MixedLength extends LengthProperty {
+
+    /** The collection of Length objects comprising this MixedLength object */
+    private Vector lengths ;
+
+    /**
+     * Constructor
+     * @param lengths the collection of Length objects which comprise the new
+     * MixedLength object
+     */
+    public MixedLength(Vector lengths) {
+        this.lengths = lengths;
+    }
+
+    /**
+     * Iterates through each internal component, computing and
+     * summarizing the values, then setting the value for this
+     */
+    protected void computeValue() {
+        int computedValue = 0;
+        boolean bAllComputed = true;
+        Enumeration e = lengths.elements();
+        while (e.hasMoreElements()) {
+            LengthProperty l = (LengthProperty) e.nextElement();
+            computedValue += l.getValue();
+            if (!l.isComputed()) {
+                bAllComputed = false;
+            }
+        }
+        setComputedValue(computedValue, bAllComputed);
+    }
+
+
+    public double getTableUnits() {
+        double tableUnits = 0.0;
+        Enumeration e = lengths.elements();
+        while (e.hasMoreElements()) {
+            tableUnits += ((LengthProperty) e.nextElement()).getTableUnits();
+        }
+        return tableUnits;
+    }
+
+    public void resolveTableUnit(double dTableUnit) {
+        Enumeration e = lengths.elements();
+        while (e.hasMoreElements()) {
+            ((LengthProperty) e.nextElement()).resolveTableUnit(dTableUnit);
+        }
+    }
+
+    /**
+     * @return String equivalent of this
+     */
+    public String toString() {
+        StringBuffer sbuf = new StringBuffer();
+        Enumeration e = lengths.elements();
+        while (e.hasMoreElements()) {
+            if (sbuf.length() > 0) {
+                sbuf.append('+');
+            }
+            sbuf.append(e.nextElement().toString());
+        }
+        return sbuf.toString();
+    }
+
+    /**
+     * @return Numeric equivalent of this
+     */
+    public NumericProperty asNumeric() {
+        NumericProperty numeric = null;
+        for (Enumeration e = lengths.elements(); e.hasMoreElements();) {
+            LengthProperty l = (LengthProperty) e.nextElement();
+            if (numeric == null) {
+                numeric = l.asNumeric();
+            } else {
+                try {
+                    NumericProperty sum = numeric.add(l.asNumeric());
+                    numeric = sum;
+                } catch (PropertyException pe) {
+                    System.err.println(
+                      "Can't convert MixedLength to Numeric: " + pe);
+                }
+            }
+        }
+        return numeric;
+    }
+}
+
diff --git a/src/java/org/apache/fop/fo/properties/NumberProperty.java b/src/java/org/apache/fop/fo/properties/NumberProperty.java
new file mode 100644 (file)
index 0000000..cccb86d
--- /dev/null
@@ -0,0 +1,159 @@
+/*
+ * $Id$
+ * ============================================================================
+ *                    The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any, must
+ *    include the following acknowledgment: "This product includes software
+ *    developed by the Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself, if
+ *    and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ *    endorse or promote products derived from this software without prior
+ *    written permission. For written permission, please contact
+ *    apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache", nor may
+ *    "Apache" appear in their name, without prior written permission of the
+ *    Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ============================================================================
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the Apache Software Foundation and was originally created by
+ * James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
+package org.apache.fop.fo.properties;
+
+import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.expr.NumericProperty;
+
+/**
+ * Class for handling numeric properties
+ */
+public class NumberProperty extends Property {
+
+    /**
+     * Inner class for making NumberProperty objects
+     */
+    public static class Maker extends PropertyMaker {
+
+        /**
+         * Constructor for NumberProperty.Maker
+         * @param propName the name of the property
+         */
+        public Maker(int propId) {
+            super(propId);
+        }
+
+        /**
+         * @see Property.Maker#convertProperty
+         */
+        public Property convertProperty(Property p,
+                                        PropertyList propertyList, FObj fo) {
+            if (p instanceof NumberProperty) {
+                return p;
+            }
+            Number val = p.getNumber();
+            if (val != null) {
+                return new NumberProperty(val);
+            }
+            return convertPropertyDatatype(p, propertyList, fo);
+        }
+
+    }
+
+    private Number number;
+
+    /**
+     * Constructor for Number input
+     * @param num Number object value for property
+     */
+    public NumberProperty(Number num) {
+        this.number = num;
+    }
+
+    /**
+     * Constructor for double input
+     * @param num double numeric value for property
+     */
+    public NumberProperty(double num) {
+        this.number = new Double(num);
+    }
+
+    /**
+     * Constructor for integer input
+     * @param num integer numeric value for property
+     */
+    public NumberProperty(int num) {
+        this.number = new Integer(num);
+    }
+
+    /**
+     * @return this.number cast as a Number
+     */
+    public Number getNumber() {
+        return this.number;
+    }
+
+    /**
+     * public Double getDouble() {
+     * return new Double(this.number.doubleValue());
+     * }
+     * public Integer getInteger() {
+     * return new Integer(this.number.intValue());
+     * }
+     */
+
+    /**
+     * @return this.number cast as an Object
+     */
+    public Object getObject() {
+        return this.number;
+    }
+
+    /**
+     * Convert NumberProperty to Numeric object
+     * @return Numeric object corresponding to this
+     */
+    public NumericProperty getNumeric() {
+        return new NumericProperty(this.number);
+    }
+
+    /**
+     * Convert NumberProperty to a ColorType. Not sure why this is needed.
+     * @return ColorType that corresponds to black
+     */
+    public ColorTypeProperty getColorType() {
+        // Convert numeric value to color ???
+        // Convert to hexadecimal and then try to make it into a color?
+        return new ColorTypeProperty((float)0.0, (float)0.0, (float)0.0);
+    }
+
+}
diff --git a/src/java/org/apache/fop/fo/properties/PercentLength.java b/src/java/org/apache/fop/fo/properties/PercentLength.java
new file mode 100644 (file)
index 0000000..7d58df8
--- /dev/null
@@ -0,0 +1,140 @@
+/*
+ * $Id$
+ * ============================================================================
+ *                    The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any, must
+ *    include the following acknowledgment: "This product includes software
+ *    developed by the Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself, if
+ *    and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ *    endorse or promote products derived from this software without prior
+ *    written permission. For written permission, please contact
+ *    apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache", nor may
+ *    "Apache" appear in their name, without prior written permission of the
+ *    Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ============================================================================
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the Apache Software Foundation and was originally created by
+ * James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
+package org.apache.fop.fo.properties;
+
+import org.apache.fop.datatypes.PercentBase;
+import org.apache.fop.fo.expr.NumericProperty;
+
+/**
+ * a percent specified length quantity in XSL
+ */
+public class PercentLength extends LengthProperty {
+
+    /**
+     * The percentage itself, expressed as a decimal value, e.g. for 95%, set
+     * the value to .95
+     */
+    private double factor;
+
+    /**
+     * A PercentBase implementation that contains the base length to which the
+     * {@link #factor} should be applied to compute the actual length
+     */
+    private PercentBase lbase = null;
+
+    /**
+     * Main constructor. Construct an object based on a factor (the percent,
+     * as a factor) and an object which has a method to return the Length which
+     * provides the "base" for the actual length that is modeled.
+     * @param factor the percentage factor, expressed as a decimal (e.g. use
+     * .95 to represent 95%)
+     * @param lbase base property to which the factor should be applied
+     */
+    public PercentLength(double factor, PercentBase lbase) {
+        this.factor = factor;
+        this.lbase = lbase;
+    }
+
+    /**
+     * Convenience constructor when only the factor is known
+     * @param factor the percentage factor, expressed as a decimal (e.g. use
+     * .95 to represent 95%)
+     */
+    public PercentLength(double factor) {
+        this(factor, null);
+    }
+
+    /**
+     * @param lbase the base to set
+     */
+    public void setBaseLength(PercentBase lbase) {
+        this.lbase = lbase;
+    }
+
+    /**
+     * @return the base
+     */
+    public PercentBase getBaseLength() {
+        return this.lbase;
+    }
+
+    /**
+     * Return the computed value in millipoints. This assumes that the
+     * base length has been resolved to an absolute length value.
+     */
+    protected void computeValue() {
+        setComputedValue((int)(factor * (double)lbase.getBaseLength()));
+    }
+
+    /**
+     *
+     * @return the factor
+     */
+    public double value() {
+        return factor;
+    }
+
+    /**
+     * @return the String equivalent of this
+     */
+    public String toString() {
+        // TODO: What about the base value?
+        return (new Double(factor * 100.0).toString()) + "%";
+    }
+
+    /**
+     * @return new Numeric object that is equivalent to this
+     */
+    public NumericProperty asNumeric() {
+        return new NumericProperty(this);
+    }
+
+}
diff --git a/src/java/org/apache/fop/fo/properties/Property.java b/src/java/org/apache/fop/fo/properties/Property.java
new file mode 100644 (file)
index 0000000..855f60a
--- /dev/null
@@ -0,0 +1,217 @@
+/*
+ * $Id$
+ * ============================================================================
+ *                    The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any, must
+ *    include the following acknowledgment: "This product includes software
+ *    developed by the Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself, if
+ *    and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ *    endorse or promote products derived from this software without prior
+ *    written permission. For written permission, please contact
+ *    apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache", nor may
+ *    "Apache" appear in their name, without prior written permission of the
+ *    Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ============================================================================
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the Apache Software Foundation and was originally created by
+ * James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
+package org.apache.fop.fo.properties;
+
+import org.apache.fop.fo.expr.NumericProperty;
+
+import java.util.Vector;
+
+/**
+ * Base class for all property objects
+ * @author unascribed
+ */
+public class Property {
+
+    /**
+     * The original specified value for properties which inherit
+     * specified values.
+     */
+    private String specVal;
+
+    /**
+     * Set the original value specified for the property attribute.
+     * @param specVal The specified value.
+     */
+    public void setSpecifiedValue(String specVal) {
+        this.specVal = specVal;
+    }
+
+    /**
+     * Return the original value specified for the property attribute.
+     * @return The specified value as a String.
+     */
+    public String getSpecifiedValue() {
+        return specVal;
+    }
+
+/*
+ * This section contains accessor functions for all possible Property datatypes
+ */
+
+
+    /**
+     * This method expects to be overridden by subclasses
+     * @return Length property value
+     */
+    public LengthProperty getLength() {
+        return null;
+    }
+
+    /**
+     * This method expects to be overridden by subclasses
+     * @return ColorType property value
+     */
+    public ColorTypeProperty getColorType() {
+        return null;
+    }
+
+    /**
+     * This method expects to be overridden by subclasses
+     * @return CondLength property value
+     */
+    public CondLengthProperty getCondLength() {
+        return null;
+    }
+
+    /**
+     * This method expects to be overridden by subclasses
+     * @return LenghtRange property value
+     */
+    public LengthRangeProperty getLengthRange() {
+        return null;
+    }
+
+    /**
+     * This method expects to be overridden by subclasses
+     * @return LengthPair property value
+     */
+    public LengthPairProperty getLengthPair() {
+        return null;
+    }
+
+    /**
+     * This method expects to be overridden by subclasses
+     * @return Space property value
+     */
+    public SpaceProperty getSpace() {
+        return null;
+    }
+
+    /**
+     * This method expects to be overridden by subclasses
+     * @return Keep property value
+     */
+    public KeepProperty getKeep() {
+        return null;
+    }
+
+    /**
+     * This method expects to be overridden by subclasses
+     * @return integer equivalent of enumerated property value
+     */
+    public int getEnum() {
+        return 0;
+    }
+
+    /**
+     * This method expects to be overridden by subclasses
+     * @return char property value
+     */
+    public char getCharacter() {
+        return 0;
+    }
+
+    /**
+     * This method expects to be overridden by subclasses
+     * @return collection of other property (sub-property) objects
+     */
+    public Vector getList() {
+        return null;
+    }
+
+    /**
+     * This method expects to be overridden by subclasses
+     * @return Number property value
+     */
+    public Number getNumber() {
+        return null;
+    }
+
+    /**
+     * This method expects to be overridden by subclasses
+     * @return Numeric property value
+     */
+    public NumericProperty getNumeric() {
+        return null;
+    }
+
+    /**
+     * This method expects to be overridden by subclasses
+     * @return NCname property value
+     */
+    public String getNCname() {
+        return null;
+    }
+
+    /**
+     * This method expects to be overridden by subclasses
+     * @return Object property value
+     */
+    public Object getObject() {
+        return null;
+    }
+
+    /**
+     * This method expects to be overridden by subclasses.
+     * @return String property value
+     */
+    public String getString() {
+        return null;
+    }
+
+    /**
+     * Return a string representation of the property value. Only used
+     * for debugging.
+     */
+    public String toString() {
+        return getString();
+    }
+}
index 77465a58b193d92a37d7cad1516e5d114c7bd45c..0c130b1905d938a53fce5a2e8e79ffc934131c93 100644 (file)
@@ -59,8 +59,6 @@ import org.apache.fop.datatypes.LengthBase;
 import org.apache.fop.datatypes.PercentBase;
 import org.apache.fop.fo.FOPropertyMapping;
 import org.apache.fop.fo.FObj;
-import org.apache.fop.fo.ListProperty;
-import org.apache.fop.fo.Property;
 import org.apache.fop.fo.PropertyList;
 import org.apache.fop.fo.ShorthandParser;
 import org.apache.fop.fo.expr.PropertyInfo;
diff --git a/src/java/org/apache/fop/fo/properties/SpaceProperty.java b/src/java/org/apache/fop/fo/properties/SpaceProperty.java
new file mode 100644 (file)
index 0000000..c67e804
--- /dev/null
@@ -0,0 +1,192 @@
+/*
+ * $Id$
+ * ============================================================================
+ *                    The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any, must
+ *    include the following acknowledgment: "This product includes software
+ *    developed by the Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself, if
+ *    and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ *    endorse or promote products derived from this software without prior
+ *    written permission. For written permission, please contact
+ *    apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache", nor may
+ *    "Apache" appear in their name, without prior written permission of the
+ *    Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ============================================================================
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the Apache Software Foundation and was originally created by
+ * James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
+package org.apache.fop.fo.properties;
+
+import org.apache.fop.apps.FOPException;
+import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.PropertyList;
+
+/**
+ * Base class used for handling properties of the fo:space-before and
+ * fo:space-after variety. It is extended by org.apache.fop.fo.properties.GenericSpace,
+ * which is extended by many other properties.
+ */
+public class SpaceProperty extends LengthRangeProperty {
+    private Property precedence;
+    private Property conditionality;
+
+    /**
+     * Inner class used to create new instances of SpaceProperty
+     */
+    public static class Maker extends CompoundPropertyMaker {
+
+        /**
+         * @param name name of the property whose Maker is to be created
+         */
+        public Maker(int propId) {
+            super(propId);
+        }
+
+        /**
+         * Create a new empty instance of SpaceProperty.
+         * @return the new instance. 
+         */
+        public Property makeNewProperty() {
+            return new SpaceProperty();
+        }
+
+        /**
+         * @see CompoundPropertyMaker#convertProperty
+         */
+        public Property convertProperty(Property p,
+                                        PropertyList propertyList,
+                                        FObj fo) throws FOPException {
+            if (p instanceof SpaceProperty) {
+                return p;
+            }
+            return super.convertProperty(p, propertyList, fo);
+        }
+    }
+
+
+
+    /**
+     * @see org.apache.fop.datatypes.CompoundDatatype#setComponent(int, Property, boolean)
+     */
+    public void setComponent(int cmpId, Property cmpnValue,
+                             boolean bIsDefault) {
+        if (cmpId == CP_PRECEDENCE) {
+            setPrecedence(cmpnValue, bIsDefault);
+        } else if (cmpId == CP_CONDITIONALITY) {
+            setConditionality(cmpnValue, bIsDefault);
+        } else {
+            super.setComponent(cmpId, cmpnValue, bIsDefault);
+        }
+    }
+
+    /**
+     * @see org.apache.fop.datatypes.CompoundDatatype#getComponent(int)
+     */
+    public Property getComponent(int cmpId) {
+        if (cmpId == CP_PRECEDENCE) {
+            return getPrecedence();
+        } else if (cmpId == CP_CONDITIONALITY) {
+            return getConditionality();
+        } else {
+            return super.getComponent(cmpId);
+        }
+    }
+
+    /**
+     *
+     * @param precedence precedence Property to set
+     * @param bIsDefault (is not used anywhere)
+     */
+    protected void setPrecedence(Property precedence, boolean bIsDefault) {
+        this.precedence = precedence;
+    }
+
+    /**
+     *
+     * @param conditionality conditionality Property to set
+     * @param bIsDefault (is not used anywhere)
+     */
+    protected void setConditionality(Property conditionality,
+                                     boolean bIsDefault) {
+        this.conditionality = conditionality;
+    }
+
+    /**
+     * @return precedence Property
+     */
+    public Property getPrecedence() {
+        return this.precedence;
+    }
+
+    /**
+     * @return conditionality Property
+     */
+    public Property getConditionality() {
+        return this.conditionality;
+    }
+
+    public String toString() {
+        return "Space[" +
+        "min:" + getMinimum().getObject() + 
+        ", max:" + getMaximum().getObject() + 
+        ", opt:" + getOptimum().getObject() + 
+        ", precedence:" + precedence.getObject() + 
+        ", conditionality:" + conditionality.getObject() + "]";
+    }
+
+    /**
+     * @return the Space (datatype) object contained here
+     */
+    public SpaceProperty getSpace() {
+        return this;
+    }
+
+    /**
+     * Space extends LengthRange.
+     * @return the Space (datatype) object contained here
+     */
+    public LengthRangeProperty getLengthRange() {
+        return this;
+    }
+
+    /**
+     * @return the Space (datatype) object contained here
+     */
+    public Object getObject() {
+        return this;
+    }
+
+}
diff --git a/src/java/org/apache/fop/fo/properties/StringProperty.java b/src/java/org/apache/fop/fo/properties/StringProperty.java
new file mode 100644 (file)
index 0000000..5ba6309
--- /dev/null
@@ -0,0 +1,135 @@
+/*
+ * $Id$
+ * ============================================================================
+ *                    The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any, must
+ *    include the following acknowledgment: "This product includes software
+ *    developed by the Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself, if
+ *    and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ *    endorse or promote products derived from this software without prior
+ *    written permission. For written permission, please contact
+ *    apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache", nor may
+ *    "Apache" appear in their name, without prior written permission of the
+ *    Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ============================================================================
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the Apache Software Foundation and was originally created by
+ * James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
+package org.apache.fop.fo.properties;
+
+import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.PropertyList;
+
+/**
+ * Exists primarily as a container for its Maker inner class, which is
+ * extended by many string-based FO property classes.
+ */
+public class StringProperty extends Property {
+
+    /**
+     * Inner class for making instances of StringProperty
+     */
+    public static class Maker extends PropertyMaker {
+
+        /**
+         * @param propName name of property for which to create a Maker
+         */
+        public Maker(int propId) {
+            super(propId);
+        }
+
+        /**
+         * Make a new StringProperty object
+         * @param propertyList not used
+         * @param value String value of the new object
+         * @param fo not used
+         * @return the StringProperty object
+         */
+        public Property make(PropertyList propertyList, String value,
+                             FObj fo) {
+            // Work around the fact that most String properties are not
+            // specified as actual String literals (with "" or '') since
+            // the attribute values themselves are Strings!
+            // If the value starts with ' or ", make sure it also ends with
+            // this character
+            // Otherwise, just take the whole value as the String
+            int vlen = value.length() - 1;
+            if (vlen > 0) {
+                char q1 = value.charAt(0);
+                if (q1 == '"' || q1 == '\'') {
+                    if (value.charAt(vlen) == q1) {
+                        return new StringProperty(value.substring(1, vlen));
+                    }
+                    System.err.println("Warning String-valued property starts with quote"
+                                       + " but doesn't end with quote: "
+                                       + value);
+                    // fall through and use the entire value, including first quote
+                }
+                String str = checkValueKeywords(value);
+                if (str != null) {
+                    value = str;
+                }
+            }
+            return new StringProperty(value);
+        }
+
+    }    // end String.Maker
+
+    private String str;
+
+    /**
+     * @param str String value to place in this object
+     */
+    public StringProperty(String str) {
+        this.str = str;
+        // System.err.println("Set StringProperty: " + str);
+    }
+
+    /**
+     * @return the Object equivalent of this property
+     */
+    public Object getObject() {
+        return this.str;
+    }
+
+    /**
+     * @return the String equivalent of this property
+     */
+    public String getString() {
+        return this.str;
+    }
+
+}
diff --git a/src/java/org/apache/fop/fo/properties/TableColLength.java b/src/java/org/apache/fop/fo/properties/TableColLength.java
new file mode 100644 (file)
index 0000000..752fea6
--- /dev/null
@@ -0,0 +1,121 @@
+/*
+ * $Id$
+ * ============================================================================
+ *                    The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any, must
+ *    include the following acknowledgment: "This product includes software
+ *    developed by the Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself, if
+ *    and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ *    endorse or promote products derived from this software without prior
+ *    written permission. For written permission, please contact
+ *    apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache", nor may
+ *    "Apache" appear in their name, without prior written permission of the
+ *    Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ============================================================================
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the Apache Software Foundation and was originally created by
+ * James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
+package org.apache.fop.fo.properties;
+
+import org.apache.fop.fo.expr.NumericProperty;
+
+/**
+ * A table-column width specification, possibly including some
+ * number of proportional "column-units". The absolute size of a
+ * column-unit depends on the fixed and proportional sizes of all
+ * columns in the table, and on the overall size of the table.
+ * It can't be calculated until all columns have been specified and until
+ * the actual width of the table is known. Since this can be specified
+ * as a percent of its parent containing width, the calculation is done
+ * during layout.
+ * NOTE: this is only supposed to be allowed if table-layout=fixed.
+ */
+public class TableColLength extends LengthProperty {
+
+    /**
+     * Number of table-column proportional units
+     */
+    private double tcolUnits;
+
+    /**
+     * Construct an object with tcolUnits of proportional measure.
+     * @param tcolUnits number of table-column proportional units
+     */
+    public TableColLength(double tcolUnits) {
+        this.tcolUnits = tcolUnits;
+    }
+
+    /**
+     * Override the method in Length
+     * @return the number of specified proportional table-column units.
+     */
+    public double getTableUnits() {
+        return tcolUnits;
+    }
+
+    /**
+     * Calculate the number of millipoints and set it.
+     * @param mpointsPerUnit density of millipoints per unit
+     */
+    public void resolveTableUnit(double mpointsPerUnit) {
+        setComputedValue((int)(tcolUnits * mpointsPerUnit));
+    }
+
+    //If the table-unit can be resolved, set the computed value
+    /*protected void computeValue() {
+        if (tblUnitBase.canResolveUnit()) {
+            rslt += (int)(tcolUnits * (double)tblUnitBase.getUnitValue());
+            setComputedValue(rslt);
+        }
+    }*/
+
+    /**
+     * Convert this to a String
+     * @return the string representation of this
+     */
+    public String toString() {
+        return (Double.toString(tcolUnits) + " table-column-units");
+    }
+
+    /**
+     * Converts this to a new Numeric object
+     * @return the Numeric object
+     */
+    public NumericProperty asNumeric() {
+        return new NumericProperty(this);
+    }
+}
+
diff --git a/src/java/org/apache/fop/fo/properties/ToBeImplementedProperty.java b/src/java/org/apache/fop/fo/properties/ToBeImplementedProperty.java
new file mode 100644 (file)
index 0000000..77db039
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ * $Id$
+ * ============================================================================
+ *                    The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any, must
+ *    include the following acknowledgment: "This product includes software
+ *    developed by the Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself, if
+ *    and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ *    endorse or promote products derived from this software without prior
+ *    written permission. For written permission, please contact
+ *    apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache", nor may
+ *    "Apache" appear in their name, without prior written permission of the
+ *    Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ============================================================================
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the Apache Software Foundation and was originally created by
+ * James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
+package org.apache.fop.fo.properties;
+
+import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.PropertyList;
+
+public class ToBeImplementedProperty extends Property {
+
+    public static class Maker extends PropertyMaker {
+
+        public Maker(int propId) {
+            super(propId);
+        }
+
+        public Property convertProperty(Property p,
+                                        PropertyList propertyList, FObj fo) {
+            if (p instanceof ToBeImplementedProperty) {
+                return p;
+            }
+
+            ToBeImplementedProperty val =
+                new ToBeImplementedProperty(getPropId());
+            return val;
+        }
+    }
+
+    /**
+     * Constructor
+     * @param propName name of Property
+     */
+    public ToBeImplementedProperty(int propId) {
+
+        //XXX: (mjg@recalldesign.com) This is a bit of a kluge, perhaps an
+        //UnimplementedPropertyException or something similar should
+        //get thrown here instead.
+
+//         Logger log = Hierarchy.getDefaultHierarchy().getLoggerFor("fop");
+//         log.warn("property - \"" + propName
+//                                + "\" is not implemented yet.");
+    }
+}
+
index 5b153127a1a714a56e40e61fc05fc4180624823a..abfacc217d8ef37d3ed07fff8a0597e6d6aca6de 100644 (file)
@@ -52,9 +52,9 @@ package org.apache.fop.render.rtf;
 //FOP
 import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.Constants;
-import org.apache.fop.fo.Property;
-import org.apache.fop.fo.LengthProperty;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.properties.LengthProperty;
+import org.apache.fop.fo.properties.Property;
 
 //RTF
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfAttributes;
index 994aacfaa0206c029a033060e289a51ad2128695..9c2b85139a8258e653d706270f0943c3edd88927 100644 (file)
@@ -58,7 +58,7 @@ import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.Constants;
 import org.apache.fop.fo.pagination.Region;
 import org.apache.fop.fo.pagination.SimplePageMaster;
-import org.apache.fop.fo.Property;
+import org.apache.fop.fo.properties.Property;
 import org.apache.fop.fo.PropertyList;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfAttributes;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfPage;
index 72250b65013152abda7219ca31e5aa5ce4f020bd..68894c3c01085bc40d37c54ac49e99e9a5d952f5 100644 (file)
@@ -59,10 +59,8 @@ import java.util.Iterator;
 import org.apache.avalon.framework.logger.ConsoleLogger;
 import org.apache.avalon.framework.logger.Logger;
 import org.apache.fop.apps.FOPException;
-import org.apache.fop.fo.EnumProperty;
 import org.apache.fop.fo.FOInputHandler;
 import org.apache.fop.fo.FObj;
-import org.apache.fop.datatypes.FixedLength;
 import org.apache.fop.fo.flow.BasicLink;
 import org.apache.fop.fo.flow.Block;
 import org.apache.fop.fo.flow.ExternalGraphic;
@@ -84,11 +82,13 @@ import org.apache.fop.fo.flow.TableRow;
 import org.apache.fop.fo.pagination.Flow;
 import org.apache.fop.fo.pagination.PageSequence;
 import org.apache.fop.fo.pagination.SimplePageMaster;
+import org.apache.fop.fo.properties.EnumProperty;
+import org.apache.fop.fo.properties.FixedLength;
+import org.apache.fop.fo.properties.LengthProperty;
+import org.apache.fop.fo.properties.Property;
+import org.apache.fop.fo.properties.StringProperty;
 import org.apache.fop.fo.Constants;
 import org.apache.fop.fo.FOText;
-import org.apache.fop.fo.Property;
-import org.apache.fop.fo.LengthProperty;
-import org.apache.fop.fo.StringProperty;
 import org.apache.fop.apps.Document;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.ITableAttributes;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.IRtfAfterContainer;
index e7aef684e809ebe7a6c1097a1e63968e374488a5..57f260c12480e388a52d70712ef93e61fbbb483f 100644 (file)
@@ -57,15 +57,15 @@ import org.apache.fop.render.rtf.rtflib.rtfdoc.BorderAttributesConverter;
 import org.apache.avalon.framework.logger.Logger;
 import org.apache.avalon.framework.logger.ConsoleLogger;
 import org.apache.fop.apps.FOPException;
-import org.apache.fop.fo.EnumProperty;
 import org.apache.fop.fo.expr.NCnameProperty;
+import org.apache.fop.fo.properties.ColorTypeProperty;
+import org.apache.fop.fo.properties.EnumProperty;
+import org.apache.fop.fo.properties.LengthProperty;
+import org.apache.fop.fo.properties.ListProperty;
+import org.apache.fop.fo.properties.NumberProperty;
+import org.apache.fop.fo.properties.Property;
 import org.apache.fop.fo.Constants;
-import org.apache.fop.fo.LengthProperty;
-import org.apache.fop.fo.ListProperty;
 import org.apache.fop.fo.PropertyList;
-import org.apache.fop.fo.Property;
-import org.apache.fop.fo.ColorTypeProperty;
-import org.apache.fop.fo.NumberProperty;
 import org.apache.fop.datatypes.ColorType;
 
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfAttributes;
index d7f7f0d5cec083f633f5cbfb4116e9c69859350a..ea26c60d16811e1ae7cef4f06e777d32cd96cf2e 100644 (file)
@@ -54,12 +54,12 @@ package org.apache.fop.render.rtf;
 import org.apache.avalon.framework.logger.Logger;
 import org.apache.avalon.framework.logger.ConsoleLogger;
 import org.apache.fop.apps.FOPException;
-import org.apache.fop.fo.EnumProperty;
 import org.apache.fop.fo.Constants;
-import org.apache.fop.fo.LengthProperty;
 import org.apache.fop.fo.PropertyList;
-import org.apache.fop.fo.SpaceProperty;
-import org.apache.fop.fo.ColorTypeProperty;
+import org.apache.fop.fo.properties.ColorTypeProperty;
+import org.apache.fop.fo.properties.EnumProperty;
+import org.apache.fop.fo.properties.LengthProperty;
+import org.apache.fop.fo.properties.SpaceProperty;
 import org.apache.fop.datatypes.ColorType;
 
 //RTF
index b15e8cb4934839e4e03ec3654ca0cf5ba8f231b4..561721761bf327295b54c17a15a844bcd3d8e46f 100644 (file)
@@ -50,9 +50,9 @@
  */ 
 package org.apache.fop.traits;
 
-import org.apache.fop.fo.Property;
-import org.apache.fop.fo.SpaceProperty;
 import org.apache.fop.fo.Constants;
+import org.apache.fop.fo.properties.Property;
+import org.apache.fop.fo.properties.SpaceProperty;
 
 /**
  * Store a single Space property value in simplified form, with all