org.activemath.author.toc
Class EditableTOCJTreeDropTarget

java.lang.Object
  extended by org.activemath.author.toc.EditableTOCJTreeDropTarget
All Implemented Interfaces:
DropTargetListener, EventListener

public class EditableTOCJTreeDropTarget
extends Object
implements DropTargetListener

A drop target implementation that may be attached to any TOC Frame


Field Summary
protected  DropTarget dt
           
 
Constructor Summary
EditableTOCJTreeDropTarget(EditableTOCJTree tree)
           
 
Method Summary
 boolean acceptOrReject(DropTargetDragEvent dtde)
          calls either dtde.acceptDrag or dtde.rejectDrag, depending on actionType.
 void checkFlavor(DropTargetDragEvent dtde)
          checks if the drag source of the given Event is able to supply file lists, and sets the dropAcceptable flag accordingly.
 void dragEnter(DropTargetDragEvent dtde)
          called when cursor enters droptarget's component checks if a dnd operation from the DragEvent's DragSource to this DropTargetListener's Component is allowed.
 void dragExit(DropTargetEvent dte)
          called when the mouse, while dragging something, leaves the Component that belongs to this Listener, or when a drop occurs.
 void dragOver(DropTargetDragEvent dtde)
          called when the mouse moves over this Listener's Component during a dnd operation.
 void drop(DropTargetDropEvent dtde)
          called if something is actually dropped inside the Component this Listener is attached to.
 void dropActionChanged(DropTargetDragEvent dtde)
          called when the type of dnd-action is changed, for example if the user presses SHIFT/ALT/CTRL etc.
 boolean isURL(DropTargetDragEvent dtde)
          checks whether the data inside the given DropTargetDragEvent is a string that starts with 'http://'
static String readURLFromEvent(DropTargetDropEvent dtde)
          Tries to match the possible data-flavours to get the and returns it if found or null otherwise.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dt

protected DropTarget dt
Constructor Detail

EditableTOCJTreeDropTarget

public EditableTOCJTreeDropTarget(EditableTOCJTree tree)
Method Detail

checkFlavor

public void checkFlavor(DropTargetDragEvent dtde)
checks if the drag source of the given Event is able to supply file lists, and sets the dropAcceptable flag accordingly.


isURL

public boolean isURL(DropTargetDragEvent dtde)
checks whether the data inside the given DropTargetDragEvent is a string that starts with 'http://'


acceptOrReject

public boolean acceptOrReject(DropTargetDragEvent dtde)
calls either dtde.acceptDrag or dtde.rejectDrag, depending on actionType. Returns true if drag was acceptable.


dragEnter

public void dragEnter(DropTargetDragEvent dtde)
called when cursor enters droptarget's component checks if a dnd operation from the DragEvent's DragSource to this DropTargetListener's Component is allowed.

Specified by:
dragEnter in interface DropTargetListener

dragOver

public void dragOver(DropTargetDragEvent dtde)
called when the mouse moves over this Listener's Component during a dnd operation. Checks if dnd operation would be permitted considering the DragSource etc.

Specified by:
dragOver in interface DropTargetListener

dropActionChanged

public void dropActionChanged(DropTargetDragEvent dtde)
called when the type of dnd-action is changed, for example if the user presses SHIFT/ALT/CTRL etc.

Specified by:
dropActionChanged in interface DropTargetListener

dragExit

public void dragExit(DropTargetEvent dte)
called when the mouse, while dragging something, leaves the Component that belongs to this Listener, or when a drop occurs.

Specified by:
dragExit in interface DropTargetListener

drop

public void drop(DropTargetDropEvent dtde)
called if something is actually dropped inside the Component this Listener is attached to.

Specified by:
drop in interface DropTargetListener

readURLFromEvent

public static String readURLFromEvent(DropTargetDropEvent dtde)
                               throws Exception
Tries to match the possible data-flavours to get the and returns it if found or null otherwise.

Throws:
Exception