Class BorderRadius

  • All Implemented Interfaces:
    Cloneable

    public final class BorderRadius
    extends Object
    implements Cloneable
    Represents the border-radius CSS3 property.

    All short values are in screen pixels, that is, the display scaling is already taken into account.

    Once initialized, an instance of this class should be treated as immutable.

    See Also:
    CSS Backgrounds and Borders Module Level 3
    • Field Summary

      Fields 
      Modifier and Type Field Description
      short bottomLeftH
      Horizontal radius of the bottom/left quarter ellipse.
      short bottomLeftV
      Vertical radius of the bottom/left quarter ellipse.
      short bottomRightH
      Horizontal radius of the bottom/right quarter ellipse.
      short bottomRightV
      Vertical radius of the bottom/right quarter ellipse.
      short topLeftH
      Horizontal radius of the top/left quarter ellipse.
      short topLeftV
      Vertical radius of the top/left quarter ellipse.
      short topRightH
      Horizontal radius of the top/right quarter ellipse.
      short topRightV
      Vertical radius of the top/right quarter ellipse.
    • Constructor Summary

      Constructors 
      Constructor Description
      BorderRadius()
      Constructs a border-radius having no rounded corner.
      BorderRadius​(int topRightH, int topRightV, int bottomRightH, int bottomRightV, int bottomLeftH, int bottomLeftV, int topLeftH, int topLeftV)
      Constructs a border-radius having specified rounded corners.
    • Field Detail

      • topRightH

        public short topRightH
        Horizontal radius of the top/right quarter ellipse.
      • topRightV

        public short topRightV
        Vertical radius of the top/right quarter ellipse.
      • bottomRightH

        public short bottomRightH
        Horizontal radius of the bottom/right quarter ellipse.
      • bottomRightV

        public short bottomRightV
        Vertical radius of the bottom/right quarter ellipse.
      • bottomLeftH

        public short bottomLeftH
        Horizontal radius of the bottom/left quarter ellipse.
      • bottomLeftV

        public short bottomLeftV
        Vertical radius of the bottom/left quarter ellipse.
      • topLeftH

        public short topLeftH
        Horizontal radius of the top/left quarter ellipse.
      • topLeftV

        public short topLeftV
        Vertical radius of the top/left quarter ellipse.
    • Constructor Detail

      • BorderRadius

        public BorderRadius​(int topRightH,
                            int topRightV,
                            int bottomRightH,
                            int bottomRightV,
                            int bottomLeftH,
                            int bottomLeftV,
                            int topLeftH,
                            int topLeftV)
        Constructs a border-radius having specified rounded corners.
      • BorderRadius

        public BorderRadius()
        Constructs a border-radius having no rounded corner.
    • Method Detail

      • initTopRight

        public void initTopRight​(int topRightH,
                                 int topRightV)
        Initializes the top/right quarter ellipse.
      • initBottomRight

        public void initBottomRight​(int bottomRightH,
                                    int bottomRightV)
        Initializes the bottom/right quarter ellipse.
      • initBottomLeft

        public void initBottomLeft​(int bottomLeftH,
                                   int bottomLeftV)
        Initializes the bottom/left quarter ellipse.
      • initTopLeft

        public void initTopLeft​(int topLeftH,
                                int topLeftV)
        Initializes the top/left quarter ellipse.
      • hasRoundCorners

        public boolean hasRoundCorners()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object