agile2d.geom
Class PolygonShape

java.lang.Object
  |
  +--agile2d.geom.PolygonShape
All Implemented Interfaces:
Shape
Direct Known Subclasses:
QuadShape, TriangleShape

public abstract class PolygonShape
extends Object
implements Shape

Class PolygonShape

Version:
$Revision: 1.1 $
Author:
Jean-Daniel Fekete

Field Summary
protected  boolean closed
           
protected  int origin
           
protected  float[] vertices
           
 
Constructor Summary
protected PolygonShape(float[] vertices, int origin, boolean closed)
           
protected PolygonShape(int size, boolean closed)
           
 
Method Summary
 void append(PathIterator pi, boolean connect)
           
 void append(Shape s, boolean connect)
           
 void closePath()
           
 boolean contains(double x, double y)
           
 boolean contains(double x, double y, double w, double h)
           
 boolean contains(Point2D p)
           
 boolean contains(Rectangle2D r)
           
 Shape createTransformedShape(AffineTransform at)
           
 void curveTo(float x1, float y1, float x2, float y2, float x3, float y3)
           
 Rectangle getBounds()
           
 Rectangle2D getBounds2D()
           
 Point2D getCurrentPoint()
           
 GeneralPath getPath()
           
 PathIterator getPathIterator(AffineTransform at)
           
 PathIterator getPathIterator(AffineTransform at, double flatness)
           
 int getSize()
           
 int getWindingRule()
           
 float getXAt(int index)
           
 float getYAt(int index)
           
 boolean intersects(double x, double y, double w, double h)
           
 boolean intersects(Rectangle2D r)
           
 boolean isClosed()
           
 void setWindingRule(int rule)
           
 void setXAt(int index, float value)
           
 void setYAt(int index, float value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vertices

protected float[] vertices

origin

protected int origin

closed

protected boolean closed
Constructor Detail

PolygonShape

protected PolygonShape(float[] vertices,
                       int origin,
                       boolean closed)

PolygonShape

protected PolygonShape(int size,
                       boolean closed)
Method Detail

getXAt

public float getXAt(int index)

getYAt

public float getYAt(int index)

setXAt

public void setXAt(int index,
                   float value)

setYAt

public void setYAt(int index,
                   float value)

getSize

public int getSize()

getPath

public GeneralPath getPath()

append

public void append(PathIterator pi,
                   boolean connect)

append

public void append(Shape s,
                   boolean connect)

closePath

public void closePath()

contains

public boolean contains(double x,
                        double y)
Specified by:
contains in interface Shape

contains

public boolean contains(double x,
                        double y,
                        double w,
                        double h)
Specified by:
contains in interface Shape

contains

public boolean contains(Point2D p)
Specified by:
contains in interface Shape

contains

public boolean contains(Rectangle2D r)
Specified by:
contains in interface Shape

createTransformedShape

public Shape createTransformedShape(AffineTransform at)

curveTo

public void curveTo(float x1,
                    float y1,
                    float x2,
                    float y2,
                    float x3,
                    float y3)

getBounds

public Rectangle getBounds()
Specified by:
getBounds in interface Shape

getBounds2D

public Rectangle2D getBounds2D()
Specified by:
getBounds2D in interface Shape

getCurrentPoint

public Point2D getCurrentPoint()

getPathIterator

public PathIterator getPathIterator(AffineTransform at)
Specified by:
getPathIterator in interface Shape

getPathIterator

public PathIterator getPathIterator(AffineTransform at,
                                    double flatness)
Specified by:
getPathIterator in interface Shape

getWindingRule

public int getWindingRule()

intersects

public boolean intersects(double x,
                          double y,
                          double w,
                          double h)
Specified by:
intersects in interface Shape

intersects

public boolean intersects(Rectangle2D r)
Specified by:
intersects in interface Shape

setWindingRule

public void setWindingRule(int rule)

isClosed

public boolean isClosed()


Copyright © 2002 by University of Maryland, USA All rights reserved.