Package org.eclipse.graphiti.datatypes
Interface IRectangle
- All Superinterfaces:
IDimension
,ILocation
- All Known Implementing Classes:
RectangleImpl
An interface for the rectangle data type.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(int x, int y) Checks whether the point with (x,y) is inside the rectangle.boolean
Checks whether the point with the given location is inside the rectangle.void
setRectangle
(int x, int y, int width, int height) Sets the location and dimension of the rectangle.void
setRectangle
(IRectangle rectangle) Sets the location and dimension of the rectangle to the values of the given rectangle.Methods inherited from interface org.eclipse.graphiti.datatypes.IDimension
getHeight, getWidth, setHeight, setWidth
-
Method Details
-
getRectangleCopy
IRectangle getRectangleCopy()- Returns:
- An exact copy of the current rectangle instance.
-
setRectangle
void setRectangle(int x, int y, int width, int height) Sets the location and dimension of the rectangle.- Parameters:
x
- the x coordinate of the rectangley
- the y coordinate of the rectanglewidth
- the width of the rectangleheight
- the height of the rectangle
-
setRectangle
Sets the location and dimension of the rectangle to the values of the given rectangle.- Parameters:
rectangle
- The rectangle which contains new location and dimension.
-
contains
boolean contains(int x, int y) Checks whether the point with (x,y) is inside the rectangle.- Parameters:
x
- the x coordinate of the point to be testedy
- the y coordinate of the point to be tested- Returns:
- TRUE, if the point with (x,y) is inside the rectangle; FALSE otherwise
-
contains
Checks whether the point with the given location is inside the rectangle.- Parameters:
location
- the location of the point to be tested- Returns:
- TRUE, if the location is inside the rectangle; FALSE otherwise
-