World Wind 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());  	
	}
}

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


评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值