pythagoras.d

## Class RectangularShape

• ### Constructor Summary

Constructors
Constructor and Description
`RectangularShape()`
• ### Method Summary

All Methods
Modifier and Type Method and Description
`Rectangle` `bounds()`
Returns a copy of the bounding rectangle for this shape.
`Rectangle` `bounds(Rectangle target)`
Initializes the supplied rectangle with this shape's bounding rectangle.
`Point` `center()`
Returns the center of the framing rectangle.
`double` `centerX()`
Returns the x-coordinate of the center of the framing rectangle.
`double` `centerY()`
Returns the y-coordinate of the center of the framing rectangle.
`boolean` `contains(IRectangle rect)`
Returns true if this shape completely contains the supplied rectangle.
`boolean` `contains(XY point)`
Returns true if this shape contains the supplied point.
`Rectangle` `frame()`
Returns a copy of this shape's framing rectangle.
`Rectangle` `frame(Rectangle target)`
Initializes the supplied rectangle with this shape's framing rectangle.
`boolean` `intersects(IRectangle rect)`
Returns true if this shape intersects the supplied rectangle.
`boolean` `isEmpty()`
Returns true if this shape encloses no area.
`Point` `max()`
Returns the maximum x,y-coordinate of the framing rectangle.
`double` `maxX()`
Returns the maximum x-coordinate of the framing rectangle.
`double` `maxY()`
Returns the maximum y-coordinate of the framing rectangle.
`Point` `min()`
Returns the minimum x,y-coordinate of the framing rectangle.
`double` `minX()`
Returns the minimum x-coordinate of the framing rectangle.
`double` `minY()`
Returns the minimum y-coordinate of the framing rectangle.
`PathIterator` ```pathIterator(Transform t, double flatness)```
Returns an iterator over the path described by this shape.
`abstract void` ```setFrame(double x, double y, double width, double height)```
Sets the location and size of the framing rectangle of this shape to the specified values.
`void` `setFrame(IRectangle r)`
Sets the location and size of the framing rectangle of this shape to be equal to the supplied rectangle.
`void` ```setFrame(XY loc, IDimension size)```
Sets the location and size of the framing rectangle of this shape to the supplied values.
`void` ```setFrameFromCenter(double centerX, double centerY, double cornerX, double cornerY)```
Sets the location and size of the framing rectangle of this shape based on the specified center and corner points.
`void` ```setFrameFromCenter(XY center, XY corner)```
Sets the location and size of the framing rectangle of this shape based on the supplied center and corner points.
`void` ```setFrameFromDiagonal(double x1, double y1, double x2, double y2)```
Sets the location and size of the framing rectangle of this shape based on the specified diagonal line.
`void` ```setFrameFromDiagonal(XY p1, XY p2)```
Sets the location and size of the framing rectangle of this shape based on the supplied diagonal line.
• ### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• ### Methods inherited from interface pythagoras.d.IRectangularShape

`height, width, x, y`
• ### Methods inherited from interface pythagoras.d.IShape

`contains, contains, intersects, pathIterator`
• ### Constructor Detail

• #### RectangularShape

`public RectangularShape()`
• ### Method Detail

• #### setFrame

```public abstract void setFrame(double x,
double y,
double width,
double height)```
Sets the location and size of the framing rectangle of this shape to the specified values.
• #### setFrame

```public void setFrame(XY loc,
IDimension size)```
Sets the location and size of the framing rectangle of this shape to the supplied values.
• #### setFrame

`public void setFrame(IRectangle r)`
Sets the location and size of the framing rectangle of this shape to be equal to the supplied rectangle.
• #### setFrameFromDiagonal

```public void setFrameFromDiagonal(double x1,
double y1,
double x2,
double y2)```
Sets the location and size of the framing rectangle of this shape based on the specified diagonal line.
• #### setFrameFromDiagonal

```public void setFrameFromDiagonal(XY p1,
XY p2)```
Sets the location and size of the framing rectangle of this shape based on the supplied diagonal line.
• #### setFrameFromCenter

```public void setFrameFromCenter(double centerX,
double centerY,
double cornerX,
double cornerY)```
Sets the location and size of the framing rectangle of this shape based on the specified center and corner points.
• #### setFrameFromCenter

```public void setFrameFromCenter(XY center,
XY corner)```
Sets the location and size of the framing rectangle of this shape based on the supplied center and corner points.
• #### min

`public Point min()`
Description copied from interface: `IRectangularShape`
Returns the minimum x,y-coordinate of the framing rectangle.
Specified by:
`min` in interface `IRectangularShape`
• #### minX

`public double minX()`
Description copied from interface: `IRectangularShape`
Returns the minimum x-coordinate of the framing rectangle.
Specified by:
`minX` in interface `IRectangularShape`
• #### minY

`public double minY()`
Description copied from interface: `IRectangularShape`
Returns the minimum y-coordinate of the framing rectangle.
Specified by:
`minY` in interface `IRectangularShape`
• #### max

`public Point max()`
Description copied from interface: `IRectangularShape`
Returns the maximum x,y-coordinate of the framing rectangle.
Specified by:
`max` in interface `IRectangularShape`
• #### maxX

`public double maxX()`
Description copied from interface: `IRectangularShape`
Returns the maximum x-coordinate of the framing rectangle.
Specified by:
`maxX` in interface `IRectangularShape`
• #### maxY

`public double maxY()`
Description copied from interface: `IRectangularShape`
Returns the maximum y-coordinate of the framing rectangle.
Specified by:
`maxY` in interface `IRectangularShape`
• #### center

`public Point center()`
Description copied from interface: `IRectangularShape`
Returns the center of the framing rectangle.
Specified by:
`center` in interface `IRectangularShape`
• #### centerX

`public double centerX()`
Description copied from interface: `IRectangularShape`
Returns the x-coordinate of the center of the framing rectangle.
Specified by:
`centerX` in interface `IRectangularShape`
• #### centerY

`public double centerY()`
Description copied from interface: `IRectangularShape`
Returns the y-coordinate of the center of the framing rectangle.
Specified by:
`centerY` in interface `IRectangularShape`
• #### frame

`public Rectangle frame()`
Description copied from interface: `IRectangularShape`
Returns a copy of this shape's framing rectangle.
Specified by:
`frame` in interface `IRectangularShape`
• #### frame

`public Rectangle frame(Rectangle target)`
Description copied from interface: `IRectangularShape`
Initializes the supplied rectangle with this shape's framing rectangle.
Specified by:
`frame` in interface `IRectangularShape`
Returns:
the supplied rectangle.
• #### isEmpty

`public boolean isEmpty()`
Description copied from interface: `IShape`
Returns true if this shape encloses no area.
Specified by:
`isEmpty` in interface `IShape`
• #### contains

`public boolean contains(XY point)`
Description copied from interface: `IShape`
Returns true if this shape contains the supplied point.
Specified by:
`contains` in interface `IShape`
• #### contains

`public boolean contains(IRectangle rect)`
Description copied from interface: `IShape`
Returns true if this shape completely contains the supplied rectangle.
Specified by:
`contains` in interface `IShape`
• #### intersects

`public boolean intersects(IRectangle rect)`
Description copied from interface: `IShape`
Returns true if this shape intersects the supplied rectangle.
Specified by:
`intersects` in interface `IShape`
• #### bounds

`public Rectangle bounds()`
Description copied from interface: `IShape`
Returns a copy of the bounding rectangle for this shape.
Specified by:
`bounds` in interface `IShape`
• #### bounds

`public Rectangle bounds(Rectangle target)`
Description copied from interface: `IShape`
Initializes the supplied rectangle with this shape's bounding rectangle.
Specified by:
`bounds` in interface `IShape`
Returns:
the supplied rectangle.
• #### pathIterator

```public PathIterator pathIterator(Transform t,
double flatness)```
Description copied from interface: `IShape`
Returns an iterator over the path described by this shape.
Specified by:
`pathIterator` in interface `IShape`
Parameters:
`t` - if supplied, the points in the path are transformed using this.
`flatness` - when approximating curved segments with lines, this controls the maximum distance the lines are allowed to deviate from the approximated curve, thus a higher flatness value generally allows for a path with fewer segments.