< prev index next >

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

Print this page




 451         try {
 452             ng.translate(width - (SCROLLBAR - SPACE), MARGIN);
 453             vsb.paint(ng, colors, paintAll);
 454         }
 455         finally {
 456             ng.dispose();
 457         }
 458     }
 459 
 460     /**
 461      *
 462      * @see java.awt.event.MouseEvent
 463      * MouseEvent.MOUSE_CLICKED
 464      * MouseEvent.MOUSE_PRESSED
 465      * MouseEvent.MOUSE_RELEASED
 466      * MouseEvent.MOUSE_MOVED
 467      * MouseEvent.MOUSE_ENTERED
 468      * MouseEvent.MOUSE_EXITED
 469      * MouseEvent.MOUSE_DRAGGED
 470      */

 471     public void handleJavaMouseEvent( MouseEvent mouseEvent ) {
 472         super.handleJavaMouseEvent(mouseEvent);
 473         int modifiers = mouseEvent.getModifiers();
 474         int id = mouseEvent.getID();
 475         int x = mouseEvent.getX();
 476         int y = mouseEvent.getY();
 477 
 478 
 479         //        super.handleMouseEvent(mouseEvent);
 480 
 481         if ((modifiers & InputEvent.BUTTON1_MASK) == 0) {
 482             return;
 483         }
 484 
 485         switch (id) {
 486             case MouseEvent.MOUSE_PRESSED:
 487                 if (inVerticalScrollbar(x,y )) {
 488                     active = VERTICAL;
 489                     int h = height - hsbSpace - (2*MARGIN);
 490                     vsb.handleMouseEvent(id,modifiers,x - (width - SCROLLBAR + SPACE),y-MARGIN);




 451         try {
 452             ng.translate(width - (SCROLLBAR - SPACE), MARGIN);
 453             vsb.paint(ng, colors, paintAll);
 454         }
 455         finally {
 456             ng.dispose();
 457         }
 458     }
 459 
 460     /**
 461      *
 462      * @see java.awt.event.MouseEvent
 463      * MouseEvent.MOUSE_CLICKED
 464      * MouseEvent.MOUSE_PRESSED
 465      * MouseEvent.MOUSE_RELEASED
 466      * MouseEvent.MOUSE_MOVED
 467      * MouseEvent.MOUSE_ENTERED
 468      * MouseEvent.MOUSE_EXITED
 469      * MouseEvent.MOUSE_DRAGGED
 470      */
 471     @SuppressWarnings("deprecation")
 472     public void handleJavaMouseEvent( MouseEvent mouseEvent ) {
 473         super.handleJavaMouseEvent(mouseEvent);
 474         int modifiers = mouseEvent.getModifiers();
 475         int id = mouseEvent.getID();
 476         int x = mouseEvent.getX();
 477         int y = mouseEvent.getY();
 478 
 479 
 480         //        super.handleMouseEvent(mouseEvent);
 481 
 482         if ((modifiers & InputEvent.BUTTON1_MASK) == 0) {
 483             return;
 484         }
 485 
 486         switch (id) {
 487             case MouseEvent.MOUSE_PRESSED:
 488                 if (inVerticalScrollbar(x,y )) {
 489                     active = VERTICAL;
 490                     int h = height - hsbSpace - (2*MARGIN);
 491                     vsb.handleMouseEvent(id,modifiers,x - (width - SCROLLBAR + SPACE),y-MARGIN);


< prev index next >