2362N/A * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * <code>RectangularShape</code> is the base class for a number of 0N/A * {@link Shape} objects whose geometry is defined by a rectangular frame. 0N/A * This class does not directly specify any specific geometry by 0N/A * itself, but merely provides manipulation methods inherited by 0N/A * a whole category of <code>Shape</code> objects. 0N/A * The manipulation methods provided by this class can be used to 0N/A * query and modify the rectangular frame, which provides a reference 0N/A * for the subclasses to define their geometry. 0N/A * @author Jim Graham 0N/A * This is an abstract class that cannot be instantiated directly. 0N/A * @see RoundRectangle2D 0N/A * Returns the X coordinate of the upper-left corner of 0N/A * the framing rectangle in <code>double</code> precision. 0N/A * @return the X coordinate of the upper-left corner of 0N/A * the framing rectangle. 0N/A * Returns the Y coordinate of the upper-left corner of 0N/A * the framing rectangle in <code>double</code> precision. 0N/A * @return the Y coordinate of the upper-left corner of 0N/A * the framing rectangle. 0N/A * Returns the width of the framing rectangle in 0N/A * <code>double</code> precision. 0N/A * @return the width of the framing rectangle. 0N/A * Returns the height of the framing rectangle 0N/A * in <code>double</code> precision. 0N/A * @return the height of the framing rectangle. 0N/A * Returns the smallest X coordinate of the framing 0N/A * rectangle of the <code>Shape</code> in <code>double</code> 0N/A * @return the smallest X coordinate of the framing 0N/A * rectangle of the <code>Shape</code>. 0N/A * Returns the smallest Y coordinate of the framing 0N/A * rectangle of the <code>Shape</code> in <code>double</code> 0N/A * @return the smallest Y coordinate of the framing 0N/A * rectangle of the <code>Shape</code>. 0N/A * Returns the largest X coordinate of the framing 0N/A * rectangle of the <code>Shape</code> in <code>double</code> 0N/A * @return the largest X coordinate of the framing 0N/A * rectangle of the <code>Shape</code>. 0N/A * Returns the largest Y coordinate of the framing 0N/A * rectangle of the <code>Shape</code> in <code>double</code> 0N/A * @return the largest Y coordinate of the framing 0N/A * rectangle of the <code>Shape</code>. 0N/A * Returns the X coordinate of the center of the framing 0N/A * rectangle of the <code>Shape</code> in <code>double</code> 0N/A * @return the X coordinate of the center of the framing rectangle 0N/A * of the <code>Shape</code>. 0N/A * Returns the Y coordinate of the center of the framing 0N/A * rectangle of the <code>Shape</code> in <code>double</code> 0N/A * @return the Y coordinate of the center of the framing rectangle 0N/A * of the <code>Shape</code>. 0N/A * Returns the framing {@link Rectangle2D} 0N/A * that defines the overall shape of this object. 0N/A * @return a <code>Rectangle2D</code>, specified in 0N/A * <code>double</code> coordinates. 0N/A * @see #setFrame(double, double, double, double) 0N/A * @see #setFrame(Point2D, Dimension2D) 0N/A * @see #setFrame(Rectangle2D) 0N/A * Determines whether the <code>RectangularShape</code> is empty. 0N/A * When the <code>RectangularShape</code> is empty, it encloses no 0N/A * @return <code>true</code> if the <code>RectangularShape</code> is empty; 0N/A * <code>false</code> otherwise. 0N/A * Sets the location and size of the framing rectangle of this 0N/A * <code>Shape</code> to the specified rectangular values. 0N/A * @param x the X coordinate of the upper-left corner of the 0N/A * specified rectangular shape 0N/A * @param y the Y coordinate of the upper-left corner of the 0N/A * specified rectangular shape 0N/A * @param w the width of the specified rectangular shape 0N/A * @param h the height of the specified rectangular shape 0N/A public abstract void setFrame(
double x,
double y,
double w,
double h);
0N/A * Sets the location and size of the framing rectangle of this 0N/A * <code>Shape</code> to the specified {@link Point2D} and 0N/A * {@link Dimension2D}, respectively. The framing rectangle is used 0N/A * by the subclasses of <code>RectangularShape</code> to define 0N/A * @param loc the specified <code>Point2D</code> 0N/A * @param size the specified <code>Dimension2D</code> 0N/A * Sets the framing rectangle of this <code>Shape</code> to 0N/A * be the specified <code>Rectangle2D</code>. The framing rectangle is 0N/A * used by the subclasses of <code>RectangularShape</code> to define 0N/A * @param r the specified <code>Rectangle2D</code> 0N/A * Sets the diagonal of the framing rectangle of this <code>Shape</code> 0N/A * based on the two specified coordinates. The framing rectangle is 0N/A * used by the subclasses of <code>RectangularShape</code> to define 0N/A * @param x1 the X coordinate of the start point of the specified diagonal 0N/A * @param y1 the Y coordinate of the start point of the specified diagonal 0N/A * @param x2 the X coordinate of the end point of the specified diagonal 0N/A * @param y2 the Y coordinate of the end point of the specified diagonal 0N/A * Sets the diagonal of the framing rectangle of this <code>Shape</code> 0N/A * based on two specified <code>Point2D</code> objects. The framing 0N/A * rectangle is used by the subclasses of <code>RectangularShape</code> 0N/A * to define their geometry. 0N/A * @param p1 the start <code>Point2D</code> of the specified diagonal 0N/A * @param p2 the end <code>Point2D</code> of the specified diagonal 0N/A * Sets the framing rectangle of this <code>Shape</code> 0N/A * based on the specified center point coordinates and corner point 0N/A * coordinates. The framing rectangle is used by the subclasses of 0N/A * <code>RectangularShape</code> to define their geometry. 0N/A * @param centerX the X coordinate of the specified center point 0N/A * @param centerY the Y coordinate of the specified center point 0N/A * @param cornerX the X coordinate of the specified corner point 0N/A * @param cornerY the Y coordinate of the specified corner point 0N/A * Sets the framing rectangle of this <code>Shape</code> based on a 0N/A * specified center <code>Point2D</code> and corner 0N/A * <code>Point2D</code>. The framing rectangle is used by the subclasses 0N/A * of <code>RectangularShape</code> to define their geometry. 0N/A * @param center the specified center <code>Point2D</code> 0N/A * @param corner the specified corner <code>Point2D</code> 0N/A * Returns an iterator object that iterates along the 0N/A * <code>Shape</code> object's boundary and provides access to a 0N/A * flattened view of the outline of the <code>Shape</code> 0N/A * object's geometry. 0N/A * Only SEG_MOVETO, SEG_LINETO, and SEG_CLOSE point types will 0N/A * be returned by the iterator. 0N/A * The amount of subdivision of the curved segments is controlled 0N/A * by the <code>flatness</code> parameter, which specifies the 0N/A * maximum distance that any point on the unflattened transformed 0N/A * curve can deviate from the returned flattened path segments. 0N/A * An optional {@link AffineTransform} can 0N/A * be specified so that the coordinates returned in the iteration are 0N/A * transformed accordingly. 0N/A * @param at an optional <code>AffineTransform</code> to be applied to the 0N/A * coordinates as they are returned in the iteration, 0N/A * or <code>null</code> if untransformed coordinates are desired. 0N/A * @param flatness the maximum distance that the line segments used to 0N/A * approximate the curved segments are allowed to deviate 0N/A * from any point on the original curve 0N/A * @return a <code>PathIterator</code> object that provides access to 0N/A * the <code>Shape</code> object's flattened geometry. 0N/A * Creates a new object of the same class and with the same 0N/A * contents as this object. 0N/A * @return a clone of this instance. 0N/A * @exception OutOfMemoryError if there is not enough memory. 0N/A * @see java.lang.Cloneable 0N/A // this shouldn't happen, since we are Cloneable