码迷,mamicode.com
首页 > 编程语言 > 详细

World Wind Java开发之一

时间:2014-10-26 17:06:51      阅读:236      评论:0      收藏:0      [点我收藏+]

标签:worldwind   java   三维   地理信息   

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

第一个demo

//基础类
public class VGE_GFBasicClass extends JFrame
{
	protected WorldWindowGLCanvas worldWindowGLCanvas; //WorldWind 画布
	protected StatusBar statusBar;					//状态栏
	protected Model modelEarth;
	protected LayerPanel layerPanel;     			//图层面板
	
	public VGE_GFBasicClass ()
	{
		//按指定尺寸创建画布
		Dimension canvasSize = new Dimension(800, 600);
		this.worldWindowGLCanvas = new WorldWindowGLCanvas();
		this.worldWindowGLCanvas.setPreferredSize(canvasSize);

		// 创建Earth模型,并与画面绑定
		modelEarth = (Model) WorldWind
				.createConfigurationComponent(AVKey.MODEL_CLASS_NAME);
		this.worldWindowGLCanvas.setModel(modelEarth);
		this.add(this.worldWindowGLCanvas, BorderLayout.CENTER);

		// 增加状态栏
		this.statusBar = new StatusBar();
		this.add(statusBar, BorderLayout.PAGE_END);
		this.statusBar.setEventSource(worldWindowGLCanvas);

		// 显示图层面板
		layerPanel = new LayerPanel(worldWindowGLCanvas);
		this.add(layerPanel, BorderLayout.WEST);

		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.setVisible(true);
		this.setSize(canvasSize);
	}
	public static void main(String[] args)
	{
		String strTitle = "…………子系统";
		VGE_GFBasicClass WWRun = new VGE_GFBasicClass();  
		WWRun.setTitle( strTitle + ":" + WWRun.getClass().getName());  	
	}
}

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


bubuko.com,布布扣

World Wind Java开发之一

标签:worldwind   java   三维   地理信息   

原文地址:http://blog.csdn.net/giser_whu/article/details/40477235

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!