2
2
* Copyright 2006-2009, 2017, 2020 United States Government, as represented by the
3
3
* Administrator of the National Aeronautics and Space Administration.
4
4
* All rights reserved.
5
- *
5
+ *
6
6
* The NASA World Wind Java (WWJ) platform is licensed under the Apache License,
7
7
* Version 2.0 (the "License"); you may not use this file except in compliance
8
8
* with the License. You may obtain a copy of the License at
9
9
* http://www.apache.org/licenses/LICENSE-2.0
10
- *
10
+ *
11
11
* Unless required by applicable law or agreed to in writing, software distributed
12
12
* under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
13
13
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
14
14
* specific language governing permissions and limitations under the License.
15
- *
15
+ *
16
16
* NASA World Wind Java (WWJ) also contains the following 3rd party Open Source
17
17
* software:
18
- *
18
+ *
19
19
* Jackson Parser – Licensed under Apache 2.0
20
20
* GDAL – Licensed under MIT
21
21
* JOGL – Licensed under Berkeley Software Distribution (BSD)
22
22
* Gluegen – Licensed under Berkeley Software Distribution (BSD)
23
- *
23
+ *
24
24
* A complete listing of 3rd Party software notices and licenses included in
25
25
* NASA World Wind Java (WWJ) can be found in the WorldWindJava-v2.2 3rd-party
26
26
* notices and licenses PDF found in code directory.
@@ -224,9 +224,9 @@ public WorldWindowGLCanvas(WorldWindow shareWith, java.awt.GraphicsDevice device
224
224
}
225
225
226
226
@ Override
227
- public void propertyChange (PropertyChangeEvent evt )
227
+ public void propertyChange (PropertyChangeEvent evt )
228
228
{
229
- if (this .wwd == evt .getSource ())
229
+ if (this .wwd == evt .getSource ())
230
230
this .firePropertyChange (evt );
231
231
232
232
//noinspection StringEquality
@@ -235,7 +235,7 @@ public void propertyChange(PropertyChangeEvent evt)
235
235
}
236
236
237
237
@ Override
238
- public void shutdown ()
238
+ public void shutdown ()
239
239
{
240
240
WorldWind .removePropertyChangeListener (WorldWind .SHUTDOWN_EVENT , this );
241
241
this .wwd .shutdown ();
@@ -266,13 +266,13 @@ protected void createDefaultInputHandler()
266
266
}
267
267
268
268
@ Override
269
- public InputHandler getInputHandler ()
269
+ public InputHandler getInputHandler ()
270
270
{
271
271
return this .wwd .getInputHandler ();
272
272
}
273
273
274
274
@ Override
275
- public void setInputHandler (InputHandler inputHandler )
275
+ public void setInputHandler (InputHandler inputHandler )
276
276
{
277
277
if (this .wwd .getInputHandler () != null )
278
278
this .wwd .getInputHandler ().setEventSource (null ); // remove this window as a source of events
@@ -283,181 +283,181 @@ public void setInputHandler(InputHandler inputHandler)
283
283
}
284
284
285
285
@ Override
286
- public SceneController getSceneController ()
286
+ public SceneController getSceneController ()
287
287
{
288
288
return this .wwd .getSceneController ();
289
289
}
290
290
291
291
@ Override
292
- public void setSceneController (SceneController sceneController )
292
+ public void setSceneController (SceneController sceneController )
293
293
{
294
294
this .wwd .setSceneController (sceneController );
295
295
}
296
296
297
297
@ Override
298
- public GpuResourceCache getGpuResourceCache ()
298
+ public GpuResourceCache getGpuResourceCache ()
299
299
{
300
300
return this .wwd .getGpuResourceCache ();
301
301
}
302
302
303
303
@ Override
304
- public void redraw ()
304
+ public void redraw ()
305
305
{
306
306
this .repaint ();
307
307
}
308
308
309
309
@ Override
310
- public void redrawNow ()
310
+ public void redrawNow ()
311
311
{
312
312
this .wwd .redrawNow ();
313
313
}
314
314
315
315
@ Override
316
- public void setModel (Model model )
316
+ public void setModel (Model model )
317
317
{
318
318
// null models are permissible
319
319
this .wwd .setModel (model );
320
320
}
321
321
322
322
@ Override
323
- public Model getModel ()
323
+ public Model getModel ()
324
324
{
325
325
return this .wwd .getModel ();
326
326
}
327
F438
327
328
328
@ Override
329
- public void setView (View view )
329
+ public void setView (View view )
330
330
{
331
331
// null views are permissible
332
332
if (view != null )
333
333
this .wwd .setView (view );
334
334
}
335
335
336
336
@ Override
337
- public View getView ()
337
+ public View getView ()
338
338
{
339
339
return this .wwd .getView ();
340
340
}
341
341
342
342
@ Override
343
- public void setModelAndView (Model model , View view )
343
+ public void setModelAndView (Model model , View view )
344
344
{ // null models/views are permissible
345
345
this .setModel (model );
346
346
this .setView (view );
347
347
}
348
348
349
349
@ Override
350
- public void addRenderingListener (RenderingListener listener )
350
+ public void addRenderingListener (RenderingListener listener )
351
351
{
352
352
this .wwd .addRenderingListener (listener );
353
353
}
354
354
355
355
@ Override
356
- public void removeRenderingListener (RenderingListener listener )
356
+ public void removeRenderingListener (RenderingListener listener )
357
357
{
358
358
this .wwd .removeRenderingListener (listener );
359
359
}
360
360
361
361
@ Override
362
- public void addSelectListener (SelectListener listener )
362
+ public void addSelectListener (SelectListener listener )
363
363
{
364
364
this .wwd .getInputHandler ().addSelectListener (listener );
365
365
this .wwd .addSelectListener (listener );
366
366
<
10000
div class="diff-text-inner"> }
367
367
368
368
@ Override
369
- public void removeSelectListener (SelectListener listener )
369
+ public void removeSelectListener (SelectListener listener )
370
370
{
371
371
this .wwd .getInputHandler ().removeSelectListener (listener );
372
372
this .wwd .removeSelectListener (listener );
373
373
}
374
374
375
375
@ Override
376
- public void addPositionListener (PositionListener listener )
376
+ public void addPositionListener (PositionListener listener )
377
377
{
378
378
this .wwd .addPositionListener (listener );
379
379
}
380
380
381
381
@ Override
382
- public void removePositionListener (PositionListener listener )
382
+ public void removePositionListener (PositionListener listener )
383
383
{
384
384
this .wwd .removePositionListener (listener );
385
385
}
386
386
387
387
@ Override
388
- public void addRenderingExceptionListener (RenderingExceptionListener listener )
388
+ public void addRenderingExceptionListener (RenderingExceptionListener listener )
389
389
{
390
390
this .wwd .addRenderingExceptionListener (listener );
391
391
}
392
392
393
393
@ Override
394
- public void removeRenderingExceptionListener (RenderingExceptionListener listener )
394
+ public void removeRenderingExceptionListener (RenderingExceptionListener listener )
395
395
{
396
396
this .wwd .removeRenderingExceptionListener (listener );
397
397
}
398
398
399
399
@ Override
400
- public Position getCurrentPosition ()
400
+ public Position getCurrentPosition ()
401
401
{
402
402
return this .wwd .getCurrentPosition ();
403
403
}
404
404
405
405
@ Override
406
- public PickedObjectList getObjectsAtCurrentPosition ()
406
+ public PickedObjectList getObjectsAtCurrentPosition ()
407
407
{
408
408
return this .wwd .getSceneController () != null ? this .wwd .getSceneController ().getPickedObjectList () : null ;
409
409
}
410
410
411
411
@ Override
412
- public PickedObjectList getObjectsInSelectionBox ()
412
+ public PickedObjectList getObjectsInSelectionBox ()
413
413
{
414
414
return this .wwd .getSceneController () != null ? this .wwd .getSceneController ().getObjectsInPickRectangle () : null ;
415
415
}
416
416
417
417
@ Override
418
- public Object setValue (String key , Object value )
418
+ public Object setValue (String key , Object value )
419
419
{
420
420
return this .wwd .setValue (key , value );
421
421
}
422
422
423
423
@ Override
424
- public AVList setValues (AVList avList )
424
+ public AVList setValues (AVList avList )
425
425
{
426
426
return this .wwd .setValues (avList );
427
427
}
428
428
429
429
@ Override
430
- public Object getValue (String key )
430
+ public Object getValue (String key )
431
431
{
432
432
return this .wwd .getValue (key );
433
433
}
434
434
435
435
@ Override
436
- public Collection <Object > getValues ()
436
+ public Collection <Object > getValues ()
437
437
{
438
438
return this .wwd .getValues ();
439
439
}
440
440
441
441
@ Override
442
- public Set <Map .Entry <String , Object >> getEntries ()
442
+ public Set <Map .Entry <String , Object >> getEntries ()
443
443
{
444
444
return this .wwd .getEntries ();
445
445
}
446
446
447
447
@ Override
448
- public String getStringValue (String key )
448
+ public String getStringValue (String key )
449
449
{
450
450
return this .wwd .getStringValue (key );
451
451
}
452
452
453
453
@ Override
454
- public boolean hasKey (String key )
454
+ public boolean hasKey (String key )
455
455
{
456
456
return this .wwd .hasKey (key );
457
457
}
458
458
459
459
@ Override
460
- public Object removeKey (String key )
460
+ public Object removeKey (String key )
461
461
{
462
462
return this .wwd .removeKey (key );
463
463
}
@@ -493,52 +493,58 @@ public void firePropertyChange(String propertyName, Object oldValue, Object newV
493
493
}
494
494
495
495
@ Override
496
- public void firePropertyChange (PropertyChangeEvent propertyChangeEvent )
496
+ public void firePropertyChange (PropertyChangeEvent propertyChangeEvent )
497
497
{
498
498
this .wwd .firePropertyChange (propertyChangeEvent );
499
499
}
500
500
501
501
@ Override
502
- public AVList copy ()
502
+ public AVList copy ()
503
503
{
504
504
return this .wwd .copy ();
505
505
}
506
506
507
507
@ Override
508
- public AVList clearList ()
508
+ public AVList clearList ()
509
509
{
510
510
return this .wwd .clearList ();
511
511
}
512
512
513
513
@ Override
514
- public void setPerFrameStatisticsKeys (Set <String > keys )
514
+ public void setPerFrameStatisticsKeys (Set <String > keys )
515
515
{
516
516
this .wwd .setPerFrameStatisticsKeys (keys );
517
517
}
518
518
519
519
@ Override
520
- public Collection <PerformanceStatistic > getPerFrameStatistics ()
520
+ public Collection <PerformanceStatistic > getPerFrameStatistics ()
521
521
{
522
522
return this .wwd .getPerFrameStatistics ();
523
523
}
524
-
524
+
525
525
/**
526
526
* @return current mouse pointer position in GL surface screen coordinates.
527
527
*/
528
528
@ Override
529
- public Point getMousePosition () throws HeadlessException {
530
- Point mpos = super .getMousePosition ();
531
- int [] awtPt = { mpos .x , mpos .y };
532
-
533
- if (wwd .getContext () == null ) return mpos ;
534
-
535
- GLDrawable drawable = wwd .getContext ().getGLDrawable ();
536
- if (drawable == null ) return mpos ;
537
-
538
- // Convert to GL surface coordinates
539
- int [] glSurfacePt = drawable .getNativeSurface ().convertToPixelUnits (awtPt );
540
- int glSurfaceHeight = drawable .getSurfaceHeight ();
541
- glSurfacePt [1 ] = glSurfaceHeight - glSurfacePt [1 ] - 1 ;
542
- return new Point (glSurfacePt [0 ], glSurfacePt [1 ]);
529
+ public Point getMousePosition () throws HeadlessException
530
+ {
531
+ Point mpos = super .getMousePosition ();
532
+ int [] awtPt =
533
+ {
534
+ mpos .x , mpos .y
535
+ };
536
+
537
+ if (wwd .getContext () == null )
538
+ return mpos ;
539
+
540
+ GLDrawable drawable = wwd .getContext ().getGLDrawable ();
541
+ if (drawable == null )
542
+ return mpos ;
543
+
544
+ // Convert to GL surface coordinates
545 + int [] glSurfacePt = drawable .getNativeSurface ().convertToPixelUnits (awtPt );
546
+ int glSurfaceHeight = drawable .getSurfaceHeight ();
547
+ glSurfacePt [1 ] = glSurfaceHeight - glSurfacePt [1 ] - 1 ;
548
+ return new Point (glSurfacePt [0 ], glSurfacePt [1 ]);
543
549
}
544
550
}
0 commit comments