public abstract class AbstractBaseLayoutManager extends Object implements LayoutManager, PercentBaseContext
LayoutManager
and the PercentBaseContext
interfaces
into a common base class for all higher LayoutManagers.Modifier and Type | Field and Description |
---|---|
protected FObj |
fobj
The formatting object for this LM.
|
protected boolean |
generatesBlockArea
Indicator if this LM generates block areas.
|
protected boolean |
generatesReferenceArea
Indicator if this LM generates reference areas.
|
Constructor and Description |
---|
AbstractBaseLayoutManager()
Abstract base layout manager.
|
AbstractBaseLayoutManager(FObj fo)
Abstract base layout manager.
|
Modifier and Type | Method and Description |
---|---|
protected int |
getAncestorBlockAreaBPD()
Find the first ancestor area that is a block area
and returns its BPD.
|
protected int |
getAncestorBlockAreaIPD()
Find the first ancestor area that is a block area
and returns its IPD.
|
int |
getBaseLength(int lengthBase,
FObj fobjx)
Returns the base length for the given length base.
|
List<ChangeBar> |
getChangeBarList()
Returns the active change bar list.
|
int |
getContentAreaBPD()
Returns the BPD of the content area
|
int |
getContentAreaIPD()
Returns the IPD of the content area
|
FObj |
getFObj()
Returns the fo this layout manager is associated with.
|
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.
|
boolean |
getGeneratesReferenceArea()
Returns an indication if the layout manager generates a reference area.
|
List |
getNextKnuthElements(LayoutContext context,
int alignment,
Stack lmStack,
Position positionAtIPDChange,
LayoutManager restartAtLM)
Returns an updated list of Knuth elements corresponding to this layout
manager, after a change of IPD has been detected.
|
protected int |
getParentAreaBPD()
Find the parent area and returns its BPD.
|
protected int |
getParentAreaIPD()
Find the parent area and returns its IPD.
|
protected int |
getReferenceAreaBPD()
Find the first ancestor area that is a reference area
and returns its BPD.
|
int |
getReferenceAreaIPD()
Find the first ancestor area that is a reference area
and returns its IPD.
|
boolean |
isRestartable()
Returns
true if this layout manager is able to re-generate its
Knuth elements after an IPD change. |
void |
preserveChildrenAtEndOfLayout() |
void |
recreateChildrenLMs() |
void |
reset()
Re-initializes this layout manager in order to re-generate its Knuth
elements according to a new IPD value.
|
protected void |
setGeneratesBlockArea(boolean generatesBlockArea)
Lets implementing LM set the flag indicating if they
generate block areas.
|
protected void |
setGeneratesReferenceArea(boolean generatesReferenceArea)
Lets implementing LM set the flag indicating if they
generate reference areas.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addAreas, addChildArea, addChildLM, addChildLMs, createNextChildLMs, getBaselineOffset, getChangedKnuthElements, getChildLMs, getNextKnuthElements, getParent, getParentArea, getPSLM, hasLineAreaDescendant, initialize, isFinished, notifyPos, setFinished, setParent
protected boolean generatesReferenceArea
protected boolean generatesBlockArea
protected final FObj fobj
public AbstractBaseLayoutManager()
public AbstractBaseLayoutManager(FObj fo)
fo
- the formatting object for this layout managerpublic int getBaseLength(int lengthBase, FObj fobjx)
LengthBase
.getBaseLength
in interface PercentBaseContext
lengthBase
- Indicates which type of the base length value is to be returnedfobjx
- The FO object against which the percentage should be evaluatedprotected int getAncestorBlockAreaIPD()
protected int getAncestorBlockAreaBPD()
protected int getParentAreaIPD()
protected int getParentAreaBPD()
public int getReferenceAreaIPD()
protected int getReferenceAreaBPD()
public int getContentAreaIPD()
UnsupportedOperationException
.getContentAreaIPD
in interface LayoutManager
public int getContentAreaBPD()
UnsupportedOperationException
.getContentAreaBPD
in interface LayoutManager
public boolean getGeneratesReferenceArea()
getGeneratesReferenceArea
in interface LayoutManager
protected void setGeneratesReferenceArea(boolean generatesReferenceArea)
generatesReferenceArea
- if true the areas generates by this LM are
reference areas.public boolean getGeneratesBlockArea()
getGeneratesBlockArea
in interface LayoutManager
protected void setGeneratesBlockArea(boolean generatesBlockArea)
generatesBlockArea
- if true the areas generates by this LM are block areas.public boolean getGeneratesLineArea()
getGeneratesLineArea
in interface LayoutManager
public FObj getFObj()
getFObj
in interface LayoutManager
public List<ChangeBar> getChangeBarList()
public void reset()
reset
in interface LayoutManager
public boolean isRestartable()
true
if this layout manager is able to re-generate its
Knuth elements after an IPD change.isRestartable
in interface LayoutManager
true
if this layout manager can be restarted after an IPD
changepublic List getNextKnuthElements(LayoutContext context, int alignment, Stack lmStack, Position positionAtIPDChange, LayoutManager restartAtLM)
getNextKnuthElements
in interface LayoutManager
context
- the layout contextalignment
- the alignmentlmStack
- the stack of LMs that are active at the IPD changepositionAtIPDChange
- the position corresponding to the element
finishing the page before the IPD changerestartAtLM
- if not null, the layout manager from which to restart.
That is, the IPD change occurs between two block elements and not inside
a paragraphpublic void preserveChildrenAtEndOfLayout()
public void recreateChildrenLMs()
Copyright © 2022 Apache Software Foundation. All rights reserved.