Wordwind (Java Version) Development environment build

Source: Internet
Author: User
Tags static class

My operating platform Windows 7 64-bit operating system, if 32-bit, then in the copy of some jar packets to pay attention to 32-bit.

First download the latest Wordwind source file on the website (i downloaded the 2.0 version), unzip it, and then create a new Java Project in Eclipse.

If you want to research the WorldWind source code, the development environment is built as follows :

1. Copy all the directory files under the SRC folder in the downloaded file to the SRC directory in the project.

2. Create a new Lib folder in Java Engineering to Gadl.jar, Gluegen-rt.jar, Gluegen-rt-natives-windows-amd64.jar, Jogl-all.jar, Jogl-all-natives-windows-amd64.jar, Plugin.jar Copy to the liturgical directory.

3. In the project, on the JRE System Library, right-click on build Path→configure build Path, click Add JARs under the Libraries tab, and then add all the jar packages under the Lib folder, as shown below.


Done, run any Java files under the Gov.nasa.worldwindx.examples package, and the results are as follows:


If you only want to use WorldWind for two development, the development environment only needs to be configured like this :

1. Create a new Lib folder in Java Engineering to Worldwin.jar, Worldwindx.jar, Gluegen-rt.jar, Gluegen-rt-natives-windows-amd64.jar, Jogl-all.jar, Jogl-all-natives-windows-amd64.jar copy to Lib directory.

2. In the project, on the JRE System Library, right-click on build Path→configure build Path, click Add JARs under the Libraries tab, and then worldwin.jar the Lib folder, Worldwindx.jar, Gluegen-rt.jar, Jogl-all.jar added, as shown below.


3. Add your own code to the SRC source file directory and invoke the API provided by WorldWind.

An example is given below:

Import Java.awt.BorderLayout;
Import java.awt.Dimension;
Import Java.awt.EventQueue;

Import Java.awt.Toolkit;

Import Javax.swing.JFrame;
Import Gov.nasa.worldwind.BasicModel;

Import Gov.nasa.worldwind.awt.WorldWindowGLCanvas; public class Helloworldwind {public static class Worldwindframe extends JFrame {private static final long serialve
		
		Rsionuid = -130932605398355602l;

		Private Worldwindowglcanvas Windowcanvas;
			Public Worldwindframe () {Windowcanvas = new Worldwindowglcanvas ();
			Dimension framesize = new Dimension (600,600);
			Windowcanvas.setpreferredsize (framesize);
			This.settitle ("Worldwinddemo");
			This.getcontentpane (). Add (Windowcanvas,borderlayout.center);
			Dimension screensize = Toolkit.getdefaulttoolkit (). Getscreensize ();
			This.setlocation ((screensize.width-framesize.width)/2, (Screensize.height-framesize.height)/2);
			This.pack ();
		Windowcanvas.setmodel (New Basicmodel ()); }} public static void Main (string[] args) {eventqueue.iNvokelater (New Runnable () {@Override public void run () {new Worldwindframe (). setvisible (True);
	}
		}); }
}

The results of the operation are as follows:




Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.