Package org.scijava.ui.dnd
Interface DragAndDropHandler<D>
-
- All Superinterfaces:
Comparable<Prioritized>,Contextual,HandlerPlugin<D>,HasPluginInfo,Identifiable,Locatable,Logged,Prioritized,RichPlugin,SciJavaPlugin,SingletonPlugin,Typed<D>,TypedPlugin<D>,Versioned
- All Known Implementing Classes:
AbstractDragAndDropHandler,FileDragAndDropHandler,ListDragAndDropHandler,ScriptFileDragAndDropHandler
public interface DragAndDropHandler<D> extends HandlerPlugin<D>
Interface for drag-and-drop handlers. A drag-and-drop handler defines behavior for drag-and-drop operations with respect to a specific sort of objects.Drag-and-drop handlers discoverable at runtime must implement this interface and be annotated with @
Pluginwith attributePlugin.type()=DragAndDropHandler.class. While it possible to create a drag-and-drop handler merely by implementing this interface, it is encouraged to instead extendAbstractDragAndDropHandler, for convenience.- Author:
- Curtis Rueden
- See Also:
Plugin,DragAndDropService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description DconvertData(DragAndDropData data)Converts the givenDragAndDropDatato the type of data object supported by this handler.DconvertObject(Object object)Converts the given object to the type of data object supported by this handler.booleandrop(D dataObject, Display<?> display)Performs a drop operation with the given data object in the specifiedDisplay.booleandropData(DragAndDropData data, Display<?> display)Performs a drop operation with the given data in the specifiedDisplay.booleandropObject(Object object, Display<?> display)Performs a drop operation with the given data in the specifiedDisplay.default booleansupports(D dataObject)Gets whether this handler supports dropping the given data object onto a compatible display.booleansupports(D dataObject, Display<?> display)Gets whether this handler supports dropping the given data object onto the specified display.booleansupportsData(DragAndDropData data)Gets whether this handler supports dropping the givenDragAndDropDataonto a compatible display.booleansupportsData(DragAndDropData data, Display<?> display)Gets whether this handler supports dropping the givenDragAndDropDataonto the specified display.booleansupportsDisplay(Display<?> display)Gets whether this handler supports dropping an assumed-to-be-compatible data object onto the givenDisplay.booleansupportsObject(Object object)Gets whether this handler supports dropping the given object onto a compatible display.booleansupportsObject(Object object, Display<?> display)Gets whether this handler supports dropping the given object onto the specified display.-
Methods inherited from interface org.scijava.Contextual
context, getContext, setContext
-
Methods inherited from interface org.scijava.plugin.HasPluginInfo
getInfo, setInfo
-
Methods inherited from interface org.scijava.Locatable
getLocation
-
Methods inherited from interface org.scijava.Prioritized
compareTo, getPriority, setPriority
-
Methods inherited from interface org.scijava.plugin.RichPlugin
getIdentifier, log
-
Methods inherited from interface org.scijava.Versioned
getVersion
-
-
-
-
Method Detail
-
supports
boolean supports(D dataObject, Display<?> display)
Gets whether this handler supports dropping the given data object onto the specified display.
-
supportsData
boolean supportsData(DragAndDropData data)
Gets whether this handler supports dropping the givenDragAndDropDataonto a compatible display.
-
supportsData
boolean supportsData(DragAndDropData data, Display<?> display)
Gets whether this handler supports dropping the givenDragAndDropDataonto the specified display.
-
supportsObject
boolean supportsObject(Object object)
Gets whether this handler supports dropping the given object onto a compatible display.
-
supportsObject
boolean supportsObject(Object object, Display<?> display)
Gets whether this handler supports dropping the given object onto the specified display.
-
supportsDisplay
boolean supportsDisplay(Display<?> display)
Gets whether this handler supports dropping an assumed-to-be-compatible data object onto the givenDisplay.
-
convertData
D convertData(DragAndDropData data)
Converts the givenDragAndDropDatato the type of data object supported by this handler.- Throws:
IllegalArgumentException- if the handler does not support the givenDragAndDropData.
-
convertObject
D convertObject(Object object)
Converts the given object to the type of data object supported by this handler.- Throws:
IllegalArgumentException- if the handler does not support the given object.
-
drop
boolean drop(D dataObject, Display<?> display)
Performs a drop operation with the given data object in the specifiedDisplay.- Throws:
IllegalArgumentException- if the handler is not compatible with the given data/display combination.
-
dropData
boolean dropData(DragAndDropData data, Display<?> display)
Performs a drop operation with the given data in the specifiedDisplay.- Throws:
IllegalArgumentException- if the handler is not compatible with the given data/display combination.
-
dropObject
boolean dropObject(Object object, Display<?> display)
Performs a drop operation with the given data in the specifiedDisplay.- Throws:
IllegalArgumentException- if the handler is not compatible with the given data/display combination.
-
-