org.scijava.ui.dnd
Interface DragAndDropData

All Known Implementing Classes:
AbstractDragAndDropData, DefaultDragAndDropData

public interface DragAndDropData

Interface for drag-and-drop data.

Author:
Curtis Rueden

Method Summary
<T> T
getData(Class<T> type)
          Gets the data as an object of the given Java class.
 Object getData(MIMEType mimeType)
          Gets the data with respect to the given MIME type.
 MIMEType getMIMEType(Class<?> type)
          Gets the best supported MIME type matching the given Java class.
 List<MIMEType> getMIMETypes()
          Gets the list of supported MIME types.
 boolean isSupported(Class<?> type)
          Gets whether the data can be provided as an object of the given Java class.
 boolean isSupported(MIMEType mimeType)
          Gets whether the data can be provided as an object with the given MIME type.
 

Method Detail

isSupported

boolean isSupported(MIMEType mimeType)
Gets whether the data can be provided as an object with the given MIME type.


isSupported

boolean isSupported(Class<?> type)
Gets whether the data can be provided as an object of the given Java class.


getData

Object getData(MIMEType mimeType)
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.
Throws:
IllegalArgumentException - if the MIME type is not supported.

getData

<T> T getData(Class<T> type)
Gets the data as an object of the given Java class.


getMIMEType

MIMEType getMIMEType(Class<?> type)
Gets the best supported MIME type matching the given Java class.


getMIMETypes

List<MIMEType> getMIMETypes()
Gets the list of supported MIME types.



Copyright © 2009–2014 SciJava. All rights reserved.