org.apache.fop.layoutmgr

Class BreakElement


public class BreakElement
extends UnresolvedListElement

This class represents an unresolved break possibility.

Constructor Summary

BreakElement(Position position, int penaltyWidth, int penaltyValue, int breakClass, LayoutContext context)
Constructor for hard breaks.
BreakElement(Position position, int penaltyValue, LayoutContext context)
Main constructor

Method Summary

void
clearPendingMarks()
Clears all pending marks associated with this break element.
int
getBreakClass()
Returns the break class of this penalty.
int
getPenaltyValue()
int
getPenaltyWidth()
List
getPendingAfterMarks()
List
getPendingBeforeMarks()
boolean
isConditional()
boolean
isForcedBreak()
void
setBreakClass(int breakClass)
Sets the break class.
void
setPenaltyValue(int p)
Sets the penalty value.
String
toString()

Methods inherited from class org.apache.fop.layoutmgr.UnresolvedListElement

getOriginatingLayoutManager, isConditional

Methods inherited from class org.apache.fop.layoutmgr.ListElement

getLayoutManager, getPosition, isBox, isForcedBreak, isGlue, isPenalty, isUnresolvedElement, setPosition

Constructor Details

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 width
penaltyValue - the penalty value for the penalty element to be constructed
breakClass - the break class of this penalty (one of Constants.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

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 constructed
context - the layout context which contains the pending conditional elements

Method Details

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.

getBreakClass

public int getBreakClass()
Returns the break class of this penalty.

getPenaltyValue

public int getPenaltyValue()
Returns:
the penalty value

getPenaltyWidth

public int getPenaltyWidth()
Returns:
the penalty width

getPendingAfterMarks

public List getPendingAfterMarks()
Returns:
the pending border and padding elements at the after edge

getPendingBeforeMarks

public List getPendingBeforeMarks()
Returns:
the pending border and padding elements at the before edge

isConditional

public boolean isConditional()
Overrides:
isConditional in interface UnresolvedListElement

isForcedBreak

public boolean isForcedBreak()
Overrides:
isForcedBreak in interface ListElement

setBreakClass

public void setBreakClass(int breakClass)
Sets the break class.

setPenaltyValue

public void setPenaltyValue(int p)
Sets the penalty value.
Parameters:
p - the new penalty value

toString

public String toString()

Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.