declare namespace java {
namespace awt {
namespace geom {
/**
* The Rectangle2D
class describes a rectangle
* defined by a location {@code (x,y)} and dimension
* {@code (w x h)}.
*
* This class is only the abstract superclass for all objects that
* store a 2D rectangle.
* The actual storage representation of the coordinates is left to
* the subclass.
* @author Jim Graham
* @since 1.2
*/
// @ts-ignore
abstract class Rectangle2D extends java.awt.geom.RectangularShape {
/**
* This is an abstract class that cannot be instantiated directly.
* Type-specific implementation subclasses are available for
* instantiation and provide a number of formats for storing
* the information necessary to satisfy the various accessor
* methods below.
* @see java.awt.geom.Rectangle2D.Float
* @see java.awt.geom.Rectangle2D.Double
* @see java.awt.Rectangle
* @since 1.2
*/
// @ts-ignore
constructor()
/**
* The bitmask that indicates that a point lies to the left of
* this Rectangle2D
.
* @since 1.2
*/
// @ts-ignore
public static readonly OUT_LEFT: number /*int*/
/**
* The bitmask that indicates that a point lies above
* this Rectangle2D
.
* @since 1.2
*/
// @ts-ignore
public static readonly OUT_TOP: number /*int*/
/**
* The bitmask that indicates that a point lies to the right of
* this Rectangle2D
.
* @since 1.2
*/
// @ts-ignore
public static readonly OUT_RIGHT: number /*int*/
/**
* The bitmask that indicates that a point lies below
* this Rectangle2D
.
* @since 1.2
*/
// @ts-ignore
public static readonly OUT_BOTTOM: number /*int*/
/**
* Sets the location and size of this Rectangle2D
* to the specified double
values.
* @param x the X coordinate of the upper-left corner
* of this Rectangle2D
* @param y the Y coordinate of the upper-left corner
* of this Rectangle2D
* @param w the width of this Rectangle2D
* @param h the height of this Rectangle2D
* @since 1.2
*/
// @ts-ignore
public abstract setRect(x: number /*double*/, y: number /*double*/, w: number /*double*/, h: number /*double*/): void
/**
* Sets this Rectangle2D
to be the same as the specified
* Rectangle2D
.
* @param r the specified Rectangle2D
* @since 1.2
*/
// @ts-ignore
public setRect(r: java.awt.geom.Rectangle2D): void
/**
* Tests if the specified line segment intersects the interior of this
* Rectangle2D
.
* @param x1 the X coordinate of the start point of the specified
* line segment
* @param y1 the Y coordinate of the start point of the specified
* line segment
* @param x2 the X coordinate of the end point of the specified
* line segment
* @param y2 the Y coordinate of the end point of the specified
* line segment
* @return true
if the specified line segment intersects
* the interior of this Rectangle2D
; false
* otherwise.
* @since 1.2
*/
// @ts-ignore
public intersectsLine(x1: number /*double*/, y1: number /*double*/, x2: number /*double*/, y2: number /*double*/): boolean
/**
* Tests if the specified line segment intersects the interior of this
* Rectangle2D
.
* @param l the specified {#link Line2D} to test for intersection
* with the interior of this Rectangle2D
* @return true
if the specified Line2D
* intersects the interior of this Rectangle2D
;
* false
otherwise.
* @since 1.2
*/
// @ts-ignore
public intersectsLine(l: java.awt.geom.Line2D): boolean
/**
* Determines where the specified coordinates lie with respect
* to this Rectangle2D
.
* This method computes a binary OR of the appropriate mask values
* indicating, for each side of this Rectangle2D
,
* whether or not the specified coordinates are on the same side
* of the edge as the rest of this Rectangle2D
.
* @param x the specified X coordinate
* @param y the specified Y coordinate
* @return the logical OR of all appropriate out codes.
* @see #OUT_LEFT
* @see #OUT_TOP
* @see #OUT_RIGHT
* @see #OUT_BOTTOM
* @since 1.2
*/
// @ts-ignore
public abstract outcode(x: number /*double*/, y: number /*double*/): number /*int*/
/**
* Determines where the specified {@link Point2D} lies with
* respect to this Rectangle2D
.
* This method computes a binary OR of the appropriate mask values
* indicating, for each side of this Rectangle2D
,
* whether or not the specified Point2D
is on the same
* side of the edge as the rest of this Rectangle2D
.
* @param p the specified Point2D
* @return the logical OR of all appropriate out codes.
* @see #OUT_LEFT
* @see #OUT_TOP
* @see #OUT_RIGHT
* @see #OUT_BOTTOM
* @since 1.2
*/
// @ts-ignore
public outcode(p: java.awt.geom.Point2D): number /*int*/
/**
* Sets the location and size of the outer bounds of this
* Rectangle2D
to the specified rectangular values.
* @param x the X coordinate of the upper-left corner
* of this Rectangle2D
* @param y the Y coordinate of the upper-left corner
* of this Rectangle2D
* @param w the width of this Rectangle2D
* @param h the height of this Rectangle2D
* @since 1.2
*/
// @ts-ignore
public setFrame(x: number /*double*/, y: number /*double*/, w: number /*double*/, h: number /*double*/): void
/**
* {@inheritDoc}
* @since 1.2
*/
// @ts-ignore
public getBounds2D(): java.awt.geom.Rectangle2D
/**
* {@inheritDoc}
* @since 1.2
*/
// @ts-ignore
public contains(x: number /*double*/, y: number /*double*/): boolean
/**
* {@inheritDoc}
* @since 1.2
*/
// @ts-ignore
public intersects(x: number /*double*/, y: number /*double*/, w: number /*double*/, h: number /*double*/): boolean
/**
* {@inheritDoc}
* @since 1.2
*/
// @ts-ignore
public contains(x: number /*double*/, y: number /*double*/, w: number /*double*/, h: number /*double*/): boolean
/**
* Returns a new Rectangle2D
object representing the
* intersection of this Rectangle2D
with the specified
* Rectangle2D
.
* @param r the Rectangle2D
to be intersected with
* this Rectangle2D
* @return the largest Rectangle2D
contained in both
* the specified Rectangle2D
and in this
* Rectangle2D
.
* @since 1.2
*/
// @ts-ignore
public abstract createIntersection(r: java.awt.geom.Rectangle2D): java.awt.geom.Rectangle2D
/**
* Intersects the pair of specified source Rectangle2D
* objects and puts the result into the specified destination
* Rectangle2D
object. One of the source rectangles
* can also be the destination to avoid creating a third Rectangle2D
* object, but in this case the original points of this source
* rectangle will be overwritten by this method.
* @param src1 the first of a pair of Rectangle2D
* objects to be intersected with each other
* @param src2 the second of a pair of Rectangle2D
* objects to be intersected with each other
* @param dest the Rectangle2D
that holds the
* results of the intersection of src1
and
* src2
* @since 1.2
*/
// @ts-ignore
public static intersect(src1: java.awt.geom.Rectangle2D, src2: java.awt.geom.Rectangle2D, dest: java.awt.geom.Rectangle2D): void
/**
* Returns a new Rectangle2D
object representing the
* union of this Rectangle2D
with the specified
* Rectangle2D
.
* @param r the Rectangle2D
to be combined with
* this Rectangle2D
* @return the smallest Rectangle2D
containing both
* the specified Rectangle2D
and this
* Rectangle2D
.
* @since 1.2
*/
// @ts-ignore
public abstract createUnion(r: java.awt.geom.Rectangle2D): java.awt.geom.Rectangle2D
/**
* Unions the pair of source Rectangle2D
objects
* and puts the result into the specified destination
* Rectangle2D
object. One of the source rectangles
* can also be the destination to avoid creating a third Rectangle2D
* object, but in this case the original points of this source
* rectangle will be overwritten by this method.
* @param src1 the first of a pair of Rectangle2D
* objects to be combined with each other
* @param src2 the second of a pair of Rectangle2D
* objects to be combined with each other
* @param dest the Rectangle2D
that holds the
* results of the union of src1
and
* src2
* @since 1.2
*/
// @ts-ignore
public static union(src1: java.awt.geom.Rectangle2D, src2: java.awt.geom.Rectangle2D, dest: java.awt.geom.Rectangle2D): void
/**
* Adds a point, specified by the double precision arguments
* newx
and newy
, to this
* Rectangle2D
. The resulting Rectangle2D
* is the smallest Rectangle2D
that
* contains both the original Rectangle2D
and the
* specified point.
*
* After adding a point, a call to contains
with the
* added point as an argument does not necessarily return
* true
. The contains
method does not
* return true
for points on the right or bottom
* edges of a rectangle. Therefore, if the added point falls on
* the left or bottom edge of the enlarged rectangle,
* contains
returns false
for that point.
* @param newx the X coordinate of the new point
* @param newy the Y coordinate of the new point
* @since 1.2
*/
// @ts-ignore
public add(newx: number /*double*/, newy: number /*double*/): void
/**
* Adds the Point2D
object pt
to this
* Rectangle2D
.
* The resulting Rectangle2D
is the smallest
* Rectangle2D
that contains both the original
* Rectangle2D
and the specified Point2D
.
*
* After adding a point, a call to contains
with the
* added point as an argument does not necessarily return
* true
. The contains
* method does not return true
for points on the right
* or bottom edges of a rectangle. Therefore, if the added point falls
* on the left or bottom edge of the enlarged rectangle,
* contains
returns false
for that point.
* @param pt the new Point2D
to add to this
* Rectangle2D
.
* @since 1.2
*/
// @ts-ignore
public add(pt: java.awt.geom.Point2D): void
/**
* Adds a Rectangle2D
object to this
* Rectangle2D
. The resulting Rectangle2D
* is the union of the two Rectangle2D
objects.
* @param r the Rectangle2D
to add to this
* Rectangle2D
.
* @since 1.2
*/
// @ts-ignore
public add(r: java.awt.geom.Rectangle2D): void
/**
* Returns an iteration object that defines the boundary of this
* Rectangle2D
.
* The iterator for this class is multi-threaded safe, which means
* that this Rectangle2D
class guarantees that
* modifications to the geometry of this Rectangle2D
* object do not affect any iterations of that geometry that
* are already in process.
* @param at an optional AffineTransform
to be applied to
* the coordinates as they are returned in the iteration, or
* null
if untransformed coordinates are desired
* @return the PathIterator
object that returns the
* geometry of the outline of this
* Rectangle2D
, one segment at a time.
* @since 1.2
*/
// @ts-ignore
public getPathIterator(at: java.awt.geom.AffineTransform): java.awt.geom.PathIterator
/**
* Returns an iteration object that defines the boundary of the
* flattened Rectangle2D
. Since rectangles are already
* flat, the flatness
parameter is ignored.
* The iterator for this class is multi-threaded safe, which means
* that this Rectangle2D
class guarantees that
* modifications to the geometry of this Rectangle2D
* object do not affect any iterations of that geometry that
* are already in process.
* @param at an optional AffineTransform
to be applied to
* the coordinates as they are returned in the iteration, or
* null
if untransformed coordinates are desired
* @param flatness the maximum distance that the line segments used to
* approximate the curved segments are allowed to deviate from any
* point on the original curve. Since rectangles are already flat,
* the flatness
parameter is ignored.
* @return the PathIterator
object that returns the
* geometry of the outline of this
* Rectangle2D
, one segment at a time.
* @since 1.2
*/
// @ts-ignore
public getPathIterator(at: java.awt.geom.AffineTransform, flatness: number /*double*/): java.awt.geom.PathIterator
/**
* Returns the hashcode for this Rectangle2D
.
* @return the hashcode for this Rectangle2D
.
* @since 1.2
*/
// @ts-ignore
public hashCode(): number /*int*/
/**
* Determines whether or not the specified Object
is
* equal to this Rectangle2D
. The specified
* Object
is equal to this Rectangle2D
* if it is an instance of Rectangle2D
and if its
* location and size are the same as this Rectangle2D
.
* @param obj an Object
to be compared with this
* Rectangle2D
.
* @return true
if obj
is an instance
* of Rectangle2D
and has
* the same values; false
otherwise.
* @since 1.2
*/
// @ts-ignore
public equals(obj: java.lang.Object | any): boolean
}
}
}
}