![]() |
|
|||||||
| Development Help Help for building applications or diagnosing problems with WWJ |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Jun 2009
Posts: 17
![]() |
I've run into a pretty strange issue. To give some background, my software has a number of different JPanels all embedded within a single JFrame. One of the panels has WorldWind in it, the others are all native Swing components. I've made each panel "dockable" - that is, either all of the panels can be integrated into a single frame, or they can each be "undocked" into their own frames. This can be done at the user's request at any time.
So here's the issue - initially, the application starts up with all of the different panels "docked". After generating a BufferedImage, I add it to a SurfaceImage, then add that SurfaceImage to the globe. Nothing shows up. However, if I undock all of the panels into their own frames, then recreate the SurfaceImage and add it to the globe, it works fine. If I redock all of the panels and generate new SurfaceImages while all of the panels are docked, the SurfaceImages work just fine. Any ideas on what might be causing this? BTW - I'm using a Quadro FX 3700 with 512MB of video memory on an Intel Core2 Quad with 8GB of RAM. I've seen issues on machines with integrated graphics cards, but this machine isn't one of them and has never had a problem running WorldWind before. |
|
|
|
|
|
#2 | |
|
Senior Member
Join Date: Feb 2008
Location: Melbourne, FL, USA
Posts: 679
![]() |
is your initially docked panel getting focus correctly? perhaps the scene isnt redrawing.
__________________
Junior Member
Join Date: Jun 2009
Posts: 17
![]() |
I believe so - the initially-docked panel is also being used to display Polylines and UserFacingIcons, and there's no problem with those.
At a closer look, it seems like the SurfaceImage is appearing briefly, then disappearing. To generate the SurfaceImage, the user has to interact with a popup message... it almost seems like the image disappears as soon as the popup does, but this only happens in the initial UI state - if I undock, then redock, this problem goes away. Last edited by benlawry; 07-06-2011 at 06:10 PM. |
|
|
|
|
|
#4 |
|
WW Dev. Team
Join Date: Sep 2010
Location: Boston, MA, USA
Posts: 325
![]() |
Have you tried keeping the popup open to see if that resolves the problem? (I'm wondering if somehow the code that hides the popup is also hiding the SurfaceImage.) From what you've described, I suspect the problem is in the code that creates and adds the SurfaceImage to the globe. Something in this sequence must be failing the first time around, but working after that. You might also try adding some code that just creates a simple SurfaceImage without any user interaction, to verify that SurfaceImages themselves are working.
|
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Jun 2009
Posts: 17
![]() |
I finally figured this out - here's what's happening (turns out it's Java Swing and not WorldWind).
One of the "panels" is essentially a JTable that contains a list of Polylines, representing a Line of Bearing from some point to some "event". Each time the user clicks on a Polyline in the table, all renderables are removed from the globe and only the selected Polyline is displayed on the globe. This table does have a KeyListener associated with it so that the user can use the arrow keys to navigate through the table... this might seem off subject, but bear with me... In my program, the user has to select two Polylines from the table before generating a SurfaceImage. I use JOptionPane to get some input from the user prior to generating the SurfaceImage. When the user is done, he can either click "OK" or hit the "Enter" key. When clicking "OK", everything works as it should. However, when the user hits the "Enter" key, for some reason unknown to me, JOptionPane isn't consuming the KeyEvent, so that KeyEvent gets passed on to the JTable. Prior to the KeyEvent being consumed by the table, the new SurfaceImage is generated and rendered briefly. Then, when the table gets the key event, it removes all renderables (as it should), then displays only the polylines that were selected in the table. So... bottom line is, Java Swing is behaving oddly in that JOptionPane is not consuming the KeyEvent when the user hits "Enter" to create the SurfaceImage. The KeyEvent is still being passed on to the JTable, which is behaving exactly as I intended... haha. So the quick fix is just to have my table ignore all KeyEvents that happen as a result of the "Enter" key being pressed. Anyway, thanks for the suggestions - I know that ultimately, this is a problem with Swing and not with WorldWind, but your comments got me on the right track. I sure appreciate your time! |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Elevated SurfaceImage with Sector.FULL_SPHERE (Global Clouds) | lembas | Development Help | 13 | 02-07-2012 09:07 AM |
| SurfaceImage video | mikeallgyer | Development Help | 10 | 06-18-2011 09:03 AM |
| flickering SurfaceImage | jason_liu | Development Help | 4 | 10-08-2010 02:53 AM |
| SurfaceImage fades as I zoom out (mac only) | joefitz | Development Help | 2 | 01-29-2010 07:09 PM |
| How to properly refresh a SurfaceImage object | plarser48 | Development Help | 14 | 01-29-2010 01:26 PM |