|
From: Rich K. <ka...@po...> - 2002-11-28 01:54:13
|
Well, most of the time you know what you're working with in the case of my example, so my code would work in those cases. That was my assumption. =20 Actually, your example won't work because you've created a new PlanarAngle (during the call to convert), and haven't set it on the Arc. =20 =20 -- =20 Rich Kadel Chief Technology Officer Polexis, Inc. Direct: 619-542-7213 Fax: 619-542-8675 http://www.polexis.com/ transforming data into knowledge -----Original Message----- From: Jesse Crossley=20 Sent: Wednesday, November 27, 2002 5:02 PM To: geo...@li... Subject: Re: [Geobject-core] ARS (or the lack thereof) and other things =09 =09 If you don't want to hold on to the angle separately, just call: ((PlanarAngle)arc.getOrientation()).setAngle(3.1415, Angle.radians); =09 except this could lead to class cast exceptions, cos we're only guaranteed=20 an OrientationSource, not a PlanarAngle. to oneline it, we'd hafta call:=20 =09 ((PlanarAngle)arc.getOrientation().getOrientation().convert(PlanarAngle. class, null)).setAngle(3.1415, SI.RADIAN);=20 ...and it's debatable whether i even got that line right...=20 and then, we'd have a new PlanarAngle (possibly, anyway), not the arc's real OrientationSource,=20 so there isn't a way to oneline it, i don't think.=20 so if we want to make use of the OrientationSource's event firing, we must hang onto=20 the angle for the life of the arc? eesh, ima gonna just make new Orientations whenever i need 'em.=20 there may be some cases where i can hang onto the original Orientation i assign to the arc,=20 but i don't anticipate very many.=20 =20 jdc=20 =20 |