Class RectangleImpl
java.lang.Object
org.eclipse.graphiti.internal.datatypes.impl.RectangleImpl
- All Implemented Interfaces:
IDimension
,ILocation
,IRectangle
-
Constructor Summary
ConstructorDescriptionRectangleImpl
(int width, int height) RectangleImpl
(int x, int y, int width, int height) RectangleImpl
(IRectangle other) -
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.boolean
expand
(int dw, int dh) int
Gets the height.int
getWidth()
Gets the width.int
getX()
Gets the x value.int
getY()
Gets the y value.int
hashCode()
void
scale
(double amount) setDimension
(int width, int height) setDimension
(IDimension dimension) void
setHeight
(int height) Sets the height.setLocation
(int x, int y) setLocation
(ILocation location) 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.void
setWidth
(int width) Sets the width.void
setX
(int x) Sets the x coordinate of this location.void
setY
(int y) Sets the y coordinate of this location.toString()
translate
(int dx, int dy)
-
Constructor Details
-
RectangleImpl
public RectangleImpl(int width, int height) -
RectangleImpl
public RectangleImpl(int x, int y, int width, int height) -
RectangleImpl
-
-
Method Details
-
getHeight
public int getHeight()Description copied from interface:IDimension
Gets the height.- Specified by:
getHeight
in interfaceIDimension
- Returns:
- the height of this dimension
-
getWidth
public int getWidth()Description copied from interface:IDimension
Gets the width.- Specified by:
getWidth
in interfaceIDimension
- Returns:
- the width of this dimension
-
setHeight
public void setHeight(int height) Description copied from interface:IDimension
Sets the height.- Specified by:
setHeight
in interfaceIDimension
- Parameters:
height
- the new height of this dimension
-
setWidth
public void setWidth(int width) Description copied from interface:IDimension
Sets the width.- Specified by:
setWidth
in interfaceIDimension
- Parameters:
width
- the new width of this dimension
-
getX
public int getX()Description copied from interface:ILocation
Gets the x value. -
getY
public int getY()Description copied from interface:ILocation
Gets the y value. -
setX
public void setX(int x) Description copied from interface:ILocation
Sets the x coordinate of this location. -
setY
public void setY(int y) Description copied from interface:ILocation
Sets the y coordinate of this location. -
hashCode
public int hashCode() -
equals
-
toString
-
expand
-
getDimensionCopy
-
scale
public void scale(double amount) -
setDimension
-
setDimension
-
getLocationCopy
-
setLocation
-
setLocation
-
translate
-
getRectangleCopy
- Specified by:
getRectangleCopy
in interfaceIRectangle
- Returns:
- An exact copy of the current rectangle instance.
-
setRectangle
public void setRectangle(int x, int y, int width, int height) Description copied from interface:IRectangle
Sets the location and dimension of the rectangle.- Specified by:
setRectangle
in interfaceIRectangle
- 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
Description copied from interface:IRectangle
Sets the location and dimension of the rectangle to the values of the given rectangle.- Specified by:
setRectangle
in interfaceIRectangle
- Parameters:
rectangle
- The rectangle which contains new location and dimension.
-
contains
public boolean contains(int x, int y) Description copied from interface:IRectangle
Checks whether the point with (x,y) is inside the rectangle.- Specified by:
contains
in interfaceIRectangle
- 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
Description copied from interface:IRectangle
Checks whether the point with the given location is inside the rectangle.- Specified by:
contains
in interfaceIRectangle
- Parameters:
location
- the location of the point to be tested- Returns:
- TRUE, if the location is inside the rectangle; FALSE otherwise
-