Package gov.nasa.worldwindx.examples

Source Code of gov.nasa.worldwindx.examples.SimplestPossibleExample

/*
* Copyright (C) 2012 United States Government as represented by the Administrator of the
* National Aeronautics and Space Administration.
* All Rights Reserved.
*/

package gov.nasa.worldwindx.examples;

import gov.nasa.worldwind.BasicModel;
import gov.nasa.worldwind.Configuration;
import gov.nasa.worldwind.avlist.AVKey;
import gov.nasa.worldwind.awt.WorldWindowGLCanvas;

import javax.swing.*;

/**
* This example demonstrates the simplest possible way to create a WorldWind application.
*
* @version $Id: SimplestPossibleExample.java 1171 2013-02-11 21:45:02Z dcollins $
*/
public class SimplestPossibleExample extends JFrame
{
    public SimplestPossibleExample()
    {
        WorldWindowGLCanvas wwd = new WorldWindowGLCanvas();
        wwd.setPreferredSize(new java.awt.Dimension(1000, 800));
        this.getContentPane().add(wwd, java.awt.BorderLayout.CENTER);
        wwd.setModel(new BasicModel());
       
       
        // beg tempo bantchao
        Double lat = Configuration.getDoubleValue(AVKey.INITIAL_LATITUDE);
        Double lon = Configuration.getDoubleValue(AVKey.INITIAL_LONGITUDE);
        Double elevation = Configuration.getDoubleValue(AVKey.INITIAL_ALTITUDE);
        System.out.println("lat=" + lat + ", lon=" + lon + "elev=" + elevation);
        // end tempo bantchao
    }

    public static void main(String[] args)
    {
        java.awt.EventQueue.invokeLater(new Runnable()
        {
            public void run()
            {
                JFrame frame = new SimplestPossibleExample();
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                frame.pack();
                frame.setVisible(true);
            }
        });
    }
}
TOP

Related Classes of gov.nasa.worldwindx.examples.SimplestPossibleExample

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.