Package org.eclipse.graphiti.internal.datatypes.impl

# Class RectangleImpl

java.lang.Object
org.eclipse.graphiti.internal.datatypes.impl.RectangleImpl

All Implemented Interfaces:
  `IDimension`, `ILocation`, `IRectangle`

public class RectangleImpl extends Object implements IRectangle

## Constructor Summary

Constructors
Constructor
Description
`RectangleImpl(int width, int height)`
`RectangleImpl(int x, int y, int width, int height)`
`RectangleImpl(IRectangle other)`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`contains(int x, int y)`
Checks whether the point with (x,y) is inside the rectangle.
`boolean`
`contains(ILocation location)`
Checks whether the point with the given location is inside the rectangle.
`boolean`
`equals(Object o)`
`IDimension`
`expand(int dw, int dh)`
`IDimension`
`getDimensionCopy()`
`int`
`getHeight()`
Gets the height.
`ILocation`
`getLocationCopy()`
`IRectangle`
`getRectangleCopy()`
`int`
`getWidth()`
Gets the width.
`int`
`getX()`
Gets the x value.
`int`
`getY()`
Gets the y value.
`int`
`hashCode()`
`void`
`scale(double amount)`
`IDimension`
`setDimension(int width, int height)`
`IDimension`
`setDimension(IDimension dimension)`
`void`
`setHeight(int height)`
Sets the height.
`ILocation`
`setLocation(int x, int y)`
`ILocation`
`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.
`String`
`toString()`
`ILocation`
`translate(int dx, int dy)`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Constructor Details

### RectangleImpl

public RectangleImpl(int width, int height)

### RectangleImpl

public RectangleImpl(int x, int y, int width, int height)

### RectangleImpl

public RectangleImpl(IRectangle other)

## Method Details

### getHeight

public int getHeight()
Description copied from interface: `IDimension`
Gets the height.

Specified by:
  `getHeight` in interface `IDimension`
Returns:
  the height of this dimension

### getWidth

public int getWidth()
Description copied from interface: `IDimension`
Gets the width.

Specified by:
  `getWidth` in interface `IDimension`
Returns:
  the width of this dimension

### setHeight

public void setHeight(int height)
Description copied from interface: `IDimension`
Sets the height.

Specified by:
  `setHeight` in interface `IDimension`
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 interface `IDimension`
Parameters:
  `width` - the new width of this dimension

### getX

public int getX()
Description copied from interface: `ILocation`
Gets the x value.

Specified by:
  `getX` in interface `ILocation`
Returns:
  the x value of this location

### getY

public int getY()
Description copied from interface: `ILocation`
Gets the y value.

Specified by:
  `getY` in interface `ILocation`
Returns:
  the y value of this location

### setX

public void setX(int x)
Description copied from interface: `ILocation`
Sets the x coordinate of this location.

Specified by:
  `setX` in interface `ILocation`
Parameters:
  `x` - the new x coordinate

### setY

public void setY(int y)
Description copied from interface: `ILocation`
Sets the y coordinate of this location.

Specified by:
  `setY` in interface `ILocation`
Parameters:
  `y` - the new y coordinate

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### equals

public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### expand

public IDimension expand(int dw, int dh)

### getDimensionCopy

public IDimension getDimensionCopy()

### scale

public void scale(double amount)

### setDimension

public IDimension setDimension(int width, int height)

### setDimension

public IDimension setDimension(IDimension dimension)

### getLocationCopy

public ILocation getLocationCopy()

### setLocation

public ILocation setLocation(int x, int y)

### setLocation

public ILocation setLocation(ILocation location)

### translate

public ILocation translate(int dx, int dy)

### getRectangleCopy

public IRectangle getRectangleCopy()

Specified by:
  `getRectangleCopy` in interface `IRectangle`
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 interface `IRectangle`
Parameters:
  `x` - the x coordinate of the rectangle
  `y` - the y coordinate of the rectangle
  `width` - the width of the rectangle
  `height` - the height of the rectangle

### setRectangle

public void setRectangle(IRectangle rectangle)
Description copied from interface: `IRectangle`
Sets the location and dimension of the rectangle to the values of the given rectangle.

Specified by:
  `setRectangle` in interface `IRectangle`
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 interface `IRectangle`
Parameters:
  `x` - the x coordinate of the point to be tested
  `y` - the y coordinate of the point to be tested
Returns:
  TRUE, if the point with (x,y) is inside the rectangle; FALSE otherwise

### contains

public boolean contains(ILocation location)
Description copied from interface: `IRectangle`
Checks whether the point with the given location is inside the rectangle.

Specified by:
  `contains` in interface `IRectangle`
Parameters:
  `location` - the location of the point to be tested
Returns:
  TRUE, if the location is inside the rectangle; FALSE otherwise