diff --git a/WebView32.dll b/WebView32.dll deleted file mode 100755 index 58178104f9..0000000000 Binary files a/WebView32.dll and /dev/null differ diff --git a/WebView64.dll b/WebView64.dll deleted file mode 100755 index 6c7e8503fd..0000000000 Binary files a/WebView64.dll and /dev/null differ diff --git a/libwebview.jnilib b/libwebview.jnilib deleted file mode 100755 index 904ea8a0f1..0000000000 Binary files a/libwebview.jnilib and /dev/null differ diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml index c4c6e5f242..6d9064118b 100644 --- a/nbproject/build-impl.xml +++ b/nbproject/build-impl.xml @@ -190,18 +190,6 @@ is divided into following sections: - - - - - - - - - - - - @@ -1218,13 +1206,27 @@ is divided into following sections: - + + + + + + + + + + + + + + + To run this application from the command line without Ant, try: ${platform.java} -jar "${dist.jar.resolved}" - + diff --git a/nbproject/configs/KMLViewer.properties b/nbproject/configs/KMLViewer.properties new file mode 100644 index 0000000000..9c18daa359 --- /dev/null +++ b/nbproject/configs/KMLViewer.properties @@ -0,0 +1 @@ +main.class=gov.nasa.worldwindx.examples.kml.KMLViewer diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties index b9f018bb30..b47f3833af 100644 --- a/nbproject/genfiles.properties +++ b/nbproject/genfiles.properties @@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=f85dc8f2@1.92.0.48 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=ed839dc9 -nbproject/build-impl.xml.script.CRC32=e40c9476 -nbproject/build-impl.xml.stylesheet.CRC32=3a2fa800@1.92.0.48 +nbproject/build-impl.xml.script.CRC32=2b01b309 +nbproject/build-impl.xml.stylesheet.CRC32=f89f7d21@1.93.0.48 diff --git a/src/gov/nasa/worldwind/Configuration.java b/src/gov/nasa/worldwind/Configuration.java index e82441f120..19c9cee436 100644 --- a/src/gov/nasa/worldwind/Configuration.java +++ b/src/gov/nasa/worldwind/Configuration.java @@ -608,7 +608,7 @@ public static boolean isLinuxOS() public static boolean isUnixOS() { String osName = System.getProperty("os.name"); - return osName != null && osName.toLowerCase().contains("unix"); + return osName != null && (osName.toLowerCase().contains("linux") || osName.toLowerCase().contains("unix")); } /** diff --git a/src/gov/nasa/worldwind/ogc/kml/impl/KMLAbstractBalloon.java b/src/gov/nasa/worldwind/ogc/kml/impl/KMLAbstractBalloon.java index 2b01b30550..989dbcbb92 100644 --- a/src/gov/nasa/worldwind/ogc/kml/impl/KMLAbstractBalloon.java +++ b/src/gov/nasa/worldwind/ogc/kml/impl/KMLAbstractBalloon.java @@ -83,6 +83,7 @@ public KMLAbstractBalloon(KMLAbstractFeature feature) * * @param balloon The balloon contained in this wrapper object. */ + @SuppressWarnings("deprecation") protected void initialize(Balloon balloon) { balloon.setTextDecoder(this.createTextDecoder(this.parent)); diff --git a/src/gov/nasa/worldwind/render/AbstractBrowserBalloon.java b/src/gov/nasa/worldwind/render/AbstractBrowserBalloon.java index 5e207801ff..e93e106660 100644 --- a/src/gov/nasa/worldwind/render/AbstractBrowserBalloon.java +++ b/src/gov/nasa/worldwind/render/AbstractBrowserBalloon.java @@ -93,7 +93,9 @@ * * @author dcollins * @version $Id: AbstractBrowserBalloon.java 2148 2014-07-14 16:27:49Z tgaskins $ + * @deprecated */ +@Deprecated public abstract class AbstractBrowserBalloon extends AbstractBalloon implements HotSpot, Disposable { diff --git a/src/gov/nasa/worldwind/render/GlobeBrowserBalloon.java b/src/gov/nasa/worldwind/render/GlobeBrowserBalloon.java index 5b3c0161a0..9c8f45a245 100644 --- a/src/gov/nasa/worldwind/render/GlobeBrowserBalloon.java +++ b/src/gov/nasa/worldwind/render/GlobeBrowserBalloon.java @@ -21,7 +21,9 @@ * @author pabercrombie * @version $Id: GlobeBrowserBalloon.java 2272 2014-08-25 23:24:45Z tgaskins $ * @see gov.nasa.worldwind.render.AbstractBrowserBalloon + * @deprecated */ +@Deprecated public class GlobeBrowserBalloon extends AbstractBrowserBalloon implements GlobeBalloon { protected class OrderedGlobeBrowserBalloon extends OrderedBrowserBalloon diff --git a/src/gov/nasa/worldwind/render/ScreenBrowserBalloon.java b/src/gov/nasa/worldwind/render/ScreenBrowserBalloon.java index d4afb99ada..be8ae8cfe1 100644 --- a/src/gov/nasa/worldwind/render/ScreenBrowserBalloon.java +++ b/src/gov/nasa/worldwind/render/ScreenBrowserBalloon.java @@ -18,7 +18,9 @@ * @author pabercrombie * @version $Id: ScreenBrowserBalloon.java 2148 2014-07-14 16:27:49Z tgaskins $ * @see gov.nasa.worldwind.render.AbstractBrowserBalloon + * @deprecated */ +@Deprecated public class ScreenBrowserBalloon extends AbstractBrowserBalloon implements ScreenBalloon { /** diff --git a/src/gov/nasa/worldwind/util/NativeLibraryLoader.java b/src/gov/nasa/worldwind/util/NativeLibraryLoader.java index 0825660d30..5c2d0bc1e9 100644 --- a/src/gov/nasa/worldwind/util/NativeLibraryLoader.java +++ b/src/gov/nasa/worldwind/util/NativeLibraryLoader.java @@ -3,61 +3,56 @@ * National Aeronautics and Space Administration. * All Rights Reserved. */ - package gov.nasa.worldwind.util; import gov.nasa.worldwind.exception.WWRuntimeException; +import java.io.File; /** * @author Lado Garakanidze * @version $Id: NativeLibraryLoader.java 1171 2013-02-11 21:45:02Z dcollins $ */ - -public class NativeLibraryLoader -{ - public static void loadLibrary(String libName) throws WWRuntimeException, IllegalArgumentException - { - if (WWUtil.isEmpty(libName)) - { +public class NativeLibraryLoader { + + public static void loadLibrary(String folder, String libName) throws WWRuntimeException, IllegalArgumentException { + if (WWUtil.isEmpty(libName)) { String message = Logging.getMessage("nullValue.LibraryIsNull"); throw new IllegalArgumentException(message); } - - try - { - System.loadLibrary(libName); - } - catch (java.lang.UnsatisfiedLinkError ule) - { + + try { + if (folder == null) { + System.loadLibrary(libName); + } else { + Runtime.getRuntime().load(folder + File.separator + makeFullLibName(libName)); + } + } catch (java.lang.UnsatisfiedLinkError ule) { String message = Logging.getMessage("generic.LibraryNotLoaded", libName, ule.getMessage()); throw new WWRuntimeException(message); - } - catch (Throwable t) - { + } catch (Throwable t) { String message = Logging.getMessage("generic.LibraryNotLoaded", libName, t.getMessage()); throw new WWRuntimeException(message); } } - - protected static String makeFullLibName(String libName) - { - if (WWUtil.isEmpty(libName)) + + protected static String makeFullLibName(String libName) { + if (WWUtil.isEmpty(libName)) { return null; - - if (gov.nasa.worldwind.Configuration.isWindowsOS()) - { - if (!libName.toLowerCase().endsWith(".dll")) - return libName + ".dll"; } - else if (gov.nasa.worldwind.Configuration.isMacOS()) - { - if (!libName.toLowerCase().endsWith(".jnilib") && !libName.toLowerCase().startsWith("lib")) + + if (gov.nasa.worldwind.Configuration.isWindowsOS()) { + if (!libName.toLowerCase().endsWith(".dll")) { + return libName + ".dll"; + } + } else if (gov.nasa.worldwind.Configuration.isMacOS()) { + if (!libName.toLowerCase().endsWith(".jnilib") && !libName.toLowerCase().startsWith("lib")) { return "lib" + libName + ".jnilib"; - } - else if (gov.nasa.worldwind.Configuration.isUnixOS()) // covers Solaris and Linux + } + } else if (gov.nasa.worldwind.Configuration.isUnixOS()) // covers Solaris and Linux { - if (!libName.toLowerCase().endsWith(".so") && !libName.toLowerCase().startsWith("lib")) + if (!libName.toLowerCase().endsWith(".so") && !libName.toLowerCase().startsWith("lib")) { return "lib" + libName + ".so"; + } } return libName; } diff --git a/src/gov/nasa/worldwind/util/gdal/GDALAbstractFileFilter.java b/src/gov/nasa/worldwind/util/gdal/GDALAbstractFileFilter.java index 8edb052f6c..f44f9f9a70 100644 --- a/src/gov/nasa/worldwind/util/gdal/GDALAbstractFileFilter.java +++ b/src/gov/nasa/worldwind/util/gdal/GDALAbstractFileFilter.java @@ -3,29 +3,25 @@ * National Aeronautics and Space Administration. * All Rights Reserved. */ - package gov.nasa.worldwind.util.gdal; -import gov.nasa.worldwind.util.*; - import java.io.File; -import java.util.HashSet; +import java.util.*; import java.util.regex.Pattern; +import gov.nasa.worldwind.util.*; + /** * @author Lado Garakanidze * @version $Id: GDALAbstractFileFilter.java 1171 2013-02-11 21:45:02Z dcollins $ */ +abstract class GDALAbstractFileFilter implements java.io.FileFilter { -abstract class GDALAbstractFileFilter implements java.io.FileFilter -{ - protected HashSet listFolders = new HashSet(); + protected HashSet listFolders = new HashSet<>(); protected final String searchPattern; - protected GDALAbstractFileFilter(String searchPattern) - { - if (null == searchPattern || searchPattern.length() == 0) - { + protected GDALAbstractFileFilter(String searchPattern) { + if (null == searchPattern || searchPattern.length() == 0) { String message = Logging.getMessage("nullValue.StringIsNull"); Logging.logger().severe(message); throw new IllegalArgumentException(message); @@ -36,17 +32,12 @@ protected GDALAbstractFileFilter(String searchPattern) listFolders.clear(); } - protected boolean isHidden(String path) - { - if (!WWUtil.isEmpty(path)) - { + protected boolean isHidden(String path) { + if (!WWUtil.isEmpty(path)) { String[] folders = path.split(Pattern.quote(File.separator)); - if (!WWUtil.isEmpty(folders)) - { - for (String folder : folders) - { - if (!WWUtil.isEmpty(folder) && folder.startsWith(".")) - { + if (!WWUtil.isEmpty(folders)) { + for (String folder : folders) { + if (!WWUtil.isEmpty(folder) && folder.startsWith(".")) { return true; } } @@ -55,9 +46,7 @@ protected boolean isHidden(String path) return false; } - public String[] getFolders() - { - String[] folders = new String[listFolders.size()]; - return this.listFolders.toArray(folders); + public ArrayList getFolders() { + return new ArrayList<>(listFolders); } -} \ No newline at end of file +} diff --git a/src/gov/nasa/worldwind/util/gdal/GDALUtils.java b/src/gov/nasa/worldwind/util/gdal/GDALUtils.java index 9befae2184..70dc94513d 100644 --- a/src/gov/nasa/worldwind/util/gdal/GDALUtils.java +++ b/src/gov/nasa/worldwind/util/gdal/GDALUtils.java @@ -45,14 +45,14 @@ public class GDALUtils { protected static final String OGR_DRIVER_PATH = "OGR_DRIVER_PATH"; protected static final String GDAL_DATA_PATH = "GDAL_DATA"; - protected static final AtomicBoolean gdalIsAvailable = new AtomicBoolean(false); + protected static final AtomicBoolean GDAL_IS_AVAILABLE = new AtomicBoolean(false); // This is an OLD default libname request by WW build of GDAL - protected static final String gdalalljni = Configuration.isMacOS() + protected static final String GDAL_ALL_JNI = Configuration.isMacOS() ? "gdalalljni" : (is32bitArchitecture() ? "gdalalljni32" : "gdalalljni64"); - protected static final CopyOnWriteArraySet loadedLibraries = new CopyOnWriteArraySet(); - protected static final CopyOnWriteArraySet failedLibraries = new CopyOnWriteArraySet(); + protected static final CopyOnWriteArraySet LOADED_LIBRARIES = new CopyOnWriteArraySet(); + protected static final CopyOnWriteArraySet FAILED_LIBRARIES = new CopyOnWriteArraySet(); static { // Allow the app or user to prevent library loader replacement. @@ -73,17 +73,17 @@ public void load(String libName) throws UnsatisfiedLinkError { } // check if the library is already loaded - if (loadedLibraries.contains(libName)) { + if (LOADED_LIBRARIES.contains(libName)) { return; } String message; - // check if the library is already know (from previous attempts) to fail to load - if (!failedLibraries.contains(libName)) { + // check if the library is already known (from previous attempts) to fail to load + if (!FAILED_LIBRARIES.contains(libName)) { try { - NativeLibraryLoader.loadLibrary(libName); - loadedLibraries.add(libName); + NativeLibraryLoader.loadLibrary(null, libName); + LOADED_LIBRARIES.add(libName); Logging.logger().info(Logging.getMessage("generic.LibraryLoadedOK", libName)); return; // GOOD! Leaving now @@ -92,7 +92,7 @@ public void load(String libName) throws UnsatisfiedLinkError { message = Logging.getMessage("generic.LibraryNotLoaded", libName, reason); Logging.logger().finest(message); - failedLibraries.add(libName); + FAILED_LIBRARIES.add(libName); } } else { String reason = Logging.getMessage("generic.LibraryNotFound", libName); @@ -113,7 +113,6 @@ protected static void replaceLibraryLoader() { for (Method m : methods) { if ("setLibraryLoader".equals(m.getName())) { gdal.setLibraryLoader(new GDALLibraryLoader()); -// Logging.logger().finest(Logging.getMessage("gdal.LibraryLoaderReplacedOK")); isKnownBuild = true; break; } @@ -140,11 +139,11 @@ protected static boolean is32bitArchitecture() { return "x86".equals(System.getProperty("os.arch")); } - protected static boolean gdalPreLoadNativeLibrary(boolean allowLogErrors) { + protected static boolean gdalPreLoadNativeLibrary(String folder, boolean allowLogErrors) { try { - NativeLibraryLoader.loadLibrary(gdalalljni); - loadedLibraries.add(gdalalljni); - Logging.logger().info(Logging.getMessage("generic.LibraryLoadedOK", gdalalljni)); + NativeLibraryLoader.loadLibrary(folder, GDAL_ALL_JNI); + LOADED_LIBRARIES.add(GDAL_ALL_JNI); + Logging.logger().info(Logging.getMessage("generic.LibraryLoadedOK", GDAL_ALL_JNI)); return true; } catch (Throwable t) { @@ -158,39 +157,31 @@ protected static boolean gdalPreLoadNativeLibrary(boolean allowLogErrors) { protected static void initialize() { try { - boolean runningAsJavaWebStart = (null != System.getProperty("javawebstart.version", null)); // attempt to load library from default locations // (current path OR by specifying java.library.path from the command line) - boolean gdalNativeLibraryLoaded = gdalPreLoadNativeLibrary(false); + boolean gdalNativeLibraryLoaded = gdalPreLoadNativeLibrary(null, false); - if (!gdalNativeLibraryLoaded && !runningAsJavaWebStart) { + if (!gdalNativeLibraryLoaded) { // if we are here, library is not in any default place, so we will search in sub-folders - String[] folders = findGdalFolders(); - String newJavaLibraryPath = buildPathString(folders, true); - if (newJavaLibraryPath != null) { - try { - alterJavaLibraryPath(newJavaLibraryPath); -// gdalNativeLibraryLoaded = gdalLoadNativeLibrary(true); - } catch (Exception e) { - String message = Logging.getMessage("gdal.UnableToAlterLibraryPath"); - Logging.logger().log(Level.WARNING, message, e); - } + ArrayList folders = findGdalFolders(); + folders.add("lib-external/gdal"); + folders.add(System.getProperty("user.dir")); + for (int i = 0; i < folders.size() && !gdalNativeLibraryLoaded; i++) { + gdalNativeLibraryLoaded = gdalPreLoadNativeLibrary(folders.get(i), false); } } - if ( /* gdalNativeLibraryLoaded && */gdalJNI.isAvailable() && gdalconstJNI.isAvailable()) { - if (!runningAsJavaWebStart) { - // No need, because we are build one dynamic library that contains ALL drivers - // and dependant libraries - // gdal.SetConfigOption(GDAL_DRIVER_PATH, pathToLibs); - // gdal.SetConfigOption(OGR_DRIVER_PATH, pathToLibs); - String dataFolder = findGdalDataFolder(); - if (null != dataFolder) { - String msg = Logging.getMessage("gdal.SharedDataFolderFound", dataFolder); - Logging.logger().finest(msg); - gdal.SetConfigOption(GDAL_DATA_PATH, dataFolder); - } + if (gdalJNI.isAvailable() && gdalconstJNI.isAvailable()) { + // No need, because we are build one dynamic library that contains ALL drivers + // and dependant libraries + // gdal.SetConfigOption(GDAL_DRIVER_PATH, pathToLibs); + // gdal.SetConfigOption(OGR_DRIVER_PATH, pathToLibs); + String dataFolder = findGdalDataFolder(); + if (null != dataFolder) { + String msg = Logging.getMessage("gdal.SharedDataFolderFound", dataFolder); + Logging.logger().finest(msg); + gdal.SetConfigOption(GDAL_DATA_PATH, dataFolder); } gdal.AllRegister(); @@ -199,13 +190,13 @@ protected static void initialize() { /** * "VERSION_NUM": Returns GDAL_VERSION_NUM formatted as a string. ie. "1170" "RELEASE_DATE": Returns * GDAL_RELEASE_DATE formatted as a string. "20020416" "RELEASE_NAME": Returns the GDAL_RELEASE_NAME. - * ie. "1.1.7" "--version": Returns full version , ie. "GDAL 1.1.7, released 2002/04/16" + * i.e. "1.1.7" "--version": Returns full version , ie. "GDAL 1.1.7, released 2002/04/16" */ String msg = Logging.getMessage("generic.LibraryLoadedOK", "GDAL v" + gdal.VersionInfo("RELEASE_NAME")); Logging.logger().info(msg); listAllRegisteredDrivers(); - gdalIsAvailable.set(true); + GDAL_IS_AVAILABLE.set(true); } else { String reason = Logging.getMessage("generic.LibraryNotFound", "GDAL"); String msg = Logging.getMessage("generic.LibraryNotLoaded", "GDAL", reason); @@ -227,7 +218,7 @@ protected static String getCurrentDirectory() { return cwd; } - protected static String[] findGdalFolders() { + protected static ArrayList findGdalFolders() { try { String cwd = getCurrentDirectory(); @@ -252,14 +243,14 @@ protected static String findGdalDataFolder() { GDALDataFinder filter = new GDALDataFinder(); fileTree.asList(filter); - String[] folders = filter.getFolders(); + ArrayList folders = filter.getFolders(); - if (null != folders && folders.length > 0) { - if (folders.length > 1) { - String msg = Logging.getMessage("gdal.MultipleDataFoldersFound", buildPathString(folders, false)); + if (!folders.isEmpty()) { + if (folders.size() > 1) { + String msg = Logging.getMessage("gdal.MultipleDataFoldersFound", folders.get(1)); Logging.logger().warning(msg); } - return folders[0]; + return folders.get(0); } } catch (Throwable t) { Logging.logger().severe(t.getMessage()); @@ -267,30 +258,9 @@ protected static String findGdalDataFolder() { String message = Logging.getMessage("gdal.SharedDataFolderNotFound"); Logging.logger().severe(message); - // throw new WWRuntimeException( message ); return null; } - protected static String buildPathString(String[] folders, boolean addDefaultValues) { - String del = System.getProperty("path.separator"); - StringBuilder path = new StringBuilder(); - - path.append("lib-external/gdal").append(del); - - if (null != folders && folders.length > 0) { - for (String folder : folders) { - path.append(folder).append(del); - } - } - if (addDefaultValues) { - path.append(".").append(del); // append current directory - path.append(System.getProperty("user.dir")).append(del); - path.append(System.getProperty(JAVA_LIBRARY_PATH)); - } - - return path.toString(); - } - protected static void listAllRegisteredDrivers() { StringBuilder sb = new StringBuilder(); for (int i = 0; i < gdal.GetDriverCount(); i++) { @@ -307,7 +277,7 @@ protected static void listAllRegisteredDrivers() { */ public static String getErrorMessage() { try { - if (gdalIsAvailable.get()) { + if (GDAL_IS_AVAILABLE.get()) { int errno = gdal.GetLastErrorNo(); if (errno != gdalconst.CE_None) { return Logging.getMessage("gdal.InternalError", errno, gdal.GetLastErrorMsg()); @@ -334,7 +304,7 @@ public static String getErrorMessage() { */ public static Dataset open(Object source, boolean isSilentMode) throws FileNotFoundException, IllegalArgumentException, SecurityException, WWRuntimeException { - if (!gdalIsAvailable.get()) { + if (!GDAL_IS_AVAILABLE.get()) { if (isSilentMode) { return null; } @@ -422,7 +392,7 @@ public static Dataset open(Object source) * @return true, if source is readable */ public static boolean canOpen(Object source) { - if (!gdalIsAvailable.get()) { + if (!GDAL_IS_AVAILABLE.get()) { return false; } @@ -467,7 +437,7 @@ public static boolean canOpen(Object source) { */ protected static DataRaster composeImageDataRaster(Dataset ds, AVList params) throws IllegalArgumentException, SecurityException, WWRuntimeException { - if (!gdalIsAvailable.get()) { + if (!GDAL_IS_AVAILABLE.get()) { String message = Logging.getMessage("gdal.GDALNotAvailable"); Logging.logger().severe(message); throw new WWRuntimeException(message); @@ -859,7 +829,6 @@ protected static BufferedImage verticalFlip(BufferedImage img) { int w = img.getWidth(); int h = img.getHeight(); -// BufferedImage flipImg = new BufferedImage(w, h, img.getColorModel().getTransparency() ); BufferedImage flipImg = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB); Graphics2D g2d = flipImg.createGraphics(); java.awt.Composite prevComposite = g2d.getComposite(); @@ -1015,7 +984,7 @@ public static double[] calcGetGeoTransform(Sector sector, int width, int height) } public static SpatialReference createGeographicSRS() throws WWRuntimeException { - if (!gdalIsAvailable.get()) { + if (!GDAL_IS_AVAILABLE.get()) { String message = Logging.getMessage("gdal.GDALNotAvailable"); Logging.logger().severe(message); throw new WWRuntimeException(message); @@ -1027,7 +996,7 @@ public static SpatialReference createGeographicSRS() throws WWRuntimeException { } protected static LatLon getLatLonForRasterPoint(double[] gt, int x, int y, CoordinateTransformation ct) { - if (!gdalIsAvailable.get()) { + if (!GDAL_IS_AVAILABLE.get()) { String message = Logging.getMessage("gdal.GDALNotAvailable"); Logging.logger().severe(message); throw new WWRuntimeException(message); @@ -1130,7 +1099,7 @@ public static AVList extractRasterParameters(Dataset ds, AVList params, boolean params = new AVListImpl(); } - if (!gdalIsAvailable.get()) { + if (!GDAL_IS_AVAILABLE.get()) { String message = Logging.getMessage("gdal.GDALNotAvailable"); Logging.logger().finest(message); throw new WWRuntimeException(message); @@ -1402,7 +1371,6 @@ public static AVList extractRasterParameters(Dataset ds, AVList params, boolean params.setValue(AVKey.COORDINATE_SYSTEM, AVKey.COORDINATE_SYSTEM_UNKNOWN); String msg = Logging.getMessage("generic.UnknownCoordinateSystem", proj_wkt); Logging.logger().severe(msg); -// throw new WWRuntimeException(msg); } } @@ -1427,7 +1395,6 @@ protected static void extractMinMaxSampleValues(Dataset ds, Band band, AVList pa Double maxValue = convertStringToDouble(ds.GetMetadataItem("TIFFTAG_MAXSAMPLEVALUE")); // TODO garakl This feature is not working for GeoTiff files -// String type = band.GetUnitType(); if (minValue == null || maxValue == null) { band.GetMinimum(dbls); minValue = (null != dbls[0]) ? dbls[0] : minValue; @@ -1478,7 +1445,7 @@ protected static boolean setNoDataValue(Band band, Double nodata) { public static DataRaster composeDataRaster(Dataset ds, AVList params) throws IllegalArgumentException, WWRuntimeException { - if (!gdalIsAvailable.get()) { + if (!GDAL_IS_AVAILABLE.get()) { String message = Logging.getMessage("gdal.GDALNotAvailable"); Logging.logger().severe(message); throw new WWRuntimeException(message); @@ -1500,7 +1467,7 @@ public static DataRaster composeDataRaster(Dataset ds, AVList params) public static int[] extractBandOrder(Dataset ds, AVList params) throws IllegalArgumentException, WWRuntimeException { - if (!gdalIsAvailable.get()) { + if (!GDAL_IS_AVAILABLE.get()) { String message = Logging.getMessage("gdal.GDALNotAvailable"); Logging.logger().severe(message); throw new WWRuntimeException(message); @@ -1639,42 +1606,4 @@ protected static DataRaster composeNonImageDataRaster(Dataset ds, AVList params) ElevationsUtil.rectify(raster); return raster; } - - protected static void alterJavaLibraryPath(String newJavaLibraryPath) - throws IllegalAccessException, NoSuchFieldException { - System.setProperty(JAVA_LIBRARY_PATH, newJavaLibraryPath); - - newClassLoader = ClassLoader.class; - fieldSysPaths = newClassLoader.getDeclaredField("sys_paths"); - if (null != fieldSysPaths) { - try { - fieldSysPaths.setAccessible(true); - fieldSysPaths_accessible = true; - } catch (InaccessibleObjectException ioex) { - fieldSysPaths_accessible = false; - } - originalClassLoader = fieldSysPaths.get(newClassLoader); - - // Reset it to null so that whenever "System.loadLibrary" is called, - // it will be reconstructed with the changed value. - fieldSysPaths.set(newClassLoader, null); - } - } - - protected static void restoreJavaLibraryPath() { - try { - //Revert back the changes. - if (null != originalClassLoader && null != fieldSysPaths) { - fieldSysPaths.set(newClassLoader, originalClassLoader); - fieldSysPaths.setAccessible(fieldSysPaths_accessible); - } - } catch (Exception e) { - Logging.logger().log(Level.SEVERE, e.getMessage(), e); - } - } - - private static Class newClassLoader = null; - private static Object originalClassLoader = null; - private static Field fieldSysPaths = null; - private static boolean fieldSysPaths_accessible = false; } diff --git a/src/gov/nasa/worldwind/util/webview/AbstractWebView.java b/src/gov/nasa/worldwind/util/webview/AbstractWebView.java index 1b9ae58b46..6dc6ba08bb 100644 --- a/src/gov/nasa/worldwind/util/webview/AbstractWebView.java +++ b/src/gov/nasa/worldwind/util/webview/AbstractWebView.java @@ -19,7 +19,9 @@ * * @author pabercrombie * @version $Id: AbstractWebView.java 1171 2013-02-11 21:45:02Z dcollins $ + * @deprecated */ +@Deprecated public abstract class AbstractWebView extends WWObjectImpl implements WebView, Disposable { /** The size of the WebView frame in pixels. Initially null, indicating the default size is used. */ diff --git a/src/gov/nasa/worldwind/util/webview/BasicWebViewFactory.java b/src/gov/nasa/worldwind/util/webview/BasicWebViewFactory.java index b138daaec0..d746c30414 100644 --- a/src/gov/nasa/worldwind/util/webview/BasicWebViewFactory.java +++ b/src/gov/nasa/worldwind/util/webview/BasicWebViewFactory.java @@ -17,7 +17,9 @@ * * @author dcollins * @version $Id: BasicWebViewFactory.java 1171 2013-02-11 21:45:02Z dcollins $ + * @deprecated */ +@Deprecated public class BasicWebViewFactory implements WebViewFactory { /** Create the factory. */ diff --git a/src/gov/nasa/worldwind/util/webview/MacWebView.java b/src/gov/nasa/worldwind/util/webview/MacWebView.java index 4651fd7aa1..702de06aee 100644 --- a/src/gov/nasa/worldwind/util/webview/MacWebView.java +++ b/src/gov/nasa/worldwind/util/webview/MacWebView.java @@ -20,7 +20,9 @@ /** * @author dcollins * @version $Id: MacWebView.java 1171 2013-02-11 21:45:02Z dcollins $ + * @deprecated */ +@Deprecated public class MacWebView extends AbstractWebView { /** The address of the native WebViewWindow object. Initialized during construction. */ diff --git a/src/gov/nasa/worldwind/util/webview/MacWebViewJNI.java b/src/gov/nasa/worldwind/util/webview/MacWebViewJNI.java index f0791dd60c..c125f648b5 100644 --- a/src/gov/nasa/worldwind/util/webview/MacWebViewJNI.java +++ b/src/gov/nasa/worldwind/util/webview/MacWebViewJNI.java @@ -17,7 +17,9 @@ /** * @author dcollins * @version $Id: MacWebViewJNI.java 1948 2014-04-19 20:02:38Z dcollins $ + * @deprecated */ +@Deprecated public class MacWebViewJNI { static diff --git a/src/gov/nasa/worldwind/util/webview/WebView.java b/src/gov/nasa/worldwind/util/webview/WebView.java index 167ba362a5..4f1708d50c 100644 --- a/src/gov/nasa/worldwind/util/webview/WebView.java +++ b/src/gov/nasa/worldwind/util/webview/WebView.java @@ -40,7 +40,9 @@ * * @author dcollins * @version $Id: WebView.java 1171 2013-02-11 21:45:02Z dcollins $ + * @deprecated */ +@Deprecated public interface WebView extends AVList, Disposable { /** diff --git a/src/gov/nasa/worldwind/util/webview/WebViewFactory.java b/src/gov/nasa/worldwind/util/webview/WebViewFactory.java index 94c7abef23..84f3740be3 100644 --- a/src/gov/nasa/worldwind/util/webview/WebViewFactory.java +++ b/src/gov/nasa/worldwind/util/webview/WebViewFactory.java @@ -12,7 +12,9 @@ * * @author dcollins * @version $Id: WebViewFactory.java 1171 2013-02-11 21:45:02Z dcollins $ + * @deprecated */ +@Deprecated public interface WebViewFactory { /** diff --git a/src/gov/nasa/worldwind/util/webview/WebViewTexture.java b/src/gov/nasa/worldwind/util/webview/WebViewTexture.java index d5fbaeebc8..6b2389d3f3 100644 --- a/src/gov/nasa/worldwind/util/webview/WebViewTexture.java +++ b/src/gov/nasa/worldwind/util/webview/WebViewTexture.java @@ -17,7 +17,9 @@ /** * @author dcollins * @version $Id: WebViewTexture.java 1171 2013-02-11 21:45:02Z dcollins $ + * @deprecated */ +@Deprecated public class WebViewTexture extends BasicWWTexture { protected Dimension frameSize; diff --git a/src/gov/nasa/worldwind/util/webview/WindowsWebView.java b/src/gov/nasa/worldwind/util/webview/WindowsWebView.java index bb8f19bd43..5725d40460 100644 --- a/src/gov/nasa/worldwind/util/webview/WindowsWebView.java +++ b/src/gov/nasa/worldwind/util/webview/WindowsWebView.java @@ -32,7 +32,9 @@ * * @author pabercrombie * @version $Id: WindowsWebView.java 1171 2013-02-11 21:45:02Z dcollins $ + * @deprecated */ +@Deprecated public class WindowsWebView extends AbstractWebView { /** Lock to protect creation of the web view message loop thread. */ diff --git a/src/gov/nasa/worldwind/util/webview/WindowsWebViewJNI.java b/src/gov/nasa/worldwind/util/webview/WindowsWebViewJNI.java index 100902d17f..59261f0871 100644 --- a/src/gov/nasa/worldwind/util/webview/WindowsWebViewJNI.java +++ b/src/gov/nasa/worldwind/util/webview/WindowsWebViewJNI.java @@ -65,7 +65,9 @@ * * @author pabercrombie * @version $Id: WindowsWebViewJNI.java 1171 2013-02-11 21:45:02Z dcollins $ + * @deprecated */ +@Deprecated public class WindowsWebViewJNI { static diff --git a/src/gov/nasa/worldwind/util/webview/package-info.java b/src/gov/nasa/worldwind/util/webview/package-info.java index 0a2ea2ac1a..5816396945 100644 --- a/src/gov/nasa/worldwind/util/webview/package-info.java +++ b/src/gov/nasa/worldwind/util/webview/package-info.java @@ -28,5 +28,6 @@ * * * + * @deprecated */ package gov.nasa.worldwind.util.webview; diff --git a/src/gov/nasa/worldwindx/examples/Balloons.java b/src/gov/nasa/worldwindx/examples/Balloons.java index 83fb990a3e..222aa055bf 100644 --- a/src/gov/nasa/worldwindx/examples/Balloons.java +++ b/src/gov/nasa/worldwindx/examples/Balloons.java @@ -101,6 +101,7 @@ protected void makeAnnotationBalloon() { this.layer.addRenderable(balloon); } + @Deprecated protected void makeBrowserBalloon() { String htmlString = null; InputStream contentStream = null; diff --git a/src/gov/nasa/worldwindx/examples/WebBrowserBalloons.java b/src/gov/nasa/worldwindx/examples/WebBrowserBalloons.java index bf67970165..1b8bc04779 100644 --- a/src/gov/nasa/worldwindx/examples/WebBrowserBalloons.java +++ b/src/gov/nasa/worldwindx/examples/WebBrowserBalloons.java @@ -29,7 +29,9 @@ * * @author dcollins * @version $Id: WebBrowserBalloons.java 2109 2014-06-30 16:52:38Z tgaskins $ + * @deprecated */ +@Deprecated public class WebBrowserBalloons extends ApplicationTemplate { protected static final String BROWSER_BALLOON_CONTENT_PATH diff --git a/src/gov/nasa/worldwindx/examples/util/BalloonController.java b/src/gov/nasa/worldwindx/examples/util/BalloonController.java index fd5892e6e1..79e2a75b55 100644 --- a/src/gov/nasa/worldwindx/examples/util/BalloonController.java +++ b/src/gov/nasa/worldwindx/examples/util/BalloonController.java @@ -226,6 +226,7 @@ else if (this.resizeController != null && !this.resizeController.isResizing()) } } + @SuppressWarnings("deprecation") public void selected(SelectEvent event) { if (event == null || event.isConsumed() @@ -344,6 +345,7 @@ protected KMLAbstractFeature getContext(PickedObject pickedObject) * @param browserBalloon Balloon involved in action. * @param action Identifier for the action that occurred. */ + @SuppressWarnings("deprecation") protected void onBalloonAction(AbstractBrowserBalloon browserBalloon, String action) { if (AVKey.CLOSE.equals(action)) @@ -797,6 +799,7 @@ protected Balloon getBalloon(PickedObject pickedObject) * * @return New balloon. May return null if the feature should not have a balloon. */ + @SuppressWarnings("deprecation") protected Balloon createBalloon(KMLAbstractFeature feature) { KMLBalloonStyle balloonStyle = (KMLBalloonStyle) feature.getSubStyle(new KMLBalloonStyle(null),