org.apache.fop.area.inline

Class UnresolvedPageNumber

Implemented Interfaces:
Resolvable, Serializable

public class UnresolvedPageNumber
extends TextArea
implements Resolvable

Unresolvable page number area. This is a word area that resolves itself to a page number from an id reference.

Nested Class Summary

Nested classes/interfaces inherited from class org.apache.fop.area.inline.AbstractTextArea

AbstractTextArea.TextAdjustingInfo

Nested classes/interfaces inherited from class org.apache.fop.area.inline.InlineArea

InlineArea.InlineAdjustingInfo

Field Summary

static boolean
FIRST
Indicates that the reference refers to the first area generated by a formatting object.
static boolean
LAST
Indicates that the reference refers to the last area generated by a formatting object.

Fields inherited from class org.apache.fop.area.inline.InlineParent

autoSize, inlines

Fields inherited from class org.apache.fop.area.inline.InlineArea

adjustingInfo, offset

Fields inherited from class org.apache.fop.area.Area

BT, CLASS_ABSOLUTE, CLASS_BEFORE_FLOAT, CLASS_FIXED, CLASS_FOOTNOTE, CLASS_MAX, CLASS_NORMAL, CLASS_SIDE_FLOAT, LR, ORIENT_0, ORIENT_180, ORIENT_270, ORIENT_90, RL, TB, bpd, ipd, log, props

Fields inherited from class org.apache.fop.area.AreaTreeObject

foreignAttributes

Constructor Summary

UnresolvedPageNumber(String id, Font f)
Create a new unresolved page number.
UnresolvedPageNumber(String id, Font f, boolean type)
Create a new unresolved page number.

Method Summary

boolean
applyVariationFactor(double variationFactor, int lineStretch, int lineShrink)
recursively apply the variation factor to all descendant areas
String[]
getIDRefs()
Get the id references for this area.
boolean
isResolved()
Check if this is resolved.
void
resolveIDRef(String id, List pages)
Resolve the page number idref This resolves the idref for this object by getting the page number string from the first page in the list of pages that apply for this ID.

Methods inherited from class org.apache.fop.area.inline.TextArea

addSpace, addWord, addWord, getText, removeText

Methods inherited from class org.apache.fop.area.inline.AbstractTextArea

applyVariationFactor, getBaselineOffset, getTextLetterSpaceAdjust, getTextWordSpaceAdjust, setBaselineOffset, setSpaceDifference, setTextLetterSpaceAdjust, setTextWordSpaceAdjust

Methods inherited from class org.apache.fop.area.inline.InlineParent

addChildArea, applyVariationFactor, getChildAreas

Methods inherited from class org.apache.fop.area.inline.InlineArea

addChildArea, applyVariationFactor, getAdjustingInfo, getOffset, getParentArea, handleIPDVariation, hasLineThrough, hasOverline, hasUnderline, increaseIPD, isBlinking, notifyIPDVariation, setAdjustingInfo, setAdjustment, setOffset, setParentArea

Methods inherited from class org.apache.fop.area.Area

addChildArea, addTrait, addTrait, getAllocBPD, getAllocIPD, getAreaClass, getBPD, getBooleanTrait, getBorderAndPaddingWidthAfter, getBorderAndPaddingWidthBefore, getBorderAndPaddingWidthEnd, getBorderAndPaddingWidthStart, getIPD, getSpaceAfter, getSpaceBefore, getSpaceEnd, getSpaceStart, getTrait, getTraitAsInteger, getTraits, hasTrait, hasTraits, setAreaClass, setBPD, setIPD, toString

Methods inherited from class org.apache.fop.area.AreaTreeObject

getForeignAttributeValue, getForeignAttributes, setForeignAttribute, setForeignAttributes

Field Details

FIRST

public static final boolean FIRST
Indicates that the reference refers to the first area generated by a formatting object.
Field Value:
true

LAST

public static final boolean LAST
Indicates that the reference refers to the last area generated by a formatting object.
Field Value:
false

Constructor Details

UnresolvedPageNumber

public UnresolvedPageNumber(String id,
                            Font f)
Create a new unresolved page number.
Parameters:
id - the id reference for resolving this
f - the font for formatting the page number

UnresolvedPageNumber

public UnresolvedPageNumber(String id,
                            Font f,
                            boolean type)
Create a new unresolved page number.
Parameters:
id - the id reference for resolving this
f - the font for formatting the page number
type - indicates whether the reference refers to the first or last area generated by a formatting object

Method Details

applyVariationFactor

public boolean applyVariationFactor(double variationFactor,
                                    int lineStretch,
                                    int lineShrink)
recursively apply the variation factor to all descendant areas
Overrides:
applyVariationFactor in interface AbstractTextArea
Parameters:
variationFactor - the variation factor that must be applied to adjustment ratios
lineStretch - the total stretch of the line
lineShrink - the total shrink of the line
Returns:
true if there is an UnresolvedArea descendant

getIDRefs

public String[] getIDRefs()
Get the id references for this area.
Specified by:
getIDRefs in interface Resolvable
Returns:
the id reference for this unresolved page number

isResolved

public boolean isResolved()
Check if this is resolved.
Specified by:
isResolved in interface Resolvable
Returns:
true when this has been resolved

resolveIDRef

public void resolveIDRef(String id,
                         List pages)
Resolve the page number idref This resolves the idref for this object by getting the page number string from the first page in the list of pages that apply for this ID. The page number text is then set to the String value of the page number.
Specified by:
resolveIDRef in interface Resolvable
Parameters:
id - an id whose PageViewports have been determined
pages - the list of PageViewports associated with this ID

Copyright 1999-2007 The Apache Software Foundation. All Rights Reserved.