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

Print this page
rev 9830 : 8039642: Fix raw and unchecked warnings in sun.awt.*
Reviewed-by: darcy, prr


  68     final static int TRAY_ICON_WIDTH = 24;
  69     final static int TRAY_ICON_HEIGHT = 24;
  70 
  71     XTrayIconPeer(TrayIcon target)
  72       throws AWTException
  73     {
  74         this.target = target;
  75 
  76         eventProxy = new TrayIconEventProxy(this);
  77 
  78         canvas = new TrayIconCanvas(target, TRAY_ICON_WIDTH, TRAY_ICON_HEIGHT);
  79 
  80         eframe = new XTrayIconEmbeddedFrame();
  81 
  82         eframe.setSize(TRAY_ICON_WIDTH, TRAY_ICON_HEIGHT);
  83         eframe.add(canvas);
  84 
  85         // Fix for 6317038: as EmbeddedFrame is instance of Frame, it is blocked
  86         // by modal dialogs, but in the case of TrayIcon it shouldn't. So we
  87         // set ModalExclusion property on it.
  88         AccessController.doPrivileged(new PrivilegedAction() {
  89             public Object run() {
  90                 eframe.setModalExclusionType(Dialog.ModalExclusionType.TOOLKIT_EXCLUDE);
  91                 return null;
  92             }
  93         });
  94 
  95 
  96         if (XWM.getWMID() != XWM.METACITY_WM) {
  97             parentXED = dummyXED; // We don't like to leave it 'null'.
  98 
  99         } else {
 100             parentXED = new XEventDispatcher() {
 101                 // It's executed under AWTLock.
 102                 public void dispatchEvent(XEvent ev) {
 103                     if (isDisposed() || ev.get_type() != XConstants.ConfigureNotify) {
 104                         return;
 105                     }
 106 
 107                     XConfigureEvent ce = ev.get_xconfigure();
 108 




  68     final static int TRAY_ICON_WIDTH = 24;
  69     final static int TRAY_ICON_HEIGHT = 24;
  70 
  71     XTrayIconPeer(TrayIcon target)
  72       throws AWTException
  73     {
  74         this.target = target;
  75 
  76         eventProxy = new TrayIconEventProxy(this);
  77 
  78         canvas = new TrayIconCanvas(target, TRAY_ICON_WIDTH, TRAY_ICON_HEIGHT);
  79 
  80         eframe = new XTrayIconEmbeddedFrame();
  81 
  82         eframe.setSize(TRAY_ICON_WIDTH, TRAY_ICON_HEIGHT);
  83         eframe.add(canvas);
  84 
  85         // Fix for 6317038: as EmbeddedFrame is instance of Frame, it is blocked
  86         // by modal dialogs, but in the case of TrayIcon it shouldn't. So we
  87         // set ModalExclusion property on it.
  88         AccessController.doPrivileged(new PrivilegedAction<Object>() {
  89             public Object run() {
  90                 eframe.setModalExclusionType(Dialog.ModalExclusionType.TOOLKIT_EXCLUDE);
  91                 return null;
  92             }
  93         });
  94 
  95 
  96         if (XWM.getWMID() != XWM.METACITY_WM) {
  97             parentXED = dummyXED; // We don't like to leave it 'null'.
  98 
  99         } else {
 100             parentXED = new XEventDispatcher() {
 101                 // It's executed under AWTLock.
 102                 public void dispatchEvent(XEvent ev) {
 103                     if (isDisposed() || ev.get_type() != XConstants.ConfigureNotify) {
 104                         return;
 105                     }
 106 
 107                     XConfigureEvent ce = ev.get_xconfigure();
 108