Hi,
I want to know how do I test if two Path2D.Double objects are equal. I have two
objects that contain the same coordinates, but this is insufficient to assert
that both objects are equal. What additional information am I missing?
public static void main(String[] args)
{
double[] x = { 1.5, 1.6, 1.7, 1.8 };
double[] y = { 3.0, 3.5, 4.0, 4.5 };
Path2D.Double polygon1 = new Path2D.Double();
polygon1.moveTo( x[0], y[0] );
for( int i = 1; i < x.length; i++ )
{
polygon1.lineTo( x, y );
}
Path2D.Double polygon2 = new Path2D.Double();
polygon2.moveTo( x[0], y[0] );
for( int i = 1; i < x.length; i++ )
{
polygon2.lineTo( x, y );
}
if( polygon1 == polygon2 )
{
System.out.println( "1" );
}
else
{
System.out.println( "2" );
}
if( polygon1
.equals( polygon2 ) )
{
System.out.println( "3" );
}
else
{
System.out.println( "4" );
}
}
[Message sent by forum member 'deirdre' (deirdre)]
http://forums.java.net/jive/thread.jspa?messageID=236663
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".