Package org.apache.fop.fo.properties
Class CommonBorderPaddingBackground
java.lang.Object
org.apache.fop.fo.properties.CommonBorderPaddingBackground
Stores all common border and padding properties.
See Sec. 7.7 of the XSL-FO Standard.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Utility class to express border info. -
Field Summary
Modifier and TypeFieldDescriptionstatic final int
the "after" edgefinal int
The "background-attachment" property.final Color
The "background-color" property.final String
The "background-image" property.final Length
The "background-position-horizontal" property.final Length
The "background-position-vertical" property.final int
The "background-repeat" property.final Length
final Length
static final int
the "before" edgestatic final int
the "end" edgestatic final int
the "start" edge -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
Returns the "background-attachment" property.Returns the "background-color" property.Returns the "background-image" property.org.apache.xmlgraphics.image.loader.ImageInfo
Returns the background image infoReturns the "background-position-horizontal" property.Returns the "background-position-vertical" property.int
Returns the "background-repeat" property.int
getBorderAfterWidth
(boolean discard) int
getBorderBeforeWidth
(boolean discard) getBorderColor
(int side) The border-color for the given sideint
getBorderEndWidth
(boolean discard) Returns the border infogetBorderInfo
(int side) int
getBorderRadiusEnd
(int side, boolean discard, PercentBaseContext context) Returns the border corner radius of the ending edge i.e.int
getBorderRadiusStart
(int side, boolean discard, PercentBaseContext context) Returns the border corner radius of the starting edge i.e.int
getBorderStartWidth
(boolean discard) int
getBorderStyle
(int side) The border-style for the given sideint
getBorderWidth
(int side, boolean discard) int
getBPPaddingAndBorder
(boolean discard, PercentBaseContext context) Return all the border and padding height in the block progression dimension.Returns a default BorderInfo of style none.org.apache.xmlgraphics.image.loader.ImageInfo
getInstance
(PropertyList pList) Obtain a CommonBorderPaddingBackground instance based on the related property valus in the givenPropertyList
int
getIPPaddingAndBorder
(boolean discard, PercentBaseContext context) Return all the border and padding width in the inline progression dimension.Returns the paddingint
getPadding
(int side, boolean discard, PercentBaseContext context) Return the padding for the given side, taking into account the conditionality and evaluating any percentages in the given context.int
getPaddingAfter
(boolean discard, PercentBaseContext context) int
getPaddingBefore
(boolean discard, PercentBaseContext context) int
getPaddingEnd
(boolean discard, PercentBaseContext context) getPaddingLengthProperty
(int side) Returns the CondLengthProperty for the padding on one side.int
getPaddingStart
(boolean discard, PercentBaseContext context) boolean
boolean
boolean
int
hashCode()
boolean
hasPadding
(PercentBaseContext context) toString()
-
Field Details
-
backgroundAttachment
public final int backgroundAttachmentThe "background-attachment" property. -
backgroundColor
The "background-color" property. -
backgroundImage
The "background-image" property. -
backgroundRepeat
public final int backgroundRepeatThe "background-repeat" property. -
backgroundPositionHorizontal
The "background-position-horizontal" property. -
backgroundPositionVertical
The "background-position-vertical" property. -
backgroungImageTargetWidth
-
backgroungImageTargetHeight
-
BEFORE
public static final int BEFOREthe "before" edge- See Also:
-
AFTER
public static final int AFTERthe "after" edge- See Also:
-
START
public static final int STARTthe "start" edge- See Also:
-
END
public static final int ENDthe "end" edge- See Also:
-
-
Method Details
-
getDefaultBorderInfo
Returns a default BorderInfo of style none.- Returns:
- a BorderInfo instance with style set to
Constants.EN_NONE
-
getInstance
public static CommonBorderPaddingBackground getInstance(PropertyList pList) throws PropertyException Obtain a CommonBorderPaddingBackground instance based on the related property valus in the givenPropertyList
- Parameters:
pList
- thePropertyList
to use- Returns:
- a CommonBorderPaddingBackground instance (cached if possible)
- Throws:
PropertyException
- in case of an error
-
getBorderInfo
- Parameters:
side
- the side to retrieve- Returns:
- the border info for a side
-
getImageInfo
public org.apache.xmlgraphics.image.loader.ImageInfo getImageInfo()- Returns:
- the background image info object, null if there is no background image.
-
getBorderStartWidth
public int getBorderStartWidth(boolean discard) - Parameters:
discard
- indicates whether the .conditionality component should be considered (start of a reference-area)- Returns:
- the width of the start-border, taking into account the specified conditionality
-
getBorderEndWidth
public int getBorderEndWidth(boolean discard) - Parameters:
discard
- indicates whether the .conditionality component should be considered (end of a reference-area)- Returns:
- the width of the end-border, taking into account the specified conditionality
-
getBorderBeforeWidth
public int getBorderBeforeWidth(boolean discard) - Parameters:
discard
- indicates whether the .conditionality component should be considered (start of a reference-area)- Returns:
- the width of the before-border, taking into account the specified conditionality
-
getBorderAfterWidth
public int getBorderAfterWidth(boolean discard) - Parameters:
discard
- indicates whether the .conditionality component should be considered (end of a reference-area)- Returns:
- the width of the after-border, taking into account the specified conditionality
-
getPaddingStart
- Parameters:
discard
- indicates whether the .conditionality component should be considered (start of a reference-area)context
- the context to evaluate percentage values- Returns:
- the width of the start-padding, taking into account the specified conditionality
-
getPaddingEnd
- Parameters:
discard
- indicates whether the .conditionality component should be considered (start of a reference-area)context
- the context to evaluate percentage values- Returns:
- the width of the end-padding, taking into account the specified conditionality
-
getPaddingBefore
- Parameters:
discard
- indicates whether the .conditionality component should be considered (start of a reference-area)context
- the context to evaluate percentage values- Returns:
- the width of the before-padding, taking into account the specified conditionality
-
getPaddingAfter
- Parameters:
discard
- indicates whether the .conditionality component should be considered (start of a reference-area)context
- the context to evaluate percentage values- Returns:
- the width of the after-padding, taking into account the specified conditionality
-
getBorderWidth
public int getBorderWidth(int side, boolean discard) - Parameters:
side
- the side of the borderdiscard
- indicates whether the .conditionality component should be considered (end of a reference-area)- Returns:
- the width of the start-border, taking into account the specified conditionality
-
getBorderRadiusStart
Returns the border corner radius of the starting edge i.e. the edge either adjacent to the before or start border.- Parameters:
side
- the border sidediscard
- indicates whether the .conditionality component should be considered (end of a reference-area)context
- the context for percentage calculations- Returns:
- the border radius of the of the starting corner
-
getBorderRadiusEnd
Returns the border corner radius of the ending edge i.e. the edge either adjacent to the after or end border- Parameters:
side
- the border sidediscard
- indicates whether the .conditionality component should be considered (end of a reference-area)context
- the context for percentage calculations- Returns:
- the border radius of the of the ending corner
-
getBorderColor
The border-color for the given side -
getBorderStyle
public int getBorderStyle(int side) The border-style for the given side -
getPadding
Return the padding for the given side, taking into account the conditionality and evaluating any percentages in the given context. -
getPaddingLengthProperty
Returns the CondLengthProperty for the padding on one side.- Parameters:
side
- the side- Returns:
- the requested CondLengthProperty
-
getIPPaddingAndBorder
Return all the border and padding width in the inline progression dimension.- Parameters:
discard
- the discard flag.context
- for percentage evaluation.- Returns:
- all the padding and border width.
-
getBPPaddingAndBorder
Return all the border and padding height in the block progression dimension.- Parameters:
discard
- the discard flag.context
- for percentage evaluation- Returns:
- all the padding and border height.
-
toString
-
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.
-
hasPadding
- Parameters:
context
- for percentage based evaluation.- Returns:
- true if padding is non-zero.
-
hasBorderInfo
public boolean hasBorderInfo()- Returns:
- true if there are any borders defined.
-
getBackgroundColor
Returns the "background-color" property.- Returns:
- the "background-color" property.
-
getBackgroundAttachment
public int getBackgroundAttachment()Returns the "background-attachment" property.- Returns:
- the "background-attachment" property.
-
getBackgroundImage
Returns the "background-image" property.- Returns:
- the "background-image" property.
-
getBackgroundRepeat
public int getBackgroundRepeat()Returns the "background-repeat" property.- Returns:
- the "background-repeat" property.
-
getBackgroundPositionHorizontal
Returns the "background-position-horizontal" property.- Returns:
- the "background-position-horizontal" property.
-
getBackgroundPositionVertical
Returns the "background-position-vertical" property.- Returns:
- the "background-position-vertical" property.
-
getBackgroundImageInfo
public org.apache.xmlgraphics.image.loader.ImageInfo getBackgroundImageInfo()Returns the background image info- Returns:
- the background image info
-
getBorderInfo
Returns the border info- Returns:
- the border info
-
getPadding
Returns the padding- Returns:
- the padding
-
equals
-
hashCode
public int hashCode()
-