com.mucommander.ui.dnd
Class FileDragSourceListener

java.lang.Object
  extended by com.mucommander.ui.dnd.FileDragSourceListener
All Implemented Interfaces:
java.awt.dnd.DragGestureListener, java.awt.dnd.DragSourceListener, java.util.EventListener

public class FileDragSourceListener
extends java.lang.Object
implements java.awt.dnd.DragGestureListener, java.awt.dnd.DragSourceListener

This class adds 'drag' support to components that are registered using the enableDrag(java.awt.Component) method.

A FolderPanel instance has to be specified at creation time, this instance will be used to retrieve the list of selected/marked file(s) that are dragged, whenever a drag operation is initiated on of the registered components.

Author:
Maxence Bernard

Constructor Summary
FileDragSourceListener(FolderPanel folderPanel)
          Creates a new FileDragSourceListener using the specified FolderPanel that will be used to retreive the dragged files based on the current file selection.
 
Method Summary
 void dragDropEnd(java.awt.dnd.DragSourceDropEvent event)
           
 void dragEnter(java.awt.dnd.DragSourceDragEvent event)
           
 void dragExit(java.awt.dnd.DragSourceEvent event)
           
 void dragGestureRecognized(java.awt.dnd.DragGestureEvent event)
           
 void dragOver(java.awt.dnd.DragSourceDragEvent event)
           
 void dropActionChanged(java.awt.dnd.DragSourceDragEvent event)
           
 void enableDrag(java.awt.Component c)
          Enables drag operations on the specified component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileDragSourceListener

public FileDragSourceListener(FolderPanel folderPanel)
Creates a new FileDragSourceListener using the specified FolderPanel that will be used to retreive the dragged files based on the current file selection.

Parameters:
folderPanel - the FolderPanel used to retrieve the list of selected/marked file(s) that are dragged
Method Detail

enableDrag

public void enableDrag(java.awt.Component c)
Enables drag operations on the specified component. This class will be notified wheneven drag operations are performed on the component.

Parameters:
c - the component for which to add 'drag' support

dragGestureRecognized

public void dragGestureRecognized(java.awt.dnd.DragGestureEvent event)
Specified by:
dragGestureRecognized in interface java.awt.dnd.DragGestureListener

dragEnter

public void dragEnter(java.awt.dnd.DragSourceDragEvent event)
Specified by:
dragEnter in interface java.awt.dnd.DragSourceListener

dragOver

public void dragOver(java.awt.dnd.DragSourceDragEvent event)
Specified by:
dragOver in interface java.awt.dnd.DragSourceListener

dropActionChanged

public void dropActionChanged(java.awt.dnd.DragSourceDragEvent event)
Specified by:
dropActionChanged in interface java.awt.dnd.DragSourceListener

dragExit

public void dragExit(java.awt.dnd.DragSourceEvent event)
Specified by:
dragExit in interface java.awt.dnd.DragSourceListener

dragDropEnd

public void dragDropEnd(java.awt.dnd.DragSourceDropEvent event)
Specified by:
dragDropEnd in interface java.awt.dnd.DragSourceListener


This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard