You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Denis Kishenko (JIRA)" <ji...@apache.org> on 2006/09/26 14:01:51 UTC
[jira] Created: (HARMONY-1585) [classlib][awt] Empty Arc, Ellipse
and RoundRectangle have PathIterator which is differ from RI
[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
[jira] Closed: (HARMONY-1585) [classlib][awt] Empty Arc, Ellipse
and RoundRectangle have PathIterator which is differ from RI
Posted by "Mark Hindess (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-1585?page=all ]
Mark Hindess closed HARMONY-1585.
---------------------------------
Verified by Denis.
> [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
> Assigned To: Mark Hindess
> Attachments: 1585-Empty PathIterator.patch
>
>
> 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
[jira] Commented: (HARMONY-1585) [classlib][awt] Empty Arc, Ellipse
and RoundRectangle have PathIterator which is differ from RI
Posted by "Denis Kishenko (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-1585?page=comments#action_12442849 ]
Denis Kishenko commented on HARMONY-1585:
-----------------------------------------
Verified, thanks!
> [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
> Assigned To: Mark Hindess
> Attachments: 1585-Empty PathIterator.patch
>
>
> 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
[jira] Resolved: (HARMONY-1585) [classlib][awt] Empty Arc, Ellipse
and RoundRectangle have PathIterator which is differ from RI
Posted by "Mark Hindess (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-1585?page=all ]
Mark Hindess resolved HARMONY-1585.
-----------------------------------
Resolution: Fixed
Thanks Denis. Applied in r464480. Please check that it has been applied as expected.
> [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
> Assigned To: Mark Hindess
> Attachments: 1585-Empty PathIterator.patch
>
>
> 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
[jira] Assigned: (HARMONY-1585) [classlib][awt] Empty Arc, Ellipse
and RoundRectangle have PathIterator which is differ from RI
Posted by "Mark Hindess (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-1585?page=all ]
Mark Hindess reassigned HARMONY-1585:
-------------------------------------
Assignee: Mark Hindess
> [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
> Assigned To: Mark Hindess
> Attachments: 1585-Empty PathIterator.patch
>
>
> 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
[jira] Updated: (HARMONY-1585) [classlib][awt] Empty Arc, Ellipse
and RoundRectangle have PathIterator which is differ from RI
Posted by "Denis Kishenko (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-1585?page=all ]
Denis Kishenko updated HARMONY-1585:
------------------------------------
Attachment: 1585-Empty PathIterator.patch
patch + test
> [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
> Attachments: 1585-Empty PathIterator.patch
>
>
> 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