Documentation Index
Fetch the complete documentation index at: https://mintlify.com/nasaworldwind/worldwindjava/llms.txt
Use this file to discover all available pages before exploring further.
WorldWind is the central singleton that bootstraps and manages every global service in the NASA WorldWind Java SDK. It is a final class with a private constructor — you never instantiate it directly. Instead, all services are accessed through its static methods. On first class-load the singleton initialises its retrieval services, task service, data file store, memory cache set, network status, and session cache from the active Configuration. Calling WorldWind.shutDown() tears down every service cleanly and then rebuilds the singleton in its initial empty state, making it safe to call multiple times over the lifetime of a long-running application.
Package: gov.nasa.worldwind
Class: public final class WorldWind
Constants
Altitude Modes
Altitude modes control how a shape’s elevation value is interpreted relative to the globe surface. Pass these integer constants to any WorldWind geometry that accepts an altitude-mode parameter.| Constant | Value | Description |
|---|---|---|
WorldWind.ABSOLUTE | 0 | Elevation is measured in metres above the WGS84 ellipsoid, regardless of terrain. |
WorldWind.CLAMP_TO_GROUND | 1 | Shape is clamped to the terrain surface; the elevation value is ignored. |
WorldWind.RELATIVE_TO_GROUND | 2 | Elevation is measured in metres above the terrain surface at the shape’s position. |
WorldWind.CONSTANT | 3 | Elevation is held constant; the shape follows neither the ellipsoid nor the terrain. |
Using altitude modes
Path Types
Path types determine how a line or path is interpolated between two geographic positions. Prefer theAVKey string equivalents in new code — these integer constants are retained for compatibility with Polyline.
| Constant | Value | Description |
|---|---|---|
WorldWind.GREAT_CIRCLE | 0 | Shortest-arc path on the sphere (great-circle arc). |
WorldWind.LINEAR | 1 | Straight line in Cartesian space (appears curved on screen). |
WorldWind.RHUMB_LINE | 2 | Constant-bearing (loxodromic) path on the ellipsoid. |
Anti-alias Hints
These constants map directly to the JOGL/OpenGL quality hints and are used where WorldWind exposes anti-aliasing quality control.| Constant | GL Equivalent | Description |
|---|---|---|
WorldWind.ANTIALIAS_DONT_CARE | GL.GL_DONT_CARE | No preference; the driver chooses. |
WorldWind.ANTIALIAS_FASTEST | GL.GL_FASTEST | Prefer performance over quality. |
WorldWind.ANTIALIAS_NICEST | GL.GL_NICEST | Prefer quality over performance. |
Shutdown Event
SHUTDOWN_EVENT constant
SHUTDOWN_EVENT is the PropertyChangeEvent property name fired on all registered listeners immediately before WorldWind tears down its services during shutDown(). Register a listener via WorldWind.addPropertyChangeListener(WorldWind.SHUTDOWN_EVENT, listener) to receive advance notification of a pending shutdown, for example to cleanly release application-level GPU resources.
Static Methods
Data File Store
getDataFileStore
FileStore used to read and write cached data files (terrain tiles, imagery, etc.) on the local file system. The concrete implementation is determined at startup by the AVKey.DATA_FILE_STORE_CLASS_NAME configuration key.
Returns: FileStore — the singleton data file store; never null after initialization.
Retrieval Services
getRetrievalService / getLocalRetrievalService
getRetrievalService() and getRemoteRetrievalService() both return the remote RetrievalService responsible for fetching data from the network (HTTP/HTTPS). getLocalRetrievalService() returns a separate instance that handles retrieval from the local file system. Both instances are thread-pool backed and process requests asynchronously.
Returns: RetrievalService
Task Service
getTaskService
TaskService used by WorldWind internally to run background work (e.g., tile loading). Applications can submit their own Runnable tasks to this service.
Returns: TaskService
Scheduled Task Service
getScheduledTaskService
ScheduledTaskService for tasks that should run after a delay or repeat at a fixed interval. This is backed by BasicScheduledTaskService and is always initialised directly (not via Configuration).
Returns: ScheduledTaskService
Memory Cache Set
getMemoryCacheSet / getMemoryCache
getMemoryCacheSet() returns the registry of all named in-memory caches used throughout the SDK. getMemoryCache(String key) is a shorthand that looks up a single MemoryCache by its string key.
The AVKey string identifying the specific cache (e.g.,
AVKey.TEXTURE_IMAGE_CACHE).MemoryCacheSet / MemoryCache
Network Status
getNetworkStatus
NetworkStatus object that tracks which network hosts are reachable and whether the application is in offline mode. Individual host reachability is sampled lazily and cached.
Returns: NetworkStatus
Session Cache
getSessionCache
SessionCache used to store transient per-session key/value pairs. Unlike the memory cache set, entries here have no capacity-based eviction policy — they persist for the lifetime of the WorldWind instance.
Returns: SessionCache
Component Factory
createConfigurationComponent
classNameKey in the active Configuration. This is the primary factory method used internally whenever WorldWind instantiates a service or component (views, scene controllers, input handlers, etc.). The key is looked up via Configuration.getStringValue(classNameKey) and the resulting class name is instantiated by reflection using a no-argument constructor.
An AVKey configuration key (e.g.,
AVKey.SCENE_CONTROLLER_CLASS_NAME) whose value is the fully-qualified class name to instantiate.Object — a new instance of the configured class.
Throws:
IllegalArgumentException— ifclassNameKeyisnullor empty.IllegalStateException— if no class name is registered for the key, or if the class cannot be instantiated.
Using createConfigurationComponent
Offline Mode
isOfflineMode / setOfflineMode
true, all remote retrievals are suppressed and only locally cached data is used. The default value is false. These methods delegate to getNetworkStatus().
Pass
true to prevent any network access; false (default) to allow it.Enabling offline mode
Shutdown
shutDown
SHUTDOWN_EVENT on all registered property-change listeners, disposes of every active service (task service, retrieval services, memory caches, session cache, scheduled task service), then reconstructs a fresh WorldWind singleton. Any open WorldWindow objects are in an indeterminate state after this call. WorldWind can continue to be used immediately after the call returns.
Version
Version information is provided by thegov.nasa.worldwind.Version utility class, which is separate from the WorldWind singleton.
Querying version information
| Method | Return | Example |
|---|---|---|
Version.getVersion() | String | "NASA WorldWind Java v2.2.1" |
Version.getVersionName() | String | "NASA WorldWind Java" |
Version.getVersionNumber() | String | "v2.2.1" |
Version.getVersionMajorNumber() | String | "2" |
Version.getVersionMinorNumber() | String | "2" |
Version.getVersionDotNumber() | String | "1" |