|
PenProfile 2.x | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.livescribe.geom.Shape
com.livescribe.geom.Ellipse
public class Ellipse
This class describes an ellipse with the upper left and lower right points.
The width and height are calculated as the difference between the X- and
Y-coordinates, respectively. This is similar to a Rectangle.
Note that "upper left" refers to page coordinates and not mathematical coordinates. In other words, the "upper left" is considered to contain the minimum X- and Y-coordinate values.
It is assumed that the X- and Y-coordinates of the first point (coordinate zero) are ≤ the coordinates of the second point (coordinate one). Some, but not all, of the methods here enforce this. Be aware of this fact.
| Field Summary |
|---|
| Fields inherited from class com.livescribe.geom.Shape |
|---|
COORD_MAX, COORD_MIN, INTERSECT_CLIP, INTERSECT_EXTERNAL, INTERSECT_INTERNAL1, INTERSECT_INTERNAL2, SHAPE_COMPOSITE, SHAPE_ELLIPSE, SHAPE_LINESEGMENT, SHAPE_POINT, SHAPE_POLYGON, SHAPE_POLYLINE, SHAPE_RECTANGLE, SHAPE_STROKE, type, vertex |
| Constructor Summary | |
|---|---|
Ellipse()
Creates a new ellipse having its top left point at (0,0) and a height and width of zero. |
|
Ellipse(int[] v)
Creates a new ellipse having the specified points. |
|
Ellipse(int x,
int y,
int width,
int height)
Creates a new ellipse having the specified top left coordinate and size. |
|
| Method Summary | |
|---|---|
int |
getHeight()
Gets the height of this ellipse. |
int |
getWidth()
Gets the width of this ellipse. |
int |
getX()
Returns the X-coordinate of the top left corner. |
int |
getY()
Returns the Y-coordinate of the top left corner. |
void |
setHeight(int height)
Sets the ellipse height. |
void |
setWidth(int width)
Sets the ellipse width. |
void |
setX(int x)
Sets the X-coordinate of the top left corner. |
void |
setY(int y)
Sets the Y-coordinate of the top left corner. |
String |
toString()
Returns a string representation of this object. |
| Methods inherited from class com.livescribe.geom.Shape |
|---|
contains, getBoundingBox, getNumberofVertices, getNumberOfVertices, getSize, getType, getUnion, getX, getXY, getY, intersectsWith, setVertexArray, setX, setXY, setXY, setY |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Ellipse()
public Ellipse(int x,
int y,
int width,
int height)
x - the top left X-coordinatey - the top left Y-coordinatewidth - the widthheight - the height
IllegalArgumentException - if the width or height are negative.public Ellipse(int[] v)
v - the vertex array| Method Detail |
|---|
public int getX()
public int getY()
public int getWidth()
public int getHeight()
public void setX(int x)
x - the X-coordinate of the top left cornerpublic void setY(int y)
y - the Y-coordinate of the top left cornerpublic void setWidth(int width)
width - the new width
IllegalArgumentException - if the width is negative.public void setHeight(int height)
height - the new height
IllegalArgumentException - if the height is negative.public String toString()
toString in class Shape
|
PenProfile 2.x | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||