org.foray.area
Class AreaFlexible

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.AreaFlexible
All Implemented Interfaces:
Iterable<org.axsl.galley.AreaNode>, TreeNode, org.axsl.area.Area, org.axsl.area.AreaNode, org.axsl.fo.FoContext, OrderedTreeNode
Direct Known Subclasses:
AbstractInlineArea, BlockArea, ContainerRA, ListItemArea

public abstract class AreaFlexible
extends Area

Subclasses are areas that need to store their own size and spacing information. The opposite of AreaFlexible is AreaFixed.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.foray.common.AbstractOrderedTreeNode
AbstractOrderedTreeNode.PostOrderDescendantIterator
 
Constructor Summary
protected AreaFlexible()
          Constructor.
 
Method Summary
 int computeInitialPD()
          Initialize the progression dimension for this Area.
protected  int crIPDBlockArea()
          Returns the IPD for a block area.
 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 getAnteriorSpace()
          Returns the current value of the resolved "anterior" space for this Area.
 void incrementAnteriorSpace(int incrementAmount)
          Change the anteriorSpace for this Area by incrementAmount.
protected  void incrementParentPD(int incrementAmount)
          Increments the parent's PD based on a change in this's.
 void initializeAnteriorSpace()
          Computes the initial value of anteriorSpace for this Area.
 int pdAvailable()
           
 int pdUsedBySiblings()
          Returns the total amount of the progression-dimension that has been used by siblings.
 void removeChild(AreaNode areaNode)
          Remove a child.
 void setAnteriorSpace(int anteriorSpace)
          Sets the value of the anterior space for this element.
 void setMinimumProgressionDimension(int minPD)
          Set the minimum progression dimension for this Area.
protected  void setParentPD(int progressionDimension)
          Sets the parent's PD based on a change in this's.
abstract  int traitIPDimensionOpt()
          Return the optimum IP dimension for this area.
 int usedProgressionDimension()
          The total amount of progressionDimension that is consumed by this Area.
 int usedProgressionDimensionNormalFlow()
          Returns the PD used by this area.
 
Methods inherited from class org.foray.area.Area
brBpd, brIpd, brOriginBPDOffset, brOriginIPDOffset, brOriginX, brOriginY, brPoints, contentStackingAxis, contentStackingAxisAbsolute, contentStackingDirectionAbsolute, crBpd, crIpd, crOriginX, crOriginY, crPoints, destinationName, generatedByExists, generatedByName, getAreaParent, getBPAxis, getFontWritingMode, getIPAxis, getNearestAncestorAreaContainer, getOverflowArea, getProgressionDimension, getWritingMode, hasFenceFollowing, hasFencePreceding, incrementProgressionDimension, isAbsolutelyPositioned, isBlockArea, isFirstChildOfParent, isInNormalFlow, isLastChildOfParent, isLinkRoot, larBPD, larIPD, larOriginX, larOriginY, linkDestination, linkType, narBPD, narIPD, narOriginX, narOriginY, nearestArea, parentAllocationWidth, prBpd, prIpd, prOriginBPDOffset, prOriginIPDOffset, prOriginX, prOriginY, referenceOrientationCumulative, setProgressionDimension, shouldAdjustParentPD, traitAreaClass, traitBorderAfterWidth, traitBorderBeforeWidth, traitBorderEndWidth, traitBorderStartWidth, traitEndIndent, traitId, traitIsFirst, traitIsLast, traitIsReferenceArea, traitPaddingAfter, traitPaddingBefore, traitPaddingEnd, traitPaddingStart, traitSpaceAfterOptimum, traitSpaceBeforeOptimum, traitSpaceEndOptimum, traitSpaceStartOptimum, traitStartIndent, traitWhiteSpaceTreatment
 
Methods inherited from class org.foray.area.AreaNode
ancestorArea, ancestorBlockAreaNotALineArea, ancestorBlockContentFactory, ancestorBlockOrRa, ancestorGeneratedByBlockLevelFO, ancestorLineArea, ancestorNormalBlockArea, ancestorPageCollection, ancestorReferenceArea, ancestorSpanRA, ancestorTableArea, bpdAncestorBlockOrRa, getAllowsChildren, getAreaTree, getChildAt, getChildren, getColor, getContainingReferenceArea, getFirstAreaChild, getFirstChild, getGalley, getGraftingPoint, getLastAreaChild, getLastChild, getLinkage, getLogger, getNextChildOfGeneratedBy, getNextSiblingArea, getNormalLinkage, getNormalLinkage, getOrderedParent, getPage, getParent, getPreviousChildOfGeneratedBy, getPreviousSiblingArea, getSiblings, hasUnresolvedRefId, heightContainingBlock, ipdAncestorBlockArea, ipdAncestorBlockOrRa, ipdContainingRefArea, ipdParentArea, isFirst, isFirstChildOfGeneratedBy, isGeneratedByBlockLevelFo, isLast, isLastChildOfGeneratedBy, iterator, linkage, nearestBeforeFloatArea, nearestFootnoteArea, nearestGeneratedByBlockLevelFo, nearestNormalBlockArea, nearestTableArea, optimize, optimizeChildren, registerWithLinkage, remove, removeChild, setParent, tableWidth, traitGeneratedBy, 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
getAreaName, getChildAt, getGalley, render
 
Methods inherited from interface java.lang.Iterable
iterator
 
Methods inherited from interface org.axsl.area.AreaNode
ancestorArea, ancestorBlockContentFactory, ancestorNormalBlockArea, ancestorTableArea, getAreaName, getAreaTree, getPage, isFirstChildOfGeneratedBy, nearestGeneratedByBlockLevelFo, removeChild, siblingIndex, traitGeneratedBy
 
Methods inherited from interface javax.swing.tree.TreeNode
children, getAllowsChildren, getChildCount, getIndex, getParent, isLeaf
 
Methods inherited from interface org.axsl.fo.FoContext
bpdAncestorBlockOrRa, getGraftingPoint, heightContainingBlock, ipdAncestorBlockArea, ipdAncestorBlockOrRa, ipdContainingRefArea, ipdParentArea, isFirst, isLast, tableWidth, widthContainingBlock
 

Constructor Detail

AreaFlexible

protected AreaFlexible()
Constructor.

Method Detail

getAnteriorSpace

public int getAnteriorSpace()

Returns the current value of the resolved "anterior" space for this Area. Anterior space is either space-before (for block areas) or space-start (for inline-areas). This space is not really part of the Area itself, but rather is a factor in determining what absolute position the Area occupies. This should not be used for items like start-indent, which are actually inside the Area itself.

Systems that compute anteriorSpace need to consider space-after and space-end constraints from previous Areas in that computation, but only the resolved value needs to be stored in the Area itself (the constraints are stored in FOTree). The FOray designers chose to store anterior Space in the posterior Area instead of storing the posterior Space in the anterior Area because the Area needs to know how much space to place before itself, but the last Area does not need to know how much space to place after itself, i.e. space after the last Area is a no op.

The value is stored in the AreaFlexible, and the AreaFlexible will initialize it with some reasonable amount, but the Layout system is responsible to compute and set its final value.

Returns:
Returns the anteriorSpace.

setAnteriorSpace

public void setAnteriorSpace(int anteriorSpace)
Sets the value of the anterior space for this element. See getAnteriorSpace() for a description of "anterior space".

Parameters:
anteriorSpace - The anteriorSpace to set.

incrementAnteriorSpace

public void incrementAnteriorSpace(int incrementAmount)
Change the anteriorSpace for this Area by incrementAmount. See getAnteriorSpace() for a description of "anterior space".

Parameters:
incrementAmount - The amount to adjust the anteriorSpace.

setParentPD

protected void setParentPD(int progressionDimension)
Sets the parent's PD based on a change in this's.

Parameters:
progressionDimension - This's new progression dimension.

incrementParentPD

protected void incrementParentPD(int incrementAmount)
Increments the parent's PD based on a change in this's.

Parameters:
incrementAmount - The amount this's PD has been incremented.

setMinimumProgressionDimension

public void setMinimumProgressionDimension(int minPD)
Description copied from class: Area
Set the minimum progression dimension for this Area. If the current progression dimension value is less than this value, it will be increased to this minimum. Otherwise, it is ignored.

Specified by:
setMinimumProgressionDimension in class Area
Parameters:
minPD - The minimum progression dimension to set.

usedProgressionDimension

public int usedProgressionDimension()
The total amount of progressionDimension that is consumed by this Area.

Returns:
The total amount of progressionDimension that is consumed by this Area.

usedProgressionDimensionNormalFlow

public int usedProgressionDimensionNormalFlow()
Returns the PD used by this area.

Returns:
The amount of progression that should be considered "used" by this area when computing how much is available in the normal flow.

crIPDBlockArea

protected int crIPDBlockArea()
Returns the IPD for a block area.

Returns:
The IPD for a block area.

initializeAnteriorSpace

public void initializeAnteriorSpace()
Computes the initial value of anteriorSpace for this Area.


computeInitialPD

public int computeInitialPD()
Initialize the progression dimension for this Area.

Returns:
The initial progression dimension for this Area.

pdAvailable

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

removeChild

public void removeChild(AreaNode areaNode)
Remove a child.

Parameters:
areaNode - The child to remove.

pdUsedBySiblings

public int pdUsedBySiblings()
Description copied from class: Area
Returns the total amount of the progression-dimension that has been used by siblings.

Specified by:
pdUsedBySiblings in class Area
Returns:
The total amount of the progression-dimension that has been used by siblings.

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.

traitIPDimensionOpt

public abstract int traitIPDimensionOpt()
Return the optimum IP dimension for this area.

Returns:
The optimum IP dimension for this area, or -1 for "auto".


Copyright © 2017. All rights reserved.