src/solaris/classes/sun/awt/X11/XMSelection.java

Print this page

        

@@ -126,11 +126,13 @@
         XToolkit.awtLock();
         try {
             long display = XToolkit.getDisplay();
             synchronized(this) {
                 setOwner(owner, screen);
-                if (log.isLoggable(PlatformLogger.FINE)) log.fine("New Selection Owner for screen " + screen + " = " + owner );
+                if (log.isLoggable(PlatformLogger.FINE)) {
+                    log.fine("New Selection Owner for screen " + screen + " = " + owner );
+                }
                 XlibWrapper.XSelectInput(display, owner, XConstants.StructureNotifyMask | eventMask);
                 XToolkit.addEventDispatcher(owner,
                         new XEventDispatcher() {
                             public void dispatchEvent(XEvent ev) {
                                 dispatchSelectionEvent(ev, screen);

@@ -146,23 +148,29 @@
     void selectPerScreen(final int screen, long extra_mask) {
         XToolkit.awtLock();
         try {
             try {
                 long display = XToolkit.getDisplay();
-                if (log.isLoggable(PlatformLogger.FINE)) log.fine("Grabbing XServer");
+                if (log.isLoggable(PlatformLogger.FINE)) {
+                    log.fine("Grabbing XServer");
+                }
                 XlibWrapper.XGrabServer(display);
 
                 synchronized(this) {
                     String selection_name = getName()+"_S"+screen;
-                    if (log.isLoggable(PlatformLogger.FINE)) log.fine("Screen = " + screen + " selection name = " + selection_name);
+                    if (log.isLoggable(PlatformLogger.FINE)) {
+                        log.fine("Screen = " + screen + " selection name = " + selection_name);
+                    }
                     XAtom atom = XAtom.get(selection_name);
                     selectionMap.put(Long.valueOf(atom.getAtom()),this); // add mapping from atom to the instance of XMSelection
                     setAtom(atom,screen);
                     long owner = XlibWrapper.XGetSelectionOwner(display, atom.getAtom());
                     if (owner != 0) {
                         setOwner(owner, screen);
-                        if (log.isLoggable(PlatformLogger.FINE)) log.fine("Selection Owner for screen " + screen + " = " + owner );
+                        if (log.isLoggable(PlatformLogger.FINE)) {
+                            log.fine("Selection Owner for screen " + screen + " = " + owner );
+                        }
                         XlibWrapper.XSelectInput(display, owner, XConstants.StructureNotifyMask | extra_mask);
                         XToolkit.addEventDispatcher(owner,
                                 new XEventDispatcher() {
                                         public void dispatchEvent(XEvent ev) {
                                             dispatchSelectionEvent(ev, screen);

@@ -173,11 +181,13 @@
             }
             catch (Exception e) {
                 e.printStackTrace();
             }
             finally {
-                if (log.isLoggable(PlatformLogger.FINE)) log.fine("UnGrabbing XServer");
+                if (log.isLoggable(PlatformLogger.FINE)) {
+                    log.fine("UnGrabbing XServer");
+                }
                 XlibWrapper.XUngrabServer(XToolkit.getDisplay());
             }
         } finally {
             XToolkit.awtUnlock();
         }

@@ -185,11 +195,13 @@
 
 
     static boolean processClientMessage(XEvent xev, int screen) {
         XClientMessageEvent xce = xev.get_xclient();
         if (xce.get_message_type() == XA_MANAGER.getAtom()) {
-            if (log.isLoggable(PlatformLogger.FINE)) log.fine("client messags = " + xce);
+            if (log.isLoggable(PlatformLogger.FINE)) {
+                log.fine("client messags = " + xce);
+            }
             long timestamp = xce.get_data(0);
             long atom = xce.get_data(1);
             long owner = xce.get_data(2);
             long data = xce.get_data(3);
 

@@ -292,22 +304,26 @@
         return selectionName;
     }
 
 
     synchronized void dispatchSelectionChanged( XPropertyEvent ev, int screen) {
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("Selection Changed : Screen = " + screen + "Event =" + ev);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("Selection Changed : Screen = " + screen + "Event =" + ev);
+        }
         if (listeners != null) {
             Iterator iter = listeners.iterator();
             while (iter.hasNext()) {
                 XMSelectionListener disp = (XMSelectionListener) iter.next();
                 disp.selectionChanged(screen, this, ev.get_window(), ev);
             }
         }
     }
 
     synchronized void dispatchOwnerDeath(XDestroyWindowEvent de, int screen) {
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("Owner dead : Screen = " + screen + "Event =" + de);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("Owner dead : Screen = " + screen + "Event =" + de);
+        }
         if (listeners != null) {
             Iterator iter = listeners.iterator();
             while (iter.hasNext()) {
                 XMSelectionListener disp = (XMSelectionListener) iter.next();
                 disp.ownerDeath(screen, this, de.get_window());

@@ -315,11 +331,13 @@
             }
         }
     }
 
     void dispatchSelectionEvent(XEvent xev, int screen) {
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("Event =" + xev);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("Event =" + xev);
+        }
         if (xev.get_type() == XConstants.DestroyNotify) {
             XDestroyWindowEvent de = xev.get_xdestroywindow();
             dispatchOwnerDeath( de, screen);
         }
         else if (xev.get_type() == XConstants.PropertyNotify)  {