org.foray.area
Class AreaTree

java.lang.Object
  extended by org.foray.common.AbstractOrderedTreeNode
      extended by org.foray.area.AreaNode
          extended by org.foray.area.NonArea
              extended by org.foray.area.AreaTree
All Implemented Interfaces:
Iterable<org.axsl.galley.AreaNode>, TreeNode, org.axsl.area.AreaNode, org.axsl.area.AreaTree, org.axsl.area.PageCollectionFactory, org.axsl.fo.FoContext, org.axsl.galley.Galley, OrderedTreeNode

public final class AreaTree
extends NonArea
implements org.axsl.galley.Galley, org.axsl.area.AreaTree

The root of the AreaTree.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.foray.common.AbstractOrderedTreeNode
AbstractOrderedTreeNode.PostOrderDescendantIterator
 
Method Summary
 void contentComplete()
           
 Area firstNormalAreaReturned(String id)
          Find the first normal area returned by the formatting object with an "id" trait matching the "id" parameter.
 String getAreaName()
           
 AreaTree getAreaTree()
          Returns the ancestor AreaTree for this area.
 String getAuthor()
           
 org.axsl.galley.BookmarkTree getBookmarkTree()
           
 List<PageCollection> getChildren()
          Return the List of this node's children.
 List<org.axsl.fo.fo.Marker> getDocumentMarkers()
          Return the markers in this document.
protected  FOLinkage getFONodeLinkage(org.axsl.fo.Fo node)
          Returns the FOLinkage for a given FONode.
 org.axsl.font.FontConsumer getFontConsumer()
           
 org.axsl.galley.Galley getGalley()
          Returns the ancestor Galley for this area.
 String getKeywords()
           
 FOLinkage getLinkage()
          Returns the raw "generated by" instance.
 org.apache.commons.logging.Log getLogger()
          Return the logger.
 List<PageCollection> getPageCollectionsProcessed()
          Returns the collection of page collections that have been processed.
 AreaNode getParent()
           
 org.axsl.fo.fo.Root getRoot()
          Return the FO Root that is generating this area tree.
 String getSubject()
           
 org.axsl.text.TextServer getTextServer()
           
 String getTitle()
           
 boolean isPageQueued(PageRA page)
          Indicates whether a given page is completed and in the queue to be rendered.
 PageCollection makePageCollection(org.axsl.fo.fo.PageSequence pageSequence)
           
protected  void notifyPageComplete(PageRA page)
          Notify all listeners that a "Page Complete" event has been fired.
protected  boolean optimize()
          This method should be run after layout is complete, allowing cleanup and adjustments that do not affect the placement of the areas to be computed before the page is rendered.
 void registerListener(org.axsl.area.AreaTreeListener listener)
           
 void render(org.axsl.galley.RenderVisitor visitor)
           
 org.axsl.fo.Fo retrieveId(String id)
          Retrieves the FObj instance that is associated with id.
protected  void setFONodeLinkage(org.axsl.fo.Fo node, FOLinkage linkage)
          Sets the linkage for a given FONode.
 void setParent(AreaNode node)
          Sets the parent node.
 org.axsl.fo.fo.Root traitGeneratedBy()
           
 void unRegisterListener(org.axsl.area.AreaTreeListener listener)
          Remove an object from the list of listeners to be notified about AreaTreeEvent firings.
 
Methods inherited from class org.foray.area.AreaNode
ancestorArea, ancestorBlockAreaNotALineArea, ancestorBlockContentFactory, ancestorBlockOrRa, ancestorGeneratedByBlockLevelFO, ancestorLineArea, ancestorNormalBlockArea, ancestorPageCollection, ancestorReferenceArea, ancestorSpanRA, ancestorTableArea, bpdAncestorBlockOrRa, getAllowsChildren, getChildAt, getColor, getContainingReferenceArea, getFirstAreaChild, getFirstChild, getGraftingPoint, getLastAreaChild, getLastChild, getNextChildOfGeneratedBy, getNextSiblingArea, getNormalLinkage, getNormalLinkage, getOrderedParent, getPage, getPreviousChildOfGeneratedBy, getPreviousSiblingArea, getSiblings, hasUnresolvedRefId, heightContainingBlock, ipdAncestorBlockArea, ipdAncestorBlockOrRa, ipdContainingRefArea, ipdParentArea, isFirst, isFirstChildOfGeneratedBy, isGeneratedByBlockLevelFo, isLast, isLastChildOfGeneratedBy, iterator, linkage, nearestArea, nearestBeforeFloatArea, nearestFootnoteArea, nearestGeneratedByBlockLevelFo, nearestNormalBlockArea, nearestTableArea, optimizeChildren, registerWithLinkage, remove, removeChild, tableWidth, widthContainingBlock
 
Methods inherited from class org.foray.common.AbstractOrderedTreeNode
children, getChildCount, getFirstLeaf, getIndex, getLastLeaf, getLevel, getNextLeaf, getNextSibling, getPreviousLeaf, getPreviousSibling, getSharedAncestor, hasChildren, isLeaf, isNodeAncestor, isNodeDescendant, nextPostOrderNode, nextPreOrderNode, postOrderDescendantIterator, siblingIndex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.axsl.galley.AreaNode
getChildAt
 
Methods inherited from interface java.lang.Iterable
iterator
 
Methods inherited from interface org.axsl.area.AreaNode
ancestorArea, ancestorBlockContentFactory, ancestorNormalBlockArea, ancestorTableArea, getPage, isFirstChildOfGeneratedBy, nearestArea, nearestGeneratedByBlockLevelFo, removeChild, siblingIndex
 
Methods inherited from interface javax.swing.tree.TreeNode
children, getAllowsChildren, getChildCount, getIndex, isLeaf
 
Methods inherited from interface org.axsl.fo.FoContext
bpdAncestorBlockOrRa, getGraftingPoint, heightContainingBlock, ipdAncestorBlockArea, ipdAncestorBlockOrRa, ipdContainingRefArea, ipdParentArea, isFirst, isLast, tableWidth, widthContainingBlock
 

Method Detail

makePageCollection

public PageCollection makePageCollection(org.axsl.fo.fo.PageSequence pageSequence)
                                  throws org.axsl.area.AreaTreeException
Specified by:
makePageCollection in interface org.axsl.area.PageCollectionFactory
Throws:
org.axsl.area.AreaTreeException

getFontConsumer

public org.axsl.font.FontConsumer getFontConsumer()
Specified by:
getFontConsumer in interface org.axsl.area.AreaTree
Specified by:
getFontConsumer in interface org.axsl.galley.Galley

getDocumentMarkers

public List<org.axsl.fo.fo.Marker> getDocumentMarkers()
Return the markers in this document.

Returns:
The markers in this document.

getTextServer

public org.axsl.text.TextServer getTextServer()
Specified by:
getTextServer in interface org.axsl.area.AreaTree

getLogger

public org.apache.commons.logging.Log getLogger()
Description copied from class: AreaNode
Return the logger.

Overrides:
getLogger in class AreaNode
Returns:
The logger.

contentComplete

public void contentComplete()
Specified by:
contentComplete in interface org.axsl.area.AreaTree

getRoot

public org.axsl.fo.fo.Root getRoot()
Return the FO Root that is generating this area tree.

Returns:
The FO Root.

getAreaTree

public AreaTree getAreaTree()
Returns the ancestor AreaTree for this area. Overrides the superclass method, because this is the object being sought.

Specified by:
getAreaTree in interface org.axsl.area.AreaNode
Overrides:
getAreaTree in class AreaNode
Returns:
The ancestor AreaTree for this area.

getGalley

public org.axsl.galley.Galley getGalley()
Returns the ancestor Galley for this area. Overrides the superclass method, because this is the object being sought.

Overrides:
getGalley in class AreaNode
Returns:
The ancestor Galley for this area.

retrieveId

public org.axsl.fo.Fo retrieveId(String id)
Retrieves the FObj instance that is associated with id.

Parameters:
id - The id whose FObj instance is sought.
Returns:
The FObj instance that is associated with id.

firstNormalAreaReturned

public Area firstNormalAreaReturned(String id)
Find the first normal area returned by the formatting object with an "id" trait matching the "id" parameter.

Parameters:
id - The id whose first normal area is sought.
Returns:
The first normal area returned by the FObj instance whose "id" trait matches the "id" parameter, or null if none is found.

registerListener

public void registerListener(org.axsl.area.AreaTreeListener listener)
Specified by:
registerListener in interface org.axsl.area.AreaTree

unRegisterListener

public void unRegisterListener(org.axsl.area.AreaTreeListener listener)
Remove an object from the list of listeners to be notified about AreaTreeEvent firings.

Parameters:
listener - The listener to be unregistered.

notifyPageComplete

protected void notifyPageComplete(PageRA page)
Notify all listeners that a "Page Complete" event has been fired.

Parameters:
page - The PageArea instance that was just completed.

getAreaName

public String getAreaName()
Specified by:
getAreaName in interface org.axsl.area.AreaNode

render

public void render(org.axsl.galley.RenderVisitor visitor)
            throws org.axsl.galley.GalleyVisitorException
Throws:
org.axsl.galley.GalleyVisitorException

getPageCollectionsProcessed

public List<PageCollection> getPageCollectionsProcessed()
Returns the collection of page collections that have been processed.

Returns:
Returns the pageCollectionsProcessed.

getParent

public AreaNode getParent()
Specified by:
getParent in interface TreeNode
Specified by:
getParent in class AreaNode

setParent

public void setParent(AreaNode node)
               throws org.axsl.area.AreaTreeException
Description copied from class: AreaNode
Sets the parent node.

Specified by:
setParent in class AreaNode
Parameters:
node - The new parent node.
Throws:
org.axsl.area.AreaTreeException - If the parent node is not compatible with the implementations specification for a parent node.

getChildren

public List<PageCollection> getChildren()
Description copied from class: AbstractOrderedTreeNode
Return the List of this node's children.

Specified by:
getChildren in class AreaNode
Returns:
The List of this node's children.

optimize

protected boolean optimize()
Description copied from class: AreaNode
This method should be run after layout is complete, allowing cleanup and adjustments that do not affect the placement of the areas to be computed before the page is rendered. For example, empty areas should be removed. Also classes like LineArea can use this to adjust word-spacing and other variables. NOTE: This method is called recursively by each node. The process starts at PageRA.layoutComplete().

Specified by:
optimize in class AreaNode
Returns:
True iff the Area node thinks it should be removed.

getLinkage

public FOLinkage getLinkage()
Description copied from class: AreaNode
Returns the raw "generated by" instance.

Specified by:
getLinkage in class AreaNode
Returns:
The raw linkage item.

traitGeneratedBy

public org.axsl.fo.fo.Root traitGeneratedBy()
Specified by:
traitGeneratedBy in interface org.axsl.area.AreaNode
Specified by:
traitGeneratedBy in class AreaNode

getFONodeLinkage

protected FOLinkage getFONodeLinkage(org.axsl.fo.Fo node)
Returns the FOLinkage for a given FONode.

Parameters:
node - The FONode whose linkage is needed.
Returns:
The FOLinkage for node, or null if there is none.

setFONodeLinkage

protected void setFONodeLinkage(org.axsl.fo.Fo node,
                                FOLinkage linkage)
Sets the linkage for a given FONode.

Parameters:
node - The node whose linkage is to be set.
linkage - The linkage for node.

getTitle

public String getTitle()
Specified by:
getTitle in interface org.axsl.galley.Galley

getAuthor

public String getAuthor()
Specified by:
getAuthor in interface org.axsl.galley.Galley

getSubject

public String getSubject()
Specified by:
getSubject in interface org.axsl.galley.Galley

getKeywords

public String getKeywords()
Specified by:
getKeywords in interface org.axsl.galley.Galley

isPageQueued

public boolean isPageQueued(PageRA page)
Indicates whether a given page is completed and in the queue to be rendered.

Parameters:
page - The page being tested.
Returns:
True iff the given page is in the queue of completed pages.

getBookmarkTree

public org.axsl.galley.BookmarkTree getBookmarkTree()
Specified by:
getBookmarkTree in interface org.axsl.galley.Galley


Copyright © 2017. All rights reserved.