org.scijava.ui.dnd
Class DefaultDragAndDropService
java.lang.Object
org.scijava.AbstractContextual
org.scijava.plugin.AbstractRichPlugin
org.scijava.service.AbstractService
org.scijava.plugin.AbstractPTService<PT>
org.scijava.plugin.AbstractSingletonService<PT>
org.scijava.plugin.AbstractHandlerService<Object,DragAndDropHandler<Object>>
org.scijava.ui.dnd.DefaultDragAndDropService
- All Implemented Interfaces:
- Comparable<Prioritized>, Contextual, Disposable, HandlerService<Object,DragAndDropHandler<Object>>, HasPluginInfo, PTService<DragAndDropHandler<Object>>, RichPlugin, SciJavaPlugin, SingletonService<DragAndDropHandler<Object>>, TypedService<Object,DragAndDropHandler<Object>>, Prioritized, SciJavaService, Service, Typed<Object>, DragAndDropService
public class DefaultDragAndDropService
- extends AbstractHandlerService<Object,DragAndDropHandler<Object>>
- implements DragAndDropService
Default service for handling drag and drop events.
- Author:
- Curtis Rueden
DefaultDragAndDropService
public DefaultDragAndDropService()
supports
public boolean supports(DragAndDropData data,
Display<?> display)
- Description copied from interface:
DragAndDropService
- Checks whether the given
DragAndDropData
can be dropped onto the
specified display. A (data, display) pair is deemed compatible if a
compatible handler exists for them.
- Specified by:
supports
in interface DragAndDropService
- See Also:
DragAndDropHandler
supports
public boolean supports(Object object,
Display<?> display)
- Description copied from interface:
DragAndDropService
- 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.
- Specified by:
supports
in interface DragAndDropService
- See Also:
DragAndDropHandler
drop
public boolean drop(DragAndDropData data,
Display<?> display)
- Description copied from interface:
DragAndDropService
- Performs a drag-and-drop operation in the given display with the specified
DragAndDropData
, using the first available compatible handler.
- Specified by:
drop
in interface DragAndDropService
- Returns:
- true if the drop operation was successful
- See Also:
DragAndDropHandler
drop
public boolean drop(Object data,
Display<?> display)
- Description copied from interface:
DragAndDropService
- Performs a drag-and-drop operation in the given display with the specified
data object, using the first available compatible handler.
- Specified by:
drop
in interface DragAndDropService
- Returns:
- true if the drop operation was successful
- See Also:
DragAndDropHandler
getHandler
public DragAndDropHandler<?> getHandler(DragAndDropData data,
Display<?> display)
- Description copied from interface:
DragAndDropService
- Gets the drag-and-drop handler which will be used to handle the given
DragAndDropData
dragged onto the specified display.
- Specified by:
getHandler
in interface DragAndDropService
- Returns:
- The first compatible drag-and-drop handler, or null if none
available.
getHandler
public DragAndDropHandler<?> getHandler(Object object,
Display<?> display)
- Description copied from interface:
DragAndDropService
- Gets the drag-and-drop handler which will be used to handle the given
object dragged onto the specified display.
- Specified by:
getHandler
in interface DragAndDropService
- Returns:
- The first compatible drag-and-drop handler, or null if none
available.
getPluginType
public Class<DragAndDropHandler<Object>> getPluginType()
- Description copied from interface:
PTService
- Gets the type of plugins managed by this service.
- Specified by:
getPluginType
in interface PTService<DragAndDropHandler<Object>>
getType
public Class<Object> getType()
- Description copied from interface:
Typed
- Gets the type associated with the object.
- Specified by:
getType
in interface Typed<Object>
onEvent
protected void onEvent(DragEnterEvent e)
onEvent
protected void onEvent(DragExitEvent e)
onEvent
protected void onEvent(DragOverEvent e)
onEvent
protected void onEvent(DropEvent e)
Copyright © 2009–2014 SciJava. All rights reserved.