Package org.apache.fop.layoutmgr
Class BreakElement
- java.lang.Object
-
- org.apache.fop.layoutmgr.ListElement
-
- org.apache.fop.layoutmgr.UnresolvedListElement
-
- org.apache.fop.layoutmgr.BreakElement
-
public class BreakElement extends UnresolvedListElement
This class represents an unresolved break possibility.
-
-
Constructor Summary
Constructors Constructor Description BreakElement(Position position, int penaltyWidth, int penaltyValue, int breakClass, LayoutContext context)Constructor for hard breaks.BreakElement(Position position, int penaltyValue, int breakClass, LayoutContext context)Create a new BreakElement for the givenposition,penaltyValueandbreakClass.BreakElement(Position position, int penaltyValue, LayoutContext context)Main constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearPendingMarks()Clears all pending marks associated with this break element.intgetBreakClass()Returns the break class of this penalty.intgetPenaltyValue()intgetPenaltyWidth()java.util.ListgetPendingAfterMarks()java.util.ListgetPendingBeforeMarks()booleanisConditional()booleanisForcedBreak()voidsetBreakClass(int breakClass)Sets the break class.voidsetPenaltyValue(int p)Sets the penalty value.java.lang.StringtoString()-
Methods inherited from class org.apache.fop.layoutmgr.UnresolvedListElement
getOriginatingLayoutManager
-
Methods inherited from class org.apache.fop.layoutmgr.ListElement
getLayoutManager, getPosition, isBox, isGlue, isPenalty, isUnresolvedElement, setPosition
-
-
-
-
Constructor Detail
-
BreakElement
public BreakElement(Position position, int penaltyValue, LayoutContext context)
Main constructor- Parameters:
position- the Position instance needed by the addAreas stage of the LMs.penaltyValue- the penalty value for the penalty element to be constructedcontext- the layout context which contains the pending conditional elements
-
BreakElement
public BreakElement(Position position, int penaltyValue, int breakClass, LayoutContext context)
Create a new BreakElement for the givenposition,penaltyValueandbreakClass. (Used principally to generate break-possibilities in ranges of content that must be kept together within the context corresponding to thebreakClass; expected to be one ofConstants.EN_AUTO,Constants.EN_LINE,Constants.EN_COLUMNorConstants.EN_PAGE)- Parameters:
position- the correspondingPositionpenaltyValue- the penalty valuebreakClass- the break classcontext- theLayoutContext
-
BreakElement
public BreakElement(Position position, int penaltyWidth, int penaltyValue, int breakClass, LayoutContext context)
Constructor for hard breaks.- Parameters:
position- the Position instance needed by the addAreas stage of the LMs.penaltyWidth- the penalty widthpenaltyValue- the penalty value for the penalty element to be constructedbreakClass- the break class of this penalty (one ofConstants.EN_AUTO,Constants.EN_COLUMN,Constants.EN_PAGE,Constants.EN_EVEN_PAGE,Constants.EN_ODD_PAGE)context- the layout context which contains the pending conditional elements
-
-
Method Detail
-
isConditional
public boolean isConditional()
- Specified by:
isConditionalin classUnresolvedListElement- Returns:
- true if the element is conditional (conditionality="discard")
-
getPenaltyWidth
public int getPenaltyWidth()
- Returns:
- the penalty width
-
getPenaltyValue
public int getPenaltyValue()
- Returns:
- the penalty value
-
setPenaltyValue
public void setPenaltyValue(int p)
Sets the penalty value.- Parameters:
p- the new penalty value
-
isForcedBreak
public boolean isForcedBreak()
- Overrides:
isForcedBreakin classListElement- Returns:
- true if the element is a penalty and represents a forced break.
-
getBreakClass
public int getBreakClass()
Returns the break class of this penalty.- Returns:
- one of
Constants.EN_AUTO,Constants.EN_COLUMN,Constants.EN_PAGE,Constants.EN_EVEN_PAGE,Constants.EN_ODD_PAGE.
-
setBreakClass
public void setBreakClass(int breakClass)
Sets the break class.- Parameters:
breakClass- one ofConstants.EN_AUTO,Constants.EN_LINE,Constants.EN_COLUMN,Constants.EN_PAGE,Constants.EN_EVEN_PAGE,Constants.EN_ODD_PAGE.
-
getPendingBeforeMarks
public java.util.List getPendingBeforeMarks()
- Returns:
- the pending border and padding elements at the before edge
-
getPendingAfterMarks
public java.util.List getPendingAfterMarks()
- Returns:
- the pending border and padding elements at the after edge
-
clearPendingMarks
public void clearPendingMarks()
Clears all pending marks associated with this break element. This is used in break cases where we only know very late if the break is actually after all the content of an FO has been generated.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-