Class ElementPlacement<T>

  • Type Parameters:
    T - Type of element

    public class ElementPlacement<T>
    extends java.lang.Object
    Class is used to describe element's position.
    • Constructor Detail

      • ElementPlacement

        public ElementPlacement​(Point p1,
                                Point p2)
      • ElementPlacement

        public ElementPlacement​(T element,
                                Point p1,
                                Point p2)
    • Method Detail

      • contains

        public boolean contains​(int x,
                                int y)
        Tels if given coordinates are inside element placement's coordinates topLeft and bottomRight inclusively.
        Parameters:
        x - x coordinate.
        y - y coordinate.
        Returns:
        true if coordinates are inside element placement.
      • getTopLeft

        public Point getTopLeft()
      • setTopLeft

        public void setTopLeft​(Point topLeft)
      • getBottomRight

        public Point getBottomRight()
      • setBottomRight

        public void setBottomRight​(Point bottomRight)
      • getElement

        public T getElement()
      • setElement

        public void setElement​(T element)
      • getHeight

        public int getHeight()
      • getWidth

        public int getWidth()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • 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