Class Overlay.PositionAndSize

  • Enclosing class:
    Overlay

    public static class Overlay.PositionAndSize
    extends Object
    Data object for storing position and size information.
    • Constructor Summary

      Constructors 
      Constructor Description
      PositionAndSize​(int left, int top, int width, int height)
      Constructs a data object for storing position and size information.
    • Constructor Detail

      • PositionAndSize

        public PositionAndSize​(int left,
                               int top,
                               int width,
                               int height)
        Constructs a data object for storing position and size information.
        Parameters:
        left - pixel value for left css property
        top - pixel value for top css property
        width - pixel value for width css property
        height - pixel value for height css property
    • Method Detail

      • getLeft

        public int getLeft()
        Returns the pixel value for left css property.
        Returns:
        left value
      • setLeft

        public void setLeft​(int left)
        Sets the pixel value for left css property.
        Parameters:
        left - value to set
      • getTop

        public int getTop()
        Returns the pixel value for top css property.
        Returns:
        top value
      • setTop

        public void setTop​(int top)
        Sets the pixel value for top css property.
        Parameters:
        top - value to set
      • getWidth

        public int getWidth()
        Returns the pixel value for width css property.
        Returns:
        width value
      • setWidth

        public void setWidth​(int width)
        Sets the pixel value for width css property.
        Parameters:
        width - value to set
      • getHeight

        public int getHeight()
        Returns the pixel value for height css property.
        Returns:
        height value
      • setHeight

        public void setHeight​(int height)
        Sets the pixel value for height css property.
        Parameters:
        height - value to set
      • setAnimationFromCenterProgress

        public void setAnimationFromCenterProgress​(double progress)
        Offset the set values from center by given progress to create the state of a single animation frame. Each frame needs to be initialized from the beginning, since calling this method for a second time without resetting the size and position values would lead to incorrect end results.
        Parameters:
        progress - A value between 0.0 and 1.0, indicating the progress of the animation (0=start, 1=end).