* GCJ compiles fine, but I get cast exception
@ 2008-08-01 9:11 Ciamak Abkai
2008-08-01 9:27 ` Andrew Haley
0 siblings, 1 reply; 3+ messages in thread
From: Ciamak Abkai @ 2008-08-01 9:11 UTC (permalink / raw)
To: java
Hi all,
I try to run prefuse applying gcj. There is a problem with the
following cast :
Graphics2D g2D = (Graphics2D)g;
gcj-info :
Using built-in specs.
Reading specs from /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/libgcj.spec
rename spec lib to liborig
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-4.1.2/work/gcc-4.1.2/configure
--prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.1.2
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.1.2
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.1.2/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.1.2/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/include/g++-v4
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec
--enable-nls --without-included-gettext --with-system-zlib
--disable-checking --disable-werror --enable-secureplt --enable-multilib
--enable-libmudflap --disable-libssp --enable-java-awt=gtk
--enable-languages=c,c++,java,treelang,fortran --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
gcc version 4.1.2 (Gentoo 4.1.2 p1.1)
Exception during event dispatch:
Exception in thread "prefuse_ActivityManager"
java.lang.ClassCastException: gnu.java.awt.peer.gtk.GdkGraphics cannot
be cast to java.awt.Graphics2D at
prefuse.Display.paintComponent(Display.java:795)
Do you have an idea how to solve the Problem ?
Thank you
Ciamak
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: GCJ compiles fine, but I get cast exception
2008-08-01 9:11 GCJ compiles fine, but I get cast exception Ciamak Abkai
@ 2008-08-01 9:27 ` Andrew Haley
2008-08-01 16:20 ` Robert Schuster
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Haley @ 2008-08-01 9:27 UTC (permalink / raw)
To: Ciamak Abkai; +Cc: java
Ciamak Abkai wrote:
> I try to run prefuse applying gcj. There is a problem with the
> following cast :
>
> Graphics2D g2D = (Graphics2D)g;
>
> Exception during event dispatch:
> Exception in thread "prefuse_ActivityManager"
> java.lang.ClassCastException: gnu.java.awt.peer.gtk.GdkGraphics cannot
> be cast to java.awt.Graphics2D at
> prefuse.Display.paintComponent(Display.java:795)
>
>
>
> Do you have an idea how to solve the Problem ?
GdkGraphics doesn't extend Graphics2D. Do you have any reason to
believe that it should? It extends Graphics.
Andrew.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: GCJ compiles fine, but I get cast exception
2008-08-01 9:27 ` Andrew Haley
@ 2008-08-01 16:20 ` Robert Schuster
0 siblings, 0 replies; 3+ messages in thread
From: Robert Schuster @ 2008-08-01 16:20 UTC (permalink / raw)
To: Andrew Haley; +Cc: Ciamak Abkai, java
[-- Attachment #1: Type: text/plain, Size: 424 bytes --]
Hi,
Andrew Haley schrieb:
>> Graphics2D g2D = (Graphics2D)g;
> GdkGraphics doesn't extend Graphics2D. Do you have any reason to
> believe that it should? It extends Graphics.
Typical implementation issue. On the other class library this is
possible always. Once upon a time I found this written down somewhere.
@Ciamak: You need a newer GCJ. In more recent versions the cast will work.
Regards
Robert
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 260 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-08-01 16:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-01 9:11 GCJ compiles fine, but I get cast exception Ciamak Abkai
2008-08-01 9:27 ` Andrew Haley
2008-08-01 16:20 ` Robert Schuster
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).