org.foray.area
Class PageRA

java.lang.Object
  extended by org.foray.common.AbstractOrderedTreeNode
      extended by org.foray.area.AreaNode
          extended by org.foray.area.Area
              extended by org.foray.area.AreaFixed
                  extended by org.foray.area.PageRA
All Implemented Interfaces:
Iterable<org.axsl.galley.AreaNode>, TreeNode, org.axsl.area.Area, org.axsl.area.AreaNode, org.axsl.area.PageArea, org.axsl.fo.FoContext, org.axsl.galley.Page, OrderedTreeNode

public final class PageRA
extends AreaFixed
implements org.axsl.galley.Page, org.axsl.area.PageArea

Area containing a page.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.foray.common.AbstractOrderedTreeNode
AbstractOrderedTreeNode.PostOrderDescendantIterator
 
Method Summary
 org.axsl.fo.fo.Marker bestMarker(org.axsl.fo.fo.RetrieveMarker retrieve)
           
 org.axsl.common.value.RelativeAxis contentStackingAxis()
          Returns the content stacking axis for this area.
 int crBpd()
           
 int crIpd()
           
 int crOriginBPDOffset()
          The difference, in millipoints, between the page-viewport-area's before-edge and this Area's content-rectangle before-edge.
 int crOriginIPDOffset()
          The difference, in millipoints, between the page-viewport-area's start-edge and this Area's content-rectangle start-edge.
 int crOriginX()
           
 int crOriginY()
           
 org.axsl.galley.AreaNode firstUnresolvedRefId()
           
 String getAreaName()
           
 org.axsl.common.value.Compass getBindingEdge()
          Returns the relative direction that matches the binding edge for this page.
 List<AreaNode> getChildren()
          Return the List of this node's children.
 CharSequence getFormattedNumber()
           
 int getHeight()
           
 FOLinkage getLinkage()
          Returns the raw "generated by" instance.
 List<org.axsl.fo.fo.Marker> getMarkers()
          Returns the markers found on this page.
 int getNumber()
           
 Area getOverflowArea(Area childRequesting)
          This method is used by child Areas to ask the parent Area into which Area the child Area's overflow should be placed.
 PageRA getPage()
           Overrides the Area method, because this is the Page that is being sought.
 PageCollection getPageCollection()
           
 org.axsl.fo.fo.SimplePageMaster getPageMaster()
           
 org.axsl.fo.fo.PageSequence getPageSequence()
          Returns the page-sequence that generated this page.
 PageCollection getParent()
           
 RegionRA getRegionAfter()
           
 RegionRA getRegionBefore()
           
 Collection<RegionRABody> getRegionBodies()
           
 RegionRABody getRegionBody(String regionName)
          Returns the region-body area for a named region.
 RegionRA getRegionEnd()
           
 RegionRA getRegionStart()
           
 int getWidth()
           
 boolean isBlank()
          Indicates whether this page is a blank page or not.
 boolean isReleasable()
          Indicates whether this page is ready to be released for rendering.
 void layoutComplete()
           
 Area nearestGeneratedByBlockLevelFo()
           Overrides the Area method, because there will be nothing above here that was generated by a block-level FO.
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 registerMarker(org.axsl.fo.fo.Marker marker)
           
 void render(org.axsl.galley.RenderVisitor visitor)
           
 void setFormattedNumber(CharSequence number)
          Sets the formatted page number for this page.
 void setNumber(int number)
          Sets the page number for this page.
 void setParent(AreaNode node)
          Sets the parent node.
 int traitBorderAfterWidth()
          Returns the border-after-width trait for this area.
 int traitBorderBeforeWidth()
          Returns the border-before-width trait for this area.
 int traitBorderEndWidth()
          Returns the border-end-width trait for this area.
 int traitBorderStartWidth()
          Returns the border-start-width trait for this area.
 int traitEndIndent()
          Returns the end-indent trait.
 org.axsl.fo.fo.SimplePageMaster traitGeneratedBy()
           
 int traitPaddingAfter()
          Returns the padding-after trait for this area.
 int traitPaddingBefore()
          Returns the padding-before trait for this area.
 int traitPaddingEnd()
          Returns the padding-end trait for this area.
 int traitPaddingStart()
          Returns the padding-start trait for this area.
 int traitPageHeight()
          Returns the page-height trait of this area.
 int traitPageWidth()
          Returns the page-width trait of this area.
 int traitSpaceAfterOptimum()
          Returns the space-after optimum trait for this area.
 int traitSpaceBeforeOptimum()
          Returns the space-before optimum trait for this area.
 int traitSpaceEndOptimum()
          Returns the space-end optimum trait for this area.
 int traitSpaceStartOptimum()
          Returns the space-start optimum trait for this area.
 int traitStartIndent()
          Returns the start-indent trait.
 void unregisterMarker(org.axsl.fo.fo.Marker marker)
          Unregister a marker for this page.
 
Methods inherited from class org.foray.area.AreaFixed
getProgressionDimension, incrementProgressionDimension, isAbsolutelyPositioned, pdAvailable, pdUsedBySiblings, setMinimumProgressionDimension, setProgressionDimension
 
Methods inherited from class org.foray.area.Area
brBpd, brIpd, brOriginBPDOffset, brOriginIPDOffset, brOriginX, brOriginY, brPoints, contentStackingAxisAbsolute, contentStackingDirectionAbsolute, crPoints, destinationName, generatedByExists, generatedByName, getAreaParent, getBPAxis, getFontWritingMode, getIPAxis, getNearestAncestorAreaContainer, getWritingMode, hasFenceFollowing, hasFencePreceding, isBlockArea, isFirstChildOfParent, isInNormalFlow, isLastChildOfParent, isLinkRoot, larBPD, larIPD, larOriginX, larOriginY, linkDestination, linkType, narBPD, narIPD, narOriginX, narOriginY, nearestArea, parentAllocationWidth, prBpd, prIpd, prOriginBPDOffset, prOriginIPDOffset, prOriginX, prOriginY, referenceOrientationCumulative, shouldAdjustParentPD, traitAreaClass, traitId, traitIsFirst, traitIsLast, traitIsReferenceArea, traitWhiteSpaceTreatment
 
Methods inherited from class org.foray.area.AreaNode
ancestorArea, ancestorBlockAreaNotALineArea, ancestorBlockContentFactory, ancestorBlockOrRa, ancestorGeneratedByBlockLevelFO, ancestorLineArea, ancestorNormalBlockArea, ancestorPageCollection, ancestorReferenceArea, ancestorSpanRA, ancestorTableArea, bpdAncestorBlockOrRa, getAllowsChildren, getAreaTree, getChildAt, getColor, getContainingReferenceArea, getFirstAreaChild, getFirstChild, getGalley, getGraftingPoint, getLastAreaChild, getLastChild, getLogger, getNextChildOfGeneratedBy, getNextSiblingArea, getNormalLinkage, getNormalLinkage, getOrderedParent, getPreviousChildOfGeneratedBy, getPreviousSiblingArea, getSiblings, hasUnresolvedRefId, heightContainingBlock, ipdAncestorBlockArea, ipdAncestorBlockOrRa, ipdContainingRefArea, ipdParentArea, isFirst, isFirstChildOfGeneratedBy, isGeneratedByBlockLevelFo, isLast, isLastChildOfGeneratedBy, iterator, linkage, nearestBeforeFloatArea, nearestFootnoteArea, 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.Area
brBpd, brIpd, brOriginX, brOriginY, destinationName, generatedByExists, generatedByName, isLinkRoot, linkDestination, linkType, traitId
 
Methods inherited from interface org.axsl.galley.AreaNode
getChildAt, getGalley
 
Methods inherited from interface javax.swing.tree.TreeNode
children, getAllowsChildren, getChildCount, getIndex, isLeaf
 
Methods inherited from interface java.lang.Iterable
iterator
 
Methods inherited from interface org.axsl.area.AreaNode
ancestorArea, ancestorBlockContentFactory, ancestorNormalBlockArea, ancestorTableArea, getAreaTree, isFirstChildOfGeneratedBy, removeChild, siblingIndex
 
Methods inherited from interface org.axsl.fo.FoContext
bpdAncestorBlockOrRa, getGraftingPoint, heightContainingBlock, ipdAncestorBlockArea, ipdAncestorBlockOrRa, ipdContainingRefArea, ipdParentArea, isFirst, isLast, tableWidth, widthContainingBlock
 

Method Detail

getPageSequence

public org.axsl.fo.fo.PageSequence getPageSequence()
Returns the page-sequence that generated this page.

Returns:
The page-sequence that generated this page.

getPageCollection

public PageCollection getPageCollection()
Specified by:
getPageCollection in interface org.axsl.area.PageArea

getPage

public PageRA getPage()
Overrides the Area method, because this is the Page that is being sought.

Specified by:
getPage in interface org.axsl.area.AreaNode
Overrides:
getPage in class AreaNode

setNumber

public void setNumber(int number)
Sets the page number for this page.

Parameters:
number - The new page number.

getNumber

public int getNumber()
Specified by:
getNumber in interface org.axsl.area.PageArea
Specified by:
getNumber in interface org.axsl.galley.Page

setFormattedNumber

public void setFormattedNumber(CharSequence number)
Sets the formatted page number for this page.

Parameters:
number - The new formatted page number.

getFormattedNumber

public CharSequence getFormattedNumber()
Specified by:
getFormattedNumber in interface org.axsl.galley.Page

getRegionAfter

public RegionRA getRegionAfter()
Specified by:
getRegionAfter in interface org.axsl.area.PageArea
Specified by:
getRegionAfter in interface org.axsl.galley.Page

getRegionBefore

public RegionRA getRegionBefore()
Specified by:
getRegionBefore in interface org.axsl.area.PageArea
Specified by:
getRegionBefore in interface org.axsl.galley.Page

getRegionStart

public RegionRA getRegionStart()
Specified by:
getRegionStart in interface org.axsl.area.PageArea
Specified by:
getRegionStart in interface org.axsl.galley.Page

getRegionEnd

public RegionRA getRegionEnd()
Specified by:
getRegionEnd in interface org.axsl.area.PageArea
Specified by:
getRegionEnd in interface org.axsl.galley.Page

getRegionBodies

public Collection<RegionRABody> getRegionBodies()
Specified by:
getRegionBodies in interface org.axsl.area.PageArea
Specified by:
getRegionBodies in interface org.axsl.galley.Page

getHeight

public int getHeight()
Specified by:
getHeight in interface org.axsl.galley.Page

getWidth

public int getWidth()
Specified by:
getWidth in interface org.axsl.galley.Page

registerMarker

public void registerMarker(org.axsl.fo.fo.Marker marker)
Specified by:
registerMarker in interface org.axsl.area.PageArea

unregisterMarker

public void unregisterMarker(org.axsl.fo.fo.Marker marker)
Unregister a marker for this page.

Parameters:
marker - The marker to be unregistered.

getMarkers

public List<org.axsl.fo.fo.Marker> getMarkers()
Returns the markers found on this page.

Returns:
The markers found on this page.

nearestGeneratedByBlockLevelFo

public Area nearestGeneratedByBlockLevelFo()
Overrides the Area method, because there will be nothing above here that was generated by a block-level FO.

Specified by:
nearestGeneratedByBlockLevelFo in interface org.axsl.area.AreaNode
Overrides:
nearestGeneratedByBlockLevelFo in class AreaNode
Returns:
Always returns null (override of method in Area).

layoutComplete

public void layoutComplete()
                    throws org.axsl.area.AreaTreeException
Specified by:
layoutComplete in interface org.axsl.area.PageArea
Throws:
org.axsl.area.AreaTreeException

firstUnresolvedRefId

public org.axsl.galley.AreaNode firstUnresolvedRefId()
Specified by:
firstUnresolvedRefId in interface org.axsl.galley.Page

crIpd

public int crIpd()
Specified by:
crIpd in interface org.axsl.area.Area
Specified by:
crIpd in class Area

crBpd

public int crBpd()
Specified by:
crBpd in interface org.axsl.area.Area
Specified by:
crBpd in class Area

crOriginIPDOffset

public int crOriginIPDOffset()
Description copied from class: Area
The difference, in millipoints, between the page-viewport-area's start-edge and this Area's content-rectangle start-edge. This assumes for now that the IP Direction is the same for all areas.

Specified by:
crOriginIPDOffset in class Area
Returns:
The IPD offset of the content rectangle.

crOriginBPDOffset

public int crOriginBPDOffset()
Description copied from class: Area
The difference, in millipoints, between the page-viewport-area's before-edge and this Area's content-rectangle before-edge. This assumes for now that the BP Direction is the same for all areas.

Specified by:
crOriginBPDOffset in class Area
Returns:
The BPD offset of the content rectangle.

crOriginX

public int crOriginX()
Overrides:
crOriginX in class Area

crOriginY

public int crOriginY()
Overrides:
crOriginY in class Area

getOverflowArea

public Area getOverflowArea(Area childRequesting)
                     throws org.axsl.area.AreaTreeException
This method is used by child Areas to ask the parent Area into which Area the child Area's overflow should be placed. Overflows start when a new LineArea cannot be create for the current BlockArea. General strategy for overflow is to recursively go up the tree until getting to any Area that knows how to solve the overflow. One general case is the page-reference-area, which should know how to create a new page. Overrides method in Area, because at this point, a new page needs to be created.

Specified by:
getOverflowArea in class Area
Parameters:
childRequesting - Child Areas ask
Returns:
The younger sister Area that should be used to handle the overflow condition.
Throws:
org.axsl.area.AreaTreeException - If the Area is unable to find or create the overflow area.

getBindingEdge

public org.axsl.common.value.Compass getBindingEdge()
Returns the relative direction that matches the binding edge for this page.

Returns:
One of the following TraitEnumeration constants: DIRECTION_START, DIRECTION_END, DIRECTION_BEFORE, or DIRECTION_AFTER. Note that the standard does not appear to offer any guidance on this computation. It is possible, for example, that landscape pages should be bound at the top/bottom instead of left/right.

bestMarker

public org.axsl.fo.fo.Marker bestMarker(org.axsl.fo.fo.RetrieveMarker retrieve)
Specified by:
bestMarker in interface org.axsl.area.PageArea

getPageMaster

public org.axsl.fo.fo.SimplePageMaster getPageMaster()
Specified by:
getPageMaster in interface org.axsl.area.PageArea

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

contentStackingAxis

public org.axsl.common.value.RelativeAxis contentStackingAxis()
Description copied from class: Area
Returns the content stacking axis for this area.

Specified by:
contentStackingAxis in class Area
Returns:
Either RelativeAxis.BLOCK_PROGRESSION or RelativeAxis.INLINE_PROGRESSION, depending on whether the contents of this area stack in the block-progression-direction or the inline-progression-direction. The default value is that contents stack in the BPD. Classes that stack in the IPD should override this method.

getParent

public PageCollection getParent()
Specified by:
getParent in interface TreeNode
Specified by:
getParent in interface org.axsl.galley.Page
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<AreaNode> getChildren()
Description copied from class: AbstractOrderedTreeNode
Return the List of this node's children.

Specified by:
getChildren in class AreaFixed
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 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.SimplePageMaster traitGeneratedBy()
Specified by:
traitGeneratedBy in interface org.axsl.area.AreaNode
Specified by:
traitGeneratedBy in class AreaNode

isReleasable

public boolean isReleasable()
Indicates whether this page is ready to be released for rendering. To qualify as ready to release, the following factors must be true:

Returns:
True iff this page is ready to be released for rendering.

isBlank

public boolean isBlank()
Indicates whether this page is a blank page or not.

Returns:
True iff this page is blank.

getRegionBody

public RegionRABody getRegionBody(String regionName)
Returns the region-body area for a named region.

Specified by:
getRegionBody in interface org.axsl.area.PageArea
Parameters:
regionName - The name of the region to be returned.
Returns:
The named region.

traitBorderStartWidth

public int traitBorderStartWidth()
Description copied from class: Area
Returns the border-start-width trait for this area.

Specified by:
traitBorderStartWidth in class Area
Returns:
The border-start-width trait for this area.

traitBorderEndWidth

public int traitBorderEndWidth()
Description copied from class: Area
Returns the border-end-width trait for this area.

Specified by:
traitBorderEndWidth in class Area
Returns:
The border-end-width trait for this area.

traitBorderBeforeWidth

public int traitBorderBeforeWidth()
Description copied from class: Area
Returns the border-before-width trait for this area.

Specified by:
traitBorderBeforeWidth in class Area
Returns:
The border-before-width trait for this area.

traitBorderAfterWidth

public int traitBorderAfterWidth()
Description copied from class: Area
Returns the border-after-width trait for this area.

Specified by:
traitBorderAfterWidth in class Area
Returns:
The border-after-width trait for this area.

traitPaddingStart

public int traitPaddingStart()
Description copied from class: Area
Returns the padding-start trait for this area.

Specified by:
traitPaddingStart in class Area
Returns:
The padding-start trait for this area.

traitPaddingEnd

public int traitPaddingEnd()
Description copied from class: Area
Returns the padding-end trait for this area.

Specified by:
traitPaddingEnd in class Area
Returns:
The padding-end trait for this area.

traitPaddingBefore

public int traitPaddingBefore()
Description copied from class: Area
Returns the padding-before trait for this area.

Specified by:
traitPaddingBefore in class Area
Returns:
The padding-before trait for this area.

traitPaddingAfter

public int traitPaddingAfter()
Description copied from class: Area
Returns the padding-after trait for this area.

Specified by:
traitPaddingAfter in class Area
Returns:
The padding-after trait for this area.

traitSpaceBeforeOptimum

public int traitSpaceBeforeOptimum()
Description copied from class: Area
Returns the space-before optimum trait for this area.

Specified by:
traitSpaceBeforeOptimum in class Area
Returns:
The space-before optimum trait for this area.

traitSpaceAfterOptimum

public int traitSpaceAfterOptimum()
Description copied from class: Area
Returns the space-after optimum trait for this area.

Specified by:
traitSpaceAfterOptimum in class Area
Returns:
The space-after optimum trait for this area.

traitEndIndent

public int traitEndIndent()
Description copied from class: Area
Returns the end-indent trait.

Specified by:
traitEndIndent in class Area
Returns:
The end-indent trait.

traitStartIndent

public int traitStartIndent()
Description copied from class: Area
Returns the start-indent trait.

Specified by:
traitStartIndent in class Area
Returns:
The start-indent trait.

traitSpaceStartOptimum

public int traitSpaceStartOptimum()
Description copied from class: Area
Returns the space-start optimum trait for this area.

Specified by:
traitSpaceStartOptimum in class Area
Returns:
The space-start optimum trait for this area.

traitSpaceEndOptimum

public int traitSpaceEndOptimum()
Description copied from class: Area
Returns the space-end optimum trait for this area.

Specified by:
traitSpaceEndOptimum in class Area
Returns:
The space-end optimum trait for this area.

traitPageWidth

public int traitPageWidth()
Returns the page-width trait of this area.

Returns:
The page-width trait of this area.

traitPageHeight

public int traitPageHeight()
Returns the page-height trait of this area.

Returns:
The page-height trait of this area.


Copyright © 2017. All rights reserved.