Class AbstractRectangleWrapper<R,​P>

  • Type Parameters:
    R - Target type representing the rectangle which should be wrapped.
    P - Target type representing of the rectangles point
    All Implemented Interfaces:
    RectangleWrapper<R,​P>
    Direct Known Subclasses:
    OpenCVRectangleWrapper

    public abstract class AbstractRectangleWrapper<R,​P>
    extends Object
    implements RectangleWrapper<R,​P>

    Abstract Implementation of the RectangleWrapper Interface

    Since:
    1.0
    Author:
    Christoph Praschl
    • Field Detail

      • rectangle

        protected R rectangle
        Wrapped rectangle
    • Constructor Detail

      • AbstractRectangleWrapper

        public AbstractRectangleWrapper​(R rectangle)
      • AbstractRectangleWrapper

        public AbstractRectangleWrapper​(P topLeftPoint,
                                        P bottomRightPoint)
      • AbstractRectangleWrapper

        public AbstractRectangleWrapper​(double topLeftPointX,
                                        double topLeftPointY,
                                        double bottomRightPointX,
                                        double bottomRightPointY)
    • Method Detail

      • buildRectangle

        protected R buildRectangle​(P topLeftPoint,
                                   P bottomRightPoint)
        Method to create a new rectangle from to given points
        Parameters:
        topLeftPoint - Top left point of the rectangle
        bottomRightPoint - Bottom right point of the rectangle
        Returns:
        The created rectangle
      • buildRectangle

        protected R buildRectangle​(double topLeftPointX,
                                   double topLeftPointY,
                                   double bottomRightPointX,
                                   double bottomRightPointY)
        Method to create a new rectangle from to given points (defined by the x and y coordinates)
        Parameters:
        topLeftPointX - x-Coordinate of the Top left point of the rectangle
        topLeftPointY - y-Coordinate of the Top left point of the rectangle
        bottomRightPointX - x-Coordinate of the Bottom Right point of the rectangle
        bottomRightPointY - y-Coordinate of the Bottom Right point of the rectangle
        Returns:
        The created rectangle
      • setRectangle

        public void setRectangle​(R rectangle)
        Specified by:
        setRectangle in interface RectangleWrapper<R,​P>
        Parameters:
        rectangle - The Rectangle to wrap