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)
*/
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;
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;
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 ...)
// 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);
}
*/
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.
*
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;
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.
*