|
fop 2.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.fop.layoutmgr.AbstractBaseLayoutManager
org.apache.fop.layoutmgr.AbstractLayoutManager
org.apache.fop.layoutmgr.inline.InlineStackingLayoutManager
org.apache.fop.layoutmgr.inline.LineLayoutManager
public class LineLayoutManager
LayoutManager for lines. It builds one or more lines containing inline areas generated by its sub layout managers. A break is found for each line which may contain one of more breaks from the child layout managers. Once a break is found then it is return for the parent layout manager to handle. When the areas are being added to the page this manager creates a line area to contain the inline areas added by the child layout managers.
Field Summary | |
---|---|
static int |
DEFAULT_SPACE_WIDTH
this constant is used to create elements when text-align is center: every TextLM descendant of LineLM must use the same value, otherwise the line breaking algorithm does not find the right break point |
Fields inherited from class org.apache.fop.layoutmgr.inline.InlineStackingLayoutManager |
---|
childLC, extraBPD |
Fields inherited from class org.apache.fop.layoutmgr.AbstractLayoutManager |
---|
childLMiter, childLMs, curChildLM, fobjIter, parentLayoutManager |
Fields inherited from class org.apache.fop.layoutmgr.AbstractBaseLayoutManager |
---|
generatesBlockArea, generatesReferenceArea |
Constructor Summary | |
---|---|
LineLayoutManager(Block block,
Length lh,
int l,
int f)
Create a new Line Layout Manager. |
Method Summary | |
---|---|
void |
addAreas(PositionIterator parentIter,
LayoutContext context)
Add the areas with the break points. |
void |
addChildArea(Area childArea)
Add a child area to the current area. |
void |
discardSpace(KnuthGlue spaceGlue)
Discard space. |
int |
getBaselineOffset()
Returns the position of the dominant-baseline of this FO's first descendant line-area. |
java.util.List |
getChangedKnuthElements(java.util.List oldList,
int alignment)
Get a sequence of KnuthElements representing the content of the node assigned to the LM, after changes have been applied In the context of line breaking, this method is called after hyphenation has been performed, in order to receive the sequence of elements representing the text together with all possible hyphenation points. |
java.util.List |
getChangedKnuthElements(java.util.List oldList,
int alignment,
int depth)
Get a sequence of KnuthElements representing the content of the node assigned to the LM, after changes have been applied |
boolean |
getGeneratesBlockArea()
Returns an indication if the layout manager generates a block area. |
boolean |
getGeneratesLineArea()
Returns an indication if the layout manager generates a line area. |
Keep |
getKeepTogether()
Returns the keep-together strength for this element. |
KeepProperty |
getKeepTogetherProperty()
Returns the keep-together property specified on the FObj. |
Keep |
getKeepWithNext()
Returns the keep-with-next strength for this element. |
KeepProperty |
getKeepWithNextProperty()
Returns the keep-with-next property specified on the FObj. |
Keep |
getKeepWithPrevious()
Returns the keep-with-previous strength for this element. |
KeepProperty |
getKeepWithPreviousProperty()
Returns the keep-with-previous property specified on the FObj. |
java.util.List |
getNextKnuthElements(LayoutContext context,
int alignment)
Get a sequence of KnuthElements representing the content of the node assigned to the LM. |
java.util.List |
getNextKnuthElements(LayoutContext context,
int alignment,
LeafPosition restartPosition)
Get a sequence of KnuthElements representing the content of the node assigned to the LM. |
boolean |
handleOverflow(int milliPoints)
Whether this LM can handle horizontal overflow error messages (only a BlockContainerLayoutManager can). |
protected boolean |
hasLeadingFence(boolean isNotFirst)
Line area is always considered to act as a fence. |
boolean |
hasLineAreaDescendant()
Whether the FO handled by this layout manager has a descendant (including itself) that will generate a line-area. |
protected boolean |
hasTrailingFence(boolean isNotLast)
Line area is always considered to act as a fence. |
void |
initialize()
initialize the layout manager. |
boolean |
isRestartable()
Returns true if this layout manager is able to re-generate its
Knuth elements after an IPD change. |
boolean |
mustKeepTogether()
|
boolean |
mustKeepWithNext()
|
boolean |
mustKeepWithPrevious()
|
int |
negotiateBPDAdjustment(int adj,
KnuthElement lastElement)
Negotiate BPD adjustment. |
Methods inherited from class org.apache.fop.layoutmgr.inline.InlineStackingLayoutManager |
---|
addALetterSpaceTo, addALetterSpaceTo, addSpace, applyChanges, applyChanges, getBreakBefore, getContext, getCurrentArea, getExtraIPD, getSpaceEnd, getSpaceStart, getWordChars, hyphenate, setChildContext, setCurrentArea, setLMiter, setTraits |
Methods inherited from class org.apache.fop.layoutmgr.AbstractBaseLayoutManager |
---|
getAncestorBlockAreaBPD, getAncestorBlockAreaIPD, getBaseLength, getContentAreaBPD, getContentAreaIPD, getFObj, getGeneratesReferenceArea, getNextKnuthElements, getParentAreaBPD, getParentAreaIPD, getReferenceAreaBPD, getReferenceAreaIPD, setGeneratesBlockArea, setGeneratesReferenceArea |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.fop.layoutmgr.LayoutManager |
---|
addChildLM, addChildLMs, createNextChildLMs, getChildLMs, getContentAreaBPD, getContentAreaIPD, getFObj, getGeneratesReferenceArea, getNextKnuthElements, getParent, getParentArea, getPSLM, isFinished, notifyPos, reset, setFinished, setParent |
Methods inherited from interface org.apache.fop.datatypes.PercentBaseContext |
---|
getBaseLength |
Field Detail |
---|
public static final int DEFAULT_SPACE_WIDTH
Constructor Detail |
---|
public LineLayoutManager(Block block, Length lh, int l, int f)
block
- the block formatting objectlh
- the default line heightl
- the default lead, from top to baselinef
- the default follow, from baseline to bottomMethod Detail |
---|
public void initialize()
initialize
in interface LayoutManager
initialize
in class AbstractLayoutManager
public java.util.List getNextKnuthElements(LayoutContext context, int alignment)
getNextKnuthElements
in interface LayoutManager
getNextKnuthElements
in class AbstractLayoutManager
context
- the LayoutContext used to store layout informationalignment
- the desired text alignment
public java.util.List getNextKnuthElements(LayoutContext context, int alignment, LeafPosition restartPosition)
context
- the LayoutContext used to store layout informationalignment
- the desired text alignmentrestartPosition
- position at restart
LayoutManager.getNextKnuthElements(LayoutContext,int)
public boolean mustKeepTogether()
mustKeepTogether
in interface BlockLevelLayoutManager
public KeepProperty getKeepTogetherProperty()
getKeepTogetherProperty
in interface BlockLevelLayoutManager
public KeepProperty getKeepWithPreviousProperty()
getKeepWithPreviousProperty
in interface BlockLevelLayoutManager
public KeepProperty getKeepWithNextProperty()
getKeepWithNextProperty
in interface BlockLevelLayoutManager
public Keep getKeepTogether()
getKeepTogether
in interface BlockLevelLayoutManager
public boolean mustKeepWithPrevious()
mustKeepWithPrevious
in interface BlockLevelLayoutManager
public boolean mustKeepWithNext()
mustKeepWithNext
in interface BlockLevelLayoutManager
public Keep getKeepWithNext()
getKeepWithNext
in interface BlockLevelLayoutManager
public Keep getKeepWithPrevious()
getKeepWithPrevious
in interface BlockLevelLayoutManager
public int negotiateBPDAdjustment(int adj, KnuthElement lastElement)
negotiateBPDAdjustment
in interface BlockLevelLayoutManager
adj
- amount to adjustlastElement
- the last knuth element
public void discardSpace(KnuthGlue spaceGlue)
discardSpace
in interface BlockLevelLayoutManager
spaceGlue
- the spacepublic java.util.List getChangedKnuthElements(java.util.List oldList, int alignment, int depth)
getChangedKnuthElements
in interface InlineLevelLayoutManager
getChangedKnuthElements
in class InlineStackingLayoutManager
oldList
- the elements to replacealignment
- the desired text alignmentdepth
- the depth at which the Positions for this LM in oldList are found
public java.util.List getChangedKnuthElements(java.util.List oldList, int alignment)
getChangedKnuthElements
in interface LayoutManager
getChangedKnuthElements
in class InlineStackingLayoutManager
oldList
- the elements to replacealignment
- the desired text alignment
protected boolean hasLeadingFence(boolean isNotFirst)
hasLeadingFence
in class InlineStackingLayoutManager
isNotFirst
- ignored
protected boolean hasTrailingFence(boolean isNotLast)
hasTrailingFence
in class InlineStackingLayoutManager
isNotLast
- ignored
public boolean hasLineAreaDescendant()
LayoutManager
hasLineAreaDescendant
in interface LayoutManager
hasLineAreaDescendant
in class AbstractLayoutManager
true
if a descendant line-area will be generated, false
otherwisepublic int getBaselineOffset()
LayoutManager
The behavior of this method is undefined if this FO has no descendant
line-area, and an exception may be thrown. See LayoutManager.hasLineAreaDescendant()
getBaselineOffset
in interface LayoutManager
getBaselineOffset
in class AbstractLayoutManager
LayoutManager.hasLineAreaDescendant()
public void addAreas(PositionIterator parentIter, LayoutContext context)
addAreas
in interface LayoutManager
addAreas
in class AbstractLayoutManager
parentIter
- the iterator of break positionscontext
- the context for adding areaspublic void addChildArea(Area childArea)
addChildArea
in interface LayoutManager
addChildArea
in class AbstractLayoutManager
childArea
- the child area to be addedpublic boolean getGeneratesBlockArea()
getGeneratesBlockArea
in interface LayoutManager
getGeneratesBlockArea
in class AbstractBaseLayoutManager
public boolean getGeneratesLineArea()
getGeneratesLineArea
in interface LayoutManager
getGeneratesLineArea
in class AbstractBaseLayoutManager
public boolean isRestartable()
true
if this layout manager is able to re-generate its
Knuth elements after an IPD change.
isRestartable
in interface LayoutManager
isRestartable
in class AbstractBaseLayoutManager
true
if this layout manager can be restarted after an IPD
changepublic boolean handleOverflow(int milliPoints)
milliPoints
- horizontal overflow
|
fop 2.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |