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
This class represents an unresolved break possibility.
-
Constructor Summary
ConstructorDescriptionBreakElement
(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
,penaltyValue
andbreakClass
.BreakElement
(Position position, int penaltyValue, LayoutContext context) Main constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
Clears all pending marks associated with this break element.int
Returns the break class of this penalty.int
int
boolean
boolean
void
setBreakClass
(int breakClass) Sets the break class.void
setPenaltyValue
(int p) Sets the penalty value.toString()
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 Details
-
BreakElement
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
Create a new BreakElement for the givenposition
,penaltyValue
andbreakClass
. (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_COLUMN
orConstants.EN_PAGE
)- Parameters:
position
- the correspondingPosition
penaltyValue
- 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 Details
-
isConditional
public boolean isConditional()- Specified by:
isConditional
in 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:
isForcedBreak
in 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
- Returns:
- the pending border and padding elements at the before edge
-
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
-