harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Denis Kishenko (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-1585) [classlib][awt] Empty Arc, Ellipse and RoundRectangle have PathIterator which is differ from RI
Date Tue, 26 Sep 2006 12:01:51 GMT
[classlib][awt] Empty Arc, Ellipse and RoundRectangle have PathIterator which is differ from
RI 
------------------------------------------------------------------------------------------------

                 Key: HARMONY-1585
                 URL: http://issues.apache.org/jira/browse/HARMONY-1585
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Denis Kishenko


Harmony implementation of Arc2D, Ellipse2D and RoundRectangle2D behavior differs from RI if
shapes are empty. Harmony returns absolutely empty PathIterator while RI returns non empty
PathIterator with zero points.

=========== Test.java ==============

import java.awt.geom.Arc2D;
import java.awt.geom.CubicCurve2D;
import java.awt.geom.Ellipse2D;
import java.awt.geom.GeneralPath;
import java.awt.geom.Line2D;
import java.awt.geom.QuadCurve2D;
import java.awt.geom.Rectangle2D;
import java.awt.geom.RoundRectangle2D;

public class Test
{
    static public void main(String[] args)
    { 
        System.out.println(toString(new Arc2D.Double()));
        System.out.println(toString(new Ellipse2D.Double()));
        System.out.println(toString(new CubicCurve2D.Double()));
        System.out.println(toString(new QuadCurve2D.Double()));
        System.out.println(toString(new GeneralPath()));
        System.out.println(toString(new Line2D.Double()));
        System.out.println(toString(new Rectangle2D.Double()));
        System.out.println(toString(new RoundRectangle2D.Double()));
    }    

    public static String toString(Shape shape) {
        PathIterator path = shape.getPathIterator(null);
        String out = "";
        float coords[] = new float[6];
        while(!path.isDone()) {
            switch(path.currentSegment(coords)) {
            case PathIterator.SEG_MOVETO:
                out += "move(" + coords[0] + "," + coords[1] + ")\n";
                break;
            case PathIterator.SEG_LINETO:
                out += "line(" + coords[0] + "," + coords[1] + ")\n";
                break;
            case PathIterator.SEG_QUADTO:
                out += "quad(" + coords[0] + "," + coords[1] + "," + coords[2] + "," + coords[3]
+ ")\n";
                break;
            case PathIterator.SEG_CUBICTO:
                out += "cubic(" + coords[0] + "," + coords[1] + "," + coords[2] + "," + coords[3]
+ "," + coords[4] + "," + coords[5] + ")\n";
                break;
            case PathIterator.SEG_CLOSE:
                out += "close\n";
                break;
            }
            path.next();
        }
        out += "done\n";
        return shape.getClass().getName() + "\n" + out;
    }

}

============= RI ================
java.awt.geom.Arc2D$Double
move(0.0,0.0)
done

java.awt.geom.Ellipse2D$Double
move(0.0,0.0)
cubic(0.0,0.0,0.0,0.0,0.0,0.0)
cubic(0.0,0.0,0.0,0.0,0.0,0.0)
cubic(0.0,0.0,0.0,0.0,0.0,0.0)
cubic(0.0,0.0,0.0,0.0,0.0,0.0)
close
done

java.awt.geom.CubicCurve2D$Double
move(0.0,0.0)
cubic(0.0,0.0,0.0,0.0,0.0,0.0)
done

java.awt.geom.QuadCurve2D$Double
move(0.0,0.0)
quad(0.0,0.0,0.0,0.0)
done

java.awt.geom.GeneralPath
done

java.awt.geom.Line2D$Double
move(0.0,0.0)
line(0.0,0.0)
done

java.awt.geom.Rectangle2D$Double
move(0.0,0.0)
line(0.0,0.0)
line(0.0,0.0)
line(0.0,0.0)
line(0.0,0.0)
close
done

java.awt.geom.RoundRectangle2D$Double
move(0.0,0.0)
line(0.0,0.0)
cubic(0.0,0.0,0.0,0.0,0.0,0.0)
line(0.0,0.0)
cubic(0.0,0.0,0.0,0.0,0.0,0.0)
line(0.0,0.0)
cubic(0.0,0.0,0.0,0.0,0.0,0.0)
line(0.0,0.0)
cubic(0.0,0.0,0.0,0.0,0.0,0.0)
close
done

=========Harmony =======
java.awt.geom.Arc2D$Double
done

java.awt.geom.Ellipse2D$Double
done

java.awt.geom.CubicCurve2D$Double
move(0.0,0.0)
cubic(0.0,0.0,0.0,0.0,0.0,0.0)
done

java.awt.geom.QuadCurve2D$Double
move(0.0,0.0)
quad(0.0,0.0,0.0,0.0)
done

java.awt.geom.GeneralPath
done

java.awt.geom.Line2D$Double
move(0.0,0.0)
line(0.0,0.0)
done

java.awt.geom.Rectangle2D$Double
move(0.0,0.0)
line(0.0,0.0)
line(0.0,0.0)
line(0.0,0.0)
line(0.0,0.0)
close
done

java.awt.geom.RoundRectangle2D$Double
close
done



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message