Login  Register

Re: NewtCanvasAWT Examples

Posted by snmvaughan on Aug 17, 2010; 8:29pm
URL: https://forum.jogamp.org/NewtCanvasAWT-Examples-tp1113619p1195120.html

I took a look at the junit tests and found that one of them locked up consistently.  When I run all of the unit tests within TestParenting01aAWT, the test fails on testWindowParenting04ReparentNewtWin2TopLayouted.  If I run just that one test independently, it seems to work fine.

NEWT looks pretty interesting, but it needs some work to make it more stable and predictable.  Although the test cases complete without reporting errors, each leaves running non-daemon threads.  This isn't a problem for an individual test, but if NEWT were part of a larger application It could definitely cause some issues.

Looking internally within the running instance, the Display reference counter is incorrect.  The reference counter is used to determine when the Display's EDT is longer necessary.  There is no finalize() method defined for screen, so it is have to have a Screen instance garbage collected without decrementing the reference count.  NewtCanvasAWT consistently reparents the GLWindow instances, creating second screens, which explains why the reference count within the Display is incorrect.

I see tests using multiple windows, but I didn't see any tests that independently manage those windows.  The tests construct the windows run a few operations, and then destroy the pair.  Since I'm looking to operate within a JDesktopPane, being able to create and destroy a window without negatively impacting other windows is a requirement.