com.limegroup.gnutella.gui.library
Class DragSourceListener

java.lang.Object
  extended bycom.limegroup.gnutella.gui.library.DragSourceListener
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.MouseInputListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener

public class DragSourceListener
extends java.lang.Object
implements javax.swing.event.MouseInputListener

This class handles the generation of a drag event from the dragging source. It is specialized to handle dragging and dropping within the library.


Method Summary
 void mouseClicked(java.awt.event.MouseEvent e)
          Not used.
 void mouseDragged(java.awt.event.MouseEvent e)
          Called when the mouse is dragged.
 void mouseEntered(java.awt.event.MouseEvent e)
          Called when the mouse enters whatever component that has added this class as a listener.
 void mouseExited(java.awt.event.MouseEvent e)
          Called when the mouse has "exited" the component that this listener is attached to.
 void mouseMoved(java.awt.event.MouseEvent e)
          Implements the mouseInputListener interface.
 void mousePressed(java.awt.event.MouseEvent e)
          Handles resetting the current upper and lower row bounding variables for accurately handling row selection.
 void mouseReleased(java.awt.event.MouseEvent e)
          Called when the mouse is released.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Handles resetting the current upper and lower row bounding variables for accurately handling row selection.

Specified by:
mousePressed in interface java.awt.event.MouseListener
Parameters:
e - the MouseEvent instance containing data about the mouse press

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Called when the mouse is released. Ttranslates the mouse release event's location into the tree's coordinate space to see if there is a potential drop event (if the mouse has left the table's screen space).

Specified by:
mouseReleased in interface java.awt.event.MouseListener
Parameters:
e - the MouseEvent instance containing data about the mouse release

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Not used. Let other listeners do it.

Specified by:
mouseClicked in interface java.awt.event.MouseListener
Parameters:
e - the MouseEvent instance containing data about the mouse click

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Called when the mouse enters whatever component that has added this class as a listener. Sets the flag for a potential drop to false, since in our cases you cannot drag and drop something within the same component.

Specified by:
mouseEntered in interface java.awt.event.MouseListener
Parameters:
e - the MouseEvent instance containing data about the mouse entering the Component

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Called when the mouse has "exited" the component that this listener is attached to. sets the drop flag to true, as we might be trying to drop data into another component.

Specified by:
mouseExited in interface java.awt.event.MouseListener
Parameters:
e - the MouseEvent instance containing data about the mouse exiting the Component

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Called when the mouse is dragged. Sets the cursor to the drag cursor and sets the dragging flag to true.

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener
Parameters:
e - the MouseEvent instance containing data about the mouse dragging

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Implements the mouseInputListener interface. Does nothing in this case.

Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener
Parameters:
e - the MouseEvent instance containing data about the mouse moving