Package com.ms.fx |
![]() Previous |
![]() Contents |
![]() Index |
![]() Next |
public class FxEllipse extends FxCurve implements IFxShape, java.io.Serializable { // Fields public int xStart, yStart, width, height; public int arcCenterX; public int arcCenterY; public int points[]; public int numScanLines; public boolean xMoving; // Constructor public FxEllipse(int x, int y, int w, int h); // Methods public Rectangle getBounds(); public void translate(int deltaX, int deltaY); protected void calcExtras(); public void updateBounds(int x, int y); public boolean contains(Point p); public boolean includes(Point p); public int getBorderLength(); public int getPointAngle(int idx); public int[] getPointAndAngle(int pt); protected Point getPointPos(int nPels); public Point getPoint(int nPels); public boolean setOrigin(Point p); public Point getOrigin(); public void drawBR(FxGraphics g, int temp[]); public void drawTL(FxGraphics g, int temp[]); public void drawTR(FxGraphics g, int temp[]); public void drawBL(FxGraphics g, int temp[]); public void draw(FxGraphics g); }
An class that creates and manages ellipse objects.
public FxEllipse(int x, int y, int w, int h);Defines an arc by using the same parameters as in the Graphics class.
Parameter Description x The x coordinate of the ellipse. y The y coordinate of the ellipse. w The width of the ellipse in pixels. h The height of the ellipse in pixels.
public Rectangle getBounds();Retrieves the bounds of the ellipse.
Return Value:
Returns a rectangle that represents the bounds of the ellipse.
public void translate(int deltaX, int deltaY);Translates the vertices by deltaX, deltaY.
Return Value:
No return value.
Parameter Description deltaX The amount to move the x coordinates. deltaY The amount to move the y coordinates.
protected void calcExtras();Calculates the extra information needed by ShapeX methods.
Return Value:
No return value.
public void updateBounds(int x, int y);Updates the bounding box to fit the point (x, y).
Return Value:
No return value.
Parameter Description x The x coordinate of the point. y The y coordinate of the point.
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 true if the point is within the curve's boundaries; otherwise, returns false.
Parameter Description p The point to check.
public boolean includes(Point p);Determines whether the specified point is on the curve. (This is new and is not supported by java.awt.* objects).
Return Value:
Returns true if the point is on the curve; otherwise, returns false.
Parameter Description p The point to check.
public int getBorderLength();Retrieves the length of the border in pixels.
Return Value:
Returns the length of the entire border.
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.
Parameter Description idx The point to calculate the angle from.
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 containing the point and angle.
Parameter Description pt The point to calculate the angles from.
protected Point getPointPos(int nPels);Retrieves the point from a given position.
Return Value:
Returns the point for the given position.
Parameter Description nPels The number of pixels away from the origin of the curve.
public Point getPoint(int nPels);Retrieves a point along the curve that is nPels pixels from it's origin.
Return Value:
Returns the point from the given position along the curve.
Parameter Description nPels The number of pixels away from the origin of the curve.
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 Point getOrigin();Retrieves the origin that was used.
Return Value:
Returns the point that was used as the origin.
public void drawBR(FxGraphics g, int temp[]);Draws the Q1 (bottom right quadrant) part of the curve.
Return Value:
No return value.
Parameter Description g The graphics object to use. temp The array to use to draw the curve.
public void drawTL(FxGraphics g, int temp[]);Draws the Q2 (top left quadrant) part of the curve.
Return Value:
No return value.
Parameter Description g The graphics object to use. temp The array to use to draw the curve.
public void drawTR(FxGraphics g, int temp[]);Draws the Q3 (top right quadrant) part of the curve.
Return Value:
No return value.
Parameter Description g The graphics object to use. temp The array to use to draw the curve.
public void drawBL(FxGraphics g, int temp[]);Draws the Q4 (bottom left quadrant) part of the curve.
Return Value:
No return value.
Parameter Description g The graphics object to use. temp The array to use to draw the curve.
public void draw(FxGraphics g);Draws the curve.
Return Value:
No return value.
Parameter Description g The graphics object to use.
© 1997 Microsoft Corporation. All rights reserved. Legal Notices.