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.
    • 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
    • Method Detail

      • 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 border
        discard - 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 side
        discard - 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 side
        discard - 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
        Parameters:
        side - one of BEFORE, AFTER, START, END
        Returns:
        the border-color for the given side
      • getBorderStyle

        public int getBorderStyle​(int side)
        The border-style for the given side
        Parameters:
        side - one of BEFORE, AFTER, START, END
        Returns:
        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.
        Parameters:
        side - one of BEFORE, AFTER, START, END
        discard - true if the conditionality component should be considered
        context - the context for percentage-resolution
        Returns:
        the computed padding for the given side
      • 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 class java.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
      • getPadding

        public CondLengthProperty[] getPadding()
        Returns the padding
        Returns:
        the padding
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object