diff options
author | Jeremias Maerki <jeremias@apache.org> | 2003-03-05 21:48:02 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2003-03-05 21:48:02 +0000 |
commit | 35c376f9f01747df3e433bb95c69e8e583d1d5df (patch) | |
tree | 7a0c0bcfa2249c9cc50f1fb6f878f9320352fc35 /src | |
parent | bf1b659f9ad32f669487e9871eb88389b6cb06cf (diff) | |
download | xmlgraphics-fop-35c376f9f01747df3e433bb95c69e8e583d1d5df.tar.gz xmlgraphics-fop-35c376f9f01747df3e433bb95c69e8e583d1d5df.zip |
Switched to long licence
Some general checkstyle fixing
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196020 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
40 files changed, 2253 insertions, 453 deletions
diff --git a/src/org/apache/fop/fo/AbstractCharIterator.java b/src/org/apache/fop/fo/AbstractCharIterator.java index d3b193633..ccb27a9d6 100644 --- a/src/org/apache/fop/fo/AbstractCharIterator.java +++ b/src/org/apache/fop/fo/AbstractCharIterator.java @@ -1,34 +1,96 @@ /* * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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; -// FOP -import org.apache.fop.apps.FOPException; import java.util.NoSuchElementException; +/** + * Abstract base class for character iterators. + */ public abstract class AbstractCharIterator implements CharIterator, Cloneable { + /** + * @see java.util.Iterator#hasNext() + */ public abstract boolean hasNext(); + /** + * @see org.apache.fop.fo.CharIterator#nextChar() + */ public abstract char nextChar() throws NoSuchElementException ; + /** + * @see java.util.Iterator#next() + */ public Object next() throws NoSuchElementException { return new Character(nextChar()); } + /** + * @see java.util.Iterator#remove() + */ public void remove() { throw new UnsupportedOperationException(); } + /** + * @see org.apache.fop.fo.CharIterator#replaceChar(char) + */ public void replaceChar(char c) { } + /** + * @see java.lang.Object#clone() + */ public Object clone() { try { return super.clone(); diff --git a/src/org/apache/fop/fo/BoxPropShorthandParser.java b/src/org/apache/fop/fo/BoxPropShorthandParser.java index 0e3f4debc..6131e3415 100644 --- a/src/org/apache/fop/fo/BoxPropShorthandParser.java +++ b/src/org/apache/fop/fo/BoxPropShorthandParser.java @@ -1,23 +1,70 @@ /* * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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; - public class BoxPropShorthandParser extends GenericShorthandParser { + /** + * @see org.apache.fop.fo.GenericShorthandParser#GenericShorthandParser(ListProperty) + */ public BoxPropShorthandParser(ListProperty listprop) { super(listprop); } - // Stores 1 to 4 values of same type - // Set the given property based on the number of values set - // Example: padding, border-width, border-color, border-style, margin + /** + * Stores 1 to 4 values of same type. + * Set the given property based on the number of values set. + * Example: padding, border-width, border-color, border-style, margin + * @see org.apache.fop.fo.GenericShorthandParser#convertValueForProperty(String, Maker, PropertyList) + */ protected Property convertValueForProperty(String propName, Property.Maker maker, PropertyList propertyList) { diff --git a/src/org/apache/fop/fo/CharIterator.java b/src/org/apache/fop/fo/CharIterator.java index a0657ed8a..b15d1002e 100644 --- a/src/org/apache/fop/fo/CharIterator.java +++ b/src/org/apache/fop/fo/CharIterator.java @@ -1,10 +1,53 @@ /* * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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.Iterator; diff --git a/src/org/apache/fop/fo/CharacterProperty.java b/src/org/apache/fop/fo/CharacterProperty.java index a638d883e..f9d3e049b 100644 --- a/src/org/apache/fop/fo/CharacterProperty.java +++ b/src/org/apache/fop/fo/CharacterProperty.java @@ -1,10 +1,53 @@ /* * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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; public class CharacterProperty extends Property { diff --git a/src/org/apache/fop/fo/ColorProfile.java b/src/org/apache/fop/fo/ColorProfile.java index 1f6010c9b..06e3d7b8e 100644 --- a/src/org/apache/fop/fo/ColorProfile.java +++ b/src/org/apache/fop/fo/ColorProfile.java @@ -1,31 +1,78 @@ /* * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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; -// FOP -import org.apache.fop.datatypes.ColorType; - +// Java import java.awt.color.ICC_Profile; import java.awt.color.ICC_ColorSpace; import java.net.URL; import java.io.IOException; import java.io.InputStream; +// FOP +import org.apache.fop.datatypes.ColorType; + /** * The fo:color-profile formatting object. * This loads the color profile when needed and resolves a requested color. */ public class ColorProfile extends FObj { - int intent; - String src; - String profileName; - ICC_ColorSpace colorSpace = null; + private int intent; + private String src; + private String profileName; + private ICC_ColorSpace colorSpace = null; + /** + * @see org.apache.fop.fo.FONode#FONode(FONode) + */ protected ColorProfile(FONode parent) { super(parent); } @@ -64,9 +111,9 @@ public class ColorProfile extends FObj { InputStream is = url.openStream(); ICC_Profile iccProfile = ICC_Profile.getInstance(is); colorSpace = new ICC_ColorSpace(iccProfile); - } catch(IOException ioe) { + } catch (IOException ioe) { getLogger().error("Could not read Color Profile src", ioe); - } catch(IllegalArgumentException iae) { + } catch (IllegalArgumentException iae) { getLogger().error("Color Profile src not an ICC Profile", iae); } } diff --git a/src/org/apache/fop/fo/ColorTypeProperty.java b/src/org/apache/fop/fo/ColorTypeProperty.java index 3433ee699..ea9adcf7f 100644 --- a/src/org/apache/fop/fo/ColorTypeProperty.java +++ b/src/org/apache/fop/fo/ColorTypeProperty.java @@ -1,10 +1,53 @@ /* * $Id$ - * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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.datatypes.ColorType; diff --git a/src/org/apache/fop/fo/CondLengthProperty.java b/src/org/apache/fop/fo/CondLengthProperty.java index 9355e42c0..ff71f79fa 100644 --- a/src/org/apache/fop/fo/CondLengthProperty.java +++ b/src/org/apache/fop/fo/CondLengthProperty.java @@ -1,10 +1,53 @@ /* * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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.datatypes.Length; diff --git a/src/org/apache/fop/fo/Declarations.java b/src/org/apache/fop/fo/Declarations.java index 6e2304423..cd1b2d3d8 100644 --- a/src/org/apache/fop/fo/Declarations.java +++ b/src/org/apache/fop/fo/Declarations.java @@ -1,18 +1,58 @@ /* * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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; -// FOP -import org.apache.fop.fo.flow.*; -import org.apache.fop.apps.FOPException; - -import java.util.ArrayList; -import java.util.HashMap; +// Java +import java.util.List; +import java.util.Map; import java.util.Iterator; /** @@ -23,8 +63,9 @@ import java.util.Iterator; * references. */ public class Declarations extends FObj { - HashMap colorProfiles = null; - ArrayList external = null; + + private Map colorProfiles = null; + private List external = null; protected Declarations(FONode parent) { super(parent); @@ -35,25 +76,26 @@ public class Declarations extends FObj { * a hashmap of color profiles and a list of external xml. */ public void end() { - for(Iterator iter = children.iterator(); iter.hasNext(); ) { + for (Iterator iter = children.iterator(); iter.hasNext();) { FONode node = (FONode)iter.next(); - if(node.getName().equals("fo:color-profile")) { + if (node.getName().equals("fo:color-profile")) { ColorProfile cp = (ColorProfile)node; - if(!"".equals(cp.getProfileName())) { - if(colorProfiles == null) { - colorProfiles = new HashMap(); + if (!"".equals(cp.getProfileName())) { + if (colorProfiles == null) { + colorProfiles = new java.util.HashMap(); } - if(colorProfiles.get(cp.getProfileName()) != null) { + if (colorProfiles.get(cp.getProfileName()) != null) { // duplicate names - getLogger().warn("Duplicate fo:color-profile profile name : " + cp.getProfileName()); + getLogger().warn("Duplicate fo:color-profile profile name : " + + cp.getProfileName()); } colorProfiles.put(cp.getProfileName(), cp); } else { getLogger().warn("color-profile-name required for color profile"); } - } else if(node instanceof XMLObj) { - if(external == null) { - external = new ArrayList(); + } else if (node instanceof XMLObj) { + if (external == null) { + external = new java.util.ArrayList(); } external.add(node); } else { diff --git a/src/org/apache/fop/fo/ElementMapping.java b/src/org/apache/fop/fo/ElementMapping.java index 591412be4..8e5a68a57 100644 --- a/src/org/apache/fop/fo/ElementMapping.java +++ b/src/org/apache/fop/fo/ElementMapping.java @@ -1,10 +1,53 @@ /* * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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; /** @@ -12,9 +55,9 @@ package org.apache.fop.fo; * the given builder. */ public interface ElementMapping { - public static final String DEFAULT = "<default>"; + final String DEFAULT = "<default>"; - public void addToBuilder(FOTreeBuilder builder); + void addToBuilder(FOTreeBuilder builder); public static class Maker { public FONode make(FONode parent) { diff --git a/src/org/apache/fop/fo/EnumProperty.java b/src/org/apache/fop/fo/EnumProperty.java index 2b87bb0e2..a1f7e4190 100644 --- a/src/org/apache/fop/fo/EnumProperty.java +++ b/src/org/apache/fop/fo/EnumProperty.java @@ -1,10 +1,53 @@ /* * $Id$ - * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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; diff --git a/src/org/apache/fop/fo/FOElementMapping.java b/src/org/apache/fop/fo/FOElementMapping.java index 543f3cd0b..2385781fb 100644 --- a/src/org/apache/fop/fo/FOElementMapping.java +++ b/src/org/apache/fop/fo/FOElementMapping.java @@ -1,23 +1,67 @@ /* * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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; +// Java import java.util.HashMap; -import java.util.Iterator; - -import org.apache.fop.fo.flow.*; -import org.apache.fop.fo.pagination.*; +/** + * Element mapping class for all XSL-FO elements. + */ public class FOElementMapping implements ElementMapping { + private static HashMap foObjs = null; private static synchronized void setupFO() { - if(foObjs == null) { + if (foObjs == null) { foObjs = new HashMap(); // Declarations and Pagination and Layout Formatting Objects @@ -107,6 +151,9 @@ public class FOElementMapping implements ElementMapping { } + /** + * @see org.apache.fop.fo.ElementMapping#addToBuilder(FOTreeBuilder) + */ public void addToBuilder(FOTreeBuilder builder) { setupFO(); String uri = "http://www.w3.org/1999/XSL/Format"; @@ -115,7 +162,7 @@ public class FOElementMapping implements ElementMapping { static class R extends ElementMapping.Maker { public FONode make(FONode parent) { - return new Root(parent); + return new org.apache.fop.fo.pagination.Root(parent); } } @@ -133,91 +180,91 @@ public class FOElementMapping implements ElementMapping { static class PS extends ElementMapping.Maker { public FONode make(FONode parent) { - return new PageSequence(parent); + return new org.apache.fop.fo.pagination.PageSequence(parent); } } static class LMS extends ElementMapping.Maker { public FONode make(FONode parent) { - return new LayoutMasterSet(parent); + return new org.apache.fop.fo.pagination.LayoutMasterSet(parent); } } static class PSM extends ElementMapping.Maker { public FONode make(FONode parent) { - return new PageSequenceMaster(parent); + return new org.apache.fop.fo.pagination.PageSequenceMaster(parent); } } static class SPMR extends ElementMapping.Maker { public FONode make(FONode parent) { - return new SinglePageMasterReference(parent); + return new org.apache.fop.fo.pagination.SinglePageMasterReference(parent); } } static class RPMR extends ElementMapping.Maker { public FONode make(FONode parent) { - return new RepeatablePageMasterReference(parent); + return new org.apache.fop.fo.pagination.RepeatablePageMasterReference(parent); } } static class RPMA extends ElementMapping.Maker { public FONode make(FONode parent) { - return new RepeatablePageMasterAlternatives(parent); + return new org.apache.fop.fo.pagination.RepeatablePageMasterAlternatives(parent); } } static class CPMR extends ElementMapping.Maker { public FONode make(FONode parent) { - return new ConditionalPageMasterReference(parent); + return new org.apache.fop.fo.pagination.ConditionalPageMasterReference(parent); } } static class SPM extends ElementMapping.Maker { public FONode make(FONode parent) { - return new SimplePageMaster(parent); + return new org.apache.fop.fo.pagination.SimplePageMaster(parent); } } static class RB extends ElementMapping.Maker { public FONode make(FONode parent) { - return new RegionBody(parent); + return new org.apache.fop.fo.pagination.RegionBody(parent); } } static class RBefore extends ElementMapping.Maker { public FONode make(FONode parent) { - return new RegionBefore(parent); + return new org.apache.fop.fo.pagination.RegionBefore(parent); } } static class RA extends ElementMapping.Maker { public FONode make(FONode parent) { - return new RegionAfter(parent); + return new org.apache.fop.fo.pagination.RegionAfter(parent); } } static class RS extends ElementMapping.Maker { public FONode make(FONode parent) { - return new RegionStart(parent); + return new org.apache.fop.fo.pagination.RegionStart(parent); } } static class RE extends ElementMapping.Maker { public FONode make(FONode parent) { - return new RegionEnd(parent); + return new org.apache.fop.fo.pagination.RegionEnd(parent); } } static class Fl extends ElementMapping.Maker { public FONode make(FONode parent) { - return new Flow(parent); + return new org.apache.fop.fo.flow.Flow(parent); } } static class SC extends ElementMapping.Maker { public FONode make(FONode parent) { - return new StaticContent(parent); + return new org.apache.fop.fo.flow.StaticContent(parent); } } @@ -229,19 +276,19 @@ public class FOElementMapping implements ElementMapping { static class B extends ElementMapping.Maker { public FONode make(FONode parent) { - return new Block(parent); + return new org.apache.fop.fo.flow.Block(parent); } } static class BC extends ElementMapping.Maker { public FONode make(FONode parent) { - return new BlockContainer(parent); + return new org.apache.fop.fo.flow.BlockContainer(parent); } } static class BO extends ElementMapping.Maker { public FONode make(FONode parent) { - return new BidiOverride(parent); + return new org.apache.fop.fo.flow.BidiOverride(parent); } } @@ -253,151 +300,151 @@ public class FOElementMapping implements ElementMapping { static class IPS extends ElementMapping.Maker { public FONode make(FONode parent) { - return new InitialPropertySet(parent); + return new org.apache.fop.fo.flow.InitialPropertySet(parent); } } static class EG extends ElementMapping.Maker { public FONode make(FONode parent) { - return new ExternalGraphic(parent); + return new org.apache.fop.fo.flow.ExternalGraphic(parent); } } static class IFO extends ElementMapping.Maker { public FONode make(FONode parent) { - return new InstreamForeignObject(parent); + return new org.apache.fop.fo.flow.InstreamForeignObject(parent); } } static class In extends ElementMapping.Maker { public FONode make(FONode parent) { - return new Inline(parent); + return new org.apache.fop.fo.flow.Inline(parent); } } static class IC extends ElementMapping.Maker { public FONode make(FONode parent) { - return new InlineContainer(parent); + return new org.apache.fop.fo.flow.InlineContainer(parent); } } static class L extends ElementMapping.Maker { public FONode make(FONode parent) { - return new Leader(parent); + return new org.apache.fop.fo.flow.Leader(parent); } } static class PN extends ElementMapping.Maker { public FONode make(FONode parent) { - return new PageNumber(parent); + return new org.apache.fop.fo.flow.PageNumber(parent); } } static class PNC extends ElementMapping.Maker { public FONode make(FONode parent) { - return new PageNumberCitation(parent); + return new org.apache.fop.fo.flow.PageNumberCitation(parent); } } static class TAC extends ElementMapping.Maker { public FONode make(FONode parent) { - return new TableAndCaption(parent); + return new org.apache.fop.fo.flow.TableAndCaption(parent); } } static class Ta extends ElementMapping.Maker { public FONode make(FONode parent) { - return new Table(parent); + return new org.apache.fop.fo.flow.Table(parent); } } static class TC extends ElementMapping.Maker { public FONode make(FONode parent) { - return new TableColumn(parent); + return new org.apache.fop.fo.flow.TableColumn(parent); } } static class TCaption extends ElementMapping.Maker { public FONode make(FONode parent) { - return new TableCaption(parent); + return new org.apache.fop.fo.flow.TableCaption(parent); } } static class TB extends ElementMapping.Maker { public FONode make(FONode parent) { - return new TableBody(parent); + return new org.apache.fop.fo.flow.TableBody(parent); } } static class TR extends ElementMapping.Maker { public FONode make(FONode parent) { - return new TableRow(parent); + return new org.apache.fop.fo.flow.TableRow(parent); } } static class TCell extends ElementMapping.Maker { public FONode make(FONode parent) { - return new TableCell(parent); + return new org.apache.fop.fo.flow.TableCell(parent); } } static class LB extends ElementMapping.Maker { public FONode make(FONode parent) { - return new ListBlock(parent); + return new org.apache.fop.fo.flow.ListBlock(parent); } } static class LI extends ElementMapping.Maker { public FONode make(FONode parent) { - return new ListItem(parent); + return new org.apache.fop.fo.flow.ListItem(parent); } } static class LIB extends ElementMapping.Maker { public FONode make(FONode parent) { - return new ListItemBody(parent); + return new org.apache.fop.fo.flow.ListItemBody(parent); } } static class LIL extends ElementMapping.Maker { public FONode make(FONode parent) { - return new ListItemLabel(parent); + return new org.apache.fop.fo.flow.ListItemLabel(parent); } } static class BL extends ElementMapping.Maker { public FONode make(FONode parent) { - return new BasicLink(parent); + return new org.apache.fop.fo.flow.BasicLink(parent); } } static class MS extends ElementMapping.Maker { public FONode make(FONode parent) { - return new MultiSwitch(parent); + return new org.apache.fop.fo.flow.MultiSwitch(parent); } } static class MC extends ElementMapping.Maker { public FONode make(FONode parent) { - return new MultiCase(parent); + return new org.apache.fop.fo.flow.MultiCase(parent); } } static class MT extends ElementMapping.Maker { public FONode make(FONode parent) { - return new MultiToggle(parent); + return new org.apache.fop.fo.flow.MultiToggle(parent); } } static class MP extends ElementMapping.Maker { public FONode make(FONode parent) { - return new MultiProperties(parent); + return new org.apache.fop.fo.flow.MultiProperties(parent); } } static class MPS extends ElementMapping.Maker { public FONode make(FONode parent) { - return new MultiPropertySet(parent); + return new org.apache.fop.fo.flow.MultiPropertySet(parent); } } @@ -409,31 +456,31 @@ public class FOElementMapping implements ElementMapping { static class Foot extends ElementMapping.Maker { public FONode make(FONode parent) { - return new Footnote(parent); + return new org.apache.fop.fo.flow.Footnote(parent); } } static class FB extends ElementMapping.Maker { public FONode make(FONode parent) { - return new FootnoteBody(parent); + return new org.apache.fop.fo.flow.FootnoteBody(parent); } } static class W extends ElementMapping.Maker { public FONode make(FONode parent) { - return new Wrapper(parent); + return new org.apache.fop.fo.flow.Wrapper(parent); } } static class M extends ElementMapping.Maker { public FONode make(FONode parent) { - return new Marker(parent); + return new org.apache.fop.fo.flow.Marker(parent); } } static class RM extends ElementMapping.Maker { public FONode make(FONode parent) { - return new RetrieveMarker(parent); + return new org.apache.fop.fo.flow.RetrieveMarker(parent); } } } diff --git a/src/org/apache/fop/fo/FONode.java b/src/org/apache/fop/fo/FONode.java index dabd6ff80..e9851875c 100644 --- a/src/org/apache/fop/fo/FONode.java +++ b/src/org/apache/fop/fo/FONode.java @@ -1,54 +1,126 @@ /* * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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; -// FOP -import org.apache.fop.apps.FOPException; -import org.apache.fop.apps.StructureHandler; -import org.apache.fop.util.CharUtilities; +// Java +import java.util.ListIterator; + +// XML +import org.xml.sax.Attributes; // Avalon import org.apache.avalon.framework.logger.Logger; -import org.xml.sax.Attributes; - -import java.util.ListIterator; -import java.util.NoSuchElementException; +// FOP +import org.apache.fop.apps.FOPException; +import org.apache.fop.apps.StructureHandler; +import org.apache.fop.util.CharUtilities; /** * base class for nodes in the XML tree * */ public abstract class FONode { + + /** FO User Agent for this node (for logger etc.)*/ protected FOUserAgent userAgent; + /** Parent FO node */ protected FONode parent; + /** Name of the node */ protected String name; + /** + * Main constructor. + * @param parent parent of this node + */ protected FONode(FONode parent) { this.parent = parent; } + /** + * Sets the name of the node. + * @param str the name + */ public void setName(String str) { name = str; } - public Logger getLogger() { + /** + * Returns the logger for the node. + * @return the logger + */ + protected Logger getLogger() { return userAgent.getLogger(); } + /** + * Sets the user agent for the node. + * @param ua the user agent + */ public void setUserAgent(FOUserAgent ua) { userAgent = ua; } - public FOUserAgent getUserAgent() { + /** + * Returns the user agent for the node. + * @return FOUserAgent + */ + protected FOUserAgent getUserAgent() { return userAgent; } + /** + * Sets the structure handler to send events to. + * @param st StructureHandler instance + */ public void setStructHandler(StructureHandler st) { } @@ -56,7 +128,7 @@ public abstract class FONode { } /** - * returns the name of the object + * Returns the name of the object * @return the name of this object */ public String getName() { @@ -64,7 +136,7 @@ public abstract class FONode { } /** - * adds characters (does nothing here) + * Adds characters (does nothing here) * @param data text * @param start start position * @param length length of the text @@ -99,7 +171,7 @@ public abstract class FONode { * @return A ListIterator. */ public ListIterator getChildren() { - return null; + return null; } /** diff --git a/src/org/apache/fop/fo/FOText.java b/src/org/apache/fop/fo/FOText.java index 9a0ccf1e3..78edbc48f 100644 --- a/src/org/apache/fop/fo/FOText.java +++ b/src/org/apache/fop/fo/FOText.java @@ -1,27 +1,68 @@ /* * $Id$ - * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources." - */ - + * ============================================================================ + * 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; +// Java +import java.util.NoSuchElementException; +import java.util.List; + // FOP -import org.apache.fop.layout.FontState; -import org.apache.fop.layout.*; -import org.apache.fop.datatypes.*; -import org.apache.fop.fo.properties.*; -import org.apache.fop.apps.FOPException; +import org.apache.fop.layout.TextState; import org.apache.fop.layoutmgr.LayoutManager; import org.apache.fop.layoutmgr.TextLayoutManager; import org.apache.fop.apps.StructureHandler; - -import java.util.NoSuchElementException; -import java.util.List; +import org.apache.fop.fo.properties.WhiteSpaceCollapse; /** - * a text node in the formatting object tree + * A text node in the formatting object tree. * * Modified by Mark Lillywhite, mark-fop@inomial.com. * Unfortunately the BufferManager implementatation holds @@ -61,15 +102,17 @@ public class FOText extends FObj { * @return true if this will create an area in the output */ public boolean willCreateArea() { - if (textInfo.whiteSpaceCollapse == WhiteSpaceCollapse.FALSE && - length > 0) { + if (textInfo.whiteSpaceCollapse == WhiteSpaceCollapse.FALSE + && length > 0) { return true; } for (int i = start; i < start + length; i++) { char ch = ca[i]; - if (!((ch == ' ') || (ch == '\n') || (ch == '\r') || - (ch == '\t'))) { // whitespace + if (!((ch == ' ') + || (ch == '\n') + || (ch == '\r') + || (ch == '\t'))) { // whitespace return true; } } @@ -78,7 +121,9 @@ public class FOText extends FObj { public void addLayoutManager(List list) { // if nothing left (length=0)? - if(length == 0) { return; } + if (length == 0) { + return; + } if (length < ca.length) { char[] tmp = ca; @@ -95,7 +140,8 @@ public class FOText extends FObj { } private class TextCharIterator extends AbstractCharIterator { - int curIndex = 0; + private int curIndex = 0; + public boolean hasNext() { return (curIndex < length); } diff --git a/src/org/apache/fop/fo/FOTreeBuilder.java b/src/org/apache/fop/fo/FOTreeBuilder.java index 906bdef14..fbe2a57ce 100644 --- a/src/org/apache/fop/fo/FOTreeBuilder.java +++ b/src/org/apache/fop/fo/FOTreeBuilder.java @@ -1,26 +1,71 @@ /* * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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; // FOP import org.apache.fop.apps.FOPException; import org.apache.fop.apps.StructureHandler; -// Avalon -import org.apache.avalon.framework.logger.Logger; +// Java +import java.util.HashMap; +import java.util.Map; +import java.util.Set; // SAX import org.xml.sax.helpers.DefaultHandler; import org.xml.sax.SAXException; import org.xml.sax.Attributes; -// Java -import java.util.*; +// Avalon +import org.apache.avalon.framework.logger.Logger; /** * SAX Handler that builds the formatting object tree. @@ -39,12 +84,12 @@ public class FOTreeBuilder extends DefaultHandler { * Table mapping element names to the makers of objects * representing formatting objects. */ - protected Map fobjTable = new HashMap(); + protected Map fobjTable = new java.util.HashMap(); /** * Set of mapped namespaces. */ - protected Set namespaces = new HashSet(); + protected Set namespaces = new java.util.HashSet(); /** * Current formatting object being handled @@ -64,20 +109,32 @@ public class FOTreeBuilder extends DefaultHandler { private FOUserAgent userAgent; - public FOTreeBuilder() {} + /** + * Default constructor + */ + public FOTreeBuilder() { + } - public Logger getLogger() { + private Logger getLogger() { return userAgent.getLogger(); } + /** + * Sets the user agent + * @param ua the user agent + */ public void setUserAgent(FOUserAgent ua) { userAgent = ua; } - public FOUserAgent getUserAgent() { + private FOUserAgent getUserAgent() { return userAgent; } + /** + * Sets the structure handler to receive events. + * @param sh StructureHandler instance + */ public void setStructHandler(StructureHandler sh) { this.structHandler = sh; } @@ -95,47 +152,52 @@ public class FOTreeBuilder extends DefaultHandler { /** * SAX Handler for characters + * @see org.xml.sax.ContentHandler#characters(char[], int, int) */ public void characters(char data[], int start, int length) { - if(currentFObj != null) { + if (currentFObj != null) { currentFObj.addCharacters(data, start, start + length); } } /** * SAX Handler for the end of an element + * @see org.xml.sax.ContentHandler#endElement(String, String, String) */ public void endElement(String uri, String localName, String rawName) - throws SAXException { + throws SAXException { currentFObj.end(); currentFObj = currentFObj.getParent(); } /** * SAX Handler for the start of the document + * @see org.xml.sax.ContentHandler#startDocument() */ - public void startDocument() - throws SAXException { + public void startDocument() throws SAXException { rootFObj = null; // allows FOTreeBuilder to be reused - if (getLogger().isDebugEnabled()) + if (getLogger().isDebugEnabled()) { getLogger().debug("Building formatting object tree"); + } structHandler.startDocument(); } /** * SAX Handler for the end of the document + * @see org.xml.sax.ContentHandler#endDocument() */ - public void endDocument() - throws SAXException { + public void endDocument() throws SAXException { rootFObj = null; currentFObj = null; - if (getLogger().isDebugEnabled()) + if (getLogger().isDebugEnabled()) { getLogger().debug("Parsing of document complete"); + } structHandler.endDocument(); } /** * SAX Handler for the start of an element + * @see org.xml.sax.ContentHandler#startElement(String, String, String, Attributes) */ public void startElement(String uri, String localName, String rawName, Attributes attlist) throws SAXException { @@ -146,18 +208,19 @@ public class FOTreeBuilder extends DefaultHandler { ElementMapping.Maker fobjMaker = null; Map table = (Map)fobjTable.get(uri); - if(table != null) { + if (table != null) { fobjMaker = (ElementMapping.Maker)table.get(localName); // try default - if(fobjMaker == null) { + if (fobjMaker == null) { fobjMaker = (ElementMapping.Maker)table.get(ElementMapping.DEFAULT); } } if (fobjMaker == null) { - if (getLogger().isWarnEnabled()) + if (getLogger().isWarnEnabled()) { getLogger().warn("Unknown formatting object " + uri + "^" + localName); - if(namespaces.contains(uri.intern())) { + } + if (namespaces.contains(uri.intern())) { // fall back fobjMaker = new Unknown.Maker(); } else { @@ -193,12 +256,19 @@ public class FOTreeBuilder extends DefaultHandler { currentFObj = fobj; } + /** + * Resets this object for another run. + */ public void reset() { currentFObj = null; rootFObj = null; structHandler = null; } + /** + * Indicates if data has been processed. + * @return True if data has been processed + */ public boolean hasData() { return (rootFObj != null); } diff --git a/src/org/apache/fop/fo/FOUserAgent.java b/src/org/apache/fop/fo/FOUserAgent.java index ab4424270..24574a81a 100644 --- a/src/org/apache/fop/fo/FOUserAgent.java +++ b/src/org/apache/fop/fo/FOUserAgent.java @@ -1,10 +1,53 @@ /* * $Id$ - * Copyright (C) 2001-2003 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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; // Java diff --git a/src/org/apache/fop/fo/FObj.java b/src/org/apache/fop/fo/FObj.java index 1f977da88..dd5f74921 100644 --- a/src/org/apache/fop/fo/FObj.java +++ b/src/org/apache/fop/fo/FObj.java @@ -1,37 +1,76 @@ /* * $Id$ - * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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; -// FOP -import org.apache.fop.layout.AreaClass; -import org.apache.fop.apps.FOPException; -import org.apache.fop.apps.StructureHandler; -import org.apache.fop.layoutmgr.LayoutManager; -import org.apache.fop.fo.properties.FOPropertyMapping; -import org.apache.fop.fo.flow.Marker; - // Java import java.util.Iterator; -import org.xml.sax.Attributes; - -import java.util.Iterator; import java.util.ListIterator; import java.util.ArrayList; import java.util.List; import java.util.HashMap; import java.util.Set; import java.util.Map; +import org.xml.sax.Attributes; + +// FOP +import org.apache.fop.apps.FOPException; +import org.apache.fop.apps.StructureHandler; +import org.apache.fop.fo.properties.FOPropertyMapping; +import org.apache.fop.fo.flow.Marker; /** * base class for representation of formatting objects and their processing */ public class FObj extends FONode { - private final static String FO_URI = "http://www.w3.org/1999/XSL/Format"; + private static final String FO_URI = "http://www.w3.org/1999/XSL/Format"; /** * Static property list builder that converts xml attributes @@ -236,9 +275,9 @@ public class FObj extends FONode { protected void setWritingMode() { FObj p; FONode parent; - for (p = this; !p.generatesReferenceAreas() && - (parent = p.getParent()) != null && - (parent instanceof FObj); p = (FObj) parent) { + for (p = this; !p.generatesReferenceAreas() + && (parent = p.getParent()) != null + && (parent instanceof FObj); p = (FObj) parent) { } this.properties.setWritingMode( p.getProperty("writing-mode").getEnum()); @@ -312,7 +351,8 @@ public class FObj extends FONode { if (!markers.containsKey(mcname)) { markers.put(mcname, marker); } else { - getLogger().error("fo:marker 'marker-class-name' must be unique for same parent: " + mcname); + getLogger().error("fo:marker 'marker-class-name' " + + "must be unique for same parent: " + mcname); } } diff --git a/src/org/apache/fop/fo/FObjMixed.java b/src/org/apache/fop/fo/FObjMixed.java index 12b3580d7..c1c91b88c 100644 --- a/src/org/apache/fop/fo/FObjMixed.java +++ b/src/org/apache/fop/fo/FObjMixed.java @@ -1,17 +1,57 @@ /* * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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.layout.FontState; import org.apache.fop.layout.FontInfo; -import org.apache.fop.apps.FOPException; import org.apache.fop.apps.StructureHandler; -import org.apache.fop.datatypes.ColorType; import org.apache.fop.layoutmgr.InlineStackingLayoutManager; import org.apache.fop.layoutmgr.LMiter; @@ -46,7 +86,7 @@ public class FObjMixed extends FObj { } protected void addCharacters(char data[], int start, int length) { - if(textInfo == null) { + if (textInfo == null) { // Really only need one of these, but need to get fontInfo // stored in propMgr for later use. propMgr.setFontInfo(fontInfo); diff --git a/src/org/apache/fop/fo/GenericShorthandParser.java b/src/org/apache/fop/fo/GenericShorthandParser.java index 3ba0badd0..54c2da6f1 100644 --- a/src/org/apache/fop/fo/GenericShorthandParser.java +++ b/src/org/apache/fop/fo/GenericShorthandParser.java @@ -1,10 +1,53 @@ /* * $Id$ - * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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; diff --git a/src/org/apache/fop/fo/InlineCharIterator.java b/src/org/apache/fop/fo/InlineCharIterator.java index d8db82707..78eb78d4d 100644 --- a/src/org/apache/fop/fo/InlineCharIterator.java +++ b/src/org/apache/fop/fo/InlineCharIterator.java @@ -1,16 +1,57 @@ /* * $Id$ - * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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.layout.BorderAndPadding; import org.apache.fop.util.CharUtilities; -import java.util.Iterator; -import java.util.ListIterator; import java.util.NoSuchElementException; @@ -26,15 +67,16 @@ public class InlineCharIterator extends RecursiveCharIterator { private void checkBoundaries(BorderAndPadding bap) { // TODO! use start and end in BAP!! - bStartBoundary = (bap.getBorderLeftWidth(false) > 0 || - bap.getPaddingLeft(false) > 0); - bEndBoundary = (bap.getBorderRightWidth(false) > 0 || - bap.getPaddingRight(false) > 0); + bStartBoundary = (bap.getBorderLeftWidth(false) > 0 + || bap.getPaddingLeft(false) > 0); + bEndBoundary = (bap.getBorderRightWidth(false) > 0 + || bap.getPaddingRight(false) > 0); } public boolean hasNext() { - if (bStartBoundary) + if (bStartBoundary) { return true; + } return (super.hasNext() || bEndBoundary); /* If super.hasNext() returns false, * we return true if we are going to return a "boundary" signal @@ -55,8 +97,9 @@ public class InlineCharIterator extends RecursiveCharIterator { if (bEndBoundary) { bEndBoundary = false; return CharUtilities.CODE_EOT; - } else + } else { throw e; + } } } } diff --git a/src/org/apache/fop/fo/KeepProperty.java b/src/org/apache/fop/fo/KeepProperty.java index 341180c13..c2099e051 100644 --- a/src/org/apache/fop/fo/KeepProperty.java +++ b/src/org/apache/fop/fo/KeepProperty.java @@ -1,10 +1,53 @@ /* * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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.datatypes.Keep; diff --git a/src/org/apache/fop/fo/LengthPairProperty.java b/src/org/apache/fop/fo/LengthPairProperty.java index 2cc7b465b..d978fef99 100644 --- a/src/org/apache/fop/fo/LengthPairProperty.java +++ b/src/org/apache/fop/fo/LengthPairProperty.java @@ -1,13 +1,55 @@ /* * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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.datatypes.Length; import org.apache.fop.datatypes.LengthPair; public class LengthPairProperty extends Property { diff --git a/src/org/apache/fop/fo/LengthProperty.java b/src/org/apache/fop/fo/LengthProperty.java index 07afc74f2..22c458ce4 100644 --- a/src/org/apache/fop/fo/LengthProperty.java +++ b/src/org/apache/fop/fo/LengthProperty.java @@ -1,10 +1,53 @@ /* * $Id$ - * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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.datatypes.Length; diff --git a/src/org/apache/fop/fo/LengthRangeProperty.java b/src/org/apache/fop/fo/LengthRangeProperty.java index 438f8ee23..0b6a02b28 100644 --- a/src/org/apache/fop/fo/LengthRangeProperty.java +++ b/src/org/apache/fop/fo/LengthRangeProperty.java @@ -1,13 +1,55 @@ /* * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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.datatypes.Length; import org.apache.fop.datatypes.LengthRange; public class LengthRangeProperty extends Property { diff --git a/src/org/apache/fop/fo/ListProperty.java b/src/org/apache/fop/fo/ListProperty.java index 9253283e3..32c67f7fe 100644 --- a/src/org/apache/fop/fo/ListProperty.java +++ b/src/org/apache/fop/fo/ListProperty.java @@ -1,10 +1,53 @@ /* * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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; @@ -19,10 +62,11 @@ public class ListProperty extends Property { public Property convertProperty(Property p, PropertyList propertyList, FObj fo) { - if (p instanceof ListProperty) + if (p instanceof ListProperty) { return p; - else + } else { return new ListProperty(p); + } } } diff --git a/src/org/apache/fop/fo/NumberProperty.java b/src/org/apache/fop/fo/NumberProperty.java index eec77dc3c..70e887901 100644 --- a/src/org/apache/fop/fo/NumberProperty.java +++ b/src/org/apache/fop/fo/NumberProperty.java @@ -1,9 +1,53 @@ /* * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ + * ============================================================================ + * 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.datatypes.ColorType; @@ -19,11 +63,13 @@ public class NumberProperty extends Property { public Property convertProperty(Property p, PropertyList propertyList, FObj fo) { - if (p instanceof NumberProperty) + if (p instanceof NumberProperty) { return p; + } Number val = p.getNumber(); - if (val != null) + if (val != null) { return new NumberProperty(val); + } return convertPropertyDatatype(p, propertyList, fo); } diff --git a/src/org/apache/fop/fo/OneCharIterator.java b/src/org/apache/fop/fo/OneCharIterator.java index 0f31d3f9f..5aec5701d 100644 --- a/src/org/apache/fop/fo/OneCharIterator.java +++ b/src/org/apache/fop/fo/OneCharIterator.java @@ -1,19 +1,61 @@ /* * $Id$ - * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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.Iterator; import java.util.NoSuchElementException; public class OneCharIterator extends AbstractCharIterator { - private boolean bFirst=true; + private boolean bFirst = true; private char charCode; public OneCharIterator(char c) { diff --git a/src/org/apache/fop/fo/Property.java b/src/org/apache/fop/fo/Property.java index 3f038de80..8b3fc078b 100644 --- a/src/org/apache/fop/fo/Property.java +++ b/src/org/apache/fop/fo/Property.java @@ -1,17 +1,66 @@ /* * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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.datatypes.*; +import org.apache.fop.datatypes.ColorType; +import org.apache.fop.datatypes.CondLength; +import org.apache.fop.datatypes.Keep; +import org.apache.fop.datatypes.Length; +import org.apache.fop.datatypes.LengthPair; +import org.apache.fop.datatypes.LengthRange; +import org.apache.fop.datatypes.PercentBase; +import org.apache.fop.datatypes.Space; import org.apache.fop.fo.expr.Numeric; import org.apache.fop.fo.expr.PropertyParser; import org.apache.fop.fo.expr.PropertyInfo; -import org.apache.fop.fo.expr.PropertyException; import org.apache.fop.apps.FOPException; import java.util.Vector; @@ -186,9 +235,9 @@ public class Property { } return pret; } catch (org.apache.fop.fo.expr.PropertyException propEx) { - throw new FOPException("Error in " + propName + - " property value '" + value + "': " + - propEx); + throw new FOPException("Error in " + propName + + " property value '" + value + "': " + + propEx); } } diff --git a/src/org/apache/fop/fo/PropertyList.java b/src/org/apache/fop/fo/PropertyList.java index b1ce1d130..83e289c44 100644 --- a/src/org/apache/fop/fo/PropertyList.java +++ b/src/org/apache/fop/fo/PropertyList.java @@ -1,10 +1,53 @@ /* * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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.HashMap; @@ -28,26 +71,26 @@ public class PropertyList extends HashMap { public static final int BLOCKPROGDIM = 4; public static final int INLINEPROGDIM = 5; - private static final String[] sAbsNames = new String[] { + private static final String[] ABS_NAMES = new String[] { "left", "right", "top", "bottom", "height", "width" }; - private static final String[] sRelNames = new String[] { + private static final String[] REL_NAMES = new String[] { "start", "end", "before", "after", "block-progression-dimension", "inline-progression-dimension" }; - private static final HashMap wmtables = new HashMap(4); + private static final HashMap WRITING_MODE_TABLES = new HashMap(4); { - wmtables.put(new Integer(WritingMode.LR_TB), /* lr-tb */ + WRITING_MODE_TABLES.put(new Integer(WritingMode.LR_TB), /* lr-tb */ new byte[] { START, END, BEFORE, AFTER, BLOCKPROGDIM, INLINEPROGDIM }); - wmtables.put(new Integer(WritingMode.RL_TB), /* rl-tb */ + WRITING_MODE_TABLES.put(new Integer(WritingMode.RL_TB), /* rl-tb */ new byte[] { END, START, BEFORE, AFTER, BLOCKPROGDIM, INLINEPROGDIM }); - wmtables.put(new Integer(WritingMode.TB_RL), /* tb-rl */ + WRITING_MODE_TABLES.put(new Integer(WritingMode.TB_RL), /* tb-rl */ new byte[] { AFTER, BEFORE, START, END, INLINEPROGDIM, BLOCKPROGDIM }); @@ -55,9 +98,9 @@ public class PropertyList extends HashMap { private PropertyListBuilder builder; private PropertyList parentPropertyList = null; - String namespace = ""; - String element = ""; - FObj fobj = null; + private String namespace = ""; + private String element = ""; + private FObj fobj = null; public PropertyList(PropertyList parentPropertyList, String space, String el) { @@ -77,8 +120,9 @@ public class PropertyList extends HashMap { public FObj getParentFObj() { if (parentPropertyList != null) { return parentPropertyList.getFObj(); - } else + } else { return null; + } } /** @@ -94,8 +138,9 @@ public class PropertyList extends HashMap { String baseName; if (sepchar > -1) { baseName = propertyName.substring(0, sepchar); - } else + } else { baseName = propertyName; + } Property p = getExplicitBaseProp(baseName); if (p == null) { p = builder.getShorthand(this, namespace, element, baseName); @@ -125,8 +170,9 @@ public class PropertyList extends HashMap { baseName, p, propertyName.substring(sepchar + 1)); - } else + } else { return null; + } } return (Property)super.get(propertyName); } @@ -255,7 +301,7 @@ public class PropertyList extends HashMap { // if value is inherit then get computed value from // parent - if(p != null && "inherit".equals(p.getSpecifiedValue())) { + if (p != null && "inherit".equals(p.getSpecifiedValue())) { if (this.parentPropertyList != null) { p = parentPropertyList.get(propertyName, true, false); } @@ -264,8 +310,9 @@ public class PropertyList extends HashMap { if (subpropName != null && p != null) { return this.builder.getSubpropValue(namespace, element, propertyName, p, subpropName); - } else + } else { return p; + } } public void setBuilder(PropertyListBuilder builder) { @@ -336,9 +383,10 @@ public class PropertyList extends HashMap { */ public String wmAbsToRel(int absdir) { if (wmtable != null) { - return sRelNames[wmtable[absdir]]; - } else + return REL_NAMES[wmtable[absdir]]; + } else { return ""; + } } /** @@ -349,8 +397,9 @@ public class PropertyList extends HashMap { public String wmRelToAbs(int reldir) { if (wmtable != null) { for (int i = 0; i < wmtable.length; i++) { - if (wmtable[i] == reldir) - return sAbsNames[i]; + if (wmtable[i] == reldir) { + return ABS_NAMES[i]; + } } } return ""; @@ -360,7 +409,7 @@ public class PropertyList extends HashMap { * Set the writing mode traits for the FO with this property list. */ public void setWritingMode(int writingMode) { - this.wmtable = (byte[])wmtables.get(new Integer(writingMode)); + this.wmtable = (byte[])WRITING_MODE_TABLES.get(new Integer(writingMode)); } } diff --git a/src/org/apache/fop/fo/PropertyListBuilder.java b/src/org/apache/fop/fo/PropertyListBuilder.java index 4079ddf9b..43015b5ee 100644 --- a/src/org/apache/fop/fo/PropertyListBuilder.java +++ b/src/org/apache/fop/fo/PropertyListBuilder.java @@ -1,21 +1,61 @@ /* * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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.*; -import org.apache.fop.svg.*; -import org.apache.fop.datatypes.*; - -import org.apache.fop.apps.FOPException; - +// Java +import java.util.HashMap; import org.xml.sax.Attributes; -import java.util.HashMap; +// FOP +import org.apache.fop.apps.FOPException; public class PropertyListBuilder { @@ -113,7 +153,9 @@ public class PropertyListBuilder { try { p.put(FONTSIZEATTR, propertyMaker.make(p, fontsizeval, parentFO)); - } catch (FOPException e) {} + } catch (FOPException e) { + /**@todo log this exception */ + } } // Put in the "done" list even if error or no Maker. propsDone.append(FONTSIZEATTR + ' '); @@ -184,8 +226,9 @@ public class PropertyListBuilder { Property.Maker maker = findMaker(space, element, propertyName); if (maker != null) { return maker.getSubpropValue(p, subpropName); - } else + } else { return null; + } } diff --git a/src/org/apache/fop/fo/RecursiveCharIterator.java b/src/org/apache/fop/fo/RecursiveCharIterator.java index 4317571bf..26ad26d7b 100644 --- a/src/org/apache/fop/fo/RecursiveCharIterator.java +++ b/src/org/apache/fop/fo/RecursiveCharIterator.java @@ -1,20 +1,62 @@ /* * $Id$ - * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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.Iterator; -import java.util.ListIterator; import java.util.NoSuchElementException; public class RecursiveCharIterator extends AbstractCharIterator { - Iterator childIter = null; // Child flow objects - CharIterator curCharIter = null; // Children's characters + private Iterator childIter = null; // Child flow objects + private CharIterator curCharIter = null; // Children's characters private FONode fobj; private FONode curChild; @@ -67,8 +109,9 @@ public class RecursiveCharIterator extends AbstractCharIterator { while (curCharIter != null) { if (curCharIter.hasNext() == false) { getNextCharIter(); - } else + } else { return true; + } } return false; } @@ -76,8 +119,9 @@ public class RecursiveCharIterator extends AbstractCharIterator { public char nextChar() throws NoSuchElementException { if (curCharIter != null) { return curCharIter.nextChar(); - } else + } else { throw new NoSuchElementException(); + } } diff --git a/src/org/apache/fop/fo/ShorthandParser.java b/src/org/apache/fop/fo/ShorthandParser.java index fabf1fc7f..1b06e72ba 100644 --- a/src/org/apache/fop/fo/ShorthandParser.java +++ b/src/org/apache/fop/fo/ShorthandParser.java @@ -1,14 +1,57 @@ /* * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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; public interface ShorthandParser { - public Property getValueForProperty(String propName, - Property.Maker maker, - PropertyList propertyList); + Property getValueForProperty(String propName, + Property.Maker maker, + PropertyList propertyList); } diff --git a/src/org/apache/fop/fo/SpaceProperty.java b/src/org/apache/fop/fo/SpaceProperty.java index 5aa9d184d..e06428760 100644 --- a/src/org/apache/fop/fo/SpaceProperty.java +++ b/src/org/apache/fop/fo/SpaceProperty.java @@ -1,12 +1,55 @@ /* * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ + * ============================================================================ + * 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.datatypes.Length; import org.apache.fop.datatypes.Space; import org.apache.fop.datatypes.LengthRange; diff --git a/src/org/apache/fop/fo/StringProperty.java b/src/org/apache/fop/fo/StringProperty.java index c97f6537b..c552fb278 100644 --- a/src/org/apache/fop/fo/StringProperty.java +++ b/src/org/apache/fop/fo/StringProperty.java @@ -1,10 +1,53 @@ /* * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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; @@ -37,7 +80,7 @@ public class StringProperty extends Property { // fall through and use the entire value, including first quote } String str = checkValueKeywords(value); - if(str != null) { + if (str != null) { value = str; } } diff --git a/src/org/apache/fop/fo/TextInfo.java b/src/org/apache/fop/fo/TextInfo.java index 0c2ff695b..e51c548ee 100644 --- a/src/org/apache/fop/fo/TextInfo.java +++ b/src/org/apache/fop/fo/TextInfo.java @@ -1,10 +1,53 @@ /* * $Id$ - * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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; // FOP @@ -29,7 +72,7 @@ public class TextInfo { public SpaceVal letterSpacing; // Add hyphenation props too - public boolean bCanHyphenate=true; + public boolean bCanHyphenate = true; // Textdecoration public boolean underlined = false; diff --git a/src/org/apache/fop/fo/Title.java b/src/org/apache/fop/fo/Title.java index b45b483ac..b3dc5347b 100644 --- a/src/org/apache/fop/fo/Title.java +++ b/src/org/apache/fop/fo/Title.java @@ -1,10 +1,53 @@ /* * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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; // FOP diff --git a/src/org/apache/fop/fo/ToBeImplementedElement.java b/src/org/apache/fop/fo/ToBeImplementedElement.java index 049e8c1ca..feb2e40e2 100644 --- a/src/org/apache/fop/fo/ToBeImplementedElement.java +++ b/src/org/apache/fop/fo/ToBeImplementedElement.java @@ -1,19 +1,57 @@ /* * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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; -// FOP -import org.apache.fop.fo.*; -import org.apache.fop.fo.flow.*; -import org.apache.fop.fo.properties.*; -import org.apache.fop.apps.FOPException; - /** + * This class is a placeholder for elements that have not been implemented. */ public class ToBeImplementedElement extends FObj { diff --git a/src/org/apache/fop/fo/Unknown.java b/src/org/apache/fop/fo/Unknown.java index b7dd97ecd..2936ee9c7 100644 --- a/src/org/apache/fop/fo/Unknown.java +++ b/src/org/apache/fop/fo/Unknown.java @@ -1,19 +1,55 @@ /* * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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; -// FOP -import org.apache.fop.fo.*; -import org.apache.fop.layout.*; -import org.apache.fop.fo.flow.*; -import org.apache.fop.fo.properties.*; -import org.apache.fop.apps.FOPException; - /** * This represents an unknown element. * For example with unsupported namespaces. diff --git a/src/org/apache/fop/fo/UnknownXMLObj.java b/src/org/apache/fop/fo/UnknownXMLObj.java index b1bbab99d..eea01a5a2 100644 --- a/src/org/apache/fop/fo/UnknownXMLObj.java +++ b/src/org/apache/fop/fo/UnknownXMLObj.java @@ -1,25 +1,62 @@ /* * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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.*; -import org.apache.fop.layout.FontState; -import org.apache.fop.apps.FOPException; - -import org.w3c.dom.Element; - public class UnknownXMLObj extends XMLObj { - String namespace; + private String namespace; public static class Maker extends ElementMapping.Maker { - String space; + private String space; - Maker(String sp) { + public Maker(String sp) { space = sp; } @@ -44,14 +81,14 @@ public class UnknownXMLObj extends XMLObj { } protected void addChild(FONode child) { - if(doc == null) { + if (doc == null) { createBasicDocument(); } super.addChild(child); } protected void addCharacters(char data[], int start, int length) { - if(doc == null) { + if (doc == null) { createBasicDocument(); } super.addCharacters(data, start, length); diff --git a/src/org/apache/fop/fo/XMLElement.java b/src/org/apache/fop/fo/XMLElement.java index 47ba344cf..4f64bd7db 100644 --- a/src/org/apache/fop/fo/XMLElement.java +++ b/src/org/apache/fop/fo/XMLElement.java @@ -1,23 +1,67 @@ /* * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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; +// XML +import org.xml.sax.Attributes; + // FOP -import org.apache.fop.fo.properties.*; import org.apache.fop.apps.FOPException; -import org.xml.sax.Attributes; - /** * class representing svg:svg pseudo flow object. */ public class XMLElement extends XMLObj { - String namespace = ""; + + private String namespace = ""; /** * constructs an XML object (called by Maker). diff --git a/src/org/apache/fop/fo/XMLObj.java b/src/org/apache/fop/fo/XMLObj.java index e536b68ac..3638e4732 100644 --- a/src/org/apache/fop/fo/XMLObj.java +++ b/src/org/apache/fop/fo/XMLObj.java @@ -1,23 +1,66 @@ /* * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - + * ============================================================================ + * 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; -// FOP -import org.apache.fop.fo.*; -import org.apache.fop.layout.FontState; -import org.apache.fop.apps.FOPException; +// Java +import java.awt.geom.Point2D; +import java.util.HashMap; -import org.w3c.dom.*; +import org.w3c.dom.Document; +import org.w3c.dom.Element; import org.xml.sax.Attributes; import javax.xml.parsers.DocumentBuilderFactory; -import java.util.*; -import java.awt.geom.Point2D; +// FOP +import org.apache.fop.apps.FOPException; /** * Generic XML object. @@ -27,7 +70,7 @@ import java.awt.geom.Point2D; public abstract class XMLObj extends FONode { // temp reference for attributes - Attributes attr = null; + private Attributes attr = null; protected Element element; protected Document doc; |