summaryrefslogtreecommitdiffstats
path: root/src/newt/classes/jogamp
diff options
context:
space:
mode:
Diffstat (limited to 'src/newt/classes/jogamp')
-rw-r--r--src/newt/classes/jogamp/newt/DisplayImpl.java17
-rw-r--r--src/newt/classes/jogamp/newt/PointerIconImpl.java2
2 files changed, 8 insertions, 11 deletions
diff --git a/src/newt/classes/jogamp/newt/DisplayImpl.java b/src/newt/classes/jogamp/newt/DisplayImpl.java
index 4c7169ec4..b485a4763 100644
--- a/src/newt/classes/jogamp/newt/DisplayImpl.java
+++ b/src/newt/classes/jogamp/newt/DisplayImpl.java
@@ -110,9 +110,6 @@ public abstract class DisplayImpl extends Display {
public final PointerIcon createPointerIcon(final IOUtil.ClassResources pngResource, final int hotX, final int hotY)
throws IllegalArgumentException, IllegalStateException, IOException
{
- if( !isNativeValid() ) {
- throw new IllegalStateException("Display.createPointerIcon(1): Display invalid "+this);
- }
if( null == pngResource || 0 >= pngResource.resourceCount() ) {
throw new IllegalArgumentException("Null or invalid pngResource "+pngResource);
}
@@ -123,8 +120,8 @@ public abstract class DisplayImpl extends Display {
runOnEDTIfAvail(true, new Runnable() {
public void run() {
try {
- if( !DisplayImpl.this.isNativeValid() ) {
- throw new IllegalStateException("Display.createPointerIcon(2): Display invalid "+DisplayImpl.this);
+ if( !DisplayImpl.this.isNativeValidAsync() ) {
+ throw new IllegalStateException("Display.createPointerIcon: Display invalid "+DisplayImpl.this);
}
final URLConnection urlConn = pngResource.resolve(0);
if( null == urlConn ) {
@@ -162,9 +159,6 @@ public abstract class DisplayImpl extends Display {
public final PointerIcon createPointerIcon(final PixelRectangle pixelrect, final int hotX, final int hotY)
throws IllegalArgumentException, IllegalStateException
{
- if( !isNativeValid() ) {
- throw new IllegalStateException("Display.createPointerIcon(1): Display invalid "+this);
- }
if( null == pixelrect ) {
throw new IllegalArgumentException("Null or pixelrect");
}
@@ -194,8 +188,8 @@ public abstract class DisplayImpl extends Display {
runOnEDTIfAvail(true, new Runnable() {
public void run() {
try {
- if( !DisplayImpl.this.isNativeValid() ) {
- throw new IllegalStateException("Display.createPointerIcon(2): Display invalid "+DisplayImpl.this);
+ if( !DisplayImpl.this.isNativeValidAsync() ) {
+ throw new IllegalStateException("Display.createPointerIcon: Display invalid "+DisplayImpl.this);
}
if( null != fpixelrect ) {
final long handle = createPointerIconImplChecked(fpixelrect.getPixelformat(),
@@ -630,6 +624,9 @@ public abstract class DisplayImpl extends Display {
public synchronized final boolean isNativeValid() {
return null != aDevice;
}
+ protected final boolean isNativeValidAsync() {
+ return null != aDevice;
+ }
@Override
public boolean isEDTRunning() {
diff --git a/src/newt/classes/jogamp/newt/PointerIconImpl.java b/src/newt/classes/jogamp/newt/PointerIconImpl.java
index 7c8535f20..840799d55 100644
--- a/src/newt/classes/jogamp/newt/PointerIconImpl.java
+++ b/src/newt/classes/jogamp/newt/PointerIconImpl.java
@@ -130,7 +130,7 @@ public class PointerIconImpl implements PointerIcon {
}
display.runOnEDTIfAvail(false, new Runnable() {
public void run() {
- if( display.isNativeValid() ) {
+ if( !display.isNativeValidAsync() ) {
destroyOnEDT(display.getHandle());
}
} } );