DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
Building Scalable Real-Time Apps with AstraDB and Vaadin
Register Now

Trending

  • How to Submit a Post to DZone
  • How to LINQ Between Java and SQL With JPAStreamer
  • Auditing Tools for Kubernetes
  • The SPACE Framework for Developer Productivity

Trending

  • How to Submit a Post to DZone
  • How to LINQ Between Java and SQL With JPAStreamer
  • Auditing Tools for Kubernetes
  • The SPACE Framework for Developer Productivity
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. How to Create a Cross-Platform Application with NASA WorldWind & NetBeans Platform

How to Create a Cross-Platform Application with NASA WorldWind & NetBeans Platform

Antonio Santiago user avatar by
Antonio Santiago
·
Oct. 15, 09 · Interview
Like (0)
Save
Tweet
Share
14.59K Views

Join the DZone community and get the full member experience.

Join For Free

This post is a mini tutorial on how to create an application based on NetBeans Platform that uses the WorldWind Java virtual globe.

Before to continue, you need to have some knowledge about NetBeans Platform, WWJ and JOGL.

About NetBeans Platform

NetBeans Platform, similar to Eclipse RCP, is a platform which offers a set of basic functions and functionallities that are common in almost all project. The most clear examples of applications developed with these platforms are NetBeans IDE and Eclipse IDE themselves.

In the case of NetBeans Platform some features that likes me are:

  • 100% Swing.
  • Modular runtime container.
  • Plugin support.
  • Window system.
  • Support handling actions, files and many other things typical in applications.
  • Active project, decent documentation and great forum activity.

About WorldWind Java

WordlWind Java is a Java API to create and work with a virtual globe, something common on these days and not so easy to implement.

In contrast to WorldWind .NET which is a desktop application, WWJ is only an API, a set of classes you can use to create your own based application.

One impotant thing is WWJ works thanks to JOGL (Java binding for OpenGL API), which is a Java API to work with OpenGL and that uses a native library implementation depending on your system.

...and what is the problem

Nice question. Ok, if we can say there is any problem it will be: how to create a NetBeans module which includes the JOGL JAR files and also the native libraries so my application will be portable?

Follow the next steps and you will see there is not problem to achieve that.

Environment and requisites

Here is the list of software and versions I'm using for this example:

  • NetBeans IDE 6.7.
  • WorldWind Java 0.6 (build 263.12713).
  • JOGL (version 1.1.1a). I downloaded versions for Linux and Windows to test the application on two platforms.

Install NetBeans if you don't have installed. Download WWJ and JOGL and uncompress it at some place.

How to create the application

Ok next is the important part of this article. The basic idea is to create a new NetBeans Platform application with two library modules, containing required JAR files for JOGL and WorldWindJava:

  1. Step 1: Create a NetBeans Platform Application:
  2. Step 2: Create a library wrapper module for WWJ:

    Select the worlwind.jar file from WWJ folder. This will create a module into your NB platform application with the next folder structure:

  3. Step 3: Create a library wrapper module JOGL:

    Select the jogl.jar and gluegen.jar files from JOGL folder. In addition to the previous step, here we need to include the native libraries JOGL needs to run. To do that you must to create a folder called release/modules/lib and copy the native libraries.

    In the above image you can se the *.so files which corresponds only to the Linux native libraries. To make your application portable to other systems you must need to copy here the required *.dll or any other files.

  4. Step 4: Create a normal module.

    This module will contain the code to create a TopComponent window which will show the WWJ virtual globe:

  5. Step 5: Set modules dependencies.

    What you need to do now is to set the dependecies among the modules. WWJ module depends on JOGL one and your previous normal module will depend on WWJ and JOGL, because it will show a window with the virtual globe.

  6. Step 6: In the previous module create a new TopComponent Window using the wizard:

    Right-click on the module name and select New > Window Component. In the next wizard step select for Position the value editor. Press next and select a name for your TopComponent class (and an icon if desired).

    Open the code of your TopComponent and in the init() method add the next lines:

    Model model = (Model)WorldWind.createConfigurationComponent(AVKey.MODEL_CLASS_NAME);
    WorldWindowGLCanvas wwj = new WorldWindowGLCanvas();
    wwj.setModel(model);

    setLayout(new BorderLayout());
    add(wwj, BorderLayout.CENTER);

    You will need to import the required packages from WWJ module, which you must set as a dependency previously.

If you have followed the above steps the result you must get must be something similar to:

In addition, the benefit of using this approach is your application, once you build a ZIP distribution, will run on different machines thanks to the native libraries attached in the 'lib' folder.

From http://acuriousanimal.orggeo.net/?q=content/how-create-multiplatform-application-based-worldwindjava-netbeans-platform

 

application NetBeans Cross platform Library

Opinions expressed by DZone contributors are their own.

Trending

  • How to Submit a Post to DZone
  • How to LINQ Between Java and SQL With JPAStreamer
  • Auditing Tools for Kubernetes
  • The SPACE Framework for Developer Productivity

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com

Let's be friends: