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
Nested ClassesModifier and TypeClassDescriptionstatic final classUtility class to express border info. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intthe "after" edgefinal intThe "background-attachment" property.final ColorThe "background-color" property.final StringThe "background-image" property.final LengthThe "background-position-horizontal" property.final LengthThe "background-position-vertical" property.final intThe "background-repeat" property.final Lengthfinal Lengthstatic final intthe "before" edgestatic final intthe "end" edgestatic final intthe "start" edge -
Method Summary
Modifier and TypeMethodDescriptionbooleanintReturns the "background-attachment" property.Returns the "background-color" property.Returns the "background-image" property.org.apache.xmlgraphics.image.loader.ImageInfoReturns the background image infoReturns the "background-position-horizontal" property.Returns the "background-position-vertical" property.intReturns the "background-repeat" property.intgetBorderAfterWidth(boolean discard) intgetBorderBeforeWidth(boolean discard) getBorderColor(int side) The border-color for the given sideintgetBorderEndWidth(boolean discard) Returns the border infogetBorderInfo(int side) intgetBorderRadiusEnd(int side, boolean discard, PercentBaseContext context) Returns the border corner radius of the ending edge i.e.intgetBorderRadiusStart(int side, boolean discard, PercentBaseContext context) Returns the border corner radius of the starting edge i.e.intgetBorderStartWidth(boolean discard) intgetBorderStyle(int side) The border-style for the given sideintgetBorderWidth(int side, boolean discard) intgetBPPaddingAndBorder(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.ImageInfogetInstance(PropertyList pList) Obtain a CommonBorderPaddingBackground instance based on the related property valus in the givenPropertyListintgetIPPaddingAndBorder(boolean discard, PercentBaseContext context) Return all the border and padding width in the inline progression dimension.Returns the paddingintgetPadding(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.intgetPaddingAfter(boolean discard, PercentBaseContext context) intgetPaddingBefore(boolean discard, PercentBaseContext context) intgetPaddingEnd(boolean discard, PercentBaseContext context) getPaddingLengthProperty(int side) Returns the CondLengthProperty for the padding on one side.intgetPaddingStart(boolean discard, PercentBaseContext context) booleanbooleanbooleaninthashCode()booleanhasPadding(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- thePropertyListto 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()
-