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

Print this page




 875                   */
 876                   break;
 877               case MouseEvent.MOUSE_DRAGGED:
 878                   if (mouseInSB) {
 879                       helper.handleVSBEvent(e, getBounds(), local.x, local.y);
 880                   }
 881                   else {
 882                       // See 6243382 for more information
 883                       helper.trackMouseDraggedScroll(local.x, local.y, width, height);
 884                       trackSelection(local.x, local.y);
 885                   }
 886                   break;
 887             }
 888         }
 889 
 890         private void trackSelection(int transX, int transY) {
 891             if (!helper.isEmpty()) {
 892                 if (transX > 0 && transX < width &&
 893                     transY > 0 && transY < height) {
 894                     int newIdx = helper.y2index(transY);
 895                     if (log.isLoggable(PlatformLogger.FINE)) {
 896                         log.fine("transX=" + transX + ", transY=" + transY
 897                                  + ",width=" + width + ", height=" + height
 898                                  + ", newIdx=" + newIdx + " on " + target);
 899                     }
 900                     if ((newIdx >=0) && (newIdx < helper.getItemCount())
 901                         && (newIdx != helper.getSelectedIndex()))
 902                     {
 903                         helper.select(newIdx);
 904                         unfurledChoice.repaint();
 905                     }
 906                 }
 907             }
 908             // FIXME: If dragged off top or bottom, scroll if there's a vsb
 909             // (ICK - we'll need a timer or our own event or something)
 910         }
 911 
 912         /*
 913          * fillRect with current Background color on the whole dropdown list.
 914          */
 915         public void paintBackground() {




 875                   */
 876                   break;
 877               case MouseEvent.MOUSE_DRAGGED:
 878                   if (mouseInSB) {
 879                       helper.handleVSBEvent(e, getBounds(), local.x, local.y);
 880                   }
 881                   else {
 882                       // See 6243382 for more information
 883                       helper.trackMouseDraggedScroll(local.x, local.y, width, height);
 884                       trackSelection(local.x, local.y);
 885                   }
 886                   break;
 887             }
 888         }
 889 
 890         private void trackSelection(int transX, int transY) {
 891             if (!helper.isEmpty()) {
 892                 if (transX > 0 && transX < width &&
 893                     transY > 0 && transY < height) {
 894                     int newIdx = helper.y2index(transY);
 895                     if (log.isLoggable(PlatformLogger.Level.FINE)) {
 896                         log.fine("transX=" + transX + ", transY=" + transY
 897                                  + ",width=" + width + ", height=" + height
 898                                  + ", newIdx=" + newIdx + " on " + target);
 899                     }
 900                     if ((newIdx >=0) && (newIdx < helper.getItemCount())
 901                         && (newIdx != helper.getSelectedIndex()))
 902                     {
 903                         helper.select(newIdx);
 904                         unfurledChoice.repaint();
 905                     }
 906                 }
 907             }
 908             // FIXME: If dragged off top or bottom, scroll if there's a vsb
 909             // (ICK - we'll need a timer or our own event or something)
 910         }
 911 
 912         /*
 913          * fillRect with current Background color on the whole dropdown list.
 914          */
 915         public void paintBackground() {