Class FxEllipse
public class FxEllipse extends FxCurve implements IFxShape
{
// Constructors
public FxEllipse(int x, int y, int w, int h);
// Methods
public boolean contains(Point p);
public void draw(FxGraphics g);
public int getBorderLength();
public Rectangle getBounds();
public Point getOrigin();
public Point getPoint(int nPels);
public int[] getPointAndAngle(int pt);
public int getPointAngle(int idx);
protected Point getPointPos(int nPels);
public boolean includes(Point p);
public boolean setOrigin(Point p);
public void translate(int deltaX, int deltaY);
public void updateBounds(int x, int y);
}
This class creates and manages ellipse objects.
FxCurve
|
+--FxEllipse
public FxEllipse(int x, int y, int w, int h);
Creates a definable ellipse object by using the same parameters as those used in the Graphics class.
Parameter | Description |
x
| The upper-left x coordinate of the ellipse's bounding rectangle.
|
y
| The upper-left y coordinate of the ellipse's bounding rectangle.
|
w
| The width of the ellipse (in pixels).
|
h
| The height of the ellipse (in pixels).
|
public boolean contains(Point p);
Determines whether the specified point is within the curve's boundary. (This is supported by java.awt objects).
Return Value:
Returns false.
Parameter | Description |
p
| The point to check.
|
Remarks:
Currently, this method is not implemented.
public void draw(FxGraphics g);
Draws the ellipse, one quadrant at a time.
Return Value:
No return value.
Parameter | Description |
g
| The graphic object to use.
|
public int getBorderLength();
Retrieves the length of the border.
Return Value:
Returns the length of the entire border (in pixels).
public Rectangle getBounds();
Retrieves the bounds of the ellipse.
Return Value:
Returns the bounding rectangle of the ellipse.
public Point getOrigin();
Retrieves the origin that was used.
Return Value:
Returns the point that was used as the origin.
public Point getPoint(int nPels);
Retrieves a point along the curve that is a specified number of pixels from its origin.
Return Value:
Returns the point located at the specified position along the curve.
Parameter | Description |
nPels
| The distance from the origin of the curve (in pixels).
|
public int[] getPointAndAngle(int pt);
Retrieves a point on a curve and the angle of the line that is perpendicular to the curve at that point.
Return Value:
Returns an array of integers that contain the point and angle. Currently returns null.
Parameter | Description |
pt
| The point to calculate the angles from.
|
Remarks:
Currently, this method is not implemented.
public int getPointAngle(int idx);
Retrieves the angle of the line that is perpendicular to the curve at the point indicated.
Return Value:
Returns the angle of the line that is perpendicular to the curve at the point indicated. Currently returns 0.
Parameter | Description |
idx
| The point to calculate the angle from.
|
Remarks:
Currently, this method is not implemented.
protected Point getPointPos(int nPels);
Retrieves a point from a given position.
Return Value:
Returns the Point of the given position.
Parameter | Description |
nPels
| The distance from the origin of the curve (measured in pixels).
|
public boolean includes(Point p);
Determines whether the specified point is on the curve.
Return Value:
Returns false.
Parameter | Description |
p
| The point to check.
|
Remarks:
Currently, this method is not implemented.
public boolean setOrigin(Point p);
Sets a new origin for the curve.
Return Value:
Returns true if successful; otherwise, returns false.
Parameter | Description |
p
| The point to set as the new origin.
|
public void translate(int deltaX, int deltaY);
Translates the vertices by (deltaX, deltaY).
Return Value:
No return value.
Parameter | Description |
deltaX
| The distance that the x coordinates move.
|
deltaY
| The distance that the y coordinates move.
|
public void updateBounds(int x, int y);
Updates the bounding rectangle to fit the point defined by the x and y coordinates.
Return Value:
No return value.
Parameter | Description |
x
| The x coordinate of the point.
|
y
| The y coordinate of the point.
|
Remarks:
Currently, this method is not implemented.