/** * Causes resources used by the World Window to be freed. The World Window cannot be used once * this method is called. An OpenGL context for the window must be current. */ public void shutdown() { WorldWind.getDataFileStore().removePropertyChangeListener(this); if (this.inputHandler != null) { this.inputHandler.dispose(); this.inputHandler = new NoOpInputHandler(); } // Clear the texture cache if (this.getGpuResourceCache() != null) this.getGpuResourceCache().clear(); // Dispose all the layers // TODO: Need per-window dispose for layers if (this.getModel() != null && this.getModel().getLayers() != null) { for (Layer layer : this.getModel().getLayers()) { try { layer.dispose(); } catch (Exception e) { Logging.logger() .log( java.util.logging.Level.SEVERE, Logging.getMessage("WorldWindowGLCanvas.ExceptionWhileShuttingDownWorldWindow"), e); } } } SceneController sc = this.getSceneController(); if (sc != null) sc.dispose(); }
public void doActionOnButton4() { ArrayList<LatLon> locations = new ArrayList<LatLon>(); locations.add(LatLon.fromDegrees(45.50d, -123.3d)); locations.add(LatLon.fromDegrees(45.52d, -123.3d)); locations.add(LatLon.fromDegrees(45.54d, -123.3d)); locations.add(LatLon.fromDegrees(45.56d, -123.3d)); locations.add(LatLon.fromDegrees(45.58d, -123.3d)); locations.add(LatLon.fromDegrees(45.60d, -123.3d)); locations.add(LatLon.fromDegrees(40.50d, -120.1d)); locations.add(LatLon.fromDegrees(40.52d, -120.2d)); locations.add(LatLon.fromDegrees(40.54d, -120.3d)); locations.add(LatLon.fromDegrees(40.56d, -120.4d)); locations.add(LatLon.fromDegrees(40.58d, -120.5d)); locations.add(LatLon.fromDegrees(40.60d, -120.6d)); // Now, let's find WMSBasicElevationModel WMSBasicElevationModel wmsbem = null; ElevationModel model = this.wwd.getModel().getGlobe().getElevationModel(); if (model instanceof CompoundElevationModel) { CompoundElevationModel cbem = (CompoundElevationModel) model; for (ElevationModel em : cbem.getElevationModels()) { // you can have additional checks if you know specific model name, etc. if (em instanceof WMSBasicElevationModel) { wmsbem = (WMSBasicElevationModel) em; break; } } } else if (model instanceof WMSBasicElevationModel) { wmsbem = (WMSBasicElevationModel) model; } if (null != wmsbem) { ElevationsRetriever retriever = new ElevationsRetriever(wmsbem, locations, 10000, 30000, new NotifyWhenReady()); retriever.start(); } else { String message = Logging.getMessage( "ElevationModel.ExceptionRequestingElevations", "No instance of WMSBasicElevationModel was found"); Logging.logger().severe(message); } }
public void onError(String error) { String message = Logging.getMessage("ElevationModel.ExceptionRequestingElevations", error); Logging.logger().severe(message); }