Packages
 In this topic

*Methods

 

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

 


Interface IFxShape

public interface IFxShape extends Shape
{
  // Methods
  public boolean contains(Point p);
  public void draw(FxGraphics g);
  public int getBorderLength();
  public Rectangle getBounds();
  public Point getOrigin();
  public Point getPoint(int pt);
  public int[] getPointAndAngle(int pt);
  public int getPointAngle(int pt);
  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 interface defines methods for objects that represent a geometric shape.

Shape
  |
  +--IFxShape

Methods

contains

public boolean contains(Point p);

Determines whether a specific Point lies on or within the curve.

Return Value:

Returns true if the point is on or within the curve; otherwise, returns false.

ParameterDescription
p The point to be tested.

Remarks:

If this is a closed shape, the method will return true for points contained within the curve.

draw

public void draw(FxGraphics g);

Draws a curve with the current graphics.

Return Value:

No return value.

ParameterDescription
g The graphics object to use.

getBorderLength

public int getBorderLength();

Retrieves the length of the entire border of the shape.

Return Value:

Returns the length of the border.

Remarks:

For example, the border length of a circle is its circumference, and the border length of a rectangle is ((y1 - y2) x 2) + ((x1 - x2) x 2), and so on.

getBounds

public Rectangle getBounds();

Retrieves the bounding box of the shape.

Return Value:

Returns a Rectangle that defines the bounding box of the shape.

getOrigin

public Point getOrigin();

Locates the origin of a curve.

Return Value:

Returns the point used as the origin.

Remarks:

Use this method to locate the origin of a curve and use the returned Point as a basis for the getPoint method.

getPoint

public Point getPoint(int pt);

Locates a point that is n pixels from the origin of the curve.

Return Value:

Returns the point that is n pixels from the origin.

ParameterDescription
pt The point to locate.

getPointAndAngle

public int[] getPointAndAngle(int pt);

Retrieves the coordinates and angle of the base of the normal vector at the requested point.

Return Value:

Returns an array of three integers: the x, y, and degrees values.

ParameterDescription
pt The point to calculate the vector from.

getPointAngle

public int getPointAngle(int pt);

Locates the angle of the normal vector at this point.

Return Value:

Returns the angle of the normal vector at point pt.

ParameterDescription
pt The point to calculate the angle from.

includes

public boolean includes(Point p);

Determines whether the specified point is on the curve.

Return Value:

Returns true if the point is on the curve; otherwise, returns false.

ParameterDescription
p The point to be tested.

Remarks:

If the curve represents a closed area, the method will not return true for a point within the enclosed boundaries. Under these circumstances, the contains method should be used.

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.

Remarks:

If the point is not on the curve, the curve may not be set to the new origin. The origin, which is used for plotting operations on the curve, is not equivalent to the point nearest the origin (0,0).

translate

public void translate(int deltaX, int deltaY);

Translates the vertices by deltaX and deltaY.

Return Value:

No return value.

ParameterDescription
deltaX The amount to move the x coordinates.
deltaY The amount to move the y coordinates.

updateBounds

public void updateBounds(int x, int y);

Updates the boundaries.

Return Value:

No return value.

ParameterDescription
x The new x coordinate of the boundary.
y The new y coordinate of the boundary.

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