Package com.ms.fx Previous
Previous
Contents
Contents
Index
Index
Next
Next

Interface IFxShape

Methods

public interface IFxShape extends Shape 
{
  // Methods
  public void translate(int deltaX, int deltaY);
  public boolean setOrigin(Point p);
  public void updateBounds(int x, int y);
  public boolean contains(Point p);
  public boolean includes(Point p);
  public int getBorderLength();
  public Point getPoint(int pt);
  public int getPointAngle(int pt);
  public int[] getPointAndAngle(int pt);
  public Point getOrigin();
  public void draw(FxGraphics g);
}

The interface for objects which represent some form of a geometric shape.


Methods


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.


setOrigin

public boolean setOrigin(Point p);

Sets a new origin for the curve.

Return Value:

Returns true if successful, false otherwise.

ParameterDescription
p The point to set as the new origin.

Remarks:

The curve reserves the right to reject the request if the point is not on the curve. The origin is for plotting ON the curve, and is not nessacarily the same thing as the point nearest the origin (0,0).


updateBounds

public void updateBounds(int x, int y);

Updates the boundries.

Return Value:

No return value.

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


contains

public boolean contains(Point p);

Determines whether the specified point on or within the curve.

Return Value:

Returns true if it is on or within the curve, false otherwise.

ParameterDescription
p The point to be tested.

Remarks:

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


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, false otherwise.

ParameterDescription
p The point to be tested.

Remarks:

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


getBorderLength

public int getBorderLength();

Retrieves the length of the entire border.

Return Value:

Returns the length of the border.


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.


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.


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 3 integers: the x, y and degrees values.

ParameterDescription
pt The point to calculate the vector from.


getOrigin

public Point getOrigin();

Locates the origin that is used to start of getPoint and so on.

Return Value:

Returns the point used as the origin.


draw

public void draw(FxGraphics g);

Draws a curve.

Return Value:

No return value.

ParameterDescription
g The graphics object to use.



Top© 1997 Microsoft Corporation. All rights reserved. Legal Notices.