< prev index next >

src/java.desktop/unix/classes/sun/awt/X11/XTrayIconPeer.java

Print this page




 396         try {
 397             XToolkit.removeEventDispatcher(window, xed);
 398         } finally {
 399             XToolkit.awtUnlock();
 400         }
 401     }
 402 
 403     // Private method for testing purposes.
 404     private Point getLocationOnScreen() {
 405         return eframe.getLocationOnScreen();
 406     }
 407 
 408     public Rectangle getBounds() {
 409         Point loc = getLocationOnScreen();
 410         return new Rectangle(loc.x, loc.y, loc.x + TRAY_ICON_WIDTH, loc.y + TRAY_ICON_HEIGHT);
 411     }
 412 
 413     void addListeners() {
 414         canvas.addMouseListener(eventProxy);
 415         canvas.addMouseMotionListener(eventProxy);

 416     }
 417 
 418     long getWindow() {
 419         return AWTAccessor.getComponentAccessor()
 420                           .<XEmbeddedFramePeer>getPeer(eframe).getWindow();
 421     }
 422 
 423     public boolean isDisposed() {
 424         return isDisposed;
 425     }
 426 
 427     public String getActionCommand() {
 428         return target.getActionCommand();
 429     }
 430 
 431     static class TrayIconEventProxy implements MouseListener, MouseMotionListener {
 432         XTrayIconPeer xtiPeer;
 433 
 434         TrayIconEventProxy(XTrayIconPeer xtiPeer) {
 435             this.xtiPeer = xtiPeer;




 396         try {
 397             XToolkit.removeEventDispatcher(window, xed);
 398         } finally {
 399             XToolkit.awtUnlock();
 400         }
 401     }
 402 
 403     // Private method for testing purposes.
 404     private Point getLocationOnScreen() {
 405         return eframe.getLocationOnScreen();
 406     }
 407 
 408     public Rectangle getBounds() {
 409         Point loc = getLocationOnScreen();
 410         return new Rectangle(loc.x, loc.y, loc.x + TRAY_ICON_WIDTH, loc.y + TRAY_ICON_HEIGHT);
 411     }
 412 
 413     void addListeners() {
 414         canvas.addMouseListener(eventProxy);
 415         canvas.addMouseMotionListener(eventProxy);
 416         eframe.addMouseListener(eventProxy);
 417     }
 418 
 419     long getWindow() {
 420         return AWTAccessor.getComponentAccessor()
 421                           .<XEmbeddedFramePeer>getPeer(eframe).getWindow();
 422     }
 423 
 424     public boolean isDisposed() {
 425         return isDisposed;
 426     }
 427 
 428     public String getActionCommand() {
 429         return target.getActionCommand();
 430     }
 431 
 432     static class TrayIconEventProxy implements MouseListener, MouseMotionListener {
 433         XTrayIconPeer xtiPeer;
 434 
 435         TrayIconEventProxy(XTrayIconPeer xtiPeer) {
 436             this.xtiPeer = xtiPeer;


< prev index next >