com.tensegrity.gui.swing.dnd
Class AbstractFileDropListener

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

public abstract class AbstractFileDropListener
extends java.lang.Object
implements java.awt.dnd.DropTargetListener

This drop listener opens files in a fileopener instance.

Version:
$Id: AbstractFileDropListener.java,v 1.9 2005/10/12 16:00:36 BurkhardWick Exp $
Author:
Stepan Rutz

Constructor Summary
AbstractFileDropListener(DocumentDropContext opener)
          Abstract filedrop listneer base class.
 
Method Summary
 void dragEnter(java.awt.dnd.DropTargetDragEvent dtde)
          Accepts the drag if the flavor is supported.
 void dragExit(java.awt.dnd.DropTargetEvent dte)
          Empty.
abstract  void dragOver(java.awt.dnd.DropTargetDragEvent dtde)
          Accepts the drag if the flavor is supported.
abstract  boolean dragOverInternal(java.awt.dnd.DropTargetDragEvent dtde)
          To be overridden by a derived class.
abstract  void drop(java.awt.dnd.DropTargetDropEvent dtde)
          If the drop is accepted, the Transferable will be extracted from the event instance and set properly.
 void dropActionChanged(java.awt.dnd.DropTargetDragEvent dtde)
          Empty, cause we are not interested in that.
abstract  boolean dropInternal(java.awt.dnd.DropTargetDropEvent dtde)
          To be overridden by a derived class.
protected  boolean isDragAcceptedForEvent(java.awt.dnd.DropTargetDragEvent dtde)
          Returns true if the the given flavor is supported.
protected  boolean isDropAcceptedForEvent(java.awt.dnd.DropTargetDropEvent dtde)
          Returns true if the the given flavor is supported.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractFileDropListener

public AbstractFileDropListener(DocumentDropContext opener)
Abstract filedrop listneer base class.

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

isDragAcceptedForEvent

protected boolean isDragAcceptedForEvent(java.awt.dnd.DropTargetDragEvent dtde)
Returns true if the the given flavor is supported. This DropListener only accepts FlowTransferable.compositeFlavor.

Parameters:
dtde - the event to check.
Returns:
true if the operation is accepted.

isDropAcceptedForEvent

protected boolean isDropAcceptedForEvent(java.awt.dnd.DropTargetDropEvent dtde)
Returns true if the the given flavor is supported. This DropListener only accepts FlowTransferable.compositeFlavor.

Parameters:
dtde - the event to check.
Returns:
true if the operation is accepted.

dragEnter

public void dragEnter(java.awt.dnd.DropTargetDragEvent dtde)
Accepts the drag if the flavor is supported.

Specified by:
dragEnter in interface java.awt.dnd.DropTargetListener

dragExit

public void dragExit(java.awt.dnd.DropTargetEvent dte)
Empty. Nothing to do.

Specified by:
dragExit in interface java.awt.dnd.DropTargetListener

dragOver

public abstract void dragOver(java.awt.dnd.DropTargetDragEvent dtde)
Accepts the drag if the flavor is supported.

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

dragOverInternal

public abstract boolean dragOverInternal(java.awt.dnd.DropTargetDragEvent dtde)
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.

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.

drop

public abstract void drop(java.awt.dnd.DropTargetDropEvent dtde)
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

dropInternal

public abstract boolean dropInternal(java.awt.dnd.DropTargetDropEvent dtde)
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.

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.

dropActionChanged

public void dropActionChanged(java.awt.dnd.DropTargetDragEvent dtde)
Empty, cause we are not interested in that.

Specified by:
dropActionChanged in interface java.awt.dnd.DropTargetListener


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