org.scijava.ui.dnd
Class DefaultDragAndDropData

java.lang.Object
  extended by org.scijava.AbstractContextual
      extended by org.scijava.ui.dnd.AbstractDragAndDropData
          extended by org.scijava.ui.dnd.DefaultDragAndDropData
All Implemented Interfaces:
Contextual, DragAndDropData

public class DefaultDragAndDropData
extends AbstractDragAndDropData

Default implementation of DragAndDropData, which provides a UI-agnostic way to bundle an object together with its MIME type.

Author:
Barry DeZonia, Curtis Rueden

Constructor Summary
DefaultDragAndDropData(Context context, MIMEType mimeType, Object data)
           
 
Method Summary
 Object getData(MIMEType mimeType)
          Gets the data with respect to the given MIME type.
 List<MIMEType> getMIMETypes()
          Gets the list of supported MIME types.
 boolean isSupported(MIMEType mimeType)
          Gets whether the data can be provided as an object with the given MIME type.
 
Methods inherited from class org.scijava.ui.dnd.AbstractDragAndDropData
getData, getMIMEType, isSupported
 
Methods inherited from class org.scijava.AbstractContextual
context, getContext, setContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDragAndDropData

public DefaultDragAndDropData(Context context,
                              MIMEType mimeType,
                              Object data)
Method Detail

isSupported

public boolean isSupported(MIMEType mimeType)
Description copied from interface: DragAndDropData
Gets whether the data can be provided as an object with the given MIME type.


getData

public Object getData(MIMEType mimeType)
Description copied from interface: DragAndDropData
Gets the data with respect to the given MIME type.

Returns:
The data object for the given MIME type. May return null if the data is requested too early in the drag-and-drop process, such as during a DragEnterEvent rather than a DropEvent.

getMIMETypes

public List<MIMEType> getMIMETypes()
Description copied from interface: DragAndDropData
Gets the list of supported MIME types.



Copyright © 2009–2015 SciJava. All rights reserved.