Package org.apache.fop.layoutmgr.inline
Class LineLayoutManager.LineBreakingAlgorithm
- java.lang.Object
-
- org.apache.fop.layoutmgr.BreakingAlgorithm
-
- org.apache.fop.layoutmgr.inline.LineLayoutManager.LineBreakingAlgorithm
-
- Enclosing class:
- LineLayoutManager
private class LineLayoutManager.LineBreakingAlgorithm extends BreakingAlgorithm
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.fop.layoutmgr.BreakingAlgorithm
BreakingAlgorithm.BestRecords, BreakingAlgorithm.KnuthNode
-
-
Field Summary
Fields Modifier and Type Field Description private int
activePossibility
private int
addedPositions
private int
follow
private int
lead
private int
lineHeight
private static double
MAX_DEMERITS
private int
pageAlignment
private int
textIndent
private LineLayoutManager
thisLLM
-
Fields inherited from class org.apache.fop.layoutmgr.BreakingAlgorithm
activeLines, activeNodeCount, alignment, alignmentLast, ALL_BREAKS, best, considerTooShort, endLine, incompatibleFitnessDemerit, indentFirstPart, INFINITE_RATIO, lineWidth, log, maxFlaggedPenaltiesCount, NO_FLAGGED_PENALTIES, ONLY_FORCED_BREAKS, par, repeatedFlaggedDemerit, startLine, totalShrink, totalStretch, totalWidth
-
-
Constructor Summary
Constructors Constructor Description LineBreakingAlgorithm(int pageAlign, int textAlign, int textAlignLast, int indent, int fillerWidth, int lh, int ld, int fl, boolean first, int maxFlagCount, LineLayoutManager llm)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
filterActiveNodes()
Filter active nodes.private LineLayoutManager.LineBreakPosition
makeLineBreakPosition(KnuthSequence par, int firstElementIndex, int lastElementIndex, int availableShrink, int availableStretch, int difference, double ratio, int startIndent, int endIndent)
void
resetAlgorithm()
void
updateData1(int lineCount, double demerits)
Empty method, hook for subclasses.void
updateData2(BreakingAlgorithm.KnuthNode bestActiveNode, KnuthSequence par, int total)
Empty method, hook for subclasses.-
Methods inherited from class org.apache.fop.layoutmgr.BreakingAlgorithm
activateNode, addNode, calculateBreakPoints, compareNodes, computeAdjustmentRatio, computeDemerits, computeDifference, considerLegalBreak, createForcedNodes, createNode, createNode, deactivateNode, disableFloatHandling, elementCanEndLine, findBreakingPoints, findBreakingPoints, finish, forceNode, getAlignment, getAlignmentLast, getElement, getIPDdifference, getLastTooLong, getLastTooShort, getLineWidth, getLineWidth, getMaxRecoveryAttempts, getNode, handleBox, handleElementAt, handleFloat, handleGlueAt, handleIpdChange, handlePenaltyAt, handlingFloat, initialize, isPartOverflowRecoveryActivated, recoverFromOverflow, recoverFromTooLong, removeNode, replaceLastDeactivated, restartFrom, setConstantLineWidth, toString
-
-
-
-
Field Detail
-
thisLLM
private final LineLayoutManager thisLLM
-
pageAlignment
private final int pageAlignment
-
activePossibility
private int activePossibility
-
addedPositions
private int addedPositions
-
textIndent
private final int textIndent
-
lineHeight
private final int lineHeight
-
lead
private final int lead
-
follow
private final int follow
-
MAX_DEMERITS
private static final double MAX_DEMERITS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LineBreakingAlgorithm
public LineBreakingAlgorithm(int pageAlign, int textAlign, int textAlignLast, int indent, int fillerWidth, int lh, int ld, int fl, boolean first, int maxFlagCount, LineLayoutManager llm)
-
-
Method Detail
-
updateData1
public void updateData1(int lineCount, double demerits)
Description copied from class:BreakingAlgorithm
Empty method, hook for subclasses. Called before determining the optimal breakpoints corresponding to a given active node.- Specified by:
updateData1
in classBreakingAlgorithm
- Parameters:
lineCount
- number of lines for the active nodedemerits
- total demerits of the paragraph for the active node
-
updateData2
public void updateData2(BreakingAlgorithm.KnuthNode bestActiveNode, KnuthSequence par, int total)
Description copied from class:BreakingAlgorithm
Empty method, hook for subclasses. Called when determining the optimal breakpoints for a given active node.- Specified by:
updateData2
in classBreakingAlgorithm
- Parameters:
bestActiveNode
- a node in the chain of best active nodes, corresponding to one of the optimal breakpointspar
- the corresponding paragraphtotal
- the number of lines into which the paragraph will be broken
-
resetAlgorithm
public void resetAlgorithm()
-
makeLineBreakPosition
private LineLayoutManager.LineBreakPosition makeLineBreakPosition(KnuthSequence par, int firstElementIndex, int lastElementIndex, int availableShrink, int availableStretch, int difference, double ratio, int startIndent, int endIndent)
-
filterActiveNodes
protected int filterActiveNodes()
Description copied from class:BreakingAlgorithm
Filter active nodes.- Specified by:
filterActiveNodes
in classBreakingAlgorithm
- Returns:
- an integer
-
-