Package org.eclipse.gef.geometry.planar

# Class RoundedRectangle

java.lang.Object
org.eclipse.gef.geometry.planar.RoundedRectangle

All Implemented Interfaces:
  `Serializable`, `Cloneable`, `IGeometry`, `IRotatable<PolyBezier>`, `IScalable<RoundedRectangle>`, `IShape`, `ITranslatable<RoundedRectangle>`

public final class RoundedRectangle extends Object implements IShape
Represents the geometric shape of a rounded rectangle, i.e. a rectangle with rounded corners.

                      arc-width
                             width
                     .-------------------.
                     .--------.
                    +----+-----+-----+----+
                / / |    ^           ^    |
        arc-   | |  |    |           |    |
       height  | |  + <- arc end point -> +
               | |  |                     |
               |  \ |                     |
        height |    +                     +
               |    |                     |
               |    |                     |
               |    + <- arc end point -> +
               |    |    |           |    |
                \   |    v           v    |
                    +----+-----+-----+----+

The maximum value for the arc-width is the width of the rectangle and the maximum value for the arc-height is the height of the rectangle. For the maximal values, the end points of the arcs are at the centers of the sides of the rectangle.

Note that while all manipulations (e.g. within shrink, expand) within this class are based on double precision, all comparisons (e.g. within contains, intersects, equals, etc.) are based on a limited precision (with an accuracy defined within `PrecisionUtils`) to compensate for rounding effects.

See Also:
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`RoundedRectangle(double x, double y, double width, double height, double arcWidth, double arcHeight)`
Constructs a new `RoundedRectangle` from the given bounds and arc values.
`RoundedRectangle(Rectangle r, double arcWidth, double arcHeight)`
Constructs a new `RoundedRectangle` from the bounds of the given `Rectangle` and the given arc values.

## Method Summary

Modifier and Type
Method
Description
`Object`
`clone()`
Overridden with public visibility as recommended within `Cloneable` .
`boolean`
`contains(IGeometry g)`
Tests whether the given `IGeometry` is fully contained by this `IShape`.
`boolean`
`contains(Point p)`
Returns whether the given `Point` is contained within this `IGeometry`.
`boolean`
`equals(Object obj)`
`RoundedRectangle`
`expand(double h, double v)`
Expands the horizontal and vertical sides of this `AbstractRectangleBasedGeometry` with the values provided as input, and returns `this` for convenience.
`RoundedRectangle`
`expand(double left, double top, double right, double bottom)`
Expands this `AbstractRectangleBasedGeometry` by the given amounts, and returns this for convenience.
`double`
`getArcHeight()`
Returns the arc height of this `RoundedRectangle`, which is the height of the arc used to define its rounded corners.
`double`
`getArcWidth()`
Returns the arc width of this `RoundedRectangle`, which is the width of the arc used to define its rounded corners.
`Line`
`getBottom()`
Returns the bottom edge of this `RoundedRectangle`.
`Arc`
`getBottomLeftArc()`
Returns the bottom left `Arc` of this `RoundedRectangle`.
`Arc`
`getBottomRightArc()`
Returns the bottom right `Arc` of this `RoundedRectangle`.
`Rectangle`
`getBounds()`
Returns the smallest `Rectangle` fully enclosing this `IGeometry`.
`Point`
`getCenter()`
Returns the center `Point` of this `AbstractRectangleBasedGeometry`.
`RoundedRectangle`
`getCopy()`
Returns a new identical copy of this `IGeometry`.
`protected double`
`getEffectiveArcHeight()`
Returns the effective arc height, i.e. clamped to the range `[0;height]`.
`protected double`
`getEffectiveArcWidth()`
Returns the effective arc width, i.e. clamped to the range `[0;width]`.
`RoundedRectangle`
`getExpanded(double h, double v)`
Returns a new expanded `AbstractRectangleBasedGeometry`, where the sides are incremented by the horizontal and vertical values provided.
`RoundedRectangle`
`getExpanded(double left, double top, double right, double bottom)`
Creates and returns a new `AbstractRectangleBasedGeometry` with the bounds of this `AbstractRectangleBasedGeometry` expanded by the given insets.
`final double`
`getHeight()`
Returns the height of this `AbstractRectangleBasedGeometry`.
`Line`
`getLeft()`
Returns the left edge of this `RoundedRectangle`.
`Point`
`getLocation()`
Returns a `Point` specifying the x and y coordinates of this `AbstractRectangleBasedGeometry`.
`PolyBezier`
`getOutline()`
Returns an `ICurve` representing the outline of this `IShape` .
`BezierCurve[]`
`getOutlineSegments()`
Returns the individual `ICurve` segments, which constitute the outline of this `IShape`.
`Line`
`getRight()`
Returns the right edge of this `RoundedRectangle`.
`PolyBezier`
`getRotatedCCW(Angle angle)`
Rotates the calling object by specified `Angle` counter-clock-wise (CCW) around its center `Point`.
`PolyBezier`
`getRotatedCCW(Angle angle, double cx, double cy)`
Rotates the calling object by the specified `Angle` counter-clock-wise (CCW) around the specified center `Point` (cx, cy).
`PolyBezier`
`getRotatedCCW(Angle angle, Point center)`
Rotates the calling object by the specified `Angle` counter-clock-wise (CCW) around the specified center `Point`.
`PolyBezier`
`getRotatedCW(Angle angle)`
Rotates the calling object by specified `Angle` clock-wise (CW) around its center `Point`.
`PolyBezier`
`getRotatedCW(Angle angle, double cx, double cy)`
Rotates the calling object by the specified `Angle` clock-wise (CW) around the specified center `Point` (cx, cy).
`PolyBezier`
`getRotatedCW(Angle angle, Point center)`
Rotates the calling object by the specified `Angle` clock-wise (CW) around the specified center `Point`.
`RoundedRectangle`
`getScaled(double factor)`
Scales a copy of the calling object by the given factor relative to its center `Point`.
`RoundedRectangle`
`getScaled(double factorX, double factorY)`
Scales a copy of the calling object by the given factors relative to its center `Point`.
`RoundedRectangle`
`getScaled(double factor, double centerX, double centerY)`
Scales a copy of the calling object by the given factor relative to the given center `Point` (cx, cy).
`RoundedRectangle`
`getScaled(double factorX, double factorY, double centerX, double centerY)`
Scales a copy of the calling object by the given factors relative to the given center `Point` (cx, cy).
`RoundedRectangle`
`getScaled(double factorX, double factorY, Point center)`
Scales a copy of the calling object by the given factors relative to the given center `Point`.
`RoundedRectangle`
`getScaled(double factor, Point center)`
Scales a copy of the calling object by the given factor relative to the given center `Point`.
`RoundedRectangle`
`getShrinked(double h, double v)`
Returns a new `AbstractRectangleBasedGeometry`, where the sides are shrinked by the horizontal and vertical values supplied.
`RoundedRectangle`
`getShrinked(double left, double top, double right, double bottom)`
Returns a new `AbstractRectangleBasedGeometry` shrinked by the specified insets.
`final Dimension`
`getSize()`
Returns a `Dimension` that records the width and height of this `AbstractRectangleBasedGeometry`.
`Line`
`getTop()`
Returns the top edge of this `RoundedRectangle`.
`Arc`
`getTopLeftArc()`
Returns the top left `Arc` of this `RoundedRectangle`.
`Arc`
`getTopRightArc()`
Returns the top right `Arc` of this `RoundedRectangle`.
`CurvedPolygon`
`getTransformed(AffineTransform t)`
Default implementation returning a transformed `Path` representation of this `IGeometry`.
`RoundedRectangle`
`getTranslated(double dx, double dy)`
Translates a copy of this object by the given values in x and y direction.
`RoundedRectangle`
`getTranslated(Point pt)`
Translates a copy of this object by the given `Point`.
`final double`
`getWidth()`
Returns the width of this `AbstractRectangleBasedGeometry`.
`final double`
`getX()`
Returns the x coordinate this `AbstractRectangleBasedGeometry`.
`final double`
`getY()`
Returns the y coordinate of this `AbstractRectangleBasedGeometry`.
`final int`
`hashCode()`
`RoundedRectangle`
`scale(double factor)`
Scales the calling object by the given factor relative to its center `Point`.
`RoundedRectangle`
`scale(double fx, double fy)`
Scales the calling object by the given factors relative to the given center `Point`.
`RoundedRectangle`
`scale(double factor, double cx, double cy)`
Scales the calling object by the given factor relative to the given center `Point` (cx, cy).
`RoundedRectangle`
`scale(double fx, double fy, double cx, double cy)`
Scales the calling object by the given factors relative to the given center `Point` (cx, cy).
`RoundedRectangle`
`scale(double fx, double fy, Point center)`
Scales the calling object by the given factors relative to the given center `Point`.
`RoundedRectangle`
`scale(double factor, Point center)`
Scales the calling object by the given factor relative to the given center `Point`.
`RoundedRectangle`
`setArcHeight(double arcHeight)`
Sets the arc height of this `RoundedRectangle`, which is the height of the arc used to define its rounded corners.
`RoundedRectangle`
`setArcWidth(double arcWidth)`
Sets the arc width of this `RoundedRectangle`, which is the width of the arc used to define its rounded corners.
`final RoundedRectangle`
`setBounds(double x, double y, double w, double h)`
Sets the x, y, width, and height values of this `AbstractRectangleBasedGeometry` to the given values.
`final RoundedRectangle`
`setBounds(Point loc, Dimension size)`
Sets the x, y, width, and height values of this `AbstractRectangleBasedGeometry` to the respective values specified by the passed-in `Point` and the passed-in `Dimension`.
`final RoundedRectangle`
`setBounds(Rectangle r)`
Sets the x and y coordinates and the width and height of this `AbstractRectangleBasedGeometry` to the respective values of the given `Rectangle`.
`final RoundedRectangle`
`setHeight(double height)`
Sets the height of this `AbstractRectangleBasedGeometry` to the given value.
`final RoundedRectangle`
`setLocation(double x, double y)`
Sets the x and y coordinates of this `AbstractRectangleBasedGeometry` to the specified values.
`final RoundedRectangle`
`setLocation(Point p)`
Sets the x and y coordinates of this `AbstractRectangleBasedGeometry` to the respective values of the given `Point`.
`final RoundedRectangle`
`setSize(double w, double h)`
Sets the width and height of this `AbstractRectangleBasedGeometry` to the given values.
`final RoundedRectangle`
`setSize(Dimension d)`
Sets the width and height of this `AbstractRectangleBasedGeometry` to the width and height of the given `Dimension`.
`final RoundedRectangle`
`setWidth(double width)`
Sets the width of this `AbstractRectangleBasedGeometry` to the passed-in value.
`final RoundedRectangle`
`setX(double x)`
Sets the x-coordinate of this `AbstractRectangleBasedGeometry` to the given value.
`final RoundedRectangle`
`setY(double y)`
Sets the y-coordinate of this `AbstractRectangleBasedGeometry` to the given value.
`RoundedRectangle`
`shrink(double h, double v)`
Shrinks the sides of this `AbstractRectangleBasedGeometry` by the horizontal and vertical values provided as input, and returns this `AbstractRectangleBasedGeometry` for convenience.
`RoundedRectangle`
`shrink(double left, double top, double right, double bottom)`
Shrinks this `AbstractRectangleBasedGeometry` by the specified amounts.
`Path`
`toPath()`
Converts this `IGeometry` into a `Path` representation.
`String`
`toString()`
`boolean`
`touches(IGeometry g)`
Returns `true` if the input `IGeometry` touches this `IGeometry`, i.e. there is at least one common point.
`RoundedRectangle`
`translate(double dx, double dy)`
Translates the object by the given values in x and y direction.
`RoundedRectangle`
`translate(Point p)`
Translates the object by the given `Point`.

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

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

### Methods inherited from interface org.eclipse.gef.geometry.planar.IGeometry

`getBounds, touches`

## Constructor Details

### RoundedRectangle

public RoundedRectangle(double x, double y, double width, double height, double arcWidth, double arcHeight)
Constructs a new `RoundedRectangle` from the given bounds and arc values.

Parameters:
  `x` - the x-coordinate of the new `RoundedRectangle`'s bounds
  `y` - the y-coordinate of the new `RoundedRectangle`'s bounds
  `width` - the width of the new `RoundedRectangle`'s bounds
  `height` - the height of the new `RoundedRectangle`'s bounds
  `arcWidth` - the arc width of the new `RoundedRectangle` rounded corners
  `arcHeight` - the arc height of the new `RoundedRectangle` rounded corners

### RoundedRectangle

public RoundedRectangle(Rectangle r, double arcWidth, double arcHeight)
Constructs a new `RoundedRectangle` from the bounds of the given `Rectangle` and the given arc values.

Parameters:
  `r` - the `Rectangle`, whose bounds are used to initialize the x, y, width, and height values of the new `RoundedRectangle`
  `arcWidth` - the arc width of the new `RoundedRectangle` rounded corners
  `arcHeight` - the arc height of the new `RoundedRectangle` rounded corners

## Method Details

### contains

public boolean contains(IGeometry g)
Description copied from interface: `IShape`
Tests whether the given `IGeometry` is fully contained by this `IShape`.

Specified by:
  `contains` in interface `IShape`
Parameters:
  `g` - The `IGeometry` to test for containment
Returns:
  `true` if the given `IGeometry` is fully contained by this `IShape`, `false` otherwise.

### contains

public boolean contains(Point p)
Description copied from interface: `IGeometry`
Returns whether the given `Point` is contained within this `IGeometry`. This includes the case that the `Point` lies on the border of this `IGeometry`.

Specified by:
  `contains` in interface `IGeometry`
Parameters:
  `p` - The `Point` being tested for containment
Returns:
  `true` if the `Point` is contained within this `IGeometry`, `false` otherwise.
See Also:
  - `IGeometry.contains(Point)`

### equals

public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`

### getArcHeight

public double getArcHeight()
Returns the arc height of this `RoundedRectangle`, which is the height of the arc used to define its rounded corners.

Returns:
  the arc height

### getArcWidth

public double getArcWidth()
Returns the arc width of this `RoundedRectangle`, which is the width of the arc used to define its rounded corners.

Returns:
  the arc height

### getBottom

public Line getBottom()
Returns the bottom edge of this `RoundedRectangle`.

Returns:
  the bottom edge of this `RoundedRectangle`.

### getBottomLeftArc

public Arc getBottomLeftArc()
Returns the bottom left `Arc` of this `RoundedRectangle`.

Returns:
  the bottom left `Arc` of this `RoundedRectangle`.

### getBottomRightArc

public Arc getBottomRightArc()
Returns the bottom right `Arc` of this `RoundedRectangle`.

Returns:
  the bottom right `Arc` of this `RoundedRectangle`.

### getCopy

public RoundedRectangle getCopy()
Description copied from interface: `IGeometry`
Returns a new identical copy of this `IGeometry`.

Specified by:
  `getCopy` in interface `IGeometry`
Returns:
  a copy identical to this `IGeometry`
See Also:
  - `IGeometry.getCopy()`

### getEffectiveArcHeight

protected double getEffectiveArcHeight()
Returns the effective arc height, i.e. clamped to the range `[0;height]`.

Returns:
  the effective arc height, i.e. clamped to the range `[0;height]`.

### getEffectiveArcWidth

protected double getEffectiveArcWidth()
Returns the effective arc width, i.e. clamped to the range `[0;width]`.

Returns:
  the effective arc width, i.e. clamped to the range `[0;width]`.

### getLeft

public Line getLeft()
Returns the left edge of this `RoundedRectangle`.

Returns:
  the left edge of this `RoundedRectangle`.

### getOutline

public PolyBezier getOutline()
Description copied from interface: `IShape`
Returns an `ICurve` representing the outline of this `IShape` .

Specified by:
  `getOutline` in interface `IShape`
Returns:
  An `ICurve` representing this `IShape`'s outline.

### getOutlineSegments

public BezierCurve[] getOutlineSegments()
Description copied from interface: `IShape`
Returns the individual `ICurve` segments, which constitute the outline of this `IShape`.

Specified by:
  `getOutlineSegments` in interface `IShape`
Returns:
  The `ICurve` segments of this `IShape`'s outline.
See Also:
  - `IShape.getOutlineSegments()`

### getRight

public Line getRight()
Returns the right edge of this `RoundedRectangle`.

Returns:
  the right edge of this `RoundedRectangle`.

### getRotatedCCW

public PolyBezier getRotatedCCW(Angle angle)
Description copied from interface: `IRotatable`
Rotates the calling object by specified `Angle` counter-clock-wise (CCW) around its center `Point`. Does not necessarily return an object of the same type.

Specified by:
  `getRotatedCCW` in interface `IRotatable<PolyBezier>`
Parameters:
  `angle` - rotation `Angle`
Returns:
  an `IGeometry` representing the result of the rotation

### getRotatedCCW

public PolyBezier getRotatedCCW(Angle angle, double cx, double cy)
Description copied from interface: `IRotatable`
Rotates the calling object by the specified `Angle` counter-clock-wise (CCW) around the specified center `Point` (cx, cy). Does not necessarily return an object of the same type.

Specified by:
  `getRotatedCCW` in interface `IRotatable<PolyBezier>`
Parameters:
  `angle` - rotation `Angle`
  `cx` - x-coordinate of the relative `Point` for the rotation
  `cy` - y-coordinate of the relative `Point` for the rotation
Returns:
  an `IGeometry` representing the result of the rotation

### getRotatedCCW

public PolyBezier getRotatedCCW(Angle angle, Point center)
Description copied from interface: `IRotatable`
Rotates the calling object by the specified `Angle` counter-clock-wise (CCW) around the specified center `Point`. Does not necessarily return an object of the same type.

Specified by:
  `getRotatedCCW` in interface `IRotatable<PolyBezier>`
Parameters:
  `angle` - rotation `Angle`
  `center` - relative `Point` for the rotation
Returns:
  an `IGeometry` representing the result of the rotation

### getRotatedCW

public PolyBezier getRotatedCW(Angle angle)
Description copied from interface: `IRotatable`
Rotates the calling object by specified `Angle` clock-wise (CW) around its center `Point`. Does not necessarily return an object of the same type.

Specified by:
  `getRotatedCW` in interface `IRotatable<PolyBezier>`
Parameters:
  `angle` - rotation `Angle`
Returns:
  an `IGeometry` representing the result of the rotation

### getRotatedCW

public PolyBezier getRotatedCW(Angle angle, double cx, double cy)
Description copied from interface: `IRotatable`
Rotates the calling object by the specified `Angle` clock-wise (CW) around the specified center `Point` (cx, cy). Does not necessarily return an object of the same type.

Specified by:
  `getRotatedCW` in interface `IRotatable<PolyBezier>`
Parameters:
  `angle` - rotation `Angle`
  `cx` - x-coordinate of the relative `Point` for the rotation
  `cy` - y-coordinate of the relative `Point` for the rotation
Returns:
  an `IGeometry` representing the result of the rotation

### getRotatedCW

public PolyBezier getRotatedCW(Angle angle, Point center)
Description copied from interface: `IRotatable`
Rotates the calling object by the specified `Angle` clock-wise (CW) around the specified center `Point`. Does not necessarily return an object of the same type.

Specified by:
  `getRotatedCW` in interface `IRotatable<PolyBezier>`
Parameters:
  `angle` - rotation `Angle`
  `center` - relative `Point` for the rotation
Returns:
  an `IGeometry` representing the result of the rotation

### getTop

public Line getTop()
Returns the top edge of this `RoundedRectangle`.

Returns:
  the top edge of this `RoundedRectangle`.

### getTopLeftArc

public Arc getTopLeftArc()
Returns the top left `Arc` of this `RoundedRectangle`.

Returns:
  the top left `Arc` of this `RoundedRectangle`.

### getTopRightArc

public Arc getTopRightArc()
Returns the top right `Arc` of this `RoundedRectangle`.

Returns:
  the top right `Arc` of this `RoundedRectangle`.

### getTransformed

public CurvedPolygon getTransformed(AffineTransform t)
Default implementation returning a transformed `Path` representation of this `IGeometry`. Subclasses may override this method to return a more specific representation.

Specified by:
  `getTransformed` in interface `IGeometry`
Specified by:
  `getTransformed` in interface `IShape`
Parameters:
  `t` - The `AffineTransform` to be applied
Returns:
  a transformed `Path` representation of this `IGeometry`
See Also:
  - `IGeometry.getTransformed(AffineTransform)`

### setArcHeight

public RoundedRectangle setArcHeight(double arcHeight)
Sets the arc height of this `RoundedRectangle`, which is the height of the arc used to define its rounded corners.

Parameters:
  `arcHeight` - the new arc height
Returns:
  `this` for convenience

### setArcWidth

public RoundedRectangle setArcWidth(double arcWidth)
Sets the arc width of this `RoundedRectangle`, which is the width of the arc used to define its rounded corners.

Parameters:
  `arcWidth` - the new arc width
Returns:
  `this` for convenience

### toPath

public Path toPath()
Description copied from interface: `IGeometry`
Converts this `IGeometry` into a `Path` representation.

Specified by:
  `toPath` in interface `IGeometry`
Returns:
  A new `Path` representation for this `IGeometry`.

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### expand

public RoundedRectangle expand(double h, double v)
Expands the horizontal and vertical sides of this `AbstractRectangleBasedGeometry` with the values provided as input, and returns `this` for convenience. The location of its center is kept constant.

Parameters:
  `h` - the horizontal increment
  `v` - the vertical increment
Returns:
  `this` for convenience

### expand

public RoundedRectangle expand(double left, double top, double right, double bottom)
Expands this `AbstractRectangleBasedGeometry` by the given amounts, and returns this for convenience.

Parameters:
  `left` - the amount to expand the left side
  `top` - the amount to expand the top side
  `right` - the amount to expand the right side
  `bottom` - the amount to expand the bottom side
Returns:
  `this` for convenience

### getBounds

public Rectangle getBounds()
Description copied from interface: `IGeometry`
Returns the smallest `Rectangle` fully enclosing this `IGeometry`.

Specified by:
  `getBounds` in interface `IGeometry`
Returns:
  A new `Rectangle` object that fully encloses this `IGeometry`

### getCenter

public Point getCenter()
Returns the center `Point` of this `AbstractRectangleBasedGeometry`.

Returns:
  the center `Point` of this `AbstractRectangleBasedGeometry`

### getExpanded

public RoundedRectangle getExpanded(double h, double v)
Returns a new expanded `AbstractRectangleBasedGeometry`, where the sides are incremented by the horizontal and vertical values provided. The center of the `AbstractRectangleBasedGeometry` is maintained constant.

Parameters:
  `h` - The horizontal increment
  `v` - The vertical increment
Returns:
  a new expanded `AbstractRectangleBasedGeometry`

### getExpanded

public RoundedRectangle getExpanded(double left, double top, double right, double bottom)
Creates and returns a new `AbstractRectangleBasedGeometry` with the bounds of this `AbstractRectangleBasedGeometry` expanded by the given insets.

Parameters:
  `left` - the amount to expand the left side
  `top` - the amount to expand the top side
  `right` - the amount to expand the right side
  `bottom` - the amount to expand the bottom side
Returns:
  a new expanded `AbstractRectangleBasedGeometry`

### getHeight

public final double getHeight()
Returns the height of this `AbstractRectangleBasedGeometry`.

Returns:
  the height of this `AbstractRectangleBasedGeometry`

### getLocation

public Point getLocation()
Returns a `Point` specifying the x and y coordinates of this `AbstractRectangleBasedGeometry`.

Returns:
  a `Point` representing the x and y coordinates of this `AbstractRectangleBasedGeometry`

### getScaled

public RoundedRectangle getScaled(double factor)
Description copied from interface: `IScalable`
Scales a copy of the calling object by the given factor relative to its center `Point`.

Specified by:
  `getScaled` in interface `IScalable<T extends org.eclipse.gef.geometry.planar.AbstractRectangleBasedGeometry<?,?>>`
Parameters:
  `factor` - scale-factor
Returns:
  the new, scaled object

### getScaled

public RoundedRectangle getScaled(double factorX, double factorY)
Description copied from interface: `IScalable`
Scales a copy of the calling object by the given factors relative to its center `Point`.

Specified by:
  `getScaled` in interface `IScalable<T extends org.eclipse.gef.geometry.planar.AbstractRectangleBasedGeometry<?,?>>`
Parameters:
  `factorX` - x-scale-factor
  `factorY` - y-scale-factor
Returns:
  the new, scaled object

### getScaled

public RoundedRectangle getScaled(double factor, double centerX, double centerY)
Description copied from interface: `IScalable`
Scales a copy of the calling object by the given factor relative to the given center `Point` (cx, cy).

Specified by:
  `getScaled` in interface `IScalable<T extends org.eclipse.gef.geometry.planar.AbstractRectangleBasedGeometry<?,?>>`
Parameters:
  `factor` - scale-factor
  `centerX` - x-coordinate of the relative `Point` for the scaling
  `centerY` - y-coordinate of the relative `Point` for the scaling
Returns:
  the new, scaled object

### getScaled

public RoundedRectangle getScaled(double factorX, double factorY, double centerX, double centerY)
Description copied from interface: `IScalable`
Scales a copy of the calling object by the given factors relative to the given center `Point` (cx, cy).

Specified by:
  `getScaled` in interface `IScalable<T extends org.eclipse.gef.geometry.planar.AbstractRectangleBasedGeometry<?,?>>`
Parameters:
  `factorX` - x-scale-factor
  `factorY` - y-scale-factor
  `centerX` - x-coordinate of the relative `Point` for the scaling
  `centerY` - y-coordinate of the relative `Point` for the scaling
Returns:
  the new, scaled object

### getScaled

public RoundedRectangle getScaled(double factorX, double factorY, Point center)
Description copied from interface: `IScalable`
Scales a copy of the calling object by the given factors relative to the given center `Point`.

Specified by:
  `getScaled` in interface `IScalable<T extends org.eclipse.gef.geometry.planar.AbstractRectangleBasedGeometry<?,?>>`
Parameters:
  `factorX` - x-scale-factor
  `factorY` - y-scale-factor
  `center` - relative `Point` for the scaling
Returns:
  the new, scaled object

### getScaled

public RoundedRectangle getScaled(double factor, Point center)
Description copied from interface: `IScalable`
Scales a copy of the calling object by the given factor relative to the given center `Point`.

Specified by:
  `getScaled` in interface `IScalable<T extends org.eclipse.gef.geometry.planar.AbstractRectangleBasedGeometry<?,?>>`
Parameters:
  `factor` - scale-factor
  `center` - relative `Point` for the scaling
Returns:
  the new, scaled object

### getShrinked

public RoundedRectangle getShrinked(double h, double v)
Returns a new `AbstractRectangleBasedGeometry`, where the sides are shrinked by the horizontal and vertical values supplied. The center of this `AbstractRectangleBasedGeometry` is kept constant.

Parameters:
  `h` - horizontal reduction amount
  `v` - vertical reduction amount
Returns:
  a new, shrinked `AbstractRectangleBasedGeometry`

### getShrinked

public RoundedRectangle getShrinked(double left, double top, double right, double bottom)
Returns a new `AbstractRectangleBasedGeometry` shrinked by the specified insets.

Parameters:
  `left` - the amount to shrink the left side
  `top` - the amount to shrink the top side
  `right` - the amount to shrink the right side
  `bottom` - the amount to shrink the bottom side
Returns:
  a new, shrinked `AbstractRectangleBasedGeometry`

### getSize

public final Dimension getSize()
Returns a `Dimension` that records the width and height of this `AbstractRectangleBasedGeometry`.

Returns:
  a `Dimension` that records the width and height of this `AbstractRectangleBasedGeometry`

### getTranslated

public RoundedRectangle getTranslated(double dx, double dy)
Description copied from interface: `ITranslatable`
Translates a copy of this object by the given values in x and y direction.

Specified by:
  `getTranslated` in interface `ITranslatable<T extends org.eclipse.gef.geometry.planar.AbstractRectangleBasedGeometry<?,?>>`
Parameters:
  `dx` - x-translation
  `dy` - y-translation
Returns:
  a new, translated object

### getTranslated

public RoundedRectangle getTranslated(Point pt)
Description copied from interface: `ITranslatable`
Translates a copy of this object by the given `Point`.

Specified by:
  `getTranslated` in interface `ITranslatable<T extends org.eclipse.gef.geometry.planar.AbstractRectangleBasedGeometry<?,?>>`
Parameters:
  `pt` - translation `Point`
Returns:
  a new, translated object

### getWidth

public final double getWidth()
Returns the width of this `AbstractRectangleBasedGeometry`.

Returns:
  the width of this `AbstractRectangleBasedGeometry`

### getX

public final double getX()
Returns the x coordinate this `AbstractRectangleBasedGeometry`.

Returns:
  the x coordinate this `AbstractRectangleBasedGeometry`

### getY

public final double getY()
Returns the y coordinate of this `AbstractRectangleBasedGeometry`.

Returns:
  the y coordinate of this `AbstractRectangleBasedGeometry`

### scale

public RoundedRectangle scale(double factor)
Description copied from interface: `IScalable`
Scales the calling object by the given factor relative to its center `Point`.

Specified by:
  `scale` in interface `IScalable<T extends org.eclipse.gef.geometry.planar.AbstractRectangleBasedGeometry<?,?>>`
Parameters:
  `factor` - scale-factor
Returns:
  `this` for convenience

### scale

public RoundedRectangle scale(double fx, double fy)
Description copied from interface: `IScalable`
Scales the calling object by the given factors relative to the given center `Point`.

Specified by:
  `scale` in interface `IScalable<T extends org.eclipse.gef.geometry.planar.AbstractRectangleBasedGeometry<?,?>>`
Parameters:
  `fx` - x-scale-factor
  `fy` - y-scale-factor
Returns:
  `this` for convenience

### scale

public RoundedRectangle scale(double factor, double cx, double cy)
Description copied from interface: `IScalable`
Scales the calling object by the given factor relative to the given center `Point` (cx, cy).

Specified by:
  `scale` in interface `IScalable<T extends org.eclipse.gef.geometry.planar.AbstractRectangleBasedGeometry<?,?>>`
Parameters:
  `factor` - scale-factor
  `cx` - x-coordinate of the relative `Point` for the scaling
  `cy` - y-coordinate of the relative `Point` for the scaling
Returns:
  `this` for convenience

### scale

public RoundedRectangle scale(double fx, double fy, double cx, double cy)
Description copied from interface: `IScalable`
Scales the calling object by the given factors relative to the given center `Point` (cx, cy).

Specified by:
  `scale` in interface `IScalable<T extends org.eclipse.gef.geometry.planar.AbstractRectangleBasedGeometry<?,?>>`
Parameters:
  `fx` - x-scale-factor
  `fy` - y-scale-factor
  `cx` - x-coordinate of the relative `Point` for the scaling
  `cy` - y-coordinate of the relative `Point` for the scaling
Returns:
  `this` for convenience

### scale

public RoundedRectangle scale(double fx, double fy, Point center)
Description copied from interface: `IScalable`
Scales the calling object by the given factors relative to the given center `Point`.

Specified by:
  `scale` in interface `IScalable<T extends org.eclipse.gef.geometry.planar.AbstractRectangleBasedGeometry<?,?>>`
Parameters:
  `fx` - x-scale-factor
  `fy` - y-scale-factor
  `center` - relative `Point` for the scaling
Returns:
  `this` for convenience

### scale

public RoundedRectangle scale(double factor, Point center)
Description copied from interface: `IScalable`
Scales the calling object by the given factor relative to the given center `Point`.

Specified by:
  `scale` in interface `IScalable<T extends org.eclipse.gef.geometry.planar.AbstractRectangleBasedGeometry<?,?>>`
Parameters:
  `factor` - scale-factor
  `center` - relative `Point` for the scaling
Returns:
  `this` for convenience

### setBounds

public final RoundedRectangle setBounds(double x, double y, double w, double h)
Sets the x, y, width, and height values of this `AbstractRectangleBasedGeometry` to the given values.

Parameters:
  `x` - the new x-coordinate
  `y` - the new y-coordinate
  `w` - the new width
  `h` - the new height
Returns:
  `this` for convenience

### setBounds

public final RoundedRectangle setBounds(Point loc, Dimension size)
Sets the x, y, width, and height values of this `AbstractRectangleBasedGeometry` to the respective values specified by the passed-in `Point` and the passed-in `Dimension`.

Parameters:
  `loc` - the `Point` specifying the new x and y coordinates of this `AbstractRectangleBasedGeometry`
  `size` - the `Dimension` specifying the new width and height of this `AbstractRectangleBasedGeometry`
Returns:
  `this` for convenience

### setBounds

public final RoundedRectangle setBounds(Rectangle r)
Sets the x and y coordinates and the width and height of this `AbstractRectangleBasedGeometry` to the respective values of the given `Rectangle`.

Parameters:
  `r` - the `Rectangle` specifying the new x, y, width, and height values of this `AbstractRectangleBasedGeometry`
Returns:
  `this` for convenience

### setHeight

public final RoundedRectangle setHeight(double height)
Sets the height of this `AbstractRectangleBasedGeometry` to the given value.

Parameters:
  `height` - the new height
Returns:
  `this` for convenience

### setLocation

public final RoundedRectangle setLocation(double x, double y)
Sets the x and y coordinates of this `AbstractRectangleBasedGeometry` to the specified values.

Parameters:
  `x` - the new x coordinate of this `AbstractRectangleBasedGeometry`
  `y` - the new y coordinate of this `AbstractRectangleBasedGeometry`
Returns:
  `this` for convenience

### setLocation

public final RoundedRectangle setLocation(Point p)
Sets the x and y coordinates of this `AbstractRectangleBasedGeometry` to the respective values of the given `Point`.

Parameters:
  `p` - the `Point` specifying the new x and y coordinates of this `AbstractRectangleBasedGeometry`
Returns:
  `this` for convenience

### setSize

public final RoundedRectangle setSize(Dimension d)
Sets the width and height of this `AbstractRectangleBasedGeometry` to the width and height of the given `Dimension`.

Parameters:
  `d` - the `Dimension` specifying the new width and height of this `AbstractRectangleBasedGeometry`
Returns:
  `this` for convenience

### setSize

public final RoundedRectangle setSize(double w, double h)
Sets the width and height of this `AbstractRectangleBasedGeometry` to the given values.

Parameters:
  `w` - the new width of this `AbstractRectangleBasedGeometry`
  `h` - the new height of this `AbstractRectangleBasedGeometry`
Returns:
  `this` for convenience

### setWidth

public final RoundedRectangle setWidth(double width)
Sets the width of this `AbstractRectangleBasedGeometry` to the passed-in value.

Parameters:
  `width` - the new width of this `AbstractRectangleBasedGeometry`
Returns:
  `this` for convenience

### setX

public final RoundedRectangle setX(double x)
Sets the x-coordinate of this `AbstractRectangleBasedGeometry` to the given value.

Parameters:
  `x` - The new x-coordinate.
Returns:
  `this` for convenience.

### setY

public final RoundedRectangle setY(double y)
Sets the y-coordinate of this `AbstractRectangleBasedGeometry` to the given value.

Parameters:
  `y` - The new y-coordinate.
Returns:
  `this` for convenience.

### shrink

public RoundedRectangle shrink(double h, double v)
Shrinks the sides of this `AbstractRectangleBasedGeometry` by the horizontal and vertical values provided as input, and returns this `AbstractRectangleBasedGeometry` for convenience. The center of this `AbstractRectangleBasedGeometry` is kept constant.

Parameters:
  `h` - horizontal reduction amount
  `v` - vertical reduction amount
Returns:
  `this` for convenience

### shrink

public RoundedRectangle shrink(double left, double top, double right, double bottom)
Shrinks this `AbstractRectangleBasedGeometry` by the specified amounts.

Parameters:
  `left` - the amount to shrink the left side
  `top` - the amount to shrink the top side
  `right` - the amount to shrink the right side
  `bottom` - the amount to shrink the bottom side
Returns:
  `this` for convenience

### translate

public RoundedRectangle translate(double dx, double dy)
Description copied from interface: `ITranslatable`
Translates the object by the given values in x and y direction.

Specified by:
  `translate` in interface `ITranslatable<T extends org.eclipse.gef.geometry.planar.AbstractRectangleBasedGeometry<?,?>>`
Parameters:
  `dx` - x-translation
  `dy` - y-translation
Returns:
  `this` for convenience

### translate

public RoundedRectangle translate(Point p)
Description copied from interface: `ITranslatable`
Translates the object by the given `Point`.

Specified by:
  `translate` in interface `ITranslatable<T extends org.eclipse.gef.geometry.planar.AbstractRectangleBasedGeometry<?,?>>`
Parameters:
  `p` - translation `Point`
Returns:
  `this` for convenience

### clone

public Object clone()
Overridden with public visibility as recommended within `Cloneable` .

Overrides:
  `clone` in class `Object`

### hashCode

public final int hashCode()

Overrides:
  `hashCode` in class `Object`
See Also:
  - `Object.hashCode()`

### touches

public boolean touches(IGeometry g)
Description copied from interface: `IGeometry`
Returns `true` if the input `IGeometry` touches this `IGeometry`, i.e. there is at least one common point.

Specified by:
  `touches` in interface `IGeometry`
Parameters:
  `g` - The `IGeometry` for the intersection test
Returns:
  `true` if the input `IGeometry` and this `IGeometry` have at least one common point.