Module ij
Package ij.plugin

Class DragAndDrop

java.lang.Object
ij.plugin.DragAndDrop
All Implemented Interfaces:
PlugIn, java.awt.dnd.DropTargetListener, java.lang.Runnable, java.util.EventListener

public class DragAndDrop
extends java.lang.Object
implements PlugIn, java.awt.dnd.DropTargetListener, java.lang.Runnable
This class opens images, roi's, luts and text files dragged and dropped on the "ImageJ" window. It is based on the Draw_And_Drop plugin by Eric Kischell (keesh@ieee.org). 10 November 2006: Albert Cardona added Linux support and an option to open all images in a dragged folder as a stack.
  • Constructor Summary

    Constructors 
    Constructor Description
    DragAndDrop()  
  • Method Summary

    Modifier and Type Method Description
    void dragEnter​(java.awt.dnd.DropTargetDragEvent e)  
    void dragExit​(java.awt.dnd.DropTargetEvent e)  
    void dragOver​(java.awt.dnd.DropTargetDragEvent e)  
    void drop​(java.awt.dnd.DropTargetDropEvent dtde)  
    void dropActionChanged​(java.awt.dnd.DropTargetDragEvent e)  
    void openFile​(java.io.File f)
    Open a file.
    void run()  
    void run​(java.lang.String arg)
    This method is called when the plugin is loaded.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • run

      public void run​(java.lang.String arg)
      Description copied from interface: PlugIn
      This method is called when the plugin is loaded. 'arg', which may be blank, is the argument specified for this plugin in IJ_Props.txt.
      Specified by:
      run in interface PlugIn
    • drop

      public void drop​(java.awt.dnd.DropTargetDropEvent dtde)
      Specified by:
      drop in interface java.awt.dnd.DropTargetListener
    • dragEnter

      public void dragEnter​(java.awt.dnd.DropTargetDragEvent e)
      Specified by:
      dragEnter in interface java.awt.dnd.DropTargetListener
    • dragOver

      public void dragOver​(java.awt.dnd.DropTargetDragEvent e)
      Specified by:
      dragOver in interface java.awt.dnd.DropTargetListener
    • dragExit

      public void dragExit​(java.awt.dnd.DropTargetEvent e)
      Specified by:
      dragExit in interface java.awt.dnd.DropTargetListener
    • dropActionChanged

      public void dropActionChanged​(java.awt.dnd.DropTargetDragEvent e)
      Specified by:
      dropActionChanged in interface java.awt.dnd.DropTargetListener
    • run

      public void run()
      Specified by:
      run in interface java.lang.Runnable
    • openFile

      public void openFile​(java.io.File f)
      Open a file. If it's a directory, ask to open all images as a sequence in a stack or individually.