|
fop 0.95 | |||||||||
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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.fop.layoutmgr.inline.InlineStackingLayoutManager |
---|
InlineStackingLayoutManager.StackingIter |
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, parentLM |
Fields inherited from class org.apache.fop.layoutmgr.AbstractBaseLayoutManager |
---|
generatesBlockArea, generatesReferenceArea |
Fields inherited from interface org.apache.fop.layoutmgr.BlockLevelLayoutManager |
---|
LINE_HEIGHT_ADJUSTMENT, LINE_NUMBER_ADJUSTMENT, NO_ADJUSTMENT, SPACE_AFTER_ADJUSTMENT, SPACE_BEFORE_ADJUSTMENT |
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)
|
java.util.LinkedList |
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 possibile hyphenation points. For example, if the text "representation" originates a single box element when getNextKnuthElements() is called, it will be now split in syllables (rep-re-sen-ta-tion) each one originating a box and divided by additional elements allowing a line break. In the context of page breaking, this method is called only if the pages need to be "vertically justified" modifying (also) the quantity of lines created by the paragraphs, and after a first page breaking has been performed. According to the result of the first page breaking, each paragraph now knows how many lines it must create (among the existing layout possibilities) and has to create a sequence of elements representing this layout; in particular, each box, representing a line, will contain a LineBreakPositions that will be used in the addAreas() phase. LMs having children look at the old list of elements in order to know which ones they must get the new elements from, as break conditions of preserved linefeeds can divide children into smaller groups (page sequences or paragraphs). LMs having no children can simply return the old elements if they have nothing to change. Inline LMs need to know the text alignment because it affects the elements representing feasible breaks between syllables. |
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. |
java.util.LinkedList |
getNextKnuthElements(LayoutContext context,
int alignment)
Get a sequence of KnuthElements representing the content of the node assigned to the LM |
protected boolean |
hasLeadingFence(boolean isNotFirst)
Line area is always considered to act as a fence. |
protected boolean |
hasTrailingFence(boolean isNotLast)
Line area is always considered to act as a fence. |
void |
initialize()
initialize the layout manager. Allows each layout manager to calculate often used values. |
boolean |
mustKeepTogether()
|
boolean |
mustKeepWithNext()
|
boolean |
mustKeepWithPrevious()
|
int |
negotiateBPDAdjustment(int adj,
KnuthElement lastElement)
|
Methods inherited from class org.apache.fop.layoutmgr.inline.InlineStackingLayoutManager |
---|
addALetterSpaceTo, addId, addSpace, applyChanges, clearPrevIPD, getContext, getCurrentArea, getExtraIPD, getPrevIPD, getSpaceEnd, getSpaceStart, getWordChars, hyphenate, removeWordSpace, setChildContext, setCurrentArea, setLMiter, setTraits |
Methods inherited from class org.apache.fop.layoutmgr.AbstractLayoutManager |
---|
addChildLM, addChildLMs, addMarkersToPage, createChildLMs, createNextChildLMs, getChildLM, getChildLMs, getCurrentPage, getCurrentPV, getParent, getParentArea, getPSLM, hasNextChildLM, isFinished, isFirst, isLast, notifyPos, setFinished, setParent, toString, transferForeignAttributes |
Methods inherited from class org.apache.fop.layoutmgr.AbstractBaseLayoutManager |
---|
getAncestorBlockAreaBPD, getAncestorBlockAreaIPD, getBaseLength, getContentAreaBPD, getContentAreaIPD, getFObj, getGeneratesReferenceArea, 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, getParent, getParentArea, getPSLM, isFinished, notifyPos, 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.LinkedList getNextKnuthElements(LayoutContext context, int alignment)
getNextKnuthElements
in interface LayoutManager
getNextKnuthElements
in class AbstractLayoutManager
context
- the LayoutContext used to store layout informationalignment
- the desired text alignement
public boolean mustKeepTogether()
mustKeepTogether
in interface BlockLevelLayoutManager
public boolean mustKeepWithPrevious()
mustKeepWithPrevious
in interface BlockLevelLayoutManager
public boolean mustKeepWithNext()
mustKeepWithNext
in interface BlockLevelLayoutManager
public int negotiateBPDAdjustment(int adj, KnuthElement lastElement)
negotiateBPDAdjustment
in interface BlockLevelLayoutManager
public void discardSpace(KnuthGlue spaceGlue)
discardSpace
in interface BlockLevelLayoutManager
public java.util.LinkedList 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 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
|
fop 0.95 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |