public class Circle extends java.awt.geom.Arc2D.Double implements Shape
| Constructor and Description |
|---|
Circle()
Default constructor to allow construction then deserialization
|
Circle(double x,
double y)
Initializes a circle with zero radius
|
Circle(double x,
double y,
double r)
Initializes a circle with a specific center and radius
|
| Modifier and Type | Method and Description |
|---|---|
Circle |
clone()
Returns a clone of this shape
|
double |
distanceTo(double x,
double y)
Gets the distance of this shape to the given point.
|
void |
draw(java.awt.Graphics g,
double xscale,
double yscale)
Draws the shape to the given graphics and scale.
|
void |
draw(java.awt.Graphics g,
Rectangle fileMBR,
int imageWidth,
int imageHeight,
double scale)
Draws a shape to the given graphics.
|
void |
fromText(Text text)
Retrieve information from the given text.
|
Rectangle |
getMBR()
Returns minimum bounding rectangle for this shape.
|
boolean |
isIntersected(Shape s)
Returns true if this shape is intersected with the given shape
|
void |
readFields(java.io.DataInput in) |
void |
set(double x,
double y,
double r)
Updates the circle to the given center and radius
|
java.lang.String |
toString() |
Text |
toText(Text text)
Store current object as string in the given text appending text already there.
|
void |
write(java.io.DataOutput out) |
getAngleExtent, getAngleStart, getHeight, getWidth, getX, getY, isEmpty, makeBounds, setAngleExtent, setAngleStart, setArccontains, contains, contains, containsAngle, equals, getArcType, getBounds2D, getEndPoint, getPathIterator, getStartPoint, hashCode, intersects, setAngles, setAngles, setAngleStart, setArc, setArc, setArc, setArcByCenter, setArcByTangent, setArcType, setFramepublic Circle()
public Circle(double x,
double y)
x - y - public Circle(double x,
double y,
double r)
x - y - r - public void set(double x,
double y,
double r)
x - y - r - public void write(java.io.DataOutput out)
throws java.io.IOException
java.io.IOExceptionpublic void readFields(java.io.DataInput in)
throws java.io.IOException
java.io.IOExceptionpublic Text toText(Text text)
TextSerializabletoText in interface TextSerializablepublic void fromText(Text text)
TextSerializablefromText in interface TextSerializablepublic java.lang.String toString()
toString in class java.lang.Objectpublic Rectangle getMBR()
Shapepublic double distanceTo(double x,
double y)
Shapepublic boolean isIntersected(Shape s)
Shapepublic Circle clone()
Shapeclone in class java.awt.geom.RectangularShapepublic void draw(java.awt.Graphics g,
Rectangle fileMBR,
int imageWidth,
int imageHeight,
double scale)
Shapeg - - the graphics or canvas to draw tofileMBR - - the MBR of the file in which the shape is containedimageWidth - - width of the image to drawimageHeight - - height of the image to drawscale - - the scale used to convert shape coordinates to image coordinatespublic void draw(java.awt.Graphics g,
double xscale,
double yscale)
Shapeg - - the graphics to draw the shape to.xscale - - scale of the image x-axis in terms of pixels per points.yscale - - scale of the image y-axis in terms of pixels per points.