Package org.scijava.ui.dnd
Interface DragAndDropService
-
- All Superinterfaces:
Comparable<Prioritized>,Contextual,Disposable,HandlerService<Object,DragAndDropHandler<Object>>,HasPluginInfo,Identifiable,Initializable,Locatable,Logged,Prioritized,PTService<DragAndDropHandler<Object>>,RichPlugin,SciJavaPlugin,SciJavaService,Service,SingletonService<DragAndDropHandler<Object>>,Typed<Object>,TypedService<Object,DragAndDropHandler<Object>>,Versioned
- All Known Implementing Classes:
DefaultDragAndDropService
public interface DragAndDropService extends HandlerService<Object,DragAndDropHandler<Object>>, SciJavaService
Interface for service that handles drag and drop events.- Author:
- Curtis Rueden
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default booleandrop(Object data, Display<?> display)Performs a drag-and-drop operation in the given display with the specified data object, using the first available compatible handler.default booleandrop(DragAndDropData data, Display<?> display)Performs a drag-and-drop operation in the given display with the specifiedDragAndDropData, using the first available compatible handler.default DragAndDropHandler<?>getHandler(Object object, Display<?> display)Gets the drag-and-drop handler which will be used to handle the given object dragged onto the specified display.default DragAndDropHandler<?>getHandler(DragAndDropData data, Display<?> display)Gets the drag-and-drop handler which will be used to handle the givenDragAndDropDatadragged onto the specified display.List<DragAndDropHandler<Object>>getInstances()Gets the list of available drag-and-drop handlers, which are used to perform drag-and-drop operations.default Class<DragAndDropHandler<Object>>getPluginType()Gets the type of plugins managed by this service.default Class<Object>getType()Gets the type associated with the object.default booleansupports(Object object, Display<?> display)Checks whether the given object can be dropped onto the specified display.default booleansupports(DragAndDropData data, Display<?> display)Checks whether the givenDragAndDropDatacan be dropped onto the specified display.-
Methods inherited from interface org.scijava.Contextual
context, getContext, setContext
-
Methods inherited from interface org.scijava.Disposable
dispose
-
Methods inherited from interface org.scijava.plugin.HandlerService
getHandler, supports
-
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.PTService
getPlugins, getPluginService, pluginService
-
Methods inherited from interface org.scijava.plugin.RichPlugin
getIdentifier, log
-
Methods inherited from interface org.scijava.service.Service
registerEventHandlers
-
Methods inherited from interface org.scijava.plugin.SingletonService
create, filterInstances, getInstance, initialize, objectService
-
Methods inherited from interface org.scijava.plugin.TypedService
find
-
Methods inherited from interface org.scijava.Versioned
getVersion
-
-
-
-
Method Detail
-
supports
default boolean supports(DragAndDropData data, Display<?> display)
Checks whether the givenDragAndDropDatacan be dropped onto the specified display. A (data, display) pair is deemed compatible if a compatible handler exists for them.- See Also:
DragAndDropHandler
-
supports
default boolean supports(Object object, Display<?> display)
Checks whether the given object can be dropped onto the specified display. An (object, display) pair is deemed compatible if a compatible handler exists for them.- See Also:
DragAndDropHandler
-
drop
default boolean drop(DragAndDropData data, Display<?> display)
Performs a drag-and-drop operation in the given display with the specifiedDragAndDropData, using the first available compatible handler.- Returns:
- true if the drop operation was successful
- Throws:
IllegalArgumentException- if the display and/or data object are unsupported, or are incompatible with one another.- See Also:
DragAndDropHandler
-
drop
default boolean drop(Object data, Display<?> display)
Performs a drag-and-drop operation in the given display with the specified data object, using the first available compatible handler.- Returns:
- true if the drop operation was successful
- Throws:
IllegalArgumentException- if the display and/or data object are unsupported, or are incompatible with one another.- See Also:
DragAndDropHandler
-
getHandler
default DragAndDropHandler<?> getHandler(DragAndDropData data, Display<?> display)
Gets the drag-and-drop handler which will be used to handle the givenDragAndDropDatadragged onto the specified display.- Returns:
- The first compatible drag-and-drop handler, or null if none available.
-
getHandler
default DragAndDropHandler<?> getHandler(Object object, Display<?> display)
Gets the drag-and-drop handler which will be used to handle the given object dragged onto the specified display.- Returns:
- The first compatible drag-and-drop handler, or null if none available.
-
getInstances
List<DragAndDropHandler<Object>> getInstances()
Gets the list of available drag-and-drop handlers, which are used to perform drag-and-drop operations.- Specified by:
getInstancesin interfaceHandlerService<Object,DragAndDropHandler<Object>>- Specified by:
getInstancesin interfaceSingletonService<DragAndDropHandler<Object>>
-
getPluginType
default Class<DragAndDropHandler<Object>> getPluginType()
Description copied from interface:PTServiceGets the type of plugins managed by this service.- Specified by:
getPluginTypein interfacePTService<DragAndDropHandler<Object>>
-
-