diff options
author | Sven Gothel <[email protected]> | 2014-01-11 07:27:15 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-01-11 07:27:15 +0100 |
commit | 6ea03078e162eed89653ae123d172b6fca7c6d61 (patch) | |
tree | 257f5298d499af876de1b8a4043d1f9fe10b9107 /src/nativewindow | |
parent | 6647b4a63866a554c738e0b7b61e6dc40a6fb511 (diff) |
Misc Cleanup: JAWTWindow: Reusing visible in HIERARCHY listener; Remove obsolete 'getPrivateGraphicsConfiguration()'
Diffstat (limited to 'src/nativewindow')
-rw-r--r-- | src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java | 27 | ||||
-rw-r--r-- | src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java | 6 |
2 files changed, 13 insertions, 20 deletions
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java index ddf513180..ed25a497f 100644 --- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java @@ -220,30 +220,31 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface, if( 0 != ( java.awt.event.HierarchyEvent.DISPLAYABILITY_CHANGED & bits ) ) { final boolean displayable = changed.isDisplayable(); final boolean propagateDisplayability = changed == component && ( displayable && localVisibility ) != compIsVisible; + final boolean visible = displayable && localVisibility; + final boolean propagateDisplayability = changed == component && visible != compIsVisible; if( propagateDisplayability ) { // Propagate parent's displayability, i.e. 'removeNotify()' and 'addNotify()' - final boolean _visible = displayable && localVisibility; visibilityPropagation = true; globalVisibility = displayable; if(DEBUG) { - System.err.println(jawtStr()+".hierarchyChanged DISPLAYABILITY_CHANGED (1): displayable "+displayable+" -> visible "+_visible+", "+s(e)); + System.err.println(jawtStr()+".hierarchyChanged DISPLAYABILITY_CHANGED (1): displayable "+displayable+" -> visible "+visible+", "+s(e)); } - component.setVisible(_visible); + component.setVisible(visible); } else if(DEBUG) { System.err.println(jawtStr()+".hierarchyChanged DISPLAYABILITY_CHANGED (x): displayable "+displayable+", "+s(e)); } } else if( 0 != ( java.awt.event.HierarchyEvent.SHOWING_CHANGED & bits ) ) { final boolean showing = changed.isShowing(); - final boolean propagateVisibility = changed != component && ( showing && localVisibility ) != compIsVisible; + final boolean visible = showing && localVisibility; + final boolean propagateVisibility = changed != component && visible != compIsVisible; if( propagateVisibility ) { // Propagate parent's visibility - final boolean _visible = showing && localVisibility; visibilityPropagation = true; globalVisibility = showing; if(DEBUG) { - System.err.println(jawtStr()+".hierarchyChanged SHOWING_CHANGED (1): showing "+showing+" -> visible "+_visible+", "+s(e)); + System.err.println(jawtStr()+".hierarchyChanged SHOWING_CHANGED (1): showing "+showing+" -> visible "+visible+", "+s(e)); } - component.setVisible(_visible); + component.setVisible(visible); } else if( changed == component ) { // Update component's local visibility state if(!visibilityPropagation) { @@ -251,10 +252,10 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface, } visibilityPropagation = false; if(DEBUG) { - System.err.println(jawtStr()+".hierarchyChanged SHOWING_CHANGED (0): showing "+showing+" -> visible "+(showing && localVisibility)+", "+s(e)); + System.err.println(jawtStr()+".hierarchyChanged SHOWING_CHANGED (0): showing "+showing+" -> visible "+visible+", "+s(e)); } } else if(DEBUG) { - System.err.println(jawtStr()+".hierarchyChanged SHOWING_CHANGED (x): showing "+showing+" -> visible "+(showing && localVisibility)+", "+s(e)); + System.err.println(jawtStr()+".hierarchyChanged SHOWING_CHANGED (x): showing "+showing+" -> visible "+visible+", "+s(e)); } } else if(DEBUG) { final boolean displayable = changed.isDisplayable(); @@ -423,7 +424,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface, @Override public final void setChosenCapabilities(CapabilitiesImmutable caps) { ((MutableGraphicsConfiguration)getGraphicsConfiguration()).setChosenCapabilities(caps); - getPrivateGraphicsConfiguration().setChosenCapabilities(caps); + config.setChosenCapabilities(caps); } @Override @@ -601,10 +602,6 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface, return drawable; } - public final AWTGraphicsConfiguration getPrivateGraphicsConfiguration() { - return config; - } - @Override public final AbstractGraphicsConfiguration getGraphicsConfiguration() { return config.getNativeGraphicsConfiguration(); @@ -792,7 +789,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface, sb.append(", pos "+getX()+"/"+getY()+", size "+getWidth()+"x"+getHeight()+ ", visible "+component.isVisible()); sb.append(", lockedExt "+isSurfaceLockedByOtherThread()+ - ",\n\tconfig "+getPrivateGraphicsConfiguration()+ + ",\n\tconfig "+config+ ",\n\tawtComponent "+getAWTComponent()+ ",\n\tsurfaceLock "+surfaceLock+"]"); diff --git a/src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java b/src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java index 097fffead..fbff7128e 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java +++ b/src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java @@ -45,7 +45,7 @@ public abstract class ProxySurfaceImpl implements ProxySurface { private AbstractGraphicsConfiguration config; // control access due to delegation private UpstreamSurfaceHook upstream; private long surfaceHandle_old; - private RecursiveLock surfaceLock = LockFactory.createRecursiveLock(); + private final RecursiveLock surfaceLock = LockFactory.createRecursiveLock(); private int implBitfield; private boolean upstreamSurfaceHookLifecycleEnabled; @@ -122,10 +122,6 @@ public abstract class ProxySurfaceImpl implements ProxySurface { throw new InternalError("UpstreamSurfaceHook given, but required method not implemented."); } - protected final AbstractGraphicsConfiguration getPrivateGraphicsConfiguration() { - return config; - } - @Override public final AbstractGraphicsConfiguration getGraphicsConfiguration() { return config.getNativeGraphicsConfiguration(); |