diff options
author | Sven Gothel <[email protected]> | 2015-10-03 12:05:37 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2015-10-03 12:05:37 +0200 |
commit | 24d30eec425ca6c62f72e7c218a9149777dbec52 (patch) | |
tree | a2bd52868d37051fabf10fce28bc4496e24b010c /src/newt/classes/com | |
parent | 731c473740e3e7ccd26ecda7ea0200382795c3a6 (diff) |
Bug 1238 - Fix NPE for Window-Icon's PNGPixelRect for unresolved location; Bug 1199 - Add setting to disable default window icons
Bug 1238 - Fix NPE for Window-Icon's PNGPixelRect for unresolved location, i.e. null URLConnections
Testing w/ jogl/make/scripts/tests.sh USE_BUILDDIR=1,
discloses this issue - since the icons are available in jar only.
Handling all unresolved resources, i.e. null URLConnection,
is required.
Further more, the icon list passed via property 'newt.window.icons'
shall be separated by comma as well.
This allows passing the list via scripts more conveniently.
-Dnewt.window.icons="newt/data/jogamp-16x16.png,newt/data/jogamp-32x32.png"
+++
Bug 1199 - Add setting to disable default window icons
This patch also allows disabling JogAmp's own window icons
by simply defining a non-existing location, i.e.
-Dnewt.window.icons="null,null"
Diffstat (limited to 'src/newt/classes/com')
-rw-r--r-- | src/newt/classes/com/jogamp/newt/NewtFactory.java | 4 | ||||
-rw-r--r-- | src/newt/classes/com/jogamp/newt/Window.java | 14 |
2 files changed, 12 insertions, 6 deletions
diff --git a/src/newt/classes/com/jogamp/newt/NewtFactory.java b/src/newt/classes/com/jogamp/newt/NewtFactory.java index f7b5a1340..dd15eb3ea 100644 --- a/src/newt/classes/com/jogamp/newt/NewtFactory.java +++ b/src/newt/classes/com/jogamp/newt/NewtFactory.java @@ -68,7 +68,7 @@ public class NewtFactory { NativeWindowFactory.initSingleton(); // last resort .. { /** See API Doc in {@link Window} ! */ - final String[] paths = PropertyAccess.getProperty("newt.window.icons", true, sysPaths).split("\\s"); + final String[] paths = PropertyAccess.getProperty("newt.window.icons", true, sysPaths).split("[\\s,]"); if( paths.length < 2 ) { throw new IllegalArgumentException("Property 'newt.window.icons' did not specify at least two PNG icons, but "+Arrays.toString(paths)); } @@ -81,7 +81,7 @@ public class NewtFactory { /** * Returns the application window icon resources to be used. * <p> - * Property <code>newt.window.icons</code> may define a list of PNG icons separated by a whitespace character. + * Property <code>newt.window.icons</code> may define a list of PNG icons separated by one whitespace or one comma character. * Shall reference at least two PNG icons, from lower (16x16) to higher (>= 32x32) resolution. * </p> * <p> diff --git a/src/newt/classes/com/jogamp/newt/Window.java b/src/newt/classes/com/jogamp/newt/Window.java index 1d514d548..30b02cb61 100644 --- a/src/newt/classes/com/jogamp/newt/Window.java +++ b/src/newt/classes/com/jogamp/newt/Window.java @@ -83,16 +83,22 @@ import com.jogamp.nativewindow.util.SurfaceSize; * <a name="customwindowicons"><h5>Custom Window Icons</h5></a> * <p> * Custom window icons can be defined via system property <code>newt.window.icons</code>, - * which shall contain a space separated list of PNG icon locations from low- to high-resolution. + * which shall contain a list of PNG icon locations from low- to high-resolution, + * separated by one whitespace or one comma character. * The location must be resolvable via classpath, i.e. shall reference a location within the jar file. * Example (our default): * <pre> - * -Dnewt.window.icons="newt/data/jogamp-16x16.png newt/data/jogamp-32x32.png" - * -Djnlp.newt.window.icons="newt/data/jogamp-16x16.png newt/data/jogamp-32x32.png" + * -Dnewt.window.icons="newt/data/jogamp-16x16.png,newt/data/jogamp-32x32.png" + * -Djnlp.newt.window.icons="newt/data/jogamp-16x16.png,newt/data/jogamp-32x32.png" * </pre> * The property can also be set programmatically, which must happen before any NEWT classes are <i>touched</i>: * <pre> - * System.setProperty("newt.window.icons", "newt/data/jogamp-16x16.png newt/data/jogamp-32x32.png"); + * System.setProperty("newt.window.icons", "newt/data/jogamp-16x16.png, newt/data/jogamp-32x32.png"); + * </pre> + * To disable even Jogamp's own window icons in favor of system icons, + * simply set a non-existing location, e.g.: + * <pre> + * -Dnewt.window.icons="null,null" * </pre> * </p> * |