I believe I have found a bug in the XYArray class when I was using it
to create a PLine.  Here is a simple main routine that duplicates the
bug.  In the version of Piccolo that I'm using, this throws an
exception, and I've looked at the trunk and believe that the bug is
still there.

public class PiccoloBugDemo {

    public static void main( String[] args ) {
        XYArray pointArray = new XYArray( 10 );
        pointArray.setX( 0, 5 );
        System.out.println("Point count is: " +
        System.out.println("X value of first point in array is: " +
pointArray.getX( 0 ));

The exception is thrown on the line "pointArray.setX" because the
number of points is incorrectly set when using this constructor.

I was able to work around this easily by using a PPath and creating a
shape, which makes me wonder if it makes sense to maintain the PLIne
class and the related classes (such as this XYArray class).  Perhaps
they should be deprecated.

Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en

Reply via email to