Using JAWT CALayer with QT
Jessica Finley
jfinley at tech4learning.com
Mon May 21 12:41:10 PDT 2012
So, I've modified the project to not use the JavaVM framework, and to instead point to jdk1.7.0_06.jdk/Contents/Home/jre/include headers and associated libraries (libawt.dylib, libjawt.dylib). I left out the NativeDrawnCanvas.java and DrawingCanvas.m classes, since they use deprecated NSView based drawing. Additionally, I modified the awt.version in LayerCanvas.m to be
awt.version = JAWT_VERSION_1_7 | JAWT_MACOSX_USE_CALAYER; // opt into the CALayer model
Now, when I run the application, I no longer get the error ([java] JavaVM WARNING: JAWT_GetAWT must be called after loading a JVM), but instead the canvas doesn't draw anything at all. I get no warnings about loading the resources for the layers or anything like that, so I'm assuming it's finding them (I made changes so instead of referencing the resources from the app bundle, they are referenced absolutely on the file system).
Any ideas as to why nothing is being drawn at all? Let me know if you want my modified example project to take a look at.
Has anyone gotten any sort of CALayer drawing working with Java 7? At this point, I'm not as much interested in QT specifics as much as just getting _something_ working.
Thanks,
Jess
On May 17, 2012, at 3:55 PM, Jessica Finley wrote:
> Hiya folks,
>
> It is my understanding that we are to use CALayer based embedding now instead of NSView based embedding. Can someone explain to me how to do so? Primarily, I am interested in playing a QT movie. I've been looking at the JAWTExample project located here:
>
> https://developer.apple.com/library/mac/#samplecode/JAWTExample/Introduction/Intro.html#//apple_ref/doc/uid/DTS10000683-Intro-DontLinkElementID_2
>
> Which works beautifully in Java 6, but no so much in Java 7. When run in Java 7 (after some finagling to launch the jar outside of its app bundle so it will run in Java 7), I get the following error when trying to draw the included QT movie:
> [java] JavaVM WARNING: JAWT_GetAWT must be called after loading a JVM
>
> I'm not really sure why this doesn't work in Java 7, since it is using CALayer embedding, as it should… I think.
>
> Thanks!
> -Jess
More information about the macosx-port-dev
mailing list