diff options
author | Jeremias Maerki <jeremias@apache.org> | 2003-03-07 08:09:26 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2003-03-07 08:09:26 +0000 |
commit | 9b88b319e14760f3251eab747c725ceb6c0f99a4 (patch) | |
tree | 58e81d9c10705da609aa84cb5ae00b795c07bcae /src | |
parent | 962a1b580e67a87179e1223703f5dcc17cbaf887 (diff) | |
download | xmlgraphics-fop-9b88b319e14760f3251eab747c725ceb6c0f99a4.tar.gz xmlgraphics-fop-9b88b319e14760f3251eab747c725ceb6c0f99a4.zip |
Switched to long licence
Some general checkstyle fixing
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196038 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r-- | src/org/apache/fop/mif/MIFElement.java | 94 | ||||
-rw-r--r-- | src/org/apache/fop/mif/MIFFile.java | 79 | ||||
-rw-r--r-- | src/org/apache/fop/mif/MIFHandler.java | 126 | ||||
-rw-r--r-- | src/org/apache/fop/mif/PGFElement.java | 60 | ||||
-rw-r--r-- | src/org/apache/fop/mif/RefElement.java | 58 | ||||
-rw-r--r-- | src/org/apache/fop/mif/RulingElement.java | 64 |
6 files changed, 387 insertions, 94 deletions
diff --git a/src/org/apache/fop/mif/MIFElement.java b/src/org/apache/fop/mif/MIFElement.java index bff204717..532c7d954 100644 --- a/src/org/apache/fop/mif/MIFElement.java +++ b/src/org/apache/fop/mif/MIFElement.java @@ -1,15 +1,60 @@ /* * $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.mif; // Java -import java.io.*; -import java.util.*; +import java.io.IOException; +import java.io.OutputStream; +import java.util.Iterator; +import java.util.List; /** * The is the basis for MIF document elements. @@ -19,7 +64,7 @@ import java.util.*; public class MIFElement { protected String name; protected String valueStr = null; - protected ArrayList valueElements = null; + protected List valueElements = null; protected boolean started = false; protected boolean finish = false; @@ -36,8 +81,8 @@ public class MIFElement { } public void addElement(MIFElement el) { - if(valueElements == null) { - valueElements = new ArrayList(); + if (valueElements == null) { + valueElements = new java.util.ArrayList(); } valueElements.add(el); } @@ -50,30 +95,37 @@ public class MIFElement { * the finish method is called. */ public boolean output(OutputStream os, int indent) throws IOException { - if(finished) return true; - if(valueElements == null && valueStr == null) return false; + if (finished) { + return true; + } + if (valueElements == null && valueStr == null) { + return false; + } String indentStr = ""; - for(int c = 0; c < indent; c++) indentStr += " "; - if(!started) { + for (int c = 0; c < indent; c++) { + indentStr += " "; + } + if (!started) { os.write((indentStr + "<" + name).getBytes()); - if(valueElements != null) + if (valueElements != null) { os.write(("\n").getBytes()); + } started = true; } - if(valueElements != null) { + if (valueElements != null) { boolean done = true; - for(Iterator iter = valueElements.iterator(); iter.hasNext(); ) { + for (Iterator iter = valueElements.iterator(); iter.hasNext();) { MIFElement el = (MIFElement)iter.next(); boolean d = el.output(os, indent + 1); - if(d) { + if (d) { iter.remove(); } else { done = false; break; } } - if(!finish || !done) { + if (!finish || !done) { return false; } os.write((indentStr + "> # end of " + name + "\n").getBytes()); @@ -86,8 +138,8 @@ public class MIFElement { public void finish(boolean deep) { finish = true; - if(deep && valueElements != null) { - for(Iterator iter = valueElements.iterator(); iter.hasNext(); ) { + if (deep && valueElements != null) { + for (Iterator iter = valueElements.iterator(); iter.hasNext();) { MIFElement el = (MIFElement)iter.next(); el.finish(deep); } diff --git a/src/org/apache/fop/mif/MIFFile.java b/src/org/apache/fop/mif/MIFFile.java index 19cbc9cc0..8a5d2cb4a 100644 --- a/src/org/apache/fop/mif/MIFFile.java +++ b/src/org/apache/fop/mif/MIFFile.java @@ -1,15 +1,60 @@ /* * $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.mif; // Java -import java.io.*; -import java.util.*; +import java.io.IOException; +import java.io.OutputStream; +import java.util.Iterator; +import java.util.List; /** * The MIF File. @@ -32,15 +77,13 @@ public class MIFFile extends MIFElement { protected MIFElement initialAutoNums = null; protected MIFElement aFrames = null; protected MIFElement tbls = null; - protected ArrayList pages = new ArrayList(); - protected ArrayList textFlows = null; + protected List pages = new java.util.ArrayList(); + protected List textFlows = null; - /** - */ public MIFFile() { super(""); - valueElements = new ArrayList(); + valueElements = new java.util.ArrayList(); setup(); } @@ -93,25 +136,27 @@ public class MIFFile extends MIFElement { } public void output(OutputStream os) throws IOException { - if(finished) return; + if (finished) { + return; + } - if(!started) { + if (!started) { os.write(("<MIFFile 5.00> # Generated by FOP\n"/* + getVersion()*/).getBytes()); started = true; } boolean done = true; - for(Iterator iter = valueElements.iterator(); iter.hasNext(); ) { + for (Iterator iter = valueElements.iterator(); iter.hasNext();) { MIFElement el = (MIFElement)iter.next(); boolean d = el.output(os, 0); - if(d) { + if (d) { iter.remove(); } else { done = false; break; } } - if(done && finish) { + if (done && finish) { os.write(("# end of MIFFile").getBytes()); } } diff --git a/src/org/apache/fop/mif/MIFHandler.java b/src/org/apache/fop/mif/MIFHandler.java index 1e4c320f4..8a9c87907 100644 --- a/src/org/apache/fop/mif/MIFHandler.java +++ b/src/org/apache/fop/mif/MIFHandler.java @@ -1,26 +1,75 @@ /* * $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.mif; -import org.apache.fop.apps.StructureHandler; -import org.apache.fop.layout.FontInfo; -import org.apache.fop.fo.pagination.*; -import org.apache.fop.fo.flow.*; -import org.apache.fop.fo.*; -import org.apache.fop.apps.FOPException; - // Java -import java.io.*; -import java.util.*; +import java.io.IOException; +import java.io.OutputStream; +// XML import org.xml.sax.SAXException; -// do we really want every method throwing a SAXException +// FOP +import org.apache.fop.apps.StructureHandler; +import org.apache.fop.fo.Title; +import org.apache.fop.fo.flow.Block; +import org.apache.fop.fo.flow.Flow; +import org.apache.fop.fo.pagination.LayoutMasterSet; +import org.apache.fop.fo.pagination.PageSequence; +import org.apache.fop.fo.pagination.PageSequenceMaster; +import org.apache.fop.fo.pagination.SimplePageMaster; +import org.apache.fop.layout.FontInfo; +import org.apache.fop.apps.FOPException; + +// TODO: do we really want every method throwing a SAXException /** * The MIF Handler. @@ -29,15 +78,20 @@ import org.xml.sax.SAXException; * This builds an MIF file and writes it to the output. */ public class MIFHandler extends StructureHandler { + + /** the MIFFile instance */ protected MIFFile mifFile; + /** the OutputStream to write to */ protected OutputStream outStream; private FontInfo fontInfo = new FontInfo(); // current state elements - MIFElement textFlow; - MIFElement para; + private MIFElement textFlow; + private MIFElement para; /** + * Creates a new MIF handler on a given OutputStream. + * @param os OutputStream to write to */ public MIFHandler(OutputStream os) { outStream = os; @@ -45,26 +99,35 @@ public class MIFHandler extends StructureHandler { org.apache.fop.render.pdf.FontSetup.setup(fontInfo, null); } + /** + * @see org.apache.fop.apps.StructureHandler#getFontInfo() + */ public FontInfo getFontInfo() { return fontInfo; } + /** + * @see org.apache.fop.apps.StructureHandler#startDocument() + */ public void startDocument() throws SAXException { mifFile = new MIFFile(); try { mifFile.output(outStream); - } catch(IOException ioe) { + } catch (IOException ioe) { throw new SAXException(ioe); } } + /** + * @see org.apache.fop.apps.StructureHandler#endDocument() + */ public void endDocument() throws SAXException { // finish all open elements mifFile.finish(true); try { mifFile.output(outStream); outStream.flush(); - } catch(IOException ioe) { + } catch (IOException ioe) { throw new SAXException(ioe); } } @@ -73,13 +136,14 @@ public class MIFHandler extends StructureHandler { * Start the page sequence. * This creates the pages in the MIF document that will be used * by the following flows and static areas. + * @see org.apache.fop.apps.StructureHandler */ public void startPageSequence(PageSequence pageSeq, Title seqTitle, LayoutMasterSet lms) { // get the layout master set // setup the pages for this sequence String name = pageSeq.getProperty("master-reference").getString(); SimplePageMaster spm = lms.getSimplePageMaster(name); - if(spm == null) { + if (spm == null) { PageSequenceMaster psm = lms.getPageSequenceMaster(name); } else { // create simple master with regions @@ -118,38 +182,56 @@ public class MIFHandler extends StructureHandler { } } + /** + * @see org.apache.fop.apps.StructureHandler#endPageSequence(PageSequence) + */ public void endPageSequence(PageSequence pageSeq) throws FOPException { } + /** + * @see org.apache.fop.apps.StructureHandler#startFlow(Flow) + */ public void startFlow(Flow fl) { // start text flow in body region textFlow = new MIFElement("TextFlow"); } + /** + * @see org.apache.fop.apps.StructureHandler#endFlow(Flow) + */ public void endFlow(Flow fl) { textFlow.finish(true); mifFile.addElement(textFlow); textFlow = null; } + /** + * @see org.apache.fop.apps.StructureHandler#startBlock(Block) + */ public void startBlock(Block bl) { para = new MIFElement("Para"); // get font textFlow.addElement(para); } + /** + * @see org.apache.fop.apps.StructureHandler#endBlock(Block) + */ public void endBlock(Block bl) { para.finish(true); para = null; } + /** + * @see org.apache.fop.apps.StructureHandler#characters(char[], int, int) + */ public void characters(char data[], int start, int length) { - if(para != null) { + if (para != null) { String str = new String(data, start, length); str = str.trim(); // break into nice length chunks - if(str.length() == 0) { + if (str.length() == 0) { return; } diff --git a/src/org/apache/fop/mif/PGFElement.java b/src/org/apache/fop/mif/PGFElement.java index e285c9dda..8834f21b9 100644 --- a/src/org/apache/fop/mif/PGFElement.java +++ b/src/org/apache/fop/mif/PGFElement.java @@ -1,16 +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.mif; -// Java -import java.io.*; -import java.util.*; - /** * Font Catalog element. * This is the reference lookup element for fonts in @@ -19,13 +58,14 @@ import java.util.*; public class PGFElement extends RefElement { /** + * Creates a new font catalog element. */ public PGFElement() { super("PgfCatalog"); } public MIFElement lookupElement(Object key) { - if(key == null) { + if (key == null) { MIFElement pgf = new MIFElement("Pgf"); MIFElement prop = new MIFElement("PgfTag"); prop.setValue("`Body'"); diff --git a/src/org/apache/fop/mif/RefElement.java b/src/org/apache/fop/mif/RefElement.java index c96d2d7fc..3abf665b0 100644 --- a/src/org/apache/fop/mif/RefElement.java +++ b/src/org/apache/fop/mif/RefElement.java @@ -1,16 +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.mif; -// Java -import java.io.*; -import java.util.*; - /** * Reference MIF Element. * This element is a lookup reference set that contains @@ -23,6 +62,7 @@ import java.util.*; public class RefElement extends MIFElement { /** + * @see org.apache.fop.mif.MIFElement#MIFElement(String) */ public RefElement(String n) { super(n); diff --git a/src/org/apache/fop/mif/RulingElement.java b/src/org/apache/fop/mif/RulingElement.java index 3446cc88d..70cd69b12 100644 --- a/src/org/apache/fop/mif/RulingElement.java +++ b/src/org/apache/fop/mif/RulingElement.java @@ -1,29 +1,63 @@ /* * $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.mif; -// Java -import java.io.*; -import java.util.*; - -/** - * - */ public class RulingElement extends RefElement { - /** - */ public RulingElement() { super("RulingCatalog"); } public MIFElement lookupElement(Object key) { - if(key == null) { + if (key == null) { MIFElement rul = new MIFElement("Ruling"); MIFElement prop = new MIFElement("RulingTag"); prop.setValue("`Default'"); |