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

Print this page
rev 9717 : 8039642: Fix raw and unchecked warnings in sun.awt.*
Reviewed-by:


  62 
  63         if (ev.get_type() != XConstants.ClientMessage) {
  64             return false;
  65         }
  66 
  67         boolean processed = false;
  68         XClientMessageEvent xclient = ev.get_xclient();
  69 
  70         XDropTargetProtocol curProtocol = protocol;
  71 
  72         if (protocol != null) {
  73             if (protocol.getMessageType(xclient) !=
  74                 XDropTargetProtocol.UNKNOWN_MESSAGE) {
  75                 processed = protocol.processClientMessage(xclient);
  76             } else {
  77                 protocol = null;
  78             }
  79         }
  80 
  81         if (protocol == null) {
  82             Iterator dropTargetProtocols =
  83                 XDragAndDropProtocols.getDropTargetProtocols();
  84 
  85             while (dropTargetProtocols.hasNext()) {
  86                 XDropTargetProtocol dropTargetProtocol =
  87                     (XDropTargetProtocol)dropTargetProtocols.next();
  88                 // Don't try to process it again with the current protocol.
  89                 if (dropTargetProtocol == curProtocol) {
  90                     continue;
  91                 }
  92 
  93                 if (dropTargetProtocol.getMessageType(xclient) ==
  94                     XDropTargetProtocol.UNKNOWN_MESSAGE) {
  95                     continue;
  96                 }
  97 
  98                 protocol = dropTargetProtocol;
  99                 processed = protocol.processClientMessage(xclient);
 100                 break;
 101             }
 102         }
 103 
 104         return processed;
 105     }
 106 
 107     static void reset() {


  62 
  63         if (ev.get_type() != XConstants.ClientMessage) {
  64             return false;
  65         }
  66 
  67         boolean processed = false;
  68         XClientMessageEvent xclient = ev.get_xclient();
  69 
  70         XDropTargetProtocol curProtocol = protocol;
  71 
  72         if (protocol != null) {
  73             if (protocol.getMessageType(xclient) !=
  74                 XDropTargetProtocol.UNKNOWN_MESSAGE) {
  75                 processed = protocol.processClientMessage(xclient);
  76             } else {
  77                 protocol = null;
  78             }
  79         }
  80 
  81         if (protocol == null) {
  82             Iterator<XDropTargetProtocol> dropTargetProtocols =
  83                 XDragAndDropProtocols.getDropTargetProtocols();
  84 
  85             while (dropTargetProtocols.hasNext()) {
  86                 XDropTargetProtocol dropTargetProtocol = dropTargetProtocols.next();

  87                 // Don't try to process it again with the current protocol.
  88                 if (dropTargetProtocol == curProtocol) {
  89                     continue;
  90                 }
  91 
  92                 if (dropTargetProtocol.getMessageType(xclient) ==
  93                     XDropTargetProtocol.UNKNOWN_MESSAGE) {
  94                     continue;
  95                 }
  96 
  97                 protocol = dropTargetProtocol;
  98                 processed = protocol.processClientMessage(xclient);
  99                 break;
 100             }
 101         }
 102 
 103         return processed;
 104     }
 105 
 106     static void reset() {