edu.princeton.cs.algs4.growingtree.framework
Class Ellipse2DNode

java.lang.Object
  extended by java.awt.geom.RectangularShape
      extended by java.awt.geom.Ellipse2D
          extended by java.awt.geom.Ellipse2D.Double
              extended by edu.princeton.cs.algs4.growingtree.framework.Ellipse2DNode
All Implemented Interfaces:
NodeShape, java.awt.Shape, java.io.Serializable, java.lang.Cloneable

public class Ellipse2DNode
extends java.awt.geom.Ellipse2D.Double
implements NodeShape

Ellipse2DNode class implements NodeShape for it is an Ellipse NodeShape that can be used as a node in a tree.

Because it is simply a Shape that also implements getInscribedRectangle, it therefore can use all methods defined within Ellipse2DNode.

Version:
1.2 9/15/01
Author:
Corey Sanders
See Also:
Ellipse2D, NodeShape, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.geom.Ellipse2D
java.awt.geom.Ellipse2D.Double, java.awt.geom.Ellipse2D.Float
 
Field Summary
 
Fields inherited from class java.awt.geom.Ellipse2D.Double
height, width, x, y
 
Constructor Summary
Ellipse2DNode()
          Constructs a new Ellipse2D, initialized to location (0, 0) and size (0, 0).
Ellipse2DNode(double x, double y, double w, double h)
          Constructs and initializes an Ellipse2D from the specified coordinates.
 
Method Summary
 java.awt.geom.Rectangle2D getInscribedRectangle()
          Get the Inscribed Rectangle of the current Ellipse2DNode according to the specifications of the NodeShape Interface.
 
Methods inherited from class java.awt.geom.Ellipse2D.Double
getBounds2D, getHeight, getWidth, getX, getY, isEmpty, setFrame
 
Methods inherited from class java.awt.geom.Ellipse2D
contains, contains, equals, getPathIterator, hashCode, intersects
 
Methods inherited from class java.awt.geom.RectangularShape
clone, contains, contains, getBounds, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, getPathIterator, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.awt.Shape
contains, contains, contains, contains, getBounds, getBounds2D, getPathIterator, getPathIterator, intersects, intersects
 

Constructor Detail

Ellipse2DNode

public Ellipse2DNode()
Constructs a new Ellipse2D, initialized to location (0, 0) and size (0, 0).


Ellipse2DNode

public Ellipse2DNode(double x,
                     double y,
                     double w,
                     double h)
Constructs and initializes an Ellipse2D from the specified coordinates.

Parameters:
x, y - the coordinates of the bounding rectangle
w - the width of the rectangle
h - the height of the rectangle
Method Detail

getInscribedRectangle

public java.awt.geom.Rectangle2D getInscribedRectangle()
Get the Inscribed Rectangle of the current Ellipse2DNode according to the specifications of the NodeShape Interface.

Specified by:
getInscribedRectangle in interface NodeShape
Returns:
Rectangle2D that represents the inscribedRectangle of the Ellipse2DNode.