org.apache.fop.layout
Class Area

java.lang.Object
  extended by org.apache.fop.layout.Box
      extended by org.apache.fop.layout.Area
Direct Known Subclasses:
AreaContainer, BlockArea, BodyAreaContainer, ExtensionArea, InlineArea, LineArea, SVGArea

public abstract class Area
extends Box


Field Summary
protected  int allocationWidth
           
protected  String areaClass
           
protected  BackgroundProps background
           
protected  BorderAndPadding bp
           
protected  ArrayList children
           
protected  int contentRectangleWidth
           
protected  int currentHeight
          Total height of content of this area.
 FObj foCreator
           
protected  FontState fontState
           
protected  FObj generatedBy
           
protected  boolean isFirst
           
protected  boolean isLast
           
protected  int maxHeight
           
protected  Page page
           
protected  int tableCellXOffset
           
 
Fields inherited from class org.apache.fop.layout.Box
areaTree, parent
 
Constructor Summary
Area(FontState fontState)
           
Area(FontState fontState, int allocationWidth, int maxHeight)
          Creates a new Area instance.
 
Method Summary
 void addChild(Box child)
           
 void addChildAtStart(Box child)
           
 void addDisplaySpace(int size)
           
 void addInlineSpace(int size)
           
 void end()
           
 int getAbsoluteHeight()
          Return absolute Y position of the current bottom of this area, not counting any bottom padding or border.
 int getAllocationWidth()
           
 BackgroundProps getBackground()
           
 BorderAndPadding getBorderAndPadding()
           
 int getBorderBottomWidth()
           
 int getBorderLeftWidth()
           
 int getBorderRightWidth()
           
 int getBorderTopWidth()
           
 ArrayList getChildren()
           
 int getContentHeight()
          Returns content height of the area.
 int getContentWidth()
           
 FObj getfoCreator()
           
 FontInfo getFontInfo()
           
 FontState getFontState()
           
 FObj getGeneratedBy()
           
 int getHeight()
          Returns allocation height of this area.
 IDReferences getIDReferences()
           
 int getMaxHeight()
           
 AreaContainer getNearestAncestorAreaContainer()
           
 int getPaddingBottom()
           
 int getPaddingLeft()
           
 int getPaddingRight()
           
 int getPaddingTop()
           
 Page getPage()
           
 Area getParent()
           
 int getTableCellXOffset()
           
 boolean hasChildren()
           
 boolean hasNonSpaceChildren()
          Tell whether this area contains any children which are not DisplaySpace.
 void increaseHeight(int amount)
           
 boolean isFirst()
           
 void isFirst(boolean isFirst)
           
 boolean isLast()
           
 void isLast(boolean isLast)
           
 void remove()
           
 void removeChild(Area area)
           
 void removeChild(DisplaySpace spacer)
           
 void setAbsoluteHeight(int value)
          Set "absolute" Y position of the top of this area.
 void setAllocationWidth(int w)
          Set the allocation width.
 void setBackground(BackgroundProps bg)
           
 void setBorderAndPadding(BorderAndPadding bp)
           
 void setGeneratedBy(FObj generatedBy)
           
 void setHeight(int height)
          Set the content height to the passed value if that value is larger than current content height.
 void setIDReferences(IDReferences idReferences)
           
 void setMaxHeight(int height)
           
 void setPage(Page page)
           
 void setParent(Area parent)
           
 void setTableCellXOffset(int offset)
           
 int spaceLeft()
          Return space remaining in the vertical direction (height).
 void start()
           
 
Methods inherited from class org.apache.fop.layout.Box
render
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fontState

protected FontState fontState

bp

protected BorderAndPadding bp

children

protected ArrayList children

maxHeight

protected int maxHeight

currentHeight

protected int currentHeight
Total height of content of this area.


tableCellXOffset

protected int tableCellXOffset

contentRectangleWidth

protected int contentRectangleWidth

allocationWidth

protected int allocationWidth

page

protected Page page

background

protected BackgroundProps background

generatedBy

protected FObj generatedBy

areaClass

protected String areaClass

isFirst

protected boolean isFirst

isLast

protected boolean isLast

foCreator

public FObj foCreator
Constructor Detail

Area

public Area(FontState fontState)

Area

public Area(FontState fontState,
            int allocationWidth,
            int maxHeight)
Creates a new Area instance.

Parameters:
fontState - a FontState value
allocationWidth - the inline-progression dimension of the content rectangle of the Area
maxHeight - the maximum block-progression dimension available for this Area (its allocation rectangle)
Method Detail

addChild

public void addChild(Box child)

addChildAtStart

public void addChildAtStart(Box child)

addDisplaySpace

public void addDisplaySpace(int size)

addInlineSpace

public void addInlineSpace(int size)

getFontInfo

public FontInfo getFontInfo()

end

public void end()

getAllocationWidth

public int getAllocationWidth()

setAllocationWidth

public void setAllocationWidth(int w)
Set the allocation width.

Parameters:
w - The new allocation width. This sets content width to the same value. Currently only called during layout of Table to set the width to the total width of all the columns. Note that this assumes the column widths are explicitly specified.

getChildren

public ArrayList getChildren()

hasChildren

public boolean hasChildren()

hasNonSpaceChildren

public boolean hasNonSpaceChildren()
Tell whether this area contains any children which are not DisplaySpace. This is used in determining whether to honor keeps.


getContentWidth

public int getContentWidth()

getFontState

public FontState getFontState()

getContentHeight

public int getContentHeight()
Returns content height of the area.

Returns:
Content height in millipoints

getHeight

public int getHeight()
Returns allocation height of this area. The allocation height is the sum of the content height plus border and padding in the vertical direction.

Returns:
allocation height in millipoints

getMaxHeight

public int getMaxHeight()

getPage

public Page getPage()

getBackground

public BackgroundProps getBackground()

getPaddingTop

public int getPaddingTop()

getPaddingLeft

public int getPaddingLeft()

getPaddingBottom

public int getPaddingBottom()

getPaddingRight

public int getPaddingRight()

getBorderTopWidth

public int getBorderTopWidth()

getBorderRightWidth

public int getBorderRightWidth()

getBorderLeftWidth

public int getBorderLeftWidth()

getBorderBottomWidth

public int getBorderBottomWidth()

getTableCellXOffset

public int getTableCellXOffset()

setTableCellXOffset

public void setTableCellXOffset(int offset)

getAbsoluteHeight

public int getAbsoluteHeight()
Return absolute Y position of the current bottom of this area, not counting any bottom padding or border. This is used to set positions for link hotspots. In fact, the position is not really absolute, but is relative to the Ypos of the column-level AreaContainer, even when the area is in a page header or footer!


setAbsoluteHeight

public void setAbsoluteHeight(int value)
Set "absolute" Y position of the top of this area. In fact, the position is not really absolute, but relative to the Ypos of the column-level AreaContainer, even when the area is in a page header or footer! It is set from the value of getAbsoluteHeight() on the parent area, just before adding this area.


increaseHeight

public void increaseHeight(int amount)

removeChild

public void removeChild(Area area)

removeChild

public void removeChild(DisplaySpace spacer)

remove

public void remove()

setPage

public void setPage(Page page)

setBackground

public void setBackground(BackgroundProps bg)

setBorderAndPadding

public void setBorderAndPadding(BorderAndPadding bp)

spaceLeft

public int spaceLeft()
Return space remaining in the vertical direction (height). This returns maximum available space - current content height Note: content height should be based on allocation height of content!

Returns:
space remaining in base units (millipoints)

start

public void start()

setHeight

public void setHeight(int height)
Set the content height to the passed value if that value is larger than current content height. If the new content height is greater than the maximum available height, set the content height to the max. available (!!!)

Parameters:
height - allocation height of content in millipoints

setMaxHeight

public void setMaxHeight(int height)

getParent

public Area getParent()

setParent

public void setParent(Area parent)

setIDReferences

public void setIDReferences(IDReferences idReferences)

getIDReferences

public IDReferences getIDReferences()

getfoCreator

public FObj getfoCreator()

getNearestAncestorAreaContainer

public AreaContainer getNearestAncestorAreaContainer()

getBorderAndPadding

public BorderAndPadding getBorderAndPadding()

setGeneratedBy

public void setGeneratedBy(FObj generatedBy)

getGeneratedBy

public FObj getGeneratedBy()

isFirst

public void isFirst(boolean isFirst)

isFirst

public boolean isFirst()

isLast

public void isLast(boolean isLast)

isLast

public boolean isLast()


Copyright ? 1999-2003 Apache Software Foundation. All Rights Reserved.