Class BackgroundImage


  • public class BackgroundImage
    extends java.lang.Object
    Class to hold background-image property.
    • Method Detail

      • calculateBackgroundImageSize

        public float[] calculateBackgroundImageSize​(float areaWidth,
                                                    float areaHeight)
        Calculates width and height values for background image with a given area params.
        Parameters:
        areaWidth - width of the area of this images
        areaHeight - height of the area of this images
        Returns:
        array of two float values. NOTE that first value defines width, second defines height
      • isBackgroundSpecified

        public boolean isBackgroundSpecified()
        Returns is background specified.
        Returns:
        true if background is specified, otherwise false
      • getImageWidth

        public float getImageWidth()
        Gets initial image width.
        Returns:
        the initial image width
      • getImageHeight

        public float getImageHeight()
        Gets initial image height.
        Returns:
        the initial image height
      • getBlendMode

        public BlendMode getBlendMode()
        Get the image's blend mode.
        Returns:
        the BlendMode representation of the image's blend mode
      • resolveWidthAndHeight

        protected float[] resolveWidthAndHeight​(java.lang.Float width,
                                                java.lang.Float height,
                                                float areaWidth,
                                                float areaHeight)
        Resolves the final size of the background image in specified area.
        Parameters:
        width - the intrinsic background image width
        height - the intrinsic background image height
        areaWidth - the area width in which background will be placed
        areaHeight - the area height in which background will be placed
        Returns:
        the final size of the background image
      • calculateBackgroundSizeForArea

        private static BackgroundSize calculateBackgroundSizeForArea​(BackgroundImage image,
                                                                     float areaWidth,
                                                                     float areaHeight)
      • createBackgroundSizeWithMaxValueSide

        private static BackgroundSize createBackgroundSizeWithMaxValueSide​(boolean maxWidth)