Packages
 In this topic

*Constructors

*Methods

 

Packages   PreviousThis PackageNext
Package com.ms.fx   Previous This
Package
Next

 


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

Constructors

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.

ParameterDescription
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).

Methods

contains

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.

ParameterDescription
p The point to check.

Remarks:

Currently, this method is not implemented.

draw

public void draw(FxGraphics g);

Draws the ellipse, one quadrant at a time.

Return Value:

No return value.

ParameterDescription
g The graphic object to use.

getBorderLength

public int getBorderLength();

Retrieves the length of the border.

Return Value:

Returns the length of the entire border (in pixels).

getBounds

public Rectangle getBounds();

Retrieves the bounds of the ellipse.

Return Value:

Returns the bounding rectangle of the ellipse.

getOrigin

public Point getOrigin();

Retrieves the origin that was used.

Return Value:

Returns the point that was used as the origin.

getPoint

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.

ParameterDescription
nPels The distance from the origin of the curve (in pixels).

getPointAndAngle

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.

ParameterDescription
pt The point to calculate the angles from.

Remarks:

Currently, this method is not implemented.

getPointAngle

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.

ParameterDescription
idx The point to calculate the angle from.

Remarks:

Currently, this method is not implemented.

getPointPos

protected Point getPointPos(int nPels);

Retrieves a point from a given position.

Return Value:

Returns the Point of the given position.

ParameterDescription
nPels The distance from the origin of the curve (measured in pixels).

includes

public boolean includes(Point p);

Determines whether the specified point is on the curve.

Return Value:

Returns false.

ParameterDescription
p The point to check.

Remarks:

Currently, this method is not implemented.

setOrigin

public boolean setOrigin(Point p);

Sets a new origin for the curve.

Return Value:

Returns true if successful; otherwise, returns false.

ParameterDescription
p The point to set as the new origin.

translate

public void translate(int deltaX, int deltaY);

Translates the vertices by (deltaX, deltaY).

Return Value:

No return value.

ParameterDescription
deltaX The distance that the x coordinates move.
deltaY The distance that the y coordinates move.

updateBounds

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.

ParameterDescription
x The x coordinate of the point.
y The y coordinate of the point.

Remarks:

Currently, this method is not implemented.

upnrm.gif © 1998 Microsoft Corporation. All rights reserved. Terms of use.