|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--com.jfimagine.jfgraph.geom.Rect
|
+--com.jfimagine.jfgraph.geom.RoundedRect
RoundedRect class. A class used to represent a rounded rectangle in the plane with double coordinates. A rounded rectangle will always be a regular rectangle, but not parallelogram or trapezoid.
Attention: Here we used a clockwise quadrant system. And the first quadrant is under right bottom corner.
| Field Summary | |
protected double |
m_radius
radius of each rounded corner. |
| Fields inherited from class com.jfimagine.jfgraph.geom.Rect |
m_leftBottom, m_leftTop, m_rightBottom, m_rightTop, SIDETYPE_BOTTOM, SIDETYPE_LEFT, SIDETYPE_RIGHT, SIDETYPE_TOP, VERTEXMOVETYPE_ISOSCELESTRAPEZOID, VERTEXMOVETYPE_PARALLEL, VERTEXMOVETYPE_RECTANGLE, VERTEXMOVETYPE_SCALE, VERTEXMOVETYPE_TRAPEZOID, VERTEXTYPE_LEFTBOTTOM, VERTEXTYPE_LEFTTOP, VERTEXTYPE_RIGHTBOTTOM, VERTEXTYPE_RIGHTTOP |
| Constructor Summary | |
RoundedRect()
Constructor for RoundedRect. |
|
RoundedRect(double x,
double y,
double w,
double h,
double r)
Constructor for RoundedRect. |
|
RoundedRect(RoundedRect rect)
Constructor for RoundedRect. |
|
| Method Summary | |
java.lang.Object |
clone()
Creates a new object of the same class and with the same contents as this object. |
boolean |
equals(java.lang.Object obj)
Determines whether or not two objects are equal. |
Arc |
getCornerArc(int vertex)
get an rounded corner arc. |
JFPoint |
getCornerCenterPoint(int vertex)
get an end point at the rounded corner curve. |
JFPoint |
getCornerEndPoint(int startVertex,
int endVertex)
get an end point at the rounded corner curve. |
void |
getCornerRect(int vertex,
Rect rect)
get an rounded corner rectangle(include the rounded corner). |
double |
getRadius()
get the radius of current rounded rectangle. |
LineSeg |
getSide(int sideType)
Get a side line of this rectangle. |
int |
hashCode()
Returns the hashcode for this Object. |
LineSeg |
pickLine(double x,
double y,
double pickOffset)
Pick a line segment of this rectangle by a point with a pickoffset. |
void |
setRadius(double radius)
set the radius of current rounded rectangle. |
void |
setValue(double x,
double y,
double w,
double h,
double r)
Set the bounds of current rectangle. |
void |
setValue(Rect rect)
Set the value of current rectangle. |
java.lang.String |
toString()
Convert this object to String |
| Methods inherited from class com.jfimagine.jfgraph.geom.Rect |
canAddPort, contains, contains, flipBy, flipBy, getBounds, getCenter, getHeight, getVertex, getWidth, getX, getY, intersects, intersects, intersects, intersects, intersects, mirrorBy, mirrorBy, moveBy, moveVertex, newScaleCenter, rotateBy, rotateBy, rotateBy, scaleBy, scaleBy, setValue, setVertex, setVertex |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected double m_radius
| Constructor Detail |
public RoundedRect()
public RoundedRect(RoundedRect rect)
rect - A rectangle object.
public RoundedRect(double x,
double y,
double w,
double h,
double r)
x - X coordiate.y - Y coordiate.w - Width of this rectangle.h - Height of this rectangle.r - Radius of each rounded corner.| Method Detail |
public void setValue(double x,
double y,
double w,
double h,
double r)
x - X coordiate.y - Y coordiate.w - Width of this rectangle.h - Height of this rectangle.r - Radius of each rounded corner.public void setValue(Rect rect)
setValue in class Rectrect - A new rectangle.public double getRadius()
public void setRadius(double radius)
radius - The radius.
public JFPoint getCornerEndPoint(int startVertex,
int endVertex)
startVertex - The type of start vertex type.endVertex - The type of end vertex type.
public JFPoint getCornerCenterPoint(int vertex)
vertex - The type of the vertex type.
public void getCornerRect(int vertex,
Rect rect)
vertex - The type of the vertex type.rect - The return corner rectangle.
note: the lefttop vertex of return is the corner vertex,
the rightTop vertex is the near point that under clockwise side of line from corner vertex to curve center,
the rightBottom vertex is the center of corner curve,
the leftBottom vertex is the near point that under counter-clockwise side of line from corner vertex to curve center.public Arc getCornerArc(int vertex)
vertex - The type of the vertex type.
public LineSeg getSide(int sideType)
getSide in class Rect
public LineSeg pickLine(double x,
double y,
double pickOffset)
pickLine in class Rectx - X coordinate of this point.y - Y coordinate of this point.pickOffset - An analog pick offset that great equal than 0.
public java.lang.String toString()
toString in class Rect
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class Rectjava.lang.CloneNotSupportedExceptionpublic int hashCode()
hashCode in class Rectpublic boolean equals(java.lang.Object obj)
equals in class Rectobj - an object to be compared with this object
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||