com.tensegrity.gui.swing.dnd
Class FileDropListener

java.lang.Object
  extended bycom.tensegrity.gui.swing.dnd.AbstractFileDropListener
      extended bycom.tensegrity.gui.swing.dnd.FileDropListener
All Implemented Interfaces:
java.awt.dnd.DropTargetListener, java.util.EventListener

public class FileDropListener
extends AbstractFileDropListener

This drop listener opens files in the graphframe. This class can be used stand alone in a component.

Version:
$Id: FileDropListener.java,v 1.7 2004/05/06 07:30:27 MichaelKegel Exp $
Author:
Stepan Rutz

Constructor Summary
FileDropListener(DocumentDropContext opener)
          Constructs a new Filedrop listener instance.
 
Method Summary
 void dragOver(java.awt.dnd.DropTargetDragEvent dtde)
          Accepts the drag if the flavor is supported.
 boolean dragOverInternal(java.awt.dnd.DropTargetDragEvent dtde)
          To be overridden by a derived class.
 void drop(java.awt.dnd.DropTargetDropEvent dtde)
          If the drop is accepted, the Transferable will be extracted from the event instance and set properly.
 boolean dropInternal(java.awt.dnd.DropTargetDropEvent dtde)
          To be overridden by a derived class.
 
Methods inherited from class com.tensegrity.gui.swing.dnd.AbstractFileDropListener
dragEnter, dragExit, dropActionChanged, isDragAcceptedForEvent, isDropAcceptedForEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileDropListener

public FileDropListener(DocumentDropContext opener)
Constructs a new Filedrop listener instance.

Parameters:
opener - a class that can open files.
Method Detail

dragOverInternal

public boolean dragOverInternal(java.awt.dnd.DropTargetDragEvent dtde)
Description copied from class: AbstractFileDropListener
To be overridden by a derived class. Then this method should be invoked as the first thing in the dragOver handler by the derived class. Only if false is returned the derived class is allowed to do further processing, otherwise the derived class must return straight from its dragOver.

Specified by:
dragOverInternal in class AbstractFileDropListener
Parameters:
dtde - the dnd even that occured.
Returns:
true if the drag over was absorbed. If false is returned the derived class may still handle the dragOver.

dragOver

public void dragOver(java.awt.dnd.DropTargetDragEvent dtde)
Description copied from class: AbstractFileDropListener
Accepts the drag if the flavor is supported.

Specified by:
dragOver in interface java.awt.dnd.DropTargetListener
Specified by:
dragOver in class AbstractFileDropListener

dropInternal

public boolean dropInternal(java.awt.dnd.DropTargetDropEvent dtde)
Description copied from class: AbstractFileDropListener
To be overridden by a derived class. Then this method should be invoked as the first thing in the drop handler by the derived class. Only if false is returned the derived class is allowed to do further processing, otherwise the derived class must return straight from its drop.

Specified by:
dropInternal in class AbstractFileDropListener
Parameters:
dtde - the dnd even that occured.
Returns:
true if the drag over was absorbed. If false is returned the derived class may still handle the drop.

drop

public void drop(java.awt.dnd.DropTargetDropEvent dtde)
Description copied from class: AbstractFileDropListener
If the drop is accepted, the Transferable will be extracted from the event instance and set properly.

Specified by:
drop in interface java.awt.dnd.DropTargetListener
Specified by:
drop in class AbstractFileDropListener


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.