NASA World Wind

gov.nasa.worldwindx.examples.util
Class ExampleUtil

java.lang.Object
  extended by gov.nasa.worldwindx.examples.util.ExampleUtil

public class ExampleUtil
extends Object

A collection of static utility methods used by the example programs.


Constructor Summary
ExampleUtil()
           
 
Method Summary
static void goTo(WorldWindow wwd, Sector sector)
          Causes the View attached to the specified WorldWindow to animate to the specified sector.
static File saveResourceToTempFile(String path, String suffix)
          Saves the file at the specified path in a temporary directory and returns a File to the temporary location.
static File unzipAndSaveToTempFile(String path, String suffix)
          Unzips the sole entry in the specified zip file, and saves it in a temporary directory, and returns a File to the temporary location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExampleUtil

public ExampleUtil()
Method Detail

goTo

public static void goTo(WorldWindow wwd,
                        Sector sector)
Causes the View attached to the specified WorldWindow to animate to the specified sector. The View starts animating at its current location and stops when the sector fills the window.

Parameters:
wwd - the WorldWindow who's View animates.
sector - the sector to go to.
Throws:
IllegalArgumentException - if either the wwd or the sector are null.

saveResourceToTempFile

public static File saveResourceToTempFile(String path,
                                          String suffix)
Saves the file at the specified path in a temporary directory and returns a File to the temporary location. The path may be one of the following:

Parameters:
path - the path to the source file.
suffix - the suffix to give the temp file.
Returns:
a File for the temp file.
Throws:
IllegalArgumentException - if the path is null or empty.

unzipAndSaveToTempFile

public static File unzipAndSaveToTempFile(String path,
                                          String suffix)
Unzips the sole entry in the specified zip file, and saves it in a temporary directory, and returns a File to the temporary location.

Parameters:
path - the path to the source file.
suffix - the suffix to give the temp file.
Returns:
a File for the temp file.
Throws:
IllegalArgumentException - if the path is null or empty.

NASA World Wind