home *** CD-ROM | disk | FTP | other *** search
- package javax.swing.plaf.basic;
-
- import java.awt.Rectangle;
- import java.awt.event.InputEvent;
- import java.awt.event.MouseEvent;
- import javax.swing.SwingUtilities;
- import javax.swing.event.MouseInputListener;
-
- public class BasicListUI$MouseInputHandler implements MouseInputListener {
- // $FF: synthetic field
- private final BasicListUI this$0;
-
- public BasicListUI$MouseInputHandler(BasicListUI var1) {
- this.this$0 = var1;
- }
-
- public void mouseClicked(MouseEvent var1) {
- }
-
- public void mouseDragged(MouseEvent var1) {
- if (SwingUtilities.isLeftMouseButton(var1)) {
- if (this.this$0.list.isEnabled()) {
- if (!((InputEvent)var1).isShiftDown() && !((InputEvent)var1).isControlDown()) {
- int var2 = this.this$0.convertYToRow(var1.getY());
- if (var2 != -1) {
- Rectangle var3 = this.this$0.getCellBounds(this.this$0.list, var2, var2);
- if (var3 != null) {
- this.this$0.list.scrollRectToVisible(var3);
- this.this$0.list.setSelectionInterval(var2, var2);
- }
- }
-
- }
- }
- }
- }
-
- public void mouseEntered(MouseEvent var1) {
- }
-
- public void mouseExited(MouseEvent var1) {
- }
-
- public void mouseMoved(MouseEvent var1) {
- }
-
- public void mousePressed(MouseEvent var1) {
- if (SwingUtilities.isLeftMouseButton(var1)) {
- if (this.this$0.list.isEnabled()) {
- if (!this.this$0.list.hasFocus()) {
- this.this$0.list.requestFocus();
- }
-
- int var2 = this.this$0.convertYToRow(var1.getY());
- if (var2 != -1) {
- this.this$0.list.setValueIsAdjusting(true);
- int var3 = this.this$0.list.getAnchorSelectionIndex();
- if (((InputEvent)var1).isControlDown()) {
- if (this.this$0.list.isSelectedIndex(var2)) {
- this.this$0.list.removeSelectionInterval(var2, var2);
- } else {
- this.this$0.list.addSelectionInterval(var2, var2);
- }
- } else if (((InputEvent)var1).isShiftDown() && var3 != -1) {
- this.this$0.list.setSelectionInterval(var3, var2);
- } else {
- this.this$0.list.setSelectionInterval(var2, var2);
- }
- }
-
- }
- }
- }
-
- public void mouseReleased(MouseEvent var1) {
- if (SwingUtilities.isLeftMouseButton(var1)) {
- this.this$0.list.setValueIsAdjusting(false);
- }
- }
- }
-