org.apache.fop.fo.properties

Class CommonBorderPaddingBackground


public class CommonBorderPaddingBackground
extends java.lang.Object

Stores all common border and padding properties. See Sec. 7.7 of the XSL-FO Standard.

Nested Class Summary

static class
CommonBorderPaddingBackground.BorderInfo

Field Summary

static int
AFTER
the "after" edge
static int
BEFORE
the "before" edge
static int
END
the "end" edge
static int
START
the "start" edge
int
backgroundAttachment
The "background-attachment" property.
Color
backgroundColor
The "background-color" property.
String
backgroundImage
The "background-image" property.
Length
backgroundPositionHorizontal
The "background-position-horizontal" property.
Length
backgroundPositionVertical
The "background-position-vertical" property.
int
backgroundRepeat
The "background-repeat" property.

Constructor Summary

CommonBorderPaddingBackground()
Construct a CommonBorderPaddingBackground object.
CommonBorderPaddingBackground(PropertyList pList)
Construct a CommonBorderPaddingBackground object.

Method Summary

int
getBPPaddingAndBorder(boolean bDiscard, PercentBaseContext context)
Return all the border and padding height in the block progression dimension.
int
getBorderAfterWidth(boolean bDiscard)
int
getBorderBeforeWidth(boolean bDiscard)
Color
getBorderColor(int side)
int
getBorderEndWidth(boolean bDiscard)
CommonBorderPaddingBackground.BorderInfo
getBorderInfo(int side)
int
getBorderStartWidth(boolean bDiscard)
int
getBorderStyle(int side)
int
getBorderWidth(int side, boolean bDiscard)
static CommonBorderPaddingBackground.BorderInfo
getDefaultBorderInfo()
Returns a default BorderInfo of style none.
int
getIPPaddingAndBorder(boolean bDiscard, PercentBaseContext context)
Return all the border and padding width in the inline progression dimension.
ImageInfo
getImageInfo()
int
getPadding(int side, boolean bDiscard, PercentBaseContext context)
int
getPaddingAfter(boolean bDiscard, PercentBaseContext context)
int
getPaddingBefore(boolean bDiscard, PercentBaseContext context)
int
getPaddingEnd(boolean bDiscard, PercentBaseContext context)
CondLengthProperty
getPaddingLengthProperty(int side)
Returns the CondLengthProperty for the padding on one side.
int
getPaddingStart(boolean bDiscard, PercentBaseContext context)
boolean
hasBackground()
boolean
hasBorder()
boolean
hasBorderInfo()
boolean
hasPadding(PercentBaseContext context)
void
setBorderInfo(CommonBorderPaddingBackground.BorderInfo info, int side)
Sets a border.
void
setPadding(CommonBorderPaddingBackground source)
Set padding.
String
toString()

Field Details

AFTER

public static final int AFTER
the "after" edge
Field Value:
1

BEFORE

public static final int BEFORE
the "before" edge
Field Value:
0

END

public static final int END
the "end" edge
Field Value:
3

START

public static final int START
the "start" edge
Field Value:
2

backgroundAttachment

public int backgroundAttachment
The "background-attachment" property.

backgroundColor

public Color backgroundColor
The "background-color" property.

backgroundImage

public String backgroundImage
The "background-image" property.

backgroundPositionHorizontal

public Length backgroundPositionHorizontal
The "background-position-horizontal" property.

backgroundPositionVertical

public Length backgroundPositionVertical
The "background-position-vertical" property.

backgroundRepeat

public int backgroundRepeat
The "background-repeat" property.

Constructor Details

CommonBorderPaddingBackground

public CommonBorderPaddingBackground()
Construct a CommonBorderPaddingBackground object.

CommonBorderPaddingBackground

public CommonBorderPaddingBackground(PropertyList pList)
            throws PropertyException
Construct a CommonBorderPaddingBackground object.
Parameters:
pList - The PropertyList to get properties from.
Throws:
PropertyException - if there's an error while binding the properties

Method Details

getBPPaddingAndBorder

public int getBPPaddingAndBorder(boolean bDiscard,
                                 PercentBaseContext context)
Return all the border and padding height in the block progression dimension.
Parameters:
bDiscard - the discard flag.
context - for percentage evaluation
Returns:
all the padding and border height.

getBorderAfterWidth

public int getBorderAfterWidth(boolean bDiscard)
Parameters:
bDiscard - indicates whether the .conditionality component should be considered (end of a reference-area)

getBorderBeforeWidth

public int getBorderBeforeWidth(boolean bDiscard)
Parameters:
bDiscard - indicates whether the .conditionality component should be considered (start of a reference-area)

getBorderColor

public Color getBorderColor(int side)

getBorderEndWidth

public int getBorderEndWidth(boolean bDiscard)
Parameters:
bDiscard - indicates whether the .conditionality component should be considered (end of a reference-area)

getBorderInfo

public CommonBorderPaddingBackground.BorderInfo getBorderInfo(int side)
Parameters:
side - the side to retrieve
Returns:
the border info for a side

getBorderStartWidth

public int getBorderStartWidth(boolean bDiscard)
Parameters:
bDiscard - indicates whether the .conditionality component should be considered (start of a reference-area)

getBorderStyle

public int getBorderStyle(int side)

getBorderWidth

public int getBorderWidth(int side,
                          boolean bDiscard)

getDefaultBorderInfo

public static CommonBorderPaddingBackground.BorderInfo getDefaultBorderInfo()
Returns a default BorderInfo of style none.
Returns:
a BorderInfo instance with style set to Constants.EN_NONE

getIPPaddingAndBorder

public int getIPPaddingAndBorder(boolean bDiscard,
                                 PercentBaseContext context)
Return all the border and padding width in the inline progression dimension.
Parameters:
bDiscard - the discard flag.
context - for percentage evaluation.
Returns:
all the padding and border width.

getImageInfo

public ImageInfo getImageInfo()
Returns:
the background image info object, null if there is no background image.

getPadding

public int getPadding(int side,
                      boolean bDiscard,
                      PercentBaseContext context)

getPaddingAfter

public int getPaddingAfter(boolean bDiscard,
                           PercentBaseContext context)

getPaddingBefore

public int getPaddingBefore(boolean bDiscard,
                            PercentBaseContext context)

getPaddingEnd

public int getPaddingEnd(boolean bDiscard,
                         PercentBaseContext context)

getPaddingLengthProperty

public CondLengthProperty getPaddingLengthProperty(int side)
Returns the CondLengthProperty for the padding on one side.
Parameters:
side - the side
Returns:
the requested CondLengthProperty

getPaddingStart

public int getPaddingStart(boolean bDiscard,
                           PercentBaseContext context)

hasBackground

public boolean hasBackground()
Returns:
true if there is any kind of background to be painted

hasBorder

public boolean hasBorder()
Returns:
true if border is non-zero.

hasBorderInfo

public boolean hasBorderInfo()
Returns:
true if there are any borders defined.

hasPadding

public boolean hasPadding(PercentBaseContext context)
Parameters:
context - for percentage based evaluation.
Returns:
true if padding is non-zero.

setBorderInfo

public void setBorderInfo(CommonBorderPaddingBackground.BorderInfo info,
                          int side)
Sets a border.
Parameters:
info - the border information
side - the side to apply the info to

setPadding

public void setPadding(CommonBorderPaddingBackground source)
Set padding.
Parameters:
source - the padding info to copy from

toString

public String toString()

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