Class Polygon
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class Polygon

public class netscape.application.Polygon
    extends java.lang.Object
    implements netscape.util.Codable
{
    /* Fields
     */
    public int numPoints;
    public int xPoints;
    public int yPoints;

    /* Constructors
     */
    public Polygon();
    public Polygon(int[], int[], int);

    /* Methods
     */
    public void addPoint(int, int);
    public Rect boundingRect();
    public boolean containsPoint(int, int);
    public boolean containsPoint(Point);
    public void decode(Decoder);
    public void describeClassInfo(ClassInfo);
    public void encode(Encoder);
    public void finishDecoding();
    public void moveBy(int, int);
}
Object subclass representing an ordered list of points.

Fields

numPoints

  public int numPoints

xPoints

  public int xPoints[]

yPoints

  public int yPoints[]

Constructors

.Polygon

  public Polygon()
Constructs a Polygon with no vertices.

.Polygon

  public Polygon(int xPoints[],
                 int yPoints[],
                 int numPoints)
Constructs a polygon with the given points.

Methods

.addPoint

  public void addPoint(int x,
                       int y)
Adds the point (x, y) to the end of the Polygon's list of points.

.boundingRect

  public Rect boundingRect()
Returns the Polygon's bounding Rect.

.containsPoint

  public boolean containsPoint(int x,
                               int y)
Returns true if the Polygon contains the point (x, y).

.containsPoint

  public boolean containsPoint(Point aPoint)
Returns true if the Polygon contains the point aPoint.

.moveBy

  public void moveBy(int deltaX,
                     int deltaY)
Moves each of the Polygon's points by deltaX and deltaY.

.describeClassInfo

  public void describeClassInfo(ClassInfo info)
Describes the Polygon class' information.
See Also:
describeClassInfo

.encode

  public void encode(Encoder encoder) throws CodingException
Encodes the Polygon.
See Also:
encode

.decode

  public void decode(Decoder decoder) throws CodingException
Decodes the Polygon.
See Also:
decode

.finishDecoding

  public void finishDecoding() throws CodingException
Finishes the Polygon instance decoding.
See Also:
finishDecoding

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Copyright © 1997 Netscape Communications Corporation. All rights reserved
Please send any comments or corrections to ifcfeedback@netscape.com
HTML generated on 21 Oct 1997