Package org.apache.fop.area.inline
Class InlineArea
- java.lang.Object
-
- org.apache.fop.area.AreaTreeObject
-
- org.apache.fop.area.Area
-
- org.apache.fop.area.inline.InlineArea
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
- Direct Known Subclasses:
Anchor
,InlineBlockParent
,InlineParent
,InlineViewport
,Leader
,Space
,SpaceArea
,WordArea
public class InlineArea extends Area
Inline Area This area is for all inline areas that can be placed in a line area.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
InlineArea.InlineAdjustingInfo
this class stores information about potential adjustments that can be used in order to re-compute adjustments when a page-number or a page-number-citation is resolved
-
Field Summary
Fields Modifier and Type Field Description protected InlineArea.InlineAdjustingInfo
adjustingInfo
The adjustment information objectprotected int
blockProgressionOffset
offset position from before edge of parent areaprivate Area
parentArea
parent area it is needed in order to recompute adjust ratio and indents when a page-number or a page-number-citation is resolvedprivate static long
serialVersionUID
private int
storedIPDVariation
ipd variation of child areas: if this area has not already been added and cannot notify its parent area, store the variation and wait for the parent area to be set-
Fields inherited from class org.apache.fop.area.Area
bidiLevel, bpd, CLASS_ABSOLUTE, CLASS_BEFORE_FLOAT, CLASS_FIXED, CLASS_FOOTNOTE, CLASS_MAX, CLASS_NORMAL, CLASS_SIDE_FLOAT, effectiveIPD, ipd, log, ORIENT_0, ORIENT_180, ORIENT_270, ORIENT_90, traits
-
Fields inherited from class org.apache.fop.area.AreaTreeObject
extensionAttachments, foreignAttributes
-
-
Constructor Summary
Constructors Modifier Constructor Description InlineArea()
Default constructor for inline area.protected
InlineArea(int blockProgressionOffset, int bidiLevel)
Instantiate inline area.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChildArea(Area childArea)
Set the parent for the child area.boolean
applyVariationFactor(double variationFactor, int lineStretch, int lineShrink)
recursively apply the variation factor to all descendant areasjava.util.List
collectInlineRuns(java.util.List runs)
Collection bidi inline runs.InlineArea.InlineAdjustingInfo
getAdjustingInfo()
int
getBlockProgressionOffset()
Get the block progression offset of this inline area.Area
getParentArea()
(package private) int
getVirtualBPD()
Returns the block-progression-dimension that this area would have if it were taking its children elements into account.(package private) int
getVirtualOffset()
Returns the offset that this area would have if its offset and size were taking children areas into account.void
handleIPDVariation(int ipdVariation)
Apply IPD variation.boolean
hasLineThrough()
boolean
hasOverline()
boolean
hasUnderline()
void
increaseIPD(int ipd)
Increase the inline progression dimensions of this area.boolean
isAncestor(InlineArea ia)
Determine if inline area IA is an ancestor inline area of this area.boolean
isAncestorOrSelf(InlineArea ia)
Determine if inline area IA is an ancestor inline area or same as this area.boolean
isBlinking()
protected void
notifyIPDVariation(int ipdVariation)
notify the parent area about the ipd variation of this area or of a descendant areavoid
setAdjustingInfo(int stretch, int shrink, int adjustment)
Create a new adjustment information objectvoid
setAdjustingInfo(InlineArea.InlineAdjustingInfo adjustingInfo)
Sets the adjustment information from an existing objectvoid
setAdjustment(int adjustment)
Modify the adjustment value in the adjustment information objectvoid
setBlockProgressionOffset(int blockProgressionOffset)
Set the block progression offset of this inline area.void
setParentArea(Area parentArea)
-
Methods inherited from class org.apache.fop.area.Area
activateEffectiveIPD, addTrait, clone, getAllocBPD, getAllocIPD, getAreaClass, getBidiLevel, getBorderAndPaddingWidthAfter, getBorderAndPaddingWidthBefore, getBorderAndPaddingWidthEnd, getBorderAndPaddingWidthStart, getBPD, getChangeBarList, getEffectiveAllocIPD, getEffectiveIPD, getIPD, getSpaceAfter, getSpaceBefore, getSpaceEnd, getSpaceStart, getTrait, getTraitAsBoolean, getTraitAsInteger, getTraits, hasTrait, hasTraits, resetBidiLevel, setAreaClass, setBidiLevel, setBPD, setChangeBarList, setIPD, setTraits, setWritingModeTraits, toString
-
Methods inherited from class org.apache.fop.area.AreaTreeObject
addExtensionAttachment, getExtensionAttachments, getForeignAttributes, getForeignAttributeValue, hasExtensionAttachments, setExtensionAttachments, setForeignAttribute, setForeignAttributes
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
blockProgressionOffset
protected int blockProgressionOffset
offset position from before edge of parent area
-
parentArea
private Area parentArea
parent area it is needed in order to recompute adjust ratio and indents when a page-number or a page-number-citation is resolved
-
storedIPDVariation
private int storedIPDVariation
ipd variation of child areas: if this area has not already been added and cannot notify its parent area, store the variation and wait for the parent area to be set
-
adjustingInfo
protected InlineArea.InlineAdjustingInfo adjustingInfo
The adjustment information object
-
-
Method Detail
-
getAdjustingInfo
public InlineArea.InlineAdjustingInfo getAdjustingInfo()
- Returns:
- the adjustment information object
-
setAdjustingInfo
public void setAdjustingInfo(int stretch, int shrink, int adjustment)
Create a new adjustment information object- Parameters:
stretch
- the available space for stretchingshrink
- the available space for shrinkingadjustment
- space adjustment type
-
setAdjustingInfo
public void setAdjustingInfo(InlineArea.InlineAdjustingInfo adjustingInfo)
Sets the adjustment information from an existing object- Parameters:
adjustingInfo
- the existing adjustment object
-
setAdjustment
public void setAdjustment(int adjustment)
Modify the adjustment value in the adjustment information object- Parameters:
adjustment
- the new adjustment value
-
increaseIPD
public void increaseIPD(int ipd)
Increase the inline progression dimensions of this area. This is used for inline parent areas that contain mulitple child areas.- Parameters:
ipd
- the inline progression to increase by
-
setBlockProgressionOffset
public void setBlockProgressionOffset(int blockProgressionOffset)
Set the block progression offset of this inline area. This is used to set the offset of the inline area which is relative to the before edge of the parent area.- Parameters:
blockProgressionOffset
- the offset
-
getBlockProgressionOffset
public int getBlockProgressionOffset()
Get the block progression offset of this inline area. This returns the offset of the inline area relative to the before edge of the parent area.- Returns:
- the blockProgressionOffset
-
setParentArea
public void setParentArea(Area parentArea)
- Parameters:
parentArea
- The parentArea to set.
-
getParentArea
public Area getParentArea()
- Returns:
- Returns the parentArea.
-
addChildArea
public void addChildArea(Area childArea)
Set the parent for the child area. Add a child to this area. The default is to do nothing. Subclasses must override to do something if they can have child areas.- Overrides:
addChildArea
in classArea
- Parameters:
childArea
- the child area to add
-
hasUnderline
public boolean hasUnderline()
- Returns:
- true if the inline area is underlined.
-
hasOverline
public boolean hasOverline()
- Returns:
- true if the inline area is overlined.
-
hasLineThrough
public boolean hasLineThrough()
- Returns:
- true if the inline area has a line through.
-
isBlinking
public boolean isBlinking()
- Returns:
- true if the inline area is blinking.
-
applyVariationFactor
public boolean applyVariationFactor(double variationFactor, int lineStretch, int lineShrink)
recursively apply the variation factor to all descendant areas- Parameters:
variationFactor
- the variation factor that must be applied to adjustmentslineStretch
- the total stretch of the linelineShrink
- the total shrink of the line- Returns:
- true if there is an UnresolvedArea descendant
-
handleIPDVariation
public void handleIPDVariation(int ipdVariation)
Apply IPD variation.- Parameters:
ipdVariation
- the variation
-
notifyIPDVariation
protected void notifyIPDVariation(int ipdVariation)
notify the parent area about the ipd variation of this area or of a descendant area- Parameters:
ipdVariation
- the difference between new and old ipd
-
getVirtualOffset
int getVirtualOffset()
Returns the offset that this area would have if its offset and size were taking children areas into account. The bpd of an inline area is taken from its nominal font and doesn't depend on the bpds of its children elements. However, in the case of a basic-link element we want the active area to cover all of the children elements.- Returns:
- the offset that this area would have if the before-edge of its content-rectangle were coinciding with the beforest before-edge of its children allocation-rectangles.
- See Also:
getVirtualBPD()
,BasicLinkArea
-
getVirtualBPD
int getVirtualBPD()
Returns the block-progression-dimension that this area would have if it were taking its children elements into account. See getVirtualOffset().- Returns:
- the bpd
-
collectInlineRuns
public java.util.List collectInlineRuns(java.util.List runs)
Collection bidi inline runs.- Parameters:
runs
- current list of inline runs- Returns:
- modified list of inline runs, having appended new run
-
isAncestorOrSelf
public boolean isAncestorOrSelf(InlineArea ia)
Determine if inline area IA is an ancestor inline area or same as this area.- Parameters:
ia
- inline area to test- Returns:
- true if specified inline area is an ancestor or same as this area
-
isAncestor
public boolean isAncestor(InlineArea ia)
Determine if inline area IA is an ancestor inline area of this area.- Parameters:
ia
- inline area to test- Returns:
- true if specified inline area is an ancestor of this area
-
-