Top Description Fields Constructors Methods
com.sun.javafx.geom

public abstract Class RectangularShape

extends Shape
Class Inheritance
Known Direct Subclasses
com.sun.javafx.geom.RoundRectangle2D, com.sun.javafx.geom.Arc2D, com.sun.javafx.geom.Ellipse2D
Imports
com.sun.javafx.geom.transform.BaseTransform

RectangularShape is the base class for a number of Shape objects whose geometry is defined by a rectangular frame. This class does not directly specify any specific geometry by itself, but merely provides manipulation methods inherited by a whole category of Shape objects. The manipulation methods provided by this class can be used to query and modify the rectangular frame, which provides a reference for the subclasses to define their geometry.
Version
1.26, 05/05/07

Field Summary

Inherited from com.sun.javafx.geom.Shape:
OUT_BOTTOMOUT_LEFTOUT_RIGHTOUT_TOPRECT_INTERSECTS

Constructor Summary

AccessConstructor and Description
protected
RectangularShape()

This is an abstract class that cannot be instantiated directly.

Method Summary

Modifier and TypeMethod and Description
public boolean
contains(Point2D
the specified Point2D to be tested
p
)

Overrides com.sun.javafx.geom.Shape.contains.

Tests if a specified Point2D is inside the boundary of the Shape.

public RectBounds
getBounds()

Implements abstract com.sun.javafx.geom.Shape.getBounds.

Note that there is no guarantee that the returned RectBounds is the smallest bounding box that encloses the Shape, only that the Shape lies entirely within the indicated RectBounds.

public float

Returns:

the X coordinate of the center of the framing rectangle of the Shape.
getCenterX
()

Returns the X coordinate of the center of the framing rectangle of the Shape in double precision.

public float

Returns:

the Y coordinate of the center of the framing rectangle of the Shape.
getCenterY
()

Returns the Y coordinate of the center of the framing rectangle of the Shape in double precision.

public abstract float

Returns:

the height of the framing rectangle.
getHeight
()

Returns the height of the framing rectangle in double precision.

public float

Returns:

the largest X coordinate of the framing rectangle of the Shape.
getMaxX
()

Returns the largest X coordinate of the framing rectangle of the Shape in double precision.

public float

Returns:

the largest Y coordinate of the framing rectangle of the Shape.
getMaxY
()

Returns the largest Y coordinate of the framing rectangle of the Shape in double precision.

public float

Returns:

the smallest X coordinate of the framing rectangle of the Shape.
getMinX
()

Returns the smallest X coordinate of the framing rectangle of the Shape in double precision.

public float

Returns:

the smallest Y coordinate of the framing rectangle of the Shape.
getMinY
()

Returns the smallest Y coordinate of the framing rectangle of the Shape in double precision.

public PathIterator

Returns:

a PathIterator object that provides access to the Shape object's flattened geometry.
getPathIterator
(BaseTransform
an optional BaseTransform to be applied to the coordinates as they are returned in the iteration, or null if untransformed coordinates are desired.
tx
,
float
the maximum distance that the line segments used to approximate the curved segments are allowed to deviate from any point on the original curve
flatness
)

Implements abstract com.sun.javafx.geom.Shape.getPathIterator.

Returns an iterator object that iterates along the Shape object's boundary and provides access to a flattened view of the outline of the Shape object's geometry.

public abstract float

Returns:

the width of the framing rectangle.
getWidth
()

Returns the width of the framing rectangle in double precision.

public abstract float

Returns:

the X coordinate of the upper-left corner of the framing rectangle.
getX
()

Returns the X coordinate of the upper-left corner of the framing rectangle in double precision.

public abstract float

Returns:

the Y coordinate of the upper-left corner of the framing rectangle.
getY
()

Returns the Y coordinate of the upper-left corner of the framing rectangle in double precision.

public abstract boolean

Returns:

true if the RectangularShape is empty; false otherwise.
isEmpty
()

Determines whether the RectangularShape is empty.

public abstract void
setFrame(float
the X coordinate of the upper-left corner of the specified rectangular shape
x
,
float
the Y coordinate of the upper-left corner of the specified rectangular shape
y
,
float
the width of the specified rectangular shape
w
,
float
the height of the specified rectangular shape
h
)

Sets the location and size of the framing rectangle of this Shape to the specified rectangular values.

public void
setFrame(Point2D
the specified Point2D
loc
,
Dimension2D
the specified Dimension2D
size
)

Sets the location and size of the framing rectangle of this Shape to the specified Point2D and Dimension2D, respectively.

public void
setFrameFromCenter(float
the X coordinate of the specified center point
centerX
,
float
the Y coordinate of the specified center point
centerY
,
float
the X coordinate of the specified corner point
cornerX
,
float
the Y coordinate of the specified corner point
cornerY
)

Sets the framing rectangle of this Shape based on the specified center point coordinates and corner point coordinates.

public void
setFrameFromCenter(Point2D
the specified center Point2D
center
,
Point2D
the specified corner Point2D
corner
)

Sets the framing rectangle of this Shape based on a specified center Point2D and corner Point2D.

public void
setFrameFromDiagonal(float
the X coordinate of the start point of the specified diagonal
x1
,
float
the Y coordinate of the start point of the specified diagonal
y1
,
float
the X coordinate of the end point of the specified diagonal
x2
,
float
the Y coordinate of the end point of the specified diagonal
y2
)

Sets the diagonal of the framing rectangle of this Shape based on the two specified coordinates.

public void
setFrameFromDiagonal(Point2D
the start Point2D of the specified diagonal
p1
,
Point2D
the end Point2D of the specified diagonal
p2
)

Sets the diagonal of the framing rectangle of this Shape based on two specified Point2D objects.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from com.sun.javafx.geom.Shape:
accumulateaccumulateCubicaccumulateCubicaccumulateQuadcontainscontainscontainscopygetPathIteratorintersectsintersectsintersectsLineoutcodepointCrossingsForCubicpointCrossingsForLinepointCrossingsForPathpointCrossingsForQuadrectCrossingsForCubicrectCrossingsForLinerectCrossingsForPathrectCrossingsForQuad

Constructor Detail

RectangularShapeback to summary
protected RectangularShape()

This is an abstract class that cannot be instantiated directly.

See Also
Arc2D, Ellipse2D, Rectangle2D, RoundRectangle2D

Method Detail

containsback to summary
public boolean contains(Point2D p)

Overrides com.sun.javafx.geom.Shape.contains.

Doc from com.sun.javafx.geom.Shape.contains.

Tests if a specified Point2D is inside the boundary of the Shape.

Parameters
p:Point2D

the specified Point2D to be tested

Returns:boolean

true if the specified Point2D is inside the boundary of the Shape; false otherwise.

Annotations
@Override
getBoundsback to summary
public RectBounds getBounds()

Implements abstract com.sun.javafx.geom.Shape.getBounds.

Doc from com.sun.javafx.geom.Shape.getBounds.

Note that there is no guarantee that the returned RectBounds is the smallest bounding box that encloses the Shape, only that the Shape lies entirely within the indicated RectBounds.

Returns:RectBounds

an instance of RectBounds

Annotations
@Override
getCenterXback to summary
public float getCenterX()

Returns the X coordinate of the center of the framing rectangle of the Shape in double precision.

Returns:float

the X coordinate of the center of the framing rectangle of the Shape.

getCenterYback to summary
public float getCenterY()

Returns the Y coordinate of the center of the framing rectangle of the Shape in double precision.

Returns:float

the Y coordinate of the center of the framing rectangle of the Shape.

getHeightback to summary
public abstract float getHeight()

Returns the height of the framing rectangle in double precision.

Returns:float

the height of the framing rectangle.

getMaxXback to summary
public float getMaxX()

Returns the largest X coordinate of the framing rectangle of the Shape in double precision.

Returns:float

the largest X coordinate of the framing rectangle of the Shape.

getMaxYback to summary
public float getMaxY()

Returns the largest Y coordinate of the framing rectangle of the Shape in double precision.

Returns:float

the largest Y coordinate of the framing rectangle of the Shape.

getMinXback to summary
public float getMinX()

Returns the smallest X coordinate of the framing rectangle of the Shape in double precision.

Returns:float

the smallest X coordinate of the framing rectangle of the Shape.

getMinYback to summary
public float getMinY()

Returns the smallest Y coordinate of the framing rectangle of the Shape in double precision.

Returns:float

the smallest Y coordinate of the framing rectangle of the Shape.

getPathIteratorback to summary
public PathIterator getPathIterator(BaseTransform tx, float flatness)

Implements abstract com.sun.javafx.geom.Shape.getPathIterator.

Returns an iterator object that iterates along the Shape object's boundary and provides access to a flattened view of the outline of the Shape object's geometry.

Only SEG_MOVETO, SEG_LINETO, and SEG_CLOSE point types will be returned by the iterator.

The amount of subdivision of the curved segments is controlled by the flatness parameter, which specifies the maximum distance that any point on the unflattened transformed curve can deviate from the returned flattened path segments. An optional BaseTransform can be specified so that the coordinates returned in the iteration are transformed accordingly.

Parameters
tx:BaseTransform

an optional BaseTransform to be applied to the coordinates as they are returned in the iteration, or null if untransformed coordinates are desired.

flatness:float

the maximum distance that the line segments used to approximate the curved segments are allowed to deviate from any point on the original curve

Returns:PathIterator

a PathIterator object that provides access to the Shape object's flattened geometry.

Annotations
@Override
getWidthback to summary
public abstract float getWidth()

Returns the width of the framing rectangle in double precision.

Returns:float

the width of the framing rectangle.

getXback to summary
public abstract float getX()

Returns the X coordinate of the upper-left corner of the framing rectangle in double precision.

Returns:float

the X coordinate of the upper-left corner of the framing rectangle.

getYback to summary
public abstract float getY()

Returns the Y coordinate of the upper-left corner of the framing rectangle in double precision.

Returns:float

the Y coordinate of the upper-left corner of the framing rectangle.

isEmptyback to summary
public abstract boolean isEmpty()

Determines whether the RectangularShape is empty. When the RectangularShape is empty, it encloses no area.

Returns:boolean

true if the RectangularShape is empty; false otherwise.

setFrameback to summary
public abstract void setFrame(float x, float y, float w, float h)

Sets the location and size of the framing rectangle of this Shape to the specified rectangular values.

Parameters
x:float

the X coordinate of the upper-left corner of the specified rectangular shape

y:float

the Y coordinate of the upper-left corner of the specified rectangular shape

w:float

the width of the specified rectangular shape

h:float

the height of the specified rectangular shape

See Also
getFrame
setFrameback to summary
public void setFrame(Point2D loc, Dimension2D size)

Sets the location and size of the framing rectangle of this Shape to the specified Point2D and Dimension2D, respectively. The framing rectangle is used by the subclasses of RectangularShape to define their geometry.

Parameters
loc:Point2D

the specified Point2D

size:Dimension2D

the specified Dimension2D

See Also
getFrame
setFrameFromCenterback to summary
public void setFrameFromCenter(float centerX, float centerY, float cornerX, float cornerY)

Sets the framing rectangle of this Shape based on the specified center point coordinates and corner point coordinates. The framing rectangle is used by the subclasses of RectangularShape to define their geometry.

Parameters
centerX:float

the X coordinate of the specified center point

centerY:float

the Y coordinate of the specified center point

cornerX:float

the X coordinate of the specified corner point

cornerY:float

the Y coordinate of the specified corner point

setFrameFromCenterback to summary
public void setFrameFromCenter(Point2D center, Point2D corner)

Sets the framing rectangle of this Shape based on a specified center Point2D and corner Point2D. The framing rectangle is used by the subclasses of RectangularShape to define their geometry.

Parameters
center:Point2D

the specified center Point2D

corner:Point2D

the specified corner Point2D

setFrameFromDiagonalback to summary
public void setFrameFromDiagonal(float x1, float y1, float x2, float y2)

Sets the diagonal of the framing rectangle of this Shape based on the two specified coordinates. The framing rectangle is used by the subclasses of RectangularShape to define their geometry.

Parameters
x1:float

the X coordinate of the start point of the specified diagonal

y1:float

the Y coordinate of the start point of the specified diagonal

x2:float

the X coordinate of the end point of the specified diagonal

y2:float

the Y coordinate of the end point of the specified diagonal

setFrameFromDiagonalback to summary
public void setFrameFromDiagonal(Point2D p1, Point2D p2)

Sets the diagonal of the framing rectangle of this Shape based on two specified Point2D objects. The framing rectangle is used by the subclasses of RectangularShape to define their geometry.

Parameters
p1:Point2D

the start Point2D of the specified diagonal

p2:Point2D

the end Point2D of the specified diagonal

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override