World Wind Java开发之一(转)

http://blog.csdn.net/giser_whu/article/details/40477235

参照《World wind Java三维地理信息系统开发指南随书光盘》以及官网论坛,开始学习World Wind Java开发。

第一个demo

[java] view plain copy
 
 print?在CODE上查看代码片派生到我的代码片
  1. //基础类  
  2. public class VGE_GFBasicClass extends JFrame  
  3. {  
  4.     protected WorldWindowGLCanvas worldWindowGLCanvas; //WorldWind 画布  
  5.     protected StatusBar statusBar;                  //状态栏  
  6.     protected Model modelEarth;  
  7.     protected LayerPanel layerPanel;                //图层面板  
  8.       
  9.     public VGE_GFBasicClass ()  
  10.     {  
  11.         //按指定尺寸创建画布  
  12.         Dimension canvasSize = new Dimension(800, 600);  
  13.         this.worldWindowGLCanvas = new WorldWindowGLCanvas();  
  14.         this.worldWindowGLCanvas.setPreferredSize(canvasSize);  
  15.   
  16.         // 创建Earth模型,并与画面绑定  
  17.         modelEarth = (Model) WorldWind  
  18.                 .createConfigurationComponent(AVKey.MODEL_CLASS_NAME);  
  19.         this.worldWindowGLCanvas.setModel(modelEarth);  
  20.         this.add(this.worldWindowGLCanvas, BorderLayout.CENTER);  
  21.   
  22.         // 增加状态栏  
  23.         this.statusBar = new StatusBar();  
  24.         this.add(statusBar, BorderLayout.PAGE_END);  
  25.         this.statusBar.setEventSource(worldWindowGLCanvas);  
  26.   
  27.         // 显示图层面板  
  28.         layerPanel = new LayerPanel(worldWindowGLCanvas);  
  29.         this.add(layerPanel, BorderLayout.WEST);  
  30.   
  31.         this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);  
  32.         this.setVisible(true);  
  33.         this.setSize(canvasSize);  
  34.     }  
  35.     public static void main(String[] args)  
  36.     {  
  37.         String strTitle = "…………子系统";  
  38.         VGE_GFBasicClass WWRun = new VGE_GFBasicClass();    
  39.         WWRun.setTitle( strTitle + ":" + WWRun.getClass().getName());     
  40.     }  
  41. }  

直接运行即可,效果图如下:

原文地址:https://www.cnblogs.com/telwanggs/p/6769684.html