Class AbstractTextArea
java.lang.Object
org.apache.fop.area.AreaTreeObject
org.apache.fop.area.Area
org.apache.fop.area.inline.InlineArea
org.apache.fop.area.inline.InlineParent
org.apache.fop.area.inline.AbstractTextArea
- All Implemented Interfaces:
Serializable, Cloneable
- Direct Known Subclasses:
TextArea
Abstract base class for both TextArea and Character.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classthis class stores information about spaces and potential adjustments that can be used in order to re-compute adjustments when a page-number or a page-number-citation is resolvedNested classes/interfaces inherited from class InlineArea
InlineArea.InlineAdjustingInfo -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate static final longprivate intprivate intFields inherited from class InlineParent
autoSize, inlines, minChildOffsetFields inherited from class InlineArea
adjustingInfo, blockProgressionOffsetFields inherited from class 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, traitsFields inherited from class AreaTreeObject
extensionAttachments, foreignAttributes -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorAbstractTextArea(int stretch, int shrink, int adj) Constructor with extra parameters: create a TextAdjustingInfo object -
Method Summary
Modifier and TypeMethodDescriptionbooleanapplyVariationFactor(double variationFactor, int lineStretch, int lineShrink) recursively apply the variation factor to all descendant areasintGet baseline offset, i.e.intGet text letter space adjust.intGet text word space adjust.(package private) intReturns the block-progression-dimension that this area would have if it were taking its children elements into account.(package private) intReturns the offset that this area would have if its offset and size were taking children areas into account.voidsetBaselineOffset(int baselineOffset) Set the baseline offset.voidsetSpaceDifference(int spaceDiff) Set the difference between optimal width of a space and default width of a space according to the font; this part of the space adjustment is fixed and must not be multiplied by the variation factor.voidsetTextLetterSpaceAdjust(int textLetterSpaceAdjust) Set text letter space adjust.voidsetTextWordSpaceAdjust(int textWordSpaceAdjust) Set text word space adjust.Methods inherited from class InlineParent
addChildArea, collectInlineRuns, getChildAreas, resetChildrenLevel, setFromFootnoteMethods inherited from class InlineArea
getAdjustingInfo, getBlockProgressionOffset, getParentArea, handleIPDVariation, hasLineThrough, hasOverline, hasUnderline, increaseIPD, isAncestor, isAncestorOrSelf, isBlinking, notifyIPDVariation, setAdjustingInfo, setAdjustingInfo, setAdjustment, setBlockProgressionOffset, setParentAreaMethods inherited from class 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, isFromFootnote, resetBidiLevel, setAreaClass, setBidiLevel, setBPD, setChangeBarList, setIPD, setTraits, setWritingModeTraits, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
textWordSpaceAdjust
private int textWordSpaceAdjust -
textLetterSpaceAdjust
private int textLetterSpaceAdjust -
textAdjustingInfo
-
baselineOffset
private int baselineOffset
-
-
Constructor Details
-
AbstractTextArea
public AbstractTextArea()Default constructor -
AbstractTextArea
public AbstractTextArea(int stretch, int shrink, int adj) Constructor with extra parameters: create a TextAdjustingInfo object- Parameters:
stretch- the available stretch of the textshrink- the available shrink of the textadj- the current adjustment of the area
-
-
Method Details
-
getTextWordSpaceAdjust
public int getTextWordSpaceAdjust()Get text word space adjust.- Returns:
- the text word space adjustment
-
setTextWordSpaceAdjust
public void setTextWordSpaceAdjust(int textWordSpaceAdjust) Set text word space adjust.- Parameters:
textWordSpaceAdjust- the text word space adjustment
-
getTextLetterSpaceAdjust
public int getTextLetterSpaceAdjust()Get text letter space adjust.- Returns:
- the text letter space adjustment
-
setTextLetterSpaceAdjust
public void setTextLetterSpaceAdjust(int textLetterSpaceAdjust) Set text letter space adjust.- Parameters:
textLetterSpaceAdjust- the text letter space adjustment
-
setSpaceDifference
public void setSpaceDifference(int spaceDiff) Set the difference between optimal width of a space and default width of a space according to the font; this part of the space adjustment is fixed and must not be multiplied by the variation factor.- Parameters:
spaceDiff- the space difference
-
applyVariationFactor
public boolean applyVariationFactor(double variationFactor, int lineStretch, int lineShrink) recursively apply the variation factor to all descendant areas- Overrides:
applyVariationFactorin classInlineParent- 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
-
getBaselineOffset
public int getBaselineOffset()Get baseline offset, i.e. the distance from the before edge of this area to the nominal baseline.- Returns:
- the baseline offset
-
setBaselineOffset
public void setBaselineOffset(int baselineOffset) Set the baseline offset.- Parameters:
baselineOffset- the baseline offset
-
getVirtualOffset
int getVirtualOffset()Description copied from class:InlineAreaReturns 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.- Overrides:
getVirtualOffsetin classInlineParent- 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
int getVirtualBPD()Description copied from class:InlineAreaReturns the block-progression-dimension that this area would have if it were taking its children elements into account. See InlineArea.getVirtualOffset().- Overrides:
getVirtualBPDin classInlineParent- Returns:
- the bpd
-