From: Glen Mazza Date: Wed, 8 Jun 2005 22:06:32 +0000 (+0000) Subject: LayoutManager.canBreakBefore() removed. X-Git-Tag: fop-0_90-alpha1~586 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=650436066caa8ad2632862f2d2995879e4fe8451;p=xmlgraphics-fop.git LayoutManager.canBreakBefore() removed. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198721 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java b/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java index d8cb02f26..188eebc8b 100644 --- a/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java @@ -156,24 +156,6 @@ public abstract class AbstractLayoutManager implements LayoutManager, Constants bFinished = fin; } - - /** - * Return value indicating whether the next area to be generated could - * start a new line or flow area. - * In general, if can't break at the current level, delegate to - * the first child LM. - * NOTE: should only be called if the START_AREA flag is set in context, - * since the previous sibling LM must have returned a BreakPoss which - * does not allow break-after. - * QUESTION: in block-stacked areas, does this mean some kind of keep - * condition, or is it only used for inline-stacked areas? - * Default implementation always returns true. - */ - public boolean canBreakBefore(LayoutContext context) { - return true; - } - - /** * @see org.apache.fop.layoutmgr.LayoutManager#addAreas(org.apache.fop.layoutmgr.PositionIterator, org.apache.fop.layoutmgr.LayoutContext) */ diff --git a/src/java/org/apache/fop/layoutmgr/ContentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/ContentLayoutManager.java index 8e72f6330..bd3891cea 100644 --- a/src/java/org/apache/fop/layoutmgr/ContentLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/ContentLayoutManager.java @@ -202,11 +202,6 @@ public class ContentLayoutManager implements InlineLevelLayoutManager { return this.parentLM; } - /** @see org.apache.fop.layoutmgr.LayoutManager */ - public boolean canBreakBefore(LayoutContext lc) { - return false; - } - /** @see org.apache.fop.layoutmgr.LayoutManager */ public boolean isFinished() { return false; diff --git a/src/java/org/apache/fop/layoutmgr/InlineLayoutManager.java b/src/java/org/apache/fop/layoutmgr/InlineLayoutManager.java index 2953ad79b..4e2893341 100755 --- a/src/java/org/apache/fop/layoutmgr/InlineLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/InlineLayoutManager.java @@ -18,11 +18,9 @@ package org.apache.fop.layoutmgr; -import java.util.List; import java.util.ListIterator; import java.util.LinkedList; -import org.apache.fop.fo.FObj; import org.apache.fop.fo.flow.InlineLevel; import org.apache.fop.fo.properties.CommonBorderPaddingBackground; import org.apache.fop.fo.properties.CommonMarginInline; @@ -99,20 +97,6 @@ public class InlineLayoutManager extends InlineStackingLayoutManager return inlineProps.spaceEnd; } - /** - * Return value indicating whether the next area to be generated could - * start a new line. This should only be called in the "START" condition - * if a previous inline BP couldn't end the line. - * Return true if any space-start, border-start or padding-start, else - * propagate to first child LM - */ - public boolean canBreakBefore(LayoutContext context) { - if (new SpaceVal(inlineProps.spaceStart).getSpace().min > 0 || hasLeadingFence(false)) { - return true; - } - return super.canBreakBefore(context); - } - protected void setTraits(boolean bNotFirst, boolean bNotLast) { // Add border and padding to current area and set flags (FIRST, LAST ...) diff --git a/src/java/org/apache/fop/layoutmgr/InlineStackingLayoutManager.java b/src/java/org/apache/fop/layoutmgr/InlineStackingLayoutManager.java index b62f6e1a0..0fe9fa8a4 100644 --- a/src/java/org/apache/fop/layoutmgr/InlineStackingLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/InlineStackingLayoutManager.java @@ -168,22 +168,6 @@ public class InlineStackingLayoutManager extends AbstractLayoutManager // What about prevBP? } - /** - * Return value indicating whether the next area to be generated could - * start a new line. This should only be called in the "START" condition - * if a previous inline BP couldn't end the line. - * Return true if any space-start, border-start or padding-start, else - * propagate to first child LM - */ - public boolean canBreakBefore(LayoutContext context) { - LayoutManager lm = getChildLM(); - if (lm != null) { - return lm.canBreakBefore(context); - } else { - return false; // ??? NO child LM? - } - } - protected MinOptMax getPrevIPD(LayoutManager lm) { return (MinOptMax) hmPrevIPD.get(lm); } diff --git a/src/java/org/apache/fop/layoutmgr/LayoutManager.java b/src/java/org/apache/fop/layoutmgr/LayoutManager.java index c4431c2f9..16a8f4e37 100644 --- a/src/java/org/apache/fop/layoutmgr/LayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/LayoutManager.java @@ -58,15 +58,6 @@ public interface LayoutManager { */ boolean generatesInlineAreas(); - /** - * Return true if the next area which would be generated by this - * LayoutManager could start a new line (or flow for block-level FO). - * - * @param lc the layout context - * @return true if can break before - */ - boolean canBreakBefore(LayoutContext lc); - /** * Reset to the position. * diff --git a/src/java/org/apache/fop/layoutmgr/LeafNodeLayoutManager.java b/src/java/org/apache/fop/layoutmgr/LeafNodeLayoutManager.java index 83a5c55e1..22e3a0723 100644 --- a/src/java/org/apache/fop/layoutmgr/LeafNodeLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/LeafNodeLayoutManager.java @@ -242,15 +242,6 @@ public abstract class LeafNodeLayoutManager extends AbstractLayoutManager area.setIPD(width); } - /** - * Check if can break before this area. - * @param context the layout context to check for the break - * @return true if can break before this area in the context - */ - public boolean canBreakBefore(LayoutContext context) { - return true; - } - public LinkedList getNextKnuthElements(LayoutContext context, int alignment) { MinOptMax ipd; diff --git a/src/java/org/apache/fop/layoutmgr/TextLayoutManager.java b/src/java/org/apache/fop/layoutmgr/TextLayoutManager.java index 58c8786b6..2c64e4c4e 100644 --- a/src/java/org/apache/fop/layoutmgr/TextLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/TextLayoutManager.java @@ -218,24 +218,6 @@ public class TextLayoutManager extends LeafNodeLayoutManager { sbChars.append(new String(textArray, i, ai.iBreakIndex - i)); } - /** - * Return value indicating whether the next area to be generated could - * start a new line. This should only be called in the "START" condition - * if a previous inline BP couldn't end the line. - * Return true if the first character is a potential linebreak character. - * - * @param context the layout context for determining a break - * @return true if can break before this text - */ - public boolean canBreakBefore(LayoutContext context) { - char c = textArray[iNextStart]; - return ((c == NEWLINE) || (foText.getWrapOption() == EN_WRAP - && (CharUtilities.isBreakableSpace(c) - || (BREAK_CHARS.indexOf(c) >= 0 - && (iNextStart == 0 - || Character.isLetterOrDigit(textArray[iNextStart-1])))))); - } - /** * Reset position for returning next BreakPossibility. *