2362N/A * Copyright (c) 1997, 2006, 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 * The <code>Ellipse2D</code> class describes an ellipse that is defined 0N/A * by a framing rectangle. 0N/A * This class is only the abstract superclass for all objects which 0N/A * store a 2D ellipse. 0N/A * The actual storage representation of the coordinates is left to 0N/A * @author Jim Graham 0N/A * The <code>Float</code> class defines an ellipse specified 0N/A * in <code>float</code> precision. 0N/A * The X coordinate of the upper-left corner of the 0N/A * framing rectangle of this {@code Ellipse2D}. 0N/A * The Y coordinate of the upper-left corner of the 0N/A * framing rectangle of this {@code Ellipse2D}. 0N/A * The overall width of this <code>Ellipse2D</code>. 0N/A * The overall height of this <code>Ellipse2D</code>. 0N/A * Constructs a new <code>Ellipse2D</code>, initialized to 0N/A * location (0, 0) and size (0, 0). 0N/A * Constructs and initializes an <code>Ellipse2D</code> from the 0N/A * specified coordinates. 0N/A * @param x the X coordinate of the upper-left corner 0N/A * of the framing rectangle 0N/A * @param y the Y coordinate of the upper-left corner 0N/A * of the framing rectangle 0N/A * @param w the width of the framing rectangle 0N/A * @param h the height of the framing rectangle 0N/A public Float(
float x,
float y,
float w,
float h) {
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 void setFrame(
float x,
float y,
float w,
float h) {
0N/A public void setFrame(
double x,
double y,
double w,
double h) {
0N/A * JDK 1.6 serialVersionUID 0N/A * The <code>Double</code> class defines an ellipse specified 0N/A * in <code>double</code> precision. 0N/A * The X coordinate of the upper-left corner of the 0N/A * framing rectangle of this {@code Ellipse2D}. 0N/A * The Y coordinate of the upper-left corner of the 0N/A * framing rectangle of this {@code Ellipse2D}. 0N/A * The overall width of this <code>Ellipse2D</code>. 0N/A * The overall height of the <code>Ellipse2D</code>. 0N/A * Constructs a new <code>Ellipse2D</code>, initialized to 0N/A * location (0, 0) and size (0, 0). 0N/A * Constructs and initializes an <code>Ellipse2D</code> from the 0N/A * specified coordinates. 0N/A * @param x the X coordinate of the upper-left corner 0N/A * of the framing rectangle 0N/A * @param y the Y coordinate of the upper-left corner 0N/A * of the framing rectangle 0N/A * @param w the width of the framing rectangle 0N/A * @param h the height of the framing rectangle 0N/A public Double(
double x,
double y,
double w,
double h) {
0N/A public void setFrame(
double x,
double y,
double w,
double h) {
0N/A * JDK 1.6 serialVersionUID 0N/A * This is an abstract class that cannot be instantiated directly. 0N/A * Type-specific implementation subclasses are available for 0N/A * instantiation and provide a number of formats for storing 0N/A * the information necessary to satisfy the various accessor 0N/A * @see java.awt.geom.Ellipse2D.Float 0N/A * @see java.awt.geom.Ellipse2D.Double 0N/A // Normalize the coordinates compared to the ellipse 0N/A // having a center at 0,0 and a radius of 0.5. 0N/A public boolean intersects(
double x,
double y,
double w,
double h) {
0N/A if (w <=
0.0 || h <=
0.0) {
0N/A // Normalize the rectangular coordinates compared to the ellipse 0N/A // having a center at 0,0 and a radius of 0.5. 0N/A // find nearest x (left edge, right edge, 0.0) 0N/A // find nearest y (top edge, bottom edge, 0.0) 0N/A // if nearest x,y is inside circle of radius 0.5, then intersects 0N/A // center to left of X extents 0N/A // center to right of X extents 0N/A // center above Y extents 0N/A // center below Y extents 0N/A public boolean contains(
double x,
double y,
double w,
double h) {
0N/A * Returns an iteration object that defines the boundary of this 0N/A * <code>Ellipse2D</code>. 0N/A * The iterator for this class is multi-threaded safe, which means 0N/A * that this <code>Ellipse2D</code> class guarantees that 0N/A * modifications to the geometry of this <code>Ellipse2D</code> 0N/A * object do not affect any iterations of that geometry that 0N/A * are already in process. 0N/A * @param at an optional <code>AffineTransform</code> to be applied to 0N/A * the coordinates as they are returned in the iteration, or 0N/A * <code>null</code> if untransformed coordinates are desired 0N/A * @return the <code>PathIterator</code> object that returns the 0N/A * geometry of the outline of this <code>Ellipse2D</code>, 0N/A * one segment at a time. 0N/A * Returns the hashcode for this <code>Ellipse2D</code>. 0N/A * @return the hashcode for this <code>Ellipse2D</code>. 0N/A * Determines whether or not the specified <code>Object</code> is 0N/A * equal to this <code>Ellipse2D</code>. The specified 0N/A * <code>Object</code> is equal to this <code>Ellipse2D</code> 0N/A * if it is an instance of <code>Ellipse2D</code> and if its 0N/A * location and size are the same as this <code>Ellipse2D</code>. 0N/A * @param obj an <code>Object</code> to be compared with this 0N/A * <code>Ellipse2D</code>. 0N/A * @return <code>true</code> if <code>obj</code> is an instance 0N/A * of <code>Ellipse2D</code> and has the same values; 0N/A * <code>false</code> otherwise.