< prev index next >

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

Print this page

        

@@ -843,36 +843,11 @@
             }
             public Rectangle getBounds(Component comp) {
                 return new Rectangle(comp.x, comp.y, comp.width, comp.height);
             }
             public void setMixingCutoutShape(Component comp, Shape shape) {
-                Region region = shape == null ?  null :
-                    Region.getInstance(shape, null);
-
-                synchronized (comp.getTreeLock()) {
-                    boolean needShowing = false;
-                    boolean needHiding = false;
-
-                    if (!comp.isNonOpaqueForMixing()) {
-                        needHiding = true;
-                    }
-
-                    comp.mixingCutoutRegion = region;
-
-                    if (!comp.isNonOpaqueForMixing()) {
-                        needShowing = true;
-                    }
-
-                    if (comp.isMixingNeeded()) {
-                        if (needHiding) {
-                            comp.mixOnHiding(comp.isLightweight());
-                        }
-                        if (needShowing) {
-                            comp.mixOnShowing();
-                        }
-                    }
-                }
+                comp.setMixingCutoutShape(shape);
             }
 
             public void setGraphicsConfiguration(Component comp,
                     GraphicsConfiguration gc)
             {

@@ -985,10 +960,39 @@
                 return comp.getBufferStrategy();
             }
         });
     }
 
+    private void setMixingCutoutShape(Shape shape) {
+        Region region = shape == null ? null :
+                Region.getInstance(shape, null);
+
+        synchronized (getTreeLock()) {
+            boolean needShowing = false;
+            boolean needHiding = false;
+
+            if (!isNonOpaqueForMixing()) {
+                needHiding = true;
+            }
+
+            mixingCutoutRegion = region;
+
+            if (!isNonOpaqueForMixing()) {
+                needShowing = true;
+            }
+
+            if (isMixingNeeded()) {
+                if (needHiding) {
+                    mixOnHiding(isLightweight());
+                }
+                if (needShowing) {
+                    mixOnShowing();
+                }
+            }
+        }
+    }
+
     /**
      * Constructs a new component. Class <code>Component</code> can be
      * extended directly to create a lightweight component that does not
      * utilize an opaque native window. A lightweight component must be
      * hosted by a native container somewhere higher up in the component
< prev index next >