org.scijava.ui.dnd
Class AbstractDragAndDropHandler<D>

java.lang.Object
  extended by org.scijava.AbstractContextual
      extended by org.scijava.plugin.AbstractRichPlugin
          extended by org.scijava.plugin.AbstractTypedPlugin<D>
              extended by org.scijava.plugin.AbstractHandlerPlugin<D>
                  extended by org.scijava.ui.dnd.AbstractDragAndDropHandler<D>
All Implemented Interfaces:
Comparable<Prioritized>, Contextual, HandlerPlugin<D>, HasPluginInfo, RichPlugin, SciJavaPlugin, SingletonPlugin, TypedPlugin<D>, Prioritized, Typed<D>, DragAndDropHandler<D>
Direct Known Subclasses:
FileDragAndDropHandler, ListDragAndDropHandler, ScriptFileDragAndDropHandler

public abstract class AbstractDragAndDropHandler<D>
extends AbstractHandlerPlugin<D>
implements DragAndDropHandler<D>

Abstract superclass for DragAndDropHandlers.

Author:
Curtis Rueden

Constructor Summary
AbstractDragAndDropHandler()
           
 
Method Summary
protected  void check(D dataObject, Display<?> display)
          Throws IllegalArgumentException if (data, display) pair is incompatible.
 D convertData(DragAndDropData data)
          Converts the given DragAndDropData to the type of data object supported by this handler.
protected  D convertDataUnchecked(DragAndDropData data)
          Converts the given data to this handler's native data type, without verifying compatibility first.
 D convertObject(Object object)
          Converts the given object to the type of data object supported by this handler.
protected  D convertObjectUnchecked(Object object)
          Converts the given object to this handler's native data type, without verifying compatibility first.
 boolean dropData(DragAndDropData data, Display<?> display)
          Performs a drop operation with the given data in the specified Display.
 boolean dropObject(Object object, Display<?> display)
          Performs a drop operation with the given data in the specified Display.
 boolean supports(D dataObject, Display<?> display)
          Gets whether this handler supports dropping the given data object onto the specified display.
 boolean supportsData(DragAndDropData data)
          Gets whether this handler supports dropping the given DragAndDropData onto a compatible display.
 boolean supportsData(DragAndDropData data, Display<?> display)
          Gets whether this handler supports dropping the given DragAndDropData onto the specified display.
 boolean supportsDisplay(Display<?> display)
          Gets whether this handler supports dropping an assumed-to-be-compatible data object onto the given Display.
 boolean supportsObject(Object object)
          Gets whether this handler supports dropping the given object onto a compatible display.
 boolean supportsObject(Object object, Display<?> display)
          Gets whether this handler supports dropping the given object onto the specified display.
 
Methods inherited from class org.scijava.plugin.AbstractTypedPlugin
supports
 
Methods inherited from class org.scijava.plugin.AbstractRichPlugin
compareTo, getInfo, getPriority, setInfo, setPriority, toString
 
Methods inherited from class org.scijava.AbstractContextual
context, getContext, setContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.scijava.ui.dnd.DragAndDropHandler
drop, supports
 
Methods inherited from interface org.scijava.Contextual
context, getContext, setContext
 
Methods inherited from interface org.scijava.Prioritized
getPriority, setPriority
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.scijava.plugin.HasPluginInfo
getInfo, setInfo
 
Methods inherited from interface org.scijava.Typed
getType
 

Constructor Detail

AbstractDragAndDropHandler

public AbstractDragAndDropHandler()
Method Detail

supports

public boolean supports(D dataObject,
                        Display<?> display)
Description copied from interface: DragAndDropHandler
Gets whether this handler supports dropping the given data object onto the specified display.

Specified by:
supports in interface DragAndDropHandler<D>

supportsData

public boolean supportsData(DragAndDropData data)
Description copied from interface: DragAndDropHandler
Gets whether this handler supports dropping the given DragAndDropData onto a compatible display.

Specified by:
supportsData in interface DragAndDropHandler<D>

supportsData

public boolean supportsData(DragAndDropData data,
                            Display<?> display)
Description copied from interface: DragAndDropHandler
Gets whether this handler supports dropping the given DragAndDropData onto the specified display.

Specified by:
supportsData in interface DragAndDropHandler<D>

supportsObject

public boolean supportsObject(Object object)
Description copied from interface: DragAndDropHandler
Gets whether this handler supports dropping the given object onto a compatible display.

Specified by:
supportsObject in interface DragAndDropHandler<D>

supportsObject

public boolean supportsObject(Object object,
                              Display<?> display)
Description copied from interface: DragAndDropHandler
Gets whether this handler supports dropping the given object onto the specified display.

Specified by:
supportsObject in interface DragAndDropHandler<D>

supportsDisplay

public boolean supportsDisplay(Display<?> display)
Description copied from interface: DragAndDropHandler
Gets whether this handler supports dropping an assumed-to-be-compatible data object onto the given Display.

Specified by:
supportsDisplay in interface DragAndDropHandler<D>

convertData

public D convertData(DragAndDropData data)
Description copied from interface: DragAndDropHandler
Converts the given DragAndDropData to the type of data object supported by this handler.

Specified by:
convertData in interface DragAndDropHandler<D>

convertObject

public D convertObject(Object object)
Description copied from interface: DragAndDropHandler
Converts the given object to the type of data object supported by this handler.

Specified by:
convertObject in interface DragAndDropHandler<D>

dropData

public boolean dropData(DragAndDropData data,
                        Display<?> display)
Description copied from interface: DragAndDropHandler
Performs a drop operation with the given data in the specified Display.

Specified by:
dropData in interface DragAndDropHandler<D>

dropObject

public boolean dropObject(Object object,
                          Display<?> display)
Description copied from interface: DragAndDropHandler
Performs a drop operation with the given data in the specified Display.

Specified by:
dropObject in interface DragAndDropHandler<D>

check

protected void check(D dataObject,
                     Display<?> display)
Throws IllegalArgumentException if (data, display) pair is incompatible.


convertDataUnchecked

protected D convertDataUnchecked(DragAndDropData data)
Converts the given data to this handler's native data type, without verifying compatibility first.


convertObjectUnchecked

protected D convertObjectUnchecked(Object object)
Converts the given object to this handler's native data type, without verifying compatibility first.



Copyright © 2009–2014 SciJava. All rights reserved.