@@ -66,6 +66,7 @@ public WorldWindowGLJPanel()
6666 {
6767 this .wwd = ((WorldWindowGLDrawable ) WorldWind .createConfigurationComponent (AVKey .WORLD_WINDOW_CLASS_NAME ));
6868 this .wwd .initDrawable (this );
69+ this .wwd .addPropertyChangeListener (this );
6970 this .wwd .initGpuResourceCache (WorldWindowImpl .createGpuResourceCache ());
7071 this .createView ();
7172 this .createDefaultInputHandler ();
@@ -100,6 +101,7 @@ public WorldWindowGLJPanel(WorldWindow shareWith)
100101 {
101102 this .wwd = ((WorldWindowGLDrawable ) WorldWind .createConfigurationComponent (AVKey .WORLD_WINDOW_CLASS_NAME ));
102103 this .wwd .initDrawable (this );
104+ this .wwd .addPropertyChangeListener (this );
103105 if (shareWith != null )
104106 this .wwd .initGpuResourceCache (shareWith .getGpuResourceCache ());
105107 else
@@ -143,6 +145,7 @@ public WorldWindowGLJPanel(WorldWindow shareWith, GLCapabilities capabilities,
143145 {
144146 this .wwd = ((WorldWindowGLDrawable ) WorldWind .createConfigurationComponent (AVKey .WORLD_WINDOW_CLASS_NAME ));
145147 this .wwd .initDrawable (this );
148+ this .wwd .addPropertyChangeListener (this );
146149 if (shareWith != null )
147150 this .wwd .initGpuResourceCache (shareWith .getGpuResourceCache ());
148151 else
@@ -162,6 +165,9 @@ public WorldWindowGLJPanel(WorldWindow shareWith, GLCapabilities capabilities,
162165
163166 public void propertyChange (PropertyChangeEvent evt )
164167 {
168+ if (this .wwd == evt .getSource ())
169+ this .firePropertyChange (evt );
170+
165171 //noinspection StringEquality
166172 if (evt .getPropertyName () == WorldWind .SHUTDOWN_EVENT )
167173 this .shutdown ();
@@ -367,29 +373,24 @@ public Object removeKey(String key)
367373 public synchronized void addPropertyChangeListener (PropertyChangeListener listener )
368374 {
369375 super .addPropertyChangeListener (listener );
370- if (wwd != null ) // defensive condition for NPE that happens when (for example) setting a swing look/feel
371- this .wwd .addPropertyChangeListener (listener );
372376 }
373377
374378 @ Override
375379 public synchronized void addPropertyChangeListener (String propertyName , PropertyChangeListener listener )
376380 {
377381 super .addPropertyChangeListener (propertyName , listener );
378- this .wwd .addPropertyChangeListener (propertyName , listener );
379382 }
380383
381384 @ Override
382385 public synchronized void removePropertyChangeListener (PropertyChangeListener listener )
383386 {
384387 super .removePropertyChangeListener (listener );
385- this .wwd .removePropertyChangeListener (listener );
386388 }
387389
388390 @ Override
389391 public synchronized void removePropertyChangeListener (String propertyName , PropertyChangeListener listener )
390392 {
391393 super .removePropertyChangeListener (listener );
392- this .wwd .removePropertyChangeListener (listener );
393394 }
394395
395396 @ Override
0 commit comments