SourceForge.net Logo
aXSL API 0.2

org.axsl.fo
Interface Fo

All Superinterfaces:
java.lang.Iterable<Fo>, javax.swing.tree.TreeNode
All Known Subinterfaces:
BasicLink, BidiOverride, Block, BlockContainer, Bookmark, BookmarkTitle, BookmarkTree, ChangeBarBegin, ChangeBarEnd, CharacterSequence, ColorProfile, Declarations, ExternalGraphic, Float, Flow, FoForeignXml, FolioPrefix, FolioSuffix, Footnote, FootnoteBody, FoScaled, GraftingPoint, IndexKeyReference, IndexPageCitationList, IndexPageCitationListSeparator, IndexPageCitationRangeSeparator, IndexPageNumberPrefix, IndexPageNumberSuffix, IndexRangeBegin, IndexRangeEnd, InitialPropertySet, Inline, InlineContainer, InstreamForeignObject, Leader, ListBlock, ListItem, ListItemBody, ListItemLabel, Marker, Metadata, MultiCase, MultiProperties, MultiPropertySet, MultiSwitch, MultiToggle, PageNumber, PageNumberCitation, PageNumberCitationLast, PageSequence, PageSequenceWrapper, Region, RegionAfter, RegionBefore, RegionBody, RegionEnd, RegionStart, RetrieveMarker, RetrieveTableMarker, Root, ScalingValueCitation, SimplePageMaster, StaticContent, SvgElement, Table, TableAndCaption, TableBody, TableCaption, TableCell, TableColumn, TableFooter, TableHeader, TableRow, Title, Wrapper

public interface Fo
extends javax.swing.tree.TreeNode, java.lang.Iterable<Fo>

Base interface for formatting objects. Implements the Iterable interface to provide an iterator over the child nodes.


Field Summary
static int DIMENSION_AUTO
          Constant used to designate the "auto" value for the block-progression-dimension and inline-progression-dimension properties.
 
Method Summary
 java.lang.Object acceptProxyFactory(ProxyFactory factory)
          Creates an appropriate proxy for this node.
 BasicLink ancestorBasicLink(FoContext context)
          Returns the nearest ancestor BasicLink.
 Fo ancestorListRelatedObject(FoContext context)
          Returns the nearest ancestor list-related object.
 Marker ancestorMarker()
          The nearest ancestor Marker instance.
 Table ancestorTable(FoContext context)
          Returns the nearest ancestor Table.
 Fo getChildAt(int childIndex)
          
 int getColumn()
          Returns the column number of the location of this node in the original document, if known.
 java.lang.String getContextMessage()
          Provides formatted information about the location (system-id, line, and column number from the parsed document) of this node, suitable for user messages.
 int getLine()
          Returns the line number of the location of this node in the original document, if known.
 java.lang.String getName()
          Returns the name of this formatting object.
 Fo getParent()
          
 int getSequentialIndex()
          Returns the unique sequential index assigned to this node.
 java.lang.String getSystemId()
          Returns any system-id information that is available about which document this node was parsed from.
 boolean isBlockLevelFo()
          Indicates whether this FO is a block-level FO.
 int qtyMarkerChildren()
          Returns the number of children of the FO that are Markers.
 boolean traitIsReferenceArea()
          Returns the value of the is-reference-area trait.
 
Methods inherited from interface javax.swing.tree.TreeNode
children, getAllowsChildren, getChildCount, getIndex, isLeaf
 
Methods inherited from interface java.lang.Iterable
iterator
 

Field Detail

DIMENSION_AUTO

static final int DIMENSION_AUTO
Constant used to designate the "auto" value for the block-progression-dimension and inline-progression-dimension properties.

See Also:
Constant Field Values
Method Detail

getParent

Fo getParent()

Specified by:
getParent in interface javax.swing.tree.TreeNode

getChildAt

Fo getChildAt(int childIndex)

Specified by:
getChildAt in interface javax.swing.tree.TreeNode

getSequentialIndex

int getSequentialIndex()

Returns the unique sequential index assigned to this node. Each node in the FOTree is required to have an index that is unique within the FOTree, and which is assigned sequentially starting at zero.

This index provides a way for systems external to the FOTree, like the Area Tree or a layout system, to add virtual fields to nodes in the FOTree without needing to modify or extend it, and without adding a significant amount of processing overhead. For example, for systems that use the FOTree to create an Area Tree, an object is usually needed to keep track of which Areas in the Area Tree were generated by which FONodes in the FOTree. Although a reference to this object could be embedded within the FOTree itself, this would add a concern to the FOTree that it should not have. Further, this would cause problems if, for example, two Area Tree implementation tried to access the same FOTree at the same time.

By using the sequential index, the external application can create an array-like data structure to store the references. So, for example, if the Area Tree wants to store a list of Areas generated by each FONode, it can create a List[] or ArrayList<List> (or any other data structure with efficient direct access by index), containing such Lists. Then, instead of getting the List directly from the FONode, the index is obtained instead, then the List is obtained from the data structure.

Note that the sequence of the indexes is not important, only their range. For example, if a given FOTree had 3 nodes, those nodes should always be numbered 0 thru 2. One implementation might number a fixed list of them 0, 1, 2, while another might number them 2, 0, 1. The requirement to number them from zero and sequentially is intened to minimize the amount of memory that is needed to store the array-like structures that these indexes will be used to access.

Returns:
The unique sequential index assigned to this node.

getSystemId

java.lang.String getSystemId()
Returns any system-id information that is available about which document this node was parsed from. This information is usually derived from a SAX Locator during parsing. However, this information will not be available for documents that were not parsed, for documents parsed with parsers that do not provide this information, or for documents that are downstream in a SAX chain.

Returns:
The system-id of this node if it is known, or null if it is not.

getLine

int getLine()
Returns the line number of the location of this node in the original document, if known. This information is usually derived from a SAX Locator during parsing. However, this information will not be available for documents that were not parsed, for documents parsed with parsers that do not provide this information, or for documents that are downstream in a SAX chain.

Returns:
The line number of this node if it is known, or zero if it is not.

getColumn

int getColumn()
Returns the column number of the location of this node in the original document, if known. This information is usually derived from a SAX Locator during parsing. However, this information will not be available for documents that were not parsed, for documents parsed with parsers that do not provide this information, or for documents that are downstream in a SAX chain.

Returns:
The column number of this node if it is known, or zero if it is not.

getContextMessage

java.lang.String getContextMessage()
Provides formatted information about the location (system-id, line, and column number from the parsed document) of this node, suitable for user messages.

Returns:
Formatted information about the location of this node.

acceptProxyFactory

java.lang.Object acceptProxyFactory(ProxyFactory factory)
Creates an appropriate proxy for this node. Uses a double-dispatch scheme (similar to that used in the Gang of Four "Visitor" pattern) to allow both the factory and the FONode subclass to be specified in a flexible way. Subclasses should typically return the value returned by a specific method in factory. For example, a subclass handling ExternalGraphic would be expected to return ProxyFactory.makeProxy(org.axsl.fo.fo.ExternalGraphic).

Parameters:
factory - The proxy factory that should be used to actually create the instance.
Returns:
The newly-created proxy.

ancestorMarker

Marker ancestorMarker()
The nearest ancestor Marker instance.

Returns:
The nearest ancestor Marker instance to this, or null if this has no ancestor Marker. A Marker instance should not return itself.

isBlockLevelFo

boolean isBlockLevelFo()
Indicates whether this FO is a block-level FO. Only block-level objects are considered in an object's ancestry for certain computations. See the percentage values for the inline-progression-dimension and block-progression-dimension properties for examples.

Returns:
True if this is a block-level FO, false otherwise.

traitIsReferenceArea

boolean traitIsReferenceArea()
Returns the value of the is-reference-area trait.

Returns:
True if this object type generates reference areas, false otherwise.
See Also:
"XSL-FO 1.0, Sections 4.1, 4.2.2, and 5.6", "XSL-FO 1.1, Sections 4.1, 4.2.2, and 5.6"

ancestorTable

Table ancestorTable(FoContext context)
Returns the nearest ancestor Table.

Parameters:
context - An object that knows how to resolve FO Tree context issues.
Returns:
The nearest Table, if any, that is an ancestor of this node, or null if there is none.

ancestorBasicLink

BasicLink ancestorBasicLink(FoContext context)
Returns the nearest ancestor BasicLink.

Parameters:
context - An object that knows how to resolve FO Tree context issues.
Returns:
The nearest BasicLink, if any, that is an ancestor of this node, or null if there is none.

ancestorListRelatedObject

Fo ancestorListRelatedObject(FoContext context)
Returns the nearest ancestor list-related object.

Parameters:
context - An object that knows how to resolve FO Tree context issues.
Returns:
The nearest ancestor ListItemLabel or ListItemBody object, or null if there is none.

getName

java.lang.String getName()
Returns the name of this formatting object. For example, an external-graphic object returns "external-graphic".

Returns:
The name of this formatting object.

qtyMarkerChildren

int qtyMarkerChildren()
Returns the number of children of the FO that are Markers.

Returns:
The number of child markers.

SourceForge.net Logo
aXSL API 0.2

This documentation was created August 8 2007 by The aXSL Group and may be freely copied. See license for details.