< prev index next >

src/java.desktop/share/classes/java/awt/Window.java

Print this page

        

@@ -345,11 +345,11 @@
      * @serial
      * @see #setOpacity(float)
      * @see #getOpacity()
      * @since 1.7
      */
-    private float opacity = 1.0f;
+    private volatile float opacity = 1.0f;
 
     /**
      * The shape assigned to this window. This field is set to {@code null} if
      * no shape is set (rectangular window).
      *

@@ -1038,13 +1038,11 @@
         } else {
             beforeFirstShow = false;
             closeSplashScreen();
             Dialog.checkShouldBeBlocked(this);
             super.show();
-            synchronized (getTreeLock()) {
-                this.locationByPlatform = false;
-            }
+            locationByPlatform = false;
             for (int i = 0; i < ownedWindowList.size(); i++) {
                 Window child = ownedWindowList.elementAt(i).get();
                 if ((child != null) && child.showWithParent) {
                     child.show();
                     child.showWithParent = false;

@@ -1113,13 +1111,11 @@
         }
         if (isModalBlocked()) {
             modalBlocker.unblockWindow(this);
         }
         super.hide();
-        synchronized (getTreeLock()) {
-            this.locationByPlatform = false;
-        }
+        locationByPlatform = false;
     }
 
     final void clearMostRecentFocusOwnerOnHide() {
         /* do nothing */
     }

@@ -3409,11 +3405,11 @@
      */
     boolean canContainFocusOwner(Component focusOwnerCandidate) {
         return super.canContainFocusOwner(focusOwnerCandidate) && isFocusableWindow();
     }
 
-    private boolean locationByPlatform = locationByPlatformProp;
+    private volatile boolean locationByPlatform = locationByPlatformProp;
 
 
     /**
      * Sets whether this Window should appear at the default location for the
      * native windowing system or at the current location (returned by

@@ -3480,14 +3476,12 @@
      * @see #setLocationByPlatform
      * @see #isShowing
      * @since 1.5
      */
     public boolean isLocationByPlatform() {
-        synchronized (getTreeLock()) {
             return locationByPlatform;
         }
-    }
 
     /**
      * {@inheritDoc}
      * <p>
      * The {@code width} or {@code height} values

@@ -3571,14 +3565,12 @@
      * @see GraphicsDevice.WindowTranslucency
      *
      * @since 1.7
      */
     public float getOpacity() {
-        synchronized (getTreeLock()) {
             return opacity;
         }
-    }
 
     /**
      * Sets the opacity of the window.
      * <p>
      * The opacity value is in the range [0..1]. Note that setting the opacity
< prev index next >