org.apache.fop.area

Class Area

Implemented Interfaces:
Serializable
Known Direct Subclasses:
BlockParent, Container, ForeignObject, Image, InlineArea, LineArea, MainReference, RegionReference, RegionViewport, Span

public class Area
extends AreaTreeObject
implements Serializable

Base object for all areas.

Field Summary

static int
BT
Stacking bottom to top
static int
CLASS_ABSOLUTE
Absolute position class
static int
CLASS_BEFORE_FLOAT
Before float class
static int
CLASS_FIXED
Fixed position class
static int
CLASS_FOOTNOTE
Footnote class
static int
CLASS_MAX
Maximum class count
static int
CLASS_NORMAL
Normal class
static int
CLASS_SIDE_FLOAT
Side float class
static int
LR
Stacking left to right
static int
ORIENT_0
Normal orientation
static int
ORIENT_180
Rotate 180 degrees
static int
ORIENT_270
Rotated 270 degrees clockwise
static int
ORIENT_90
Rotated 90 degrees clockwise
static int
RL
Stacking right to left
static int
TB
Stacking top to bottom
protected int
bpd
the area's block-progression-dimension
protected int
ipd
the area's inline-progression-dimension
protected static Log
log
logging instance
protected Map
props
Traits for this area stored in a HashMap

Fields inherited from class org.apache.fop.area.AreaTreeObject

foreignAttributes

Method Summary

void
addChildArea(Area child)
Add a child to this area.
void
addTrait(Object traitCode, Object prop)
Add a trait to this area.
void
addTrait(Trait prop)
Add a trait property to this area.
int
getAllocBPD()
Get the allocation block progression dimension of this area.
int
getAllocIPD()
Get the allocation inline progression dimension of this area.
int
getAreaClass()
Get the area class of this area.
int
getBPD()
Get the block progression dimension of the content rectangle for this area.
boolean
getBooleanTrait(Object oTraitCode)
Get a boolean trait from this area.
int
getBorderAndPaddingWidthAfter()
Return the sum of region border- and padding-after
int
getBorderAndPaddingWidthBefore()
Return the sum of region border- and padding-before
int
getBorderAndPaddingWidthEnd()
Return the sum of region border- and padding-end
int
getBorderAndPaddingWidthStart()
Return the sum of region border- and padding-start
int
getIPD()
Get the inline progression dimension of the content rectangle for this area.
int
getSpaceAfter()
Returns the space after
int
getSpaceBefore()
Returns the space before
int
getSpaceEnd()
Returns the space end
int
getSpaceStart()
Returns the space start
Object
getTrait(Object oTraitCode)
Get a trait from this area.
int
getTraitAsInteger(Object oTraitCode)
Get a trait from this area as an integer.
Map
getTraits()
Get the map of all traits on this area.
boolean
hasTrait(Object oTraitCode)
Checks whether a certain trait is set on this area.
boolean
hasTraits()
void
setAreaClass(int areaClass)
Set the area class of this area.
void
setBPD(int b)
Set the block progression dimension of the content rectangle for this area.
void
setIPD(int i)
Set the inline progression dimension of content rectangle for this area.
String
toString()

Methods inherited from class org.apache.fop.area.AreaTreeObject

getForeignAttributeValue, getForeignAttributes, setForeignAttribute, setForeignAttributes

Field Details

BT

public static final int BT
Stacking bottom to top
Field Value:
3

CLASS_ABSOLUTE

public static final int CLASS_ABSOLUTE
Absolute position class
Field Value:
2

CLASS_BEFORE_FLOAT

public static final int CLASS_BEFORE_FLOAT
Before float class
Field Value:
3

CLASS_FIXED

public static final int CLASS_FIXED
Fixed position class
Field Value:
1

CLASS_FOOTNOTE

public static final int CLASS_FOOTNOTE
Footnote class
Field Value:
4

CLASS_MAX

public static final int CLASS_MAX
Maximum class count
Field Value:
6

CLASS_NORMAL

public static final int CLASS_NORMAL
Normal class
Field Value:
0

CLASS_SIDE_FLOAT

public static final int CLASS_SIDE_FLOAT
Side float class
Field Value:
5

LR

public static final int LR
Stacking left to right
Field Value:
0

ORIENT_0

public static final int ORIENT_0
Normal orientation
Field Value:
0

ORIENT_180

public static final int ORIENT_180
Rotate 180 degrees
Field Value:
2

ORIENT_270

public static final int ORIENT_270
Rotated 270 degrees clockwise
Field Value:
3

ORIENT_90

public static final int ORIENT_90
Rotated 90 degrees clockwise
Field Value:
1

RL

public static final int RL
Stacking right to left
Field Value:
1

TB

public static final int TB
Stacking top to bottom
Field Value:
2

bpd

protected int bpd
the area's block-progression-dimension

ipd

protected int ipd
the area's inline-progression-dimension

log

protected static Log log
logging instance

props

protected Map props
Traits for this area stored in a HashMap

Method Details

addChildArea

public void addChildArea(Area child)
Add a child to this area. The default is to do nothing. Subclasses must override to do something if they can have child areas.
Parameters:
child - the child area to add

addTrait

public void addTrait(Object traitCode,
                     Object prop)
Add a trait to this area.
Parameters:
traitCode - the trait key
prop - the value of the trait

addTrait

public void addTrait(Trait prop)
Add a trait property to this area.
Parameters:
prop - the Trait to add

getAllocBPD

public int getAllocBPD()
Get the allocation block progression dimension of this area. This adds the content, borders, padding and spaces to find the total allocated BPD.
Returns:
the total BPD allocation for this area

getAllocIPD

public int getAllocIPD()
Get the allocation inline progression dimension of this area. This adds the content, borders and the padding to find the total allocated IPD.
Returns:
the total IPD allocation for this area

getAreaClass

public int getAreaClass()
Get the area class of this area.
Returns:
the area class

getBPD

public int getBPD()
Get the block progression dimension of the content rectangle for this area.
Returns:
the block progression dimension

getBooleanTrait

public boolean getBooleanTrait(Object oTraitCode)
Get a boolean trait from this area.
Parameters:
oTraitCode - the trait key
Returns:
the trait value

getBorderAndPaddingWidthAfter

public int getBorderAndPaddingWidthAfter()
Return the sum of region border- and padding-after
Returns:
width in millipoints

getBorderAndPaddingWidthBefore

public int getBorderAndPaddingWidthBefore()
Return the sum of region border- and padding-before
Returns:
width in millipoints

getBorderAndPaddingWidthEnd

public int getBorderAndPaddingWidthEnd()
Return the sum of region border- and padding-end
Returns:
width in millipoints

getBorderAndPaddingWidthStart

public int getBorderAndPaddingWidthStart()
Return the sum of region border- and padding-start
Returns:
width in millipoints

getIPD

public int getIPD()
Get the inline progression dimension of the content rectangle for this area.
Returns:
the inline progression dimension

getSpaceAfter

public int getSpaceAfter()
Returns the space after
Returns:
width in millipoints

getSpaceBefore

public int getSpaceBefore()
Returns the space before
Returns:
width in millipoints

getSpaceEnd

public int getSpaceEnd()
Returns the space end
Returns:
width in millipoints

getSpaceStart

public int getSpaceStart()
Returns the space start
Returns:
width in millipoints

getTrait

public Object getTrait(Object oTraitCode)
Get a trait from this area.
Parameters:
oTraitCode - the trait key
Returns:
the trait value

getTraitAsInteger

public int getTraitAsInteger(Object oTraitCode)
Get a trait from this area as an integer.
Parameters:
oTraitCode - the trait key
Returns:
the trait value

getTraits

public Map getTraits()
Get the map of all traits on this area.
Returns:
the map of traits

hasTrait

public boolean hasTrait(Object oTraitCode)
Checks whether a certain trait is set on this area.
Parameters:
oTraitCode - the trait key
Returns:
true if the trait is set

hasTraits

public boolean hasTraits()
Returns:
true if the area has traits

setAreaClass

public void setAreaClass(int areaClass)
Set the area class of this area.
Parameters:
areaClass - the area class

setBPD

public void setBPD(int b)
Set the block progression dimension of the content rectangle for this area.
Parameters:
b - the new block progression dimension

setIPD

public void setIPD(int i)
Set the inline progression dimension of content rectangle for this area.
Parameters:
i - the new inline progression dimension

toString

public String toString()
Returns:
ipd and bpd of area
See Also:
java.lang.Object.toString()

Copyright 1999-2007 The Apache Software Foundation. All Rights Reserved.