Package com.ms.fx |
![]() Previous |
![]() Contents |
![]() Index |
![]() Next |
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.
public void translate(int deltaX, int deltaY);Translates the vertices by deltaX and deltaY.
Return Value:
No return value.
Parameter Description deltaX The amount to move the x coordinates. deltaY The amount to move the y coordinates.
public boolean setOrigin(Point p);Sets a new origin for the curve.
Return Value:
Returns true if successful, false otherwise.
Parameter Description 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).
public void updateBounds(int x, int y);Updates the boundries.
Return Value:
No return value.
Parameter Description x The new x coordinate of the boundry. y The new y coordinate of the boundry.
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.
Parameter Description 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.
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.
Parameter Description 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.
public int getBorderLength();Retrieves the length of the entire border.
Return Value:
Returns the length of the border.
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.
Parameter Description pt The point to locate.
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.
Parameter Description pt The point to calculate the angle from.
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.
Parameter Description pt The point to calculate the vector from.
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.
public void draw(FxGraphics g);Draws a curve.
Return Value:
No return value.
Parameter Description g The graphics object to use.
© 1997 Microsoft Corporation. All rights reserved. Legal Notices.