Package org.apache.fop.fo.properties
Class CommonBorderPaddingBackground
- java.lang.Object
-
- org.apache.fop.fo.properties.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
Nested Classes Modifier and Type Class Description static class
CommonBorderPaddingBackground.BorderInfo
Utility class to express border info.
-
Field Summary
Fields Modifier and Type Field Description static int
AFTER
the "after" edgeint
backgroundAttachment
The "background-attachment" property.java.awt.Color
backgroundColor
The "background-color" property.java.lang.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.Length
backgroungImageTargetHeight
Length
backgroungImageTargetWidth
static int
BEFORE
the "before" edgestatic int
END
the "end" edgestatic int
START
the "start" edge
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
int
getBackgroundAttachment()
Returns the "background-attachment" property.java.awt.Color
getBackgroundColor()
Returns the "background-color" property.java.lang.String
getBackgroundImage()
Returns the "background-image" property.org.apache.xmlgraphics.image.loader.ImageInfo
getBackgroundImageInfo()
Returns the background image infoLength
getBackgroundPositionHorizontal()
Returns the "background-position-horizontal" property.Length
getBackgroundPositionVertical()
Returns the "background-position-vertical" property.int
getBackgroundRepeat()
Returns the "background-repeat" property.int
getBorderAfterWidth(boolean discard)
int
getBorderBeforeWidth(boolean discard)
java.awt.Color
getBorderColor(int side)
The border-color for the given sideint
getBorderEndWidth(boolean discard)
CommonBorderPaddingBackground.BorderInfo[]
getBorderInfo()
Returns the border infoCommonBorderPaddingBackground.BorderInfo
getBorderInfo(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.static CommonBorderPaddingBackground.BorderInfo
getDefaultBorderInfo()
Returns a default BorderInfo of style none.org.apache.xmlgraphics.image.loader.ImageInfo
getImageInfo()
static CommonBorderPaddingBackground
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.CondLengthProperty[]
getPadding()
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)
CondLengthProperty
getPaddingLengthProperty(int side)
Returns the CondLengthProperty for the padding on one side.int
getPaddingStart(boolean discard, PercentBaseContext context)
boolean
hasBackground()
boolean
hasBorder()
boolean
hasBorderInfo()
int
hashCode()
boolean
hasPadding(PercentBaseContext context)
java.lang.String
toString()
-
-
-
Field Detail
-
backgroundAttachment
public final int backgroundAttachment
The "background-attachment" property.
-
backgroundColor
public final java.awt.Color backgroundColor
The "background-color" property.
-
backgroundImage
public final java.lang.String backgroundImage
The "background-image" property.
-
backgroundRepeat
public final int backgroundRepeat
The "background-repeat" property.
-
backgroundPositionHorizontal
public final Length backgroundPositionHorizontal
The "background-position-horizontal" property.
-
backgroundPositionVertical
public final Length backgroundPositionVertical
The "background-position-vertical" property.
-
backgroungImageTargetWidth
public final Length backgroungImageTargetWidth
-
backgroungImageTargetHeight
public final Length backgroungImageTargetHeight
-
BEFORE
public static final int BEFORE
the "before" edge- See Also:
- Constant Field Values
-
AFTER
public static final int AFTER
the "after" edge- See Also:
- Constant Field Values
-
START
public static final int START
the "start" edge- See Also:
- Constant Field Values
-
END
public static final int END
the "end" edge- See Also:
- Constant Field Values
-
-
Method Detail
-
getDefaultBorderInfo
public static CommonBorderPaddingBackground.BorderInfo 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
public CommonBorderPaddingBackground.BorderInfo getBorderInfo(int side)
- 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
public int getPaddingStart(boolean discard, PercentBaseContext context)
- 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
public int getPaddingEnd(boolean discard, PercentBaseContext context)
- 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
public int getPaddingBefore(boolean discard, PercentBaseContext context)
- 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
public int getPaddingAfter(boolean discard, PercentBaseContext context)
- 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
public int getBorderRadiusStart(int side, boolean discard, PercentBaseContext context)
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
public int getBorderRadiusEnd(int side, boolean discard, PercentBaseContext context)
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
public java.awt.Color getBorderColor(int side)
The border-color for the given side
-
getBorderStyle
public int getBorderStyle(int side)
The border-style for the given side
-
getPadding
public int 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.
-
getPaddingLengthProperty
public CondLengthProperty getPaddingLengthProperty(int side)
Returns the CondLengthProperty for the padding on one side.- Parameters:
side
- the side- Returns:
- the requested CondLengthProperty
-
getIPPaddingAndBorder
public int getIPPaddingAndBorder(boolean discard, PercentBaseContext context)
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
public int getBPPaddingAndBorder(boolean discard, PercentBaseContext context)
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
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
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
public boolean hasPadding(PercentBaseContext context)
- 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
public java.awt.Color 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
public java.lang.String 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
public Length getBackgroundPositionHorizontal()
Returns the "background-position-horizontal" property.- Returns:
- the "background-position-horizontal" property.
-
getBackgroundPositionVertical
public Length 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
public CommonBorderPaddingBackground.BorderInfo[] getBorderInfo()
Returns the border info- Returns:
- the border info
-
getPadding
public CondLengthProperty[] getPadding()
Returns the padding- Returns:
- the padding
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-