cheers, I had intended to send it to the list, but I just cocked it all up
;)
What I am actually trying to do is in order to gain some familiarity with
jython I am rewriting a java prog I have in a book in jython. In the java
example it was typed exactly as in my first example i.e.
g2 = (Graphics2D)g
it seems to work in java...guess I will have to keep tinkering to work out
how jython wants to do it
blobby
From: D-Man <ds...@ri...>
>To: Mark Robinson <blo...@ho...>
>Subject: Re: [Jython-users] type conversions to Graphics2D
>Date: Wed, 18 Jul 2001 13:29:20 -0400
>
>On Wed, Jul 18, 2001 at 10:18:14AM -0700, Mark Robinson wrote:
>| This message was sent from Geocrawler.com by "Mark Robinson"
><blo...@ho...>
>|
>|
>| I apologise if I send this twice, but I don't
>| think my first attempt worked.
>
>Well, the first time had a little bit less information ;-). Neither
>copy was sent to the list though, and I don't know if that was your
>intent.
>
>| The problem here is that I don't already have a
>| Graphics2D object I have a graphics object that I
>| want to cast to a Graphics2D object. In order to
>| be able to use the Graphics2D API I have to some
>| how cast the Graphics object passed to paint() by
>| default to a Graphics2D object, but I can't figure
>| out quite how.
>
>Casting won't help here either. In Java it would blow up with a
>ClassCastException and in C/C++ you would just get weird data
>corruption. THis is becaues casting doesn't actually do any
>conversion, it only changes what the compiler thinks you have.
>
>You need to do some research on Graphics2D objects and see if you
>can't create one from a Grahics object. I haven't used those
>classes myself so I'm not sure.
>
>HTH,
>-D
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
|