Class AbstractRectangleWrapper<R,P>
- java.lang.Object
-
- science.aist.imaging.api.domain.wrapper.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
-
-
Constructor Summary
Constructors Constructor Description AbstractRectangleWrapper(double topLeftPointX, double topLeftPointY, double bottomRightPointX, double bottomRightPointY)
AbstractRectangleWrapper(P topLeftPoint, P bottomRightPoint)
AbstractRectangleWrapper(R rectangle)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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)protected R
buildRectangle(P topLeftPoint, P bottomRightPoint)
Method to create a new rectangle from to given pointsR
getRectangle()
void
setRectangle(R rectangle)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface science.aist.imaging.api.domain.wrapper.RectangleWrapper
getBottomRightPoint, getCenterPoint, getHeight, getTopLeftPoint, getWidth
-
-
-
-
Field Detail
-
rectangle
protected R rectangle
Wrapped rectangle
-
-
Constructor Detail
-
AbstractRectangleWrapper
public AbstractRectangleWrapper(R rectangle)
-
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 rectanglebottomRightPoint
- 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 rectangletopLeftPointY
- y-Coordinate of the Top left point of the rectanglebottomRightPointX
- x-Coordinate of the Bottom Right point of the rectanglebottomRightPointY
- y-Coordinate of the Bottom Right point of the rectangle- Returns:
- The created rectangle
-
getRectangle
public R getRectangle()
- Specified by:
getRectangle
in interfaceRectangleWrapper<R,P>
- Returns:
- Wrapped Rectangle
-
setRectangle
public void setRectangle(R rectangle)
- Specified by:
setRectangle
in interfaceRectangleWrapper<R,P>
- Parameters:
rectangle
- The Rectangle to wrap
-
-