Class Rect

  • All Implemented Interfaces:
    Shape

    public class Rect
    extends java.lang.Object
    implements Shape
    Two-dimensional rectangle with coordinates defined with float precision.
    • Constructor Detail

      • Rect

        public Rect​(float x,
                    float y,
                    float width,
                    float height)
    • Method Detail

      • getX

        public float getX()
      • setX

        public void setX​(float x)
      • getY

        public float getY()
      • setY

        public void setY​(float y)
      • getWidth

        public float getWidth()
      • setWidth

        public void setWidth​(float width)
      • getHeight

        public float getHeight()
      • setHeight

        public void setHeight​(float height)
      • getCenterX

        public float getCenterX()
      • getCenterY

        public float getCenterY()
      • getEndX

        public float getEndX()
      • getEndY

        public float getEndY()
      • set

        public void set​(float x,
                        float y,
                        float width,
                        float height)
      • set

        public void set​(Rect r)
      • contains

        public boolean contains​(Point p)
        Specified by:
        contains in interface Shape
      • contains

        public boolean contains​(Rect r)
      • intersects

        public boolean intersects​(Rect r)
      • copy

        public Rect copy()
      • equals

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

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object