From 962a1b580e67a87179e1223703f5dcc17cbaf887 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Fri, 7 Mar 2003 07:58:52 +0000 Subject: [PATCH] Switched to long licence Some general checkstyle fixing git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196037 13f79535-47bb-0310-9956-ffa450edef68 --- .../fop/layoutmgr/AbstractLayoutManager.java | 61 +++++- .../layoutmgr/BlockStackingLayoutManager.java | 57 +++++- src/org/apache/fop/layoutmgr/BreakCost.java | 53 ++++- src/org/apache/fop/layoutmgr/BreakPoss.java | 192 +++++++++++------- .../fop/layoutmgr/BreakPossPosIter.java | 80 +++++++- .../fop/layoutmgr/ContentLayoutManager.java | 61 +++++- .../fop/layoutmgr/FlowLayoutManager.java | 69 ++++++- src/org/apache/fop/layoutmgr/HyphContext.java | 73 +++++-- src/org/apache/fop/layoutmgr/LMiter.java | 67 +++++- .../apache/fop/layoutmgr/LayoutContext.java | 52 ++++- .../apache/fop/layoutmgr/LayoutManager.java | 59 +++++- .../apache/fop/layoutmgr/LayoutProcessor.java | 89 +++++--- .../fop/layoutmgr/LeafNodeLayoutManager.java | 55 ++++- .../apache/fop/layoutmgr/LeafPosition.java | 53 ++++- .../fop/layoutmgr/LineLayoutManager.java | 131 ++++++++---- src/org/apache/fop/layoutmgr/MinOptMax.java | 82 +++++++- .../apache/fop/layoutmgr/NonLeafPosition.java | 53 ++++- .../fop/layoutmgr/PageLayoutManager.java | 57 +++++- src/org/apache/fop/layoutmgr/Position.java | 54 ++++- .../fop/layoutmgr/PositionIterator.java | 63 +++++- .../RetrieveMarkerLayoutManager.java | 56 ++++- .../apache/fop/layoutmgr/SpaceSpecifier.java | 13 +- .../layoutmgr/StaticContentLayoutManager.java | 73 ++++++- src/org/apache/fop/layoutmgr/list/Item.java | 58 +++++- .../list/ListBlockLayoutManager.java | 61 +++++- .../layoutmgr/list/ListItemLayoutManager.java | 69 ++++++- src/org/apache/fop/layoutmgr/table/Body.java | 58 +++++- .../apache/fop/layoutmgr/table/Caption.java | 54 ++++- src/org/apache/fop/layoutmgr/table/Cell.java | 63 +++++- .../apache/fop/layoutmgr/table/Column.java | 63 +++++- src/org/apache/fop/layoutmgr/table/Row.java | 56 ++++- .../table/TableAndCaptionLayoutManager.java | 54 ++++- .../layoutmgr/table/TableLayoutManager.java | 61 +++++- 33 files changed, 1846 insertions(+), 354 deletions(-) diff --git a/src/org/apache/fop/layoutmgr/AbstractLayoutManager.java b/src/org/apache/fop/layoutmgr/AbstractLayoutManager.java index 7c095b03e..27d08a969 100644 --- a/src/org/apache/fop/layoutmgr/AbstractLayoutManager.java +++ b/src/org/apache/fop/layoutmgr/AbstractLayoutManager.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 . For more information on the Apache + * Software Foundation, please see . + */ package org.apache.fop.layoutmgr; import org.apache.fop.fo.FObj; @@ -166,8 +209,8 @@ public abstract class AbstractLayoutManager implements LayoutProcessor { LayoutManager lm = (pos != null) ? pos.getLM() : null; if (curChildLM != lm) { // ASSERT curChildLM == (LayoutManager)childLMiter.previous() - if (childLMiter.hasPrevious() && curChildLM != - (LayoutManager) childLMiter.previous()) { + if (childLMiter.hasPrevious() && curChildLM + != (LayoutManager) childLMiter.previous()) { //log.error("LMiter problem!"); } while (curChildLM != lm && childLMiter.hasPrevious()) { @@ -177,7 +220,7 @@ public abstract class AbstractLayoutManager implements LayoutProcessor { // Otherwise next returns same object childLMiter.next(); } - if(curChildLM != null) { + if (curChildLM != null) { curChildLM.resetPosition(pos); } if (isFinished()) { @@ -299,7 +342,7 @@ public abstract class AbstractLayoutManager implements LayoutProcessor { * If the id string is not null then add the id to the current page. */ protected void addID() { - if(foID != null) { + if (foID != null) { addIDToPage(foID); } } diff --git a/src/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java b/src/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java index 210464819..0c094bbc1 100644 --- a/src/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java +++ b/src/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java @@ -1,10 +1,53 @@ /* * $Id$ - * Copyright (C) 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 . For more information on the Apache + * Software Foundation, please see . + */ package org.apache.fop.layoutmgr; import org.apache.fop.area.Area; @@ -63,12 +106,12 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager { */ public void addBlockSpacing(double adjust, MinOptMax minoptmax) { int sp = minoptmax.opt; - if(adjust > 0) { + if (adjust > 0) { sp = sp + (int)(adjust * (minoptmax.max - minoptmax.opt)); } else { sp = sp + (int)(adjust * (minoptmax.opt - minoptmax.min)); } - if(sp != 0) { + if (sp != 0) { Block spacer = new Block(); spacer.setHeight(sp); parentLM.addChild(spacer); diff --git a/src/org/apache/fop/layoutmgr/BreakCost.java b/src/org/apache/fop/layoutmgr/BreakCost.java index 42a695ed1..d798a8080 100644 --- a/src/org/apache/fop/layoutmgr/BreakCost.java +++ b/src/org/apache/fop/layoutmgr/BreakCost.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 . For more information on the Apache + * Software Foundation, please see . + */ package org.apache.fop.layoutmgr; import org.apache.fop.area.Area; diff --git a/src/org/apache/fop/layoutmgr/BreakPoss.java b/src/org/apache/fop/layoutmgr/BreakPoss.java index a1875eea8..bc72d0948 100644 --- a/src/org/apache/fop/layoutmgr/BreakPoss.java +++ b/src/org/apache/fop/layoutmgr/BreakPoss.java @@ -1,9 +1,53 @@ /* * $Id$ - * Copyright (C) 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 . For more information on the Apache + * Software Foundation, please see . + */ package org.apache.fop.layoutmgr; import org.apache.fop.traits.LayoutProps; @@ -13,81 +57,86 @@ import org.apache.fop.traits.LayoutProps; * Used to pass information between different levels of layout manager concerning * the break positions. In an inline context, before and after are interpreted as * start and end. - * The m_position field is opaque represents where the break occurs. It is a + * The position field is opaque represents where the break occurs. It is a * nested structure with one level for each layout manager involved in generating * the BreakPoss.. * @author Karen Lease */ public class BreakPoss { - - /** Values for m_flags returned from lower level LM. */ - public static final int CAN_BREAK_AFTER = 0x01; // May break after - public static final int ISLAST = 0x02; // Last area generated by FO - public static final int ISFIRST = 0x04; // First area generated by FO - public static final int FORCE = 0x08; // Forced break (ie LF) - public static final int CAN_BREAK_BEFORE = 0x10; - public static final int HAS_ANCHORS = 0x40; - // Set this flag if all fo:character generated Areas would - // suppressed at the end or beginning of a line - public static final int ALL_ARE_SUPPRESS_AT_LB = 0x80; + // --- Values for flags returned from lower level LM. --- + /** May break after */ + public static final int CAN_BREAK_AFTER = 0x01; + /** Last area generated by FO */ + public static final int ISLAST = 0x02; + /** First area generated by FO */ + public static final int ISFIRST = 0x04; + /** Forced break (ie LF) */ + public static final int FORCE = 0x08; + /** May break before */ + public static final int CAN_BREAK_BEFORE = 0x10; + /** has anchors */ + public static final int HAS_ANCHORS = 0x40; + /** + * Set this flag if all fo:character generated Areas would + * suppressed at the end or beginning of a line */ + public static final int ALL_ARE_SUPPRESS_AT_LB = 0x80; /** This break possibility is a hyphenation */ - public static final int HYPHENATED = 0x100; - /** If this break possibility ends the line, all remaining characters + public static final int HYPHENATED = 0x100; + /** + * If this break possibility ends the line, all remaining characters * in the lowest level text LM will be suppressed. */ public static final int REST_ARE_SUPPRESS_AT_LB = 0x200; - /** - * Next area for LM overflows - */ - public static final int NEXT_OVERFLOWS = 0x400; + /** Next area for LM overflows */ + public static final int NEXT_OVERFLOWS = 0x400; /** The opaque position object used by m_lm to record its * break position. */ - private Position m_position; + private Position position; /** * The size range in the stacking direction of the area which would be * generated if this BreakPoss were used. */ - private MinOptMax m_stackSize; + private MinOptMax stackSize; /** * Max height above and below the baseline. These are cumulative. */ - private int m_iLead; + private int lead; // the max height of before and after alignment - private int m_iTotal; + private int total; // middle alignment height for after - private int m_iMiddle; + private int middle; /** Size in the non-stacking direction (perpendicular). */ - private MinOptMax m_nonStackSize; + private MinOptMax nonStackSize; - private long m_flags = 0; - private LayoutProps m_layoutProps = new LayoutProps(); + private long flags = 0; + private LayoutProps layoutProps = new LayoutProps(); /** Store space-after (or end) and space-before (or start) to be * added if this break position is used. */ - private SpaceSpecifier m_spaceSpecTrailing; - private SpaceSpecifier m_spaceSpecLeading; + private SpaceSpecifier spaceSpecTrailing; + private SpaceSpecifier spaceSpecLeading; public BreakPoss(Position position) { this(position, 0); } public BreakPoss(Position position, long flags) { - m_position = position; - m_flags = flags; + this.position = position; + this.flags = flags; } /** * The top-level layout manager responsible for this break */ public LayoutProcessor getLayoutManager() { - return m_position.getLM(); + return position.getLM(); } // public void setLayoutManager(LayoutManager lm) { @@ -98,31 +147,31 @@ public class BreakPoss { * An object representing the break position in this layout manager. */ public Position getPosition() { - return m_position; + return position; } public void setPosition(Position pos) { - m_position = pos; + position = pos; } public void setStackingSize(MinOptMax size) { - this.m_stackSize = size; + this.stackSize = size; } public MinOptMax getStackingSize() { - return this.m_stackSize ; + return this.stackSize ; } public void setNonStackingSize(MinOptMax size) { - this.m_nonStackSize = size; + this.nonStackSize = size; } public MinOptMax getNonStackingSize() { - return this.m_nonStackSize ; + return this.nonStackSize ; } public long getFlags() { - return m_flags; + return flags; } public void setFlag(int flagBit) { @@ -131,109 +180,114 @@ public class BreakPoss { public void setFlag(int flagBit, boolean bSet) { if (bSet) { - m_flags |= flagBit; + flags |= flagBit; } else { - m_flags &= ~flagBit; + flags &= ~flagBit; } } public boolean isLastArea() { - return ((m_flags & ISLAST) != 0); + return ((flags & ISLAST) != 0); } public boolean isFirstArea() { - return ((m_flags & ISFIRST) != 0); + return ((flags & ISFIRST) != 0); } public boolean canBreakAfter() { - return ((m_flags & CAN_BREAK_AFTER) != 0); + return ((flags & CAN_BREAK_AFTER) != 0); } public boolean canBreakBefore() { - return ((m_flags & CAN_BREAK_BEFORE) != 0); + return ((flags & CAN_BREAK_BEFORE) != 0); } public boolean couldEndLine() { - return ((m_flags & REST_ARE_SUPPRESS_AT_LB) != 0); + return ((flags & REST_ARE_SUPPRESS_AT_LB) != 0); } public boolean isForcedBreak() { - return ((m_flags & FORCE) != 0); + return ((flags & FORCE) != 0); } public boolean nextBreakOverflows() { - return ((m_flags & NEXT_OVERFLOWS) != 0); + return ((flags & NEXT_OVERFLOWS) != 0); } public boolean isSuppressible() { - return ((m_flags & ALL_ARE_SUPPRESS_AT_LB) != 0); + return ((flags & ALL_ARE_SUPPRESS_AT_LB) != 0); } public SpaceSpecifier getLeadingSpace() { - return m_spaceSpecLeading; + return spaceSpecLeading; } public MinOptMax resolveLeadingSpace() { - if (m_spaceSpecLeading != null) { - return m_spaceSpecLeading.resolve(false); - } else + if (spaceSpecLeading != null) { + return spaceSpecLeading.resolve(false); + } else { return new MinOptMax(0); + } } public SpaceSpecifier getTrailingSpace() { - return m_spaceSpecTrailing; + return spaceSpecTrailing; } public MinOptMax resolveTrailingSpace(boolean bEndsRefArea) { - if (m_spaceSpecTrailing != null) { - return m_spaceSpecTrailing.resolve(bEndsRefArea); - } else + if (spaceSpecTrailing != null) { + return spaceSpecTrailing.resolve(bEndsRefArea); + } else { return new MinOptMax(0); + } } public void setLeadingSpace(SpaceSpecifier spaceSpecLeading) { - m_spaceSpecLeading = spaceSpecLeading; + this.spaceSpecLeading = spaceSpecLeading; } public void setTrailingSpace(SpaceSpecifier spaceSpecTrailing) { - m_spaceSpecTrailing = spaceSpecTrailing; + this.spaceSpecTrailing = spaceSpecTrailing; } public LayoutProps getLayoutProps() { - return m_layoutProps; + return layoutProps; } public int getLead() { - return m_iLead; + return lead; } public int getTotal() { - return m_iTotal; + return total; } public int getMiddle() { - return m_iMiddle; + return middle; } /** * set lead height of baseline positioned element + * @param ld new lead value */ public void setLead(int ld) { - m_iLead = ld; + lead = ld; } /** * Set total height of top or bottom aligned element + * @param t new total height */ public void setTotal(int t) { - m_iTotal = t; + total = t; } /** * Set distance below baseline of middle aligned element + * @param t new value */ public void setMiddle(int t) { - m_iMiddle = t; + middle = t; } } diff --git a/src/org/apache/fop/layoutmgr/BreakPossPosIter.java b/src/org/apache/fop/layoutmgr/BreakPossPosIter.java index 9e307a49f..4b14fdefb 100644 --- a/src/org/apache/fop/layoutmgr/BreakPossPosIter.java +++ b/src/org/apache/fop/layoutmgr/BreakPossPosIter.java @@ -1,27 +1,82 @@ /* * $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 . For more information on the Apache + * Software Foundation, please see . + */ package org.apache.fop.layoutmgr; - import java.util.List; +/** + * Position iterator for break possibilities. + */ public class BreakPossPosIter extends PositionIterator { - private int m_iterCount ; + private int iterCount; + + /** + * Main constructor + * @param bpList List of break possibilities + * @param startPos starting position + * @param endPos ending position + */ public BreakPossPosIter(List bpList, int startPos, int endPos) { super(bpList.listIterator(startPos)); - m_iterCount = endPos - startPos; + iterCount = endPos - startPos; } // Check position < endPos - + + /** + * @see org.apache.fop.layoutmgr.PositionIterator#checkNext() + */ protected boolean checkNext() { - if (m_iterCount > 0) { + if (iterCount > 0) { return super.checkNext(); } else { endIter(); @@ -29,8 +84,11 @@ public class BreakPossPosIter extends PositionIterator { } } + /** + * @see java.util.Iterator#next() + */ public Object next() { - --m_iterCount; + --iterCount; return super.next(); } diff --git a/src/org/apache/fop/layoutmgr/ContentLayoutManager.java b/src/org/apache/fop/layoutmgr/ContentLayoutManager.java index 6a587fab9..8024f5d79 100644 --- a/src/org/apache/fop/layoutmgr/ContentLayoutManager.java +++ b/src/org/apache/fop/layoutmgr/ContentLayoutManager.java @@ -1,9 +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 . For more information on the Apache + * Software Foundation, please see . + */ package org.apache.fop.layoutmgr; import org.apache.fop.fo.FObj; @@ -89,7 +133,7 @@ public class ContentLayoutManager implements LayoutProcessor { middlefollow = bp.getMiddle(); } } - if(lastSize != null) { + if (lastSize != null) { stack.add(lastSize); } } @@ -143,10 +187,17 @@ public class ContentLayoutManager implements LayoutProcessor { userAgent = ua; } + /** + * @see org.apache.fop.layoutmgr.LayoutManager#getUserAgent() + */ public FOUserAgent getUserAgent() { return userAgent; } + /** + * Returns the logger + * @return the logger + */ protected Logger getLogger() { return userAgent.getLogger(); } diff --git a/src/org/apache/fop/layoutmgr/FlowLayoutManager.java b/src/org/apache/fop/layoutmgr/FlowLayoutManager.java index fc56f24dc..f1b4b0f97 100644 --- a/src/org/apache/fop/layoutmgr/FlowLayoutManager.java +++ b/src/org/apache/fop/layoutmgr/FlowLayoutManager.java @@ -1,10 +1,53 @@ /* * $Id$ - * Copyright (C) 2002-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 . For more information on the Apache + * Software Foundation, please see . + */ package org.apache.fop.layoutmgr; import org.apache.fop.fo.flow.Marker; @@ -22,12 +65,13 @@ import java.util.List; */ public class FlowLayoutManager extends BlockStackingLayoutManager { + /** List of break possibilities */ protected List blockBreaks = new ArrayList(); /** Array of areas currently being filled stored by area class */ private BlockParent[] currentAreas = new BlockParent[Area.CLASS_MAX]; - int iStartPos = 0; + private int iStartPos = 0; /** * This is the top level layout manager. @@ -36,6 +80,9 @@ public class FlowLayoutManager extends BlockStackingLayoutManager { public FlowLayoutManager() { } + /** + * @see org.apache.fop.layoutmgr.LayoutProcessor#getNextBreakPoss(LayoutContext) + */ public BreakPoss getNextBreakPoss(LayoutContext context) { // currently active LM @@ -91,6 +138,9 @@ public class FlowLayoutManager extends BlockStackingLayoutManager { return null; } + /** + * @see org.apache.fop.layoutmgr.LayoutProcessor#addAreas(PositionIterator, LayoutContext) + */ public void addAreas(PositionIterator parentIter, LayoutContext layoutContext) { LayoutProcessor childLM; @@ -114,12 +164,16 @@ public class FlowLayoutManager extends BlockStackingLayoutManager { * Add child area to a the correct container, depending on its * area class. A Flow can fill at most one area container of any class * at any one time. The actual work is done by BlockStackingLM. + * @param childArea child area to add */ public void addChild(Area childArea) { addChildToArea(childArea, this.currentAreas[childArea.getAreaClass()]); } + /** + * @see org.apache.fop.layoutmgr.LayoutProcessor#getParentArea(Area) + */ public Area getParentArea(Area childArea) { // Get an area from the Page BlockParent parentArea = @@ -129,6 +183,9 @@ public class FlowLayoutManager extends BlockStackingLayoutManager { return parentArea; } + /** + * @see org.apache.fop.layoutmgr.LayoutProcessor#resetPosition(Position) + */ public void resetPosition(Position resetPos) { if (resetPos == null) { reset(null); diff --git a/src/org/apache/fop/layoutmgr/HyphContext.java b/src/org/apache/fop/layoutmgr/HyphContext.java index cb2f9a9c6..830a95359 100644 --- a/src/org/apache/fop/layoutmgr/HyphContext.java +++ b/src/org/apache/fop/layoutmgr/HyphContext.java @@ -1,12 +1,55 @@ /* * $Id$ - * Copyright (C) 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 . For more information on the Apache + * Software Foundation, please see . + */ package org.apache.fop.layoutmgr; - /** * This class is used to pass information to the getNextBreakPoss() * method concerning hyphenation. A reference to an instance of the @@ -16,26 +59,26 @@ package org.apache.fop.layoutmgr; * processed by a Layout Manager to generate size information. */ public class HyphContext { - private int[] m_hyphPoints; - private int m_iCurOffset = 0; - private int m_iCurIndex = 0; + private int[] hyphPoints; + private int currentOffset = 0; + private int currentIndex = 0; public HyphContext(int[] hyphPoints) { - m_hyphPoints = hyphPoints; + this.hyphPoints = hyphPoints; } public int getNextHyphPoint() { - for (; m_iCurIndex < m_hyphPoints.length; m_iCurIndex++) { - if (m_hyphPoints[m_iCurIndex] > m_iCurOffset) { - return (m_hyphPoints[m_iCurIndex] - m_iCurOffset); + for (; currentIndex < hyphPoints.length; currentIndex++) { + if (hyphPoints[currentIndex] > currentOffset) { + return (hyphPoints[currentIndex] - currentOffset); } } return -1; // AT END! } public boolean hasMoreHyphPoints() { - for (; m_iCurIndex < m_hyphPoints.length; m_iCurIndex++) { - if (m_hyphPoints[m_iCurIndex] > m_iCurOffset) { + for (; currentIndex < hyphPoints.length; currentIndex++) { + if (hyphPoints[currentIndex] > currentOffset) { return true; } } @@ -43,6 +86,6 @@ public class HyphContext { } public void updateOffset(int iCharsProcessed) { - m_iCurOffset += iCharsProcessed; + currentOffset += iCharsProcessed; } } diff --git a/src/org/apache/fop/layoutmgr/LMiter.java b/src/org/apache/fop/layoutmgr/LMiter.java index a08865a41..dba70dc15 100644 --- a/src/org/apache/fop/layoutmgr/LMiter.java +++ b/src/org/apache/fop/layoutmgr/LMiter.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 . For more information on the Apache + * Software Foundation, please see . + */ package org.apache.fop.layoutmgr; import org.apache.fop.fo.FObj; @@ -35,11 +78,11 @@ public class LMiter implements ListIterator { // skip over child FObj's that don't add lms while (baseIter != null && baseIter.hasNext()) { Object theobj = baseIter.next(); - if(theobj instanceof FObj) { + if (theobj instanceof FObj) { FObj fobj = (FObj) theobj; //listLMs.add(fobj.getLayoutManager()); fobj.addLayoutManager(listLMs); - if(curPos < listLMs.size()) { + if (curPos < listLMs.size()) { return true; } } @@ -54,24 +97,26 @@ public class LMiter implements ListIterator { public Object previous() throws NoSuchElementException { if (curPos > 0) { return listLMs.get(--curPos); - } else + } else { throw new NoSuchElementException(); + } } public Object next() throws NoSuchElementException { if (curPos < listLMs.size()) { return listLMs.get(curPos++); - } else + } else { throw new NoSuchElementException(); + } } public void remove() throws NoSuchElementException { if (curPos > 0) { listLMs.remove(--curPos); // Note: doesn't actually remove it from the base! - } else + } else { throw new NoSuchElementException(); - + } } diff --git a/src/org/apache/fop/layoutmgr/LayoutContext.java b/src/org/apache/fop/layoutmgr/LayoutContext.java index 2d47c35cc..6501c21ba 100644 --- a/src/org/apache/fop/layoutmgr/LayoutContext.java +++ b/src/org/apache/fop/layoutmgr/LayoutContext.java @@ -1,9 +1,53 @@ /* * $Id$ - * Copyright (C) 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 . For more information on the Apache + * Software Foundation, please see . + */ package org.apache.fop.layoutmgr; diff --git a/src/org/apache/fop/layoutmgr/LayoutManager.java b/src/org/apache/fop/layoutmgr/LayoutManager.java index 678e2b704..6e1be9298 100644 --- a/src/org/apache/fop/layoutmgr/LayoutManager.java +++ b/src/org/apache/fop/layoutmgr/LayoutManager.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 . For more information on the Apache + * Software Foundation, please see . + */ package org.apache.fop.layoutmgr; import org.apache.fop.fo.FOUserAgent; @@ -22,7 +65,7 @@ public interface LayoutManager { * * @param obj the FO object for this layout manager */ - public void setFObj(FObj obj); + void setFObj(FObj obj); /** * Set the user agent. For resolving user agent values @@ -30,13 +73,13 @@ public interface LayoutManager { * * @param ua the user agent */ - public void setUserAgent(FOUserAgent ua); + void setUserAgent(FOUserAgent ua); /** * Get the user agent. * * @return the user agent */ - public FOUserAgent getUserAgent(); + FOUserAgent getUserAgent(); } diff --git a/src/org/apache/fop/layoutmgr/LayoutProcessor.java b/src/org/apache/fop/layoutmgr/LayoutProcessor.java index 4b344fbaa..a2f7896e8 100755 --- a/src/org/apache/fop/layoutmgr/LayoutProcessor.java +++ b/src/org/apache/fop/layoutmgr/LayoutProcessor.java @@ -1,10 +1,53 @@ /* * $Id$ - * Copyright (C) 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 . For more information on the Apache + * Software Foundation, please see . + */ package org.apache.fop.layoutmgr; import org.apache.fop.fo.flow.Marker; @@ -28,12 +71,12 @@ public interface LayoutProcessor extends LayoutManager { * * @param lm the parent layout manager */ - public void setParent(LayoutProcessor lm); + void setParent(LayoutProcessor lm); /** * Initialise this layout manager. */ - public void init(); + void init(); /** * Generates inline areas. @@ -42,7 +85,7 @@ public interface LayoutProcessor extends LayoutManager { * * @return true if the layout manager generates inline areas */ - public boolean generatesInlineAreas(); + boolean generatesInlineAreas(); /** * Return true if the next area which would be generated by this @@ -51,7 +94,7 @@ public interface LayoutProcessor extends LayoutManager { * @param lc the layout context * @return true if can break before */ - public boolean canBreakBefore(LayoutContext lc); + boolean canBreakBefore(LayoutContext lc); /** * Generate and return the next break possibility. @@ -62,14 +105,14 @@ public interface LayoutProcessor extends LayoutManager { * information. * @return the next break position */ - public BreakPoss getNextBreakPoss(LayoutContext context); + BreakPoss getNextBreakPoss(LayoutContext context); /** * Reset to the position. * * @param position */ - public void resetPosition(Position position); + void resetPosition(Position position); /** * Get the word chars between two positions and @@ -80,7 +123,7 @@ public interface LayoutProcessor extends LayoutManager { * @param bp1 the start position * @param bp2 the end position */ - public void getWordChars(StringBuffer sbChars, Position bp1, + void getWordChars(StringBuffer sbChars, Position bp1, Position bp2); /** @@ -89,7 +132,7 @@ public interface LayoutProcessor extends LayoutManager { * * @return true if this layout manager is finished */ - public boolean isFinished(); + boolean isFinished(); /** * Set a flag indicating whether the LayoutManager has laid out all @@ -98,7 +141,7 @@ public interface LayoutProcessor extends LayoutManager { * * @param isFinished the value to set the finished flag to */ - public void setFinished(boolean isFinished); + void setFinished(boolean isFinished); /** * Get the parent area for an area. @@ -108,7 +151,7 @@ public interface LayoutProcessor extends LayoutManager { * @param childArea the child area to get the parent for * @return the parent Area */ - public Area getParentArea(Area childArea); + Area getParentArea(Area childArea); /** * Add the area as a child of the current area. @@ -117,7 +160,7 @@ public interface LayoutProcessor extends LayoutManager { * * @param childArea the child area to add */ - public void addChild(Area childArea); + void addChild(Area childArea); /** * Tell the layout manager to add all the child areas implied @@ -127,14 +170,14 @@ public interface LayoutProcessor extends LayoutManager { * @param posIter the position iterator * @param context the context */ - public void addAreas(PositionIterator posIter, LayoutContext context); + void addAreas(PositionIterator posIter, LayoutContext context); /** * Get the string of the current page number. * * @return the string for the current page number */ - public String getCurrentPageNumber(); + String getCurrentPageNumber(); /** * Resolve the id reference. @@ -144,7 +187,7 @@ public interface LayoutProcessor extends LayoutManager { * @param ref the id reference * @return the page containing the id reference or null if not found */ - public PageViewport resolveRefID(String ref); + PageViewport resolveRefID(String ref); /** * Add an id to the page. @@ -152,7 +195,7 @@ public interface LayoutProcessor extends LayoutManager { * * @param id the id reference to add. */ - public void addIDToPage(String id); + void addIDToPage(String id); /** * Add an unresolved area. @@ -161,7 +204,7 @@ public interface LayoutProcessor extends LayoutManager { * @param id the id reference this object needs for resolving * @param res the resolveable object */ - public void addUnresolvedArea(String id, Resolveable res); + void addUnresolvedArea(String id, Resolveable res); /** * Add the marker. @@ -172,7 +215,7 @@ public interface LayoutProcessor extends LayoutManager { * @param start true if the formatting object is starting false is finishing * @param isfirst a flag for is first */ - public void addMarkerMap(Map marks, boolean start, boolean isfirst); + void addMarkerMap(Map marks, boolean start, boolean isfirst); /** * Retrieve a marker. @@ -183,7 +226,7 @@ public interface LayoutProcessor extends LayoutManager { * @param boundary the boundary for retrieving the marker * @return the layout manaager of the retrieved marker if any */ - public Marker retrieveMarker(String name, int pos, int boundary); + Marker retrieveMarker(String name, int pos, int boundary); } diff --git a/src/org/apache/fop/layoutmgr/LeafNodeLayoutManager.java b/src/org/apache/fop/layoutmgr/LeafNodeLayoutManager.java index 836460466..8bbebae15 100644 --- a/src/org/apache/fop/layoutmgr/LeafNodeLayoutManager.java +++ b/src/org/apache/fop/layoutmgr/LeafNodeLayoutManager.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 . For more information on the Apache + * Software Foundation, please see . + */ package org.apache.fop.layoutmgr; import org.apache.fop.area.Area; @@ -29,7 +72,6 @@ public class LeafNodeLayoutManager extends AbstractLayoutManager { /** * Create a Leaf node layout mananger. - * @param fobj the fo object that created this manager */ public LeafNodeLayoutManager() { } @@ -91,7 +133,6 @@ public class LeafNodeLayoutManager extends AbstractLayoutManager { /** * This is a leaf-node, so this method is never called. * @param childArea the childArea to add - * @return not used */ public void addChild(Area childArea) { } diff --git a/src/org/apache/fop/layoutmgr/LeafPosition.java b/src/org/apache/fop/layoutmgr/LeafPosition.java index 0ee5c9da9..bd225ce9d 100644 --- a/src/org/apache/fop/layoutmgr/LeafPosition.java +++ b/src/org/apache/fop/layoutmgr/LeafPosition.java @@ -1,10 +1,53 @@ /* * $Id$ - * Copyright (C) 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 . For more information on the Apache + * Software Foundation, please see . + */ package org.apache.fop.layoutmgr; public class LeafPosition extends Position { diff --git a/src/org/apache/fop/layoutmgr/LineLayoutManager.java b/src/org/apache/fop/layoutmgr/LineLayoutManager.java index 9ec7bea54..29fa274d3 100644 --- a/src/org/apache/fop/layoutmgr/LineLayoutManager.java +++ b/src/org/apache/fop/layoutmgr/LineLayoutManager.java @@ -1,10 +1,53 @@ /* * $Id$ - * Copyright (C) 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 . For more information on the Apache + * Software Foundation, please see . + */ package org.apache.fop.layoutmgr; import org.apache.fop.fo.PropertyManager; @@ -75,15 +118,13 @@ public class LineLayoutManager extends InlineStackingLayoutManager { private int follow; // inline start pos when adding areas - int iStartPos = 0; + private int iStartPos = 0; /** * Create a new Line Layout Manager. * This is used by the block layout manager to create * line managers for handling inline areas flowing into line areas. * - * @param fobj the block the is creating the lines - * @param lms the list of layout managers that will add inline areas * @param lh the default line height * @param l the default lead, from top to baseline * @param f the default follow, from baseline to bottom @@ -98,6 +139,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager { /** * Initialize the properties for this layout manager. * The properties are from the block area. + * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties(PropertyManager) */ protected void initProperties(PropertyManager propMgr) { MarginProps marginProps = propMgr.getMarginProps(); @@ -141,13 +183,14 @@ public class LineLayoutManager extends InlineStackingLayoutManager { while ((curLM = getChildLM()) != null) { // INITIALIZE LAYOUT CONTEXT FOR CALL TO CHILD LM // First break for the child LM in each of its areas - boolean bFirstBPforLM = (vecInlineBreaks.isEmpty() || - (((BreakPoss) vecInlineBreaks.get(vecInlineBreaks.size() - 1)). + boolean bFirstBPforLM = (vecInlineBreaks.isEmpty() + || (((BreakPoss) vecInlineBreaks.get(vecInlineBreaks.size() - 1)). getLayoutManager() != curLM)); // Need previous breakpoint! ATTENTION when backing up for hyphenation! - prev = (vecInlineBreaks.isEmpty()) ? null : - (BreakPoss) vecInlineBreaks.get(vecInlineBreaks.size() - 1); + prev = (vecInlineBreaks.isEmpty()) + ? null + : (BreakPoss) vecInlineBreaks.get(vecInlineBreaks.size() - 1); initChildLC(inlineLC, prev, (vecInlineBreaks.size() == iPrevLineEnd), bFirstBPforLM, new SpaceSpecifier(true)); @@ -158,10 +201,10 @@ public class LineLayoutManager extends InlineStackingLayoutManager { * then set the SUPPRESS_LEADING_SPACE flag. */ inlineLC.setFlags(LayoutContext.SUPPRESS_LEADING_SPACE, - (vecInlineBreaks.size() == iPrevLineEnd && - !vecInlineBreaks.isEmpty() && - ((BreakPoss) vecInlineBreaks.get(vecInlineBreaks.size() - 1)). - isForcedBreak() == false)); + (vecInlineBreaks.size() == iPrevLineEnd + && !vecInlineBreaks.isEmpty() + && ((BreakPoss) vecInlineBreaks.get(vecInlineBreaks.size() - 1)). + isForcedBreak() == false)); // GET NEXT POSSIBLE BREAK FROM CHILD LM // prevBP = bp; @@ -209,17 +252,17 @@ public class LineLayoutManager extends InlineStackingLayoutManager { inlineLC.setHyphContext( getHyphenContext(prevBP, bp)); - if (inlineLC.getHyphContext() == null) + if (inlineLC.getHyphContext() == null) { break; + } inlineLC.setFlags(LayoutContext.TRY_HYPHENATE, true); // Reset to previous acceptable break reset(); - } - /* If we are not in justified text, we can end the line at - * prevBP. - */ - else { + } else { + /* If we are not in justified text, we can end the line at + * prevBP. + */ break; } } else { @@ -240,23 +283,23 @@ public class LineLayoutManager extends InlineStackingLayoutManager { * (ie, bpDim.opt closes to availIPD.opt), keeps * and hyphenation. */ - vecPossEnd.add( new BreakCost(bp, - Math.abs(availIPD.opt - bpDim.opt))); + vecPossEnd.add(new BreakCost(bp, + Math.abs(availIPD.opt - bpDim.opt))); } // Otherwise it's short } else { /* Can't end line here. */ } } // end of bpDim.min <= availIPD.max - } // end of getNextBreakPoss!=null on current child LM - else { + // end of getNextBreakPoss!=null on current child LM + } else { /* The child LM can return a null BreakPoss if it has * nothing (more) to layout. This can happen when backing * up. Just try the next child LM. */ } - if (inlineLC.tryHyphenate() && - !inlineLC.getHyphContext().hasMoreHyphPoints()) { + if (inlineLC.tryHyphenate() + && !inlineLC.getHyphContext().hasMoreHyphPoints()) { break; } } // end of while on child LM @@ -265,10 +308,12 @@ public class LineLayoutManager extends InlineStackingLayoutManager { setFinished(true); } - if (bp == null) + if (bp == null) { return null; - if (prevBP == null) + } + if (prevBP == null) { prevBP = bp; + } // Choose the best break if (!bp.isForcedBreak() && vecPossEnd.size() > 0) { @@ -289,7 +334,6 @@ public class LineLayoutManager extends InlineStackingLayoutManager { return makeLineBreak(iPrevLineEnd, availIPD, talign); } - private void reset() { while (vecInlineBreaks.get(vecInlineBreaks.size() - 1) != prevBP) { vecInlineBreaks.remove(vecInlineBreaks.size() - 1); @@ -350,7 +394,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager { vecInlineBreaks.add(newBP); ListIterator bpIter = - vecInlineBreaks. listIterator(vecInlineBreaks.size()); + vecInlineBreaks.listIterator(vecInlineBreaks.size()); while (bpIter.hasPrevious() && bpIter.previous() != prev) { } if (bpIter.next() != prev) { @@ -430,8 +474,8 @@ public class LineLayoutManager extends InlineStackingLayoutManager { MinOptMax actual = new MinOptMax(); BreakPoss lastBP = null; LayoutManager lastLM = null; - for(Iterator iter = vecInlineBreaks.listIterator(prevLineEnd); - iter.hasNext(); ) { + for (Iterator iter = vecInlineBreaks.listIterator(prevLineEnd); + iter.hasNext();) { BreakPoss bp = (BreakPoss)iter.next(); if (bp.getLead() > lineLead) { lineLead = bp.getLead(); @@ -474,20 +518,18 @@ public class LineLayoutManager extends InlineStackingLayoutManager { int targetWith = target.opt; int realWidth = actual.opt; if (actual.opt > targetWith) { - if (actual.opt - targetWith < - (actual.opt - actual.min)) { - ipdAdjust = -(actual.opt - targetWith) / - (float)(actual.opt - actual.min); + if (actual.opt - targetWith < (actual.opt - actual.min)) { + ipdAdjust = -(actual.opt - targetWith) + / (float)(actual.opt - actual.min); realWidth = targetWith; } else { ipdAdjust = -1; realWidth = actual.max; } } else { - if (targetWith - actual.opt < - actual.max - actual.opt) { - ipdAdjust = (targetWith - actual.opt) / - (float)(actual.max - actual.opt); + if (targetWith - actual.opt < actual.max - actual.opt) { + ipdAdjust = (targetWith - actual.opt) + / (float)(actual.max - actual.opt); realWidth = targetWith; } else { ipdAdjust = 1; @@ -541,8 +583,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager { prevBP = null; } else { prevBP = (BreakPoss)vecInlineBreaks.get(((LineBreakPosition)resetPos).getLeafPos()); - while (vecInlineBreaks.get(vecInlineBreaks.size() - 1) != prevBP) -{ + while (vecInlineBreaks.get(vecInlineBreaks.size() - 1) != prevBP) { vecInlineBreaks.remove(vecInlineBreaks.size() - 1); } reset(prevBP.getPosition()); @@ -599,7 +640,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager { lc.setTrailingSpace(new SpaceSpecifier(false)); } // when can this be null? - if(lc.getTrailingSpace() != null) { + if (lc.getTrailingSpace() != null) { addSpace(lineArea, lc.getTrailingSpace().resolve(true), lc.getSpaceAdjust()); } diff --git a/src/org/apache/fop/layoutmgr/MinOptMax.java b/src/org/apache/fop/layoutmgr/MinOptMax.java index 2bba4021d..a4864f82e 100644 --- a/src/org/apache/fop/layoutmgr/MinOptMax.java +++ b/src/org/apache/fop/layoutmgr/MinOptMax.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 . For more information on the Apache + * Software Foundation, please see . + */ package org.apache.fop.layoutmgr; /** @@ -49,6 +92,9 @@ public class MinOptMax implements java.io.Serializable, Cloneable { this.max = max; } + /** + * @see java.lang.Object#clone() + */ public Object clone() { try { return super.clone(); @@ -58,27 +104,53 @@ public class MinOptMax implements java.io.Serializable, Cloneable { } } + /** + * Subtracts one MinOptMax instance from another returning a new one. + * @param op1 first instance to subtract from + * @param op2 second instance + * @return MinOptMax new instance + */ public static MinOptMax subtract(MinOptMax op1, MinOptMax op2) { return new MinOptMax(op1.min - op2.max, op1.opt - op2.opt, op1.max - op2.min); } + /** + * Adds one MinOptMax instance to another returning a new one. + * @param op1 first instance + * @param op2 second instance + * @return MinOptMax new instance + */ public static MinOptMax add(MinOptMax op1, MinOptMax op2) { return new MinOptMax(op1.min + op2.min, op1.opt + op2.opt, op1.max + op2.max); } + /** + * Multiplies a MinOptMax instance with a factor returning a new instance. + * @param op1 MinOptMax instance + * @param mult multiplier + * @return MinOptMax new instance + */ public static MinOptMax multiply(MinOptMax op1, double mult) { return new MinOptMax((int)(op1.min * mult), (int)(op1.opt * mult), (int)(op1.max * mult)); } + /** + * Adds another MinOptMax instance to this one. + * @param op the other instance + */ public void add(MinOptMax op) { min += op.min; opt += op.opt; max += op.max; } + /** + * Subtracts from this instance using another. + * @param op the other instance + */ public void subtract(MinOptMax op) { min -= op.max; opt -= op.opt; diff --git a/src/org/apache/fop/layoutmgr/NonLeafPosition.java b/src/org/apache/fop/layoutmgr/NonLeafPosition.java index 0e1dea9c0..9feca12b7 100644 --- a/src/org/apache/fop/layoutmgr/NonLeafPosition.java +++ b/src/org/apache/fop/layoutmgr/NonLeafPosition.java @@ -1,10 +1,53 @@ /* * $Id$ - * Copyright (C) 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 . For more information on the Apache + * Software Foundation, please see . + */ package org.apache.fop.layoutmgr; public class NonLeafPosition extends Position { diff --git a/src/org/apache/fop/layoutmgr/PageLayoutManager.java b/src/org/apache/fop/layoutmgr/PageLayoutManager.java index 6bdea66d4..3f91b9a24 100644 --- a/src/org/apache/fop/layoutmgr/PageLayoutManager.java +++ b/src/org/apache/fop/layoutmgr/PageLayoutManager.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 . For more information on the Apache + * Software Foundation, please see . + */ package org.apache.fop.layoutmgr; import org.apache.fop.apps.FOPException; @@ -535,8 +578,8 @@ public class PageLayoutManager extends AbstractLayoutManager implements Runnable */ protected void handleBreak(int breakVal) { if (breakVal == Constants.COLUMN) { - if (curSpan != null && - curSpan.getColumnCount() != curSpanColumns) { + if (curSpan != null + && curSpan.getColumnCount() != curSpanColumns) { // Move to next column createFlow(); return; diff --git a/src/org/apache/fop/layoutmgr/Position.java b/src/org/apache/fop/layoutmgr/Position.java index b6348209a..8b58463df 100644 --- a/src/org/apache/fop/layoutmgr/Position.java +++ b/src/org/apache/fop/layoutmgr/Position.java @@ -1,13 +1,57 @@ /* * $Id$ - * Copyright (C) 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 . For more information on the Apache + * Software Foundation, please see . + */ package org.apache.fop.layoutmgr; public class Position { + private LayoutProcessor layoutManager; public Position(LayoutProcessor lm) { diff --git a/src/org/apache/fop/layoutmgr/PositionIterator.java b/src/org/apache/fop/layoutmgr/PositionIterator.java index c173fd09e..e2ab7975d 100644 --- a/src/org/apache/fop/layoutmgr/PositionIterator.java +++ b/src/org/apache/fop/layoutmgr/PositionIterator.java @@ -1,21 +1,64 @@ /* * $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 . For more information on the Apache + * Software Foundation, please see . + */ package org.apache.fop.layoutmgr; - import java.util.Iterator; import java.util.NoSuchElementException; public abstract class PositionIterator implements Iterator { - Iterator parentIter; - Object nextObj; - LayoutProcessor childLM; - boolean bHasNext; + + private Iterator parentIter; + private Object nextObj; + private LayoutProcessor childLM; + private boolean bHasNext; PositionIterator(Iterator pIter) { parentIter = pIter; diff --git a/src/org/apache/fop/layoutmgr/RetrieveMarkerLayoutManager.java b/src/org/apache/fop/layoutmgr/RetrieveMarkerLayoutManager.java index 8c4305e5b..1f4f20fd6 100644 --- a/src/org/apache/fop/layoutmgr/RetrieveMarkerLayoutManager.java +++ b/src/org/apache/fop/layoutmgr/RetrieveMarkerLayoutManager.java @@ -1,10 +1,53 @@ /* * $Id$ - * Copyright (C) 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 . For more information on the Apache + * Software Foundation, please see . + */ package org.apache.fop.layoutmgr; import java.util.ArrayList; @@ -113,6 +156,9 @@ public class RetrieveMarkerLayoutManager extends AbstractLayoutManager { parentLM.addChild(childArea); } + /** + * @see org.apache.fop.layoutmgr.LayoutProcessor#resetPosition(Position) + */ public void resetPosition(Position resetPos) { loadLM(); if (resetPos == null) { diff --git a/src/org/apache/fop/layoutmgr/SpaceSpecifier.java b/src/org/apache/fop/layoutmgr/SpaceSpecifier.java index f51474882..9071d8aae 100644 --- a/src/org/apache/fop/layoutmgr/SpaceSpecifier.java +++ b/src/org/apache/fop/layoutmgr/SpaceSpecifier.java @@ -67,10 +67,17 @@ public class SpaceSpecifier implements Cloneable { private List vecSpaceVals = new java.util.ArrayList(); + /** + * Creates a new SpaceSpecifier. + * @param bStarts true if it starts anew reference area + */ public SpaceSpecifier(boolean bStarts) { bStartsRefArea = bStarts; } + /** + * @see java.lang.Object#clone() + */ public Object clone() { try { SpaceSpecifier ss = (SpaceSpecifier) super.clone(); @@ -92,8 +99,10 @@ public class SpaceSpecifier implements Cloneable { vecSpaceVals.clear(); } - - /** Return true if any space-specifiers have been added. */ + /** + * Indicates whether any space-specifiers have been added. + * @return true if any space-specifiers have been added. + */ public boolean hasSpaces() { return (vecSpaceVals.size() > 0); } diff --git a/src/org/apache/fop/layoutmgr/StaticContentLayoutManager.java b/src/org/apache/fop/layoutmgr/StaticContentLayoutManager.java index 6ef79d36b..6dc79151e 100644 --- a/src/org/apache/fop/layoutmgr/StaticContentLayoutManager.java +++ b/src/org/apache/fop/layoutmgr/StaticContentLayoutManager.java @@ -1,10 +1,53 @@ /* * $Id$ - * Copyright (C) 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 . For more information on the Apache + * Software Foundation, please see . + */ package org.apache.fop.layoutmgr; import org.apache.fop.area.RegionReference; @@ -26,13 +69,17 @@ public class StaticContentLayoutManager extends BlockStackingLayoutManager { private RegionReference region; private List blockBreaks = new ArrayList(); - public StaticContentLayoutManager() { - } - + /** + * Sets the region reference + * @param region region reference + */ public void setRegionReference(RegionReference region) { this.region = region; } + /** + * @see org.apache.fop.layoutmgr.LayoutProcessor#getNextBreakPoss(LayoutContext) + */ public BreakPoss getNextBreakPoss(LayoutContext context) { // currently active LM @@ -47,7 +94,8 @@ public class StaticContentLayoutManager extends BlockStackingLayoutManager { if ((bp = curLM.getNextBreakPoss(childLC)) != null) { blockBreaks.add(bp); if (bp.isForcedBreak()) { - getLogger().error("Forced breaks are not allowed in static content - ignoring"); + getLogger().error("Forced breaks are not allowed in " + + "static content - ignoring"); return null; } } @@ -61,6 +109,9 @@ public class StaticContentLayoutManager extends BlockStackingLayoutManager { return null; } + /** + * @see org.apache.fop.layoutmgr.LayoutProcessor#addAreas(PositionIterator, LayoutContext) + */ public void addAreas(PositionIterator parentIter, LayoutContext layoutContext) { LayoutProcessor childLM; @@ -88,11 +139,15 @@ public class StaticContentLayoutManager extends BlockStackingLayoutManager { * Add child area to a the correct container, depending on its * area class. A Flow can fill at most one area container of any class * at any one time. The actual work is done by BlockStackingLM. + * @param childArea child area to add */ public void addChild(Area childArea) { region.addBlock((Block)childArea); } + /** + * @see org.apache.fop.layoutmgr.LayoutProcessor#getParentArea(Area) + */ public Area getParentArea(Area childArea) { return region; } diff --git a/src/org/apache/fop/layoutmgr/list/Item.java b/src/org/apache/fop/layoutmgr/list/Item.java index 7e15acd49..3a902a87e 100644 --- a/src/org/apache/fop/layoutmgr/list/Item.java +++ b/src/org/apache/fop/layoutmgr/list/Item.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 . For more information on the Apache + * Software Foundation, please see . + */ package org.apache.fop.layoutmgr.list; import org.apache.fop.fo.PropertyManager; @@ -44,11 +87,13 @@ public class Item extends BlockStackingLayoutManager { /** * Create a new Cell layout manager. - * @param fobj the formatting object for the cell */ public Item() { } + /** + * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties(PropertyManager) + */ protected void initProperties(PropertyManager propMgr) { borderProps = propMgr.getBorderAndPadding(); backgroundProps = propMgr.getBackgroundProps(); @@ -217,7 +262,6 @@ public class Item extends BlockStackingLayoutManager { * Add the child to the list item area. * * @param childArea the child to add to the cell - * @return unused */ public void addChild(Area childArea) { if (curBlockArea != null) { diff --git a/src/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java b/src/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java index 781082781..318f35432 100644 --- a/src/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java +++ b/src/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java @@ -1,10 +1,53 @@ /* * $Id$ - * Copyright (C) 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 . For more information on the Apache + * Software Foundation, please see . + */ package org.apache.fop.layoutmgr.list; import org.apache.fop.fo.PropertyManager; @@ -54,6 +97,9 @@ public class ListBlockLayoutManager extends BlockStackingLayoutManager { public ListBlockLayoutManager() { } + /** + * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties(PropertyManager) + */ protected void initProperties(PropertyManager propMgr) { borderProps = propMgr.getBorderAndPadding(); backgroundProps = propMgr.getBackgroundProps(); @@ -161,10 +207,10 @@ public class ListBlockLayoutManager extends BlockStackingLayoutManager { } } - if(borderProps != null) { + if (borderProps != null) { TraitSetter.addBorders(curBlockArea, borderProps); } - if(backgroundProps != null) { + if (backgroundProps != null) { TraitSetter.addBackground(curBlockArea, backgroundProps); } @@ -205,7 +251,6 @@ public class ListBlockLayoutManager extends BlockStackingLayoutManager { * Add the child area to this layout manager. * * @param childArea the child area to add - * @return unused */ public void addChild(Area childArea) { if (curBlockArea != null) { diff --git a/src/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java b/src/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java index 4535a0e84..ce01a524f 100644 --- a/src/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java +++ b/src/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java @@ -1,10 +1,53 @@ /* * $Id$ - * Copyright (C) 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 . For more information on the Apache + * Software Foundation, please see . + */ package org.apache.fop.layoutmgr.list; import org.apache.fop.fo.PropertyManager; @@ -56,16 +99,27 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager { public ListItemLayoutManager() { } + /** + * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties(PropertyManager) + */ protected void initProperties(PropertyManager propMgr) { borderProps = propMgr.getBorderAndPadding(); backgroundProps = propMgr.getBackgroundProps(); } + /** + * Sets the label of the list item + * @param item the label item + */ public void setLabel(Item item) { label = item; label.setParent(this); } + /** + * Sets the body of the list item + * @param item the body item + */ public void setBody(Item item) { body = item; body.setParent(this); @@ -94,7 +148,7 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager { int stage = 0; boolean over = false; while (true) { - if(stage == 0) { + if (stage == 0) { curLM = label; } else if (stage == 1) { curLM = body; @@ -205,7 +259,7 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager { breakPosIter = new BreakPossPosIter(cellsbr, 0, cellsbr.size()); while ((childLM = (Item)breakPosIter.getNextChildLM()) != null) { - if(childLM == body) { + if (childLM == body) { childLM.setXOffset(24000); } childLM.addAreas(breakPosIter, lc); @@ -264,7 +318,6 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager { * This simply adds the area to the parent layout manager. * * @param childArea the child area - * @return unused */ public void addChild(Area childArea) { if (curBlockArea != null) { diff --git a/src/org/apache/fop/layoutmgr/table/Body.java b/src/org/apache/fop/layoutmgr/table/Body.java index ad0f03651..9b02a81ae 100644 --- a/src/org/apache/fop/layoutmgr/table/Body.java +++ b/src/org/apache/fop/layoutmgr/table/Body.java @@ -1,10 +1,53 @@ /* * $Id$ - * Copyright (C) 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 . For more information on the Apache + * Software Foundation, please see . + */ package org.apache.fop.layoutmgr.table; import org.apache.fop.fo.PropertyManager; @@ -47,8 +90,6 @@ public class Body extends BlockStackingLayoutManager { /** * Create a new body layout manager. - * - * @param fobj the formatting object that created this manager */ public Body() { } @@ -231,7 +272,6 @@ public class Body extends BlockStackingLayoutManager { * the areas return by the children. * * @param childArea the child area to add - * @return unused */ public void addChild(Area childArea) { parentLM.addChild(childArea); @@ -257,7 +297,7 @@ public class Body extends BlockStackingLayoutManager { public Area createColumnArea() { Area curBlockArea = new Block(); - if(backgroundProps != null) { + if (backgroundProps != null) { TraitSetter.addBackground(curBlockArea, backgroundProps); } return curBlockArea; diff --git a/src/org/apache/fop/layoutmgr/table/Caption.java b/src/org/apache/fop/layoutmgr/table/Caption.java index 1e9fd95b5..0fad415d5 100644 --- a/src/org/apache/fop/layoutmgr/table/Caption.java +++ b/src/org/apache/fop/layoutmgr/table/Caption.java @@ -1,10 +1,53 @@ /* * $Id$ - * Copyright (C) 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 . For more information on the Apache + * Software Foundation, please see . + */ package org.apache.fop.layoutmgr.table; import org.apache.fop.layoutmgr.BlockStackingLayoutManager; @@ -177,7 +220,6 @@ public class Caption extends BlockStackingLayoutManager { * Add the child to the caption area. * * @param childArea the child area to add - * @return unused */ public void addChild(Area childArea) { if (curBlockArea != null) { diff --git a/src/org/apache/fop/layoutmgr/table/Cell.java b/src/org/apache/fop/layoutmgr/table/Cell.java index 9ad2c2166..b75e7ab8b 100644 --- a/src/org/apache/fop/layoutmgr/table/Cell.java +++ b/src/org/apache/fop/layoutmgr/table/Cell.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 . For more information on the Apache + * Software Foundation, please see . + */ package org.apache.fop.layoutmgr.table; import org.apache.fop.fo.PropertyManager; @@ -50,6 +93,9 @@ public class Cell extends BlockStackingLayoutManager { public Cell() { } + /** + * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties(PropertyManager) + */ protected void initProperties(PropertyManager propMgr) { borderProps = propMgr.getBorderAndPadding(); backgroundProps = propMgr.getBackgroundProps(); @@ -74,7 +120,7 @@ public class Cell extends BlockStackingLayoutManager { cellIPD = context.getRefIPD(); while ((curLM = getChildLM()) != null) { - if(curLM.generatesInlineAreas()) { + if (curLM.generatesInlineAreas()) { getLogger().error("table-cell must contain block areas - ignoring"); curLM.setFinished(true); continue; @@ -188,10 +234,10 @@ public class Cell extends BlockStackingLayoutManager { } } - if(borderProps != null) { + if (borderProps != null) { TraitSetter.addBorders(curBlockArea, borderProps); } - if(backgroundProps != null) { + if (backgroundProps != null) { TraitSetter.addBackground(curBlockArea, backgroundProps); } @@ -240,7 +286,6 @@ public class Cell extends BlockStackingLayoutManager { * Add the child to the cell block area. * * @param childArea the child to add to the cell - * @return unused */ public void addChild(Area childArea) { if (curBlockArea != null) { diff --git a/src/org/apache/fop/layoutmgr/table/Column.java b/src/org/apache/fop/layoutmgr/table/Column.java index fac622e64..118b6c08b 100644 --- a/src/org/apache/fop/layoutmgr/table/Column.java +++ b/src/org/apache/fop/layoutmgr/table/Column.java @@ -1,10 +1,53 @@ /* * $Id$ - * Copyright (C) 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 . For more information on the Apache + * Software Foundation, please see . + */ package org.apache.fop.layoutmgr.table; import org.apache.fop.fo.FObj; @@ -33,17 +76,21 @@ public class Column extends AbstractLayoutManager { /** * Create a new column layout manager. - * - * @param fobj the table-column formatting object */ public Column() { } + /** + * @see org.apache.fop.layoutmgr.LayoutManager#setFObj(FObj) + */ public void setFObj(FObj fobj) { super.setFObj(fobj); columnWidth = ((TableColumn)fobj).getColumnWidth(); } + /** + * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties(PropertyManager) + */ protected void initProperties(PropertyManager propMgr) { borderProps = propMgr.getBorderAndPadding(); backgroundProps = propMgr.getBackgroundProps(); @@ -103,7 +150,7 @@ public class Column extends AbstractLayoutManager { public Area createColumnArea() { Area curBlockArea = new Block(); - if(backgroundProps != null) { + if (backgroundProps != null) { TraitSetter.addBackground(curBlockArea, backgroundProps); } return curBlockArea; diff --git a/src/org/apache/fop/layoutmgr/table/Row.java b/src/org/apache/fop/layoutmgr/table/Row.java index c55fe8ab3..e15e92833 100644 --- a/src/org/apache/fop/layoutmgr/table/Row.java +++ b/src/org/apache/fop/layoutmgr/table/Row.java @@ -1,10 +1,53 @@ /* * $Id$ - * Copyright (C) 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 . For more information on the Apache + * Software Foundation, please see . + */ package org.apache.fop.layoutmgr.table; import org.apache.fop.fo.PropertyManager; @@ -341,7 +384,6 @@ public class Row extends BlockStackingLayoutManager { * This simply adds the area to the parent layout manager. * * @param childArea the child area - * @return unused */ public void addChild(Area childArea) { parentLM.addChild(childArea); @@ -366,7 +408,7 @@ public class Row extends BlockStackingLayoutManager { */ public Area getRowArea() { Area block = new Block(); - if(backgroundProps != null) { + if (backgroundProps != null) { TraitSetter.addBackground(block, backgroundProps); } return block; diff --git a/src/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java b/src/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java index fe687652c..b8cd6b493 100644 --- a/src/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java +++ b/src/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java @@ -1,10 +1,53 @@ /* * $Id$ - * Copyright (C) 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 . For more information on the Apache + * Software Foundation, please see . + */ package org.apache.fop.layoutmgr.table; import org.apache.fop.layoutmgr.BlockStackingLayoutManager; @@ -178,7 +221,6 @@ public class TableAndCaptionLayoutManager extends BlockStackingLayoutManager { * Add the child to the current area. * * @param childArea the area to add - * @return unused */ public void addChild(Area childArea) { if (curBlockArea != null) { diff --git a/src/org/apache/fop/layoutmgr/table/TableLayoutManager.java b/src/org/apache/fop/layoutmgr/table/TableLayoutManager.java index d1879e3fb..8c1dbea1f 100644 --- a/src/org/apache/fop/layoutmgr/table/TableLayoutManager.java +++ b/src/org/apache/fop/layoutmgr/table/TableLayoutManager.java @@ -1,10 +1,53 @@ /* * $Id$ - * Copyright (C) 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 . For more information on the Apache + * Software Foundation, please see . + */ package org.apache.fop.layoutmgr.table; import org.apache.fop.fo.PropertyManager; @@ -63,6 +106,9 @@ public class TableLayoutManager extends BlockStackingLayoutManager { public TableLayoutManager() { } + /** + * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties(PropertyManager) + */ protected void initProperties(PropertyManager propMgr) { borderProps = propMgr.getBorderAndPadding(); backgroundProps = propMgr.getBackgroundProps(); @@ -287,10 +333,10 @@ public class TableLayoutManager extends BlockStackingLayoutManager { curBlockArea.setHeight(tableHeight); - if(borderProps != null) { + if (borderProps != null) { TraitSetter.addBorders(curBlockArea, borderProps); } - if(backgroundProps != null) { + if (backgroundProps != null) { TraitSetter.addBackground(curBlockArea, backgroundProps); } @@ -331,7 +377,6 @@ public class TableLayoutManager extends BlockStackingLayoutManager { * Add the child area to this layout manager. * * @param childArea the child area to add - * @return unused */ public void addChild(Area childArea) { if (curBlockArea != null) { -- 2.39.5