org.favabeans.views
Class DragSourceAdapter

java.lang.Object
  |
  +--org.favabeans.views.DragSourceAdapter

public abstract class DragSourceAdapter
extends Object

A DragSourceAdapter is responsible for making an AWT component in FavaBeans capable of being the source of a DnD drag operation.


Inner Class Summary
 class DragSourceAdapter.LocalTransferable
           
 
Constructor Summary
DragSourceAdapter(Component component)
          Create a new DragSourceAdapter.
 
Method Summary
 Component getComponent()
           
protected abstract  Object getOperandAtLocation(Point location)
          Obtain the DnD operand at the specified location.
protected abstract  DnDAction[] getSupportedDragActions(Object operand)
          Obtain the supported drag actions for a given operand.
protected abstract  void operandCopied(Object operand)
           
protected abstract  void operandLinked(Object operand)
           
protected abstract  void operandMoved(Object operand)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DragSourceAdapter

public DragSourceAdapter(Component component)
Create a new DragSourceAdapter.
Parameters:
component - the AWT component which will be drag-enabled.
sourceContainer - an object the DnDSourceContainer Facet of which will be used to implement the semantics of the source side of the DnD operation.
Method Detail

getComponent

public Component getComponent()
Returns:
the AWT component which is being drop-enabled by this DragSourceAdapter.

getOperandAtLocation

protected abstract Object getOperandAtLocation(Point location)
Obtain the DnD operand at the specified location.
Parameters:
location - the location, in the coordinates of getComponent(), at which the end-user is currently gesturing.
Returns:
the operand at the specified location, or null if the given location should not be drop-enabled.

getSupportedDragActions

protected abstract DnDAction[] getSupportedDragActions(Object operand)
                                                throws NoSuchOperandException
Obtain the supported drag actions for a given operand.
Parameters:
operand - the object in this container which may be dragged.
Returns:
the supported actions, or an empty array if no dragging of the given operand is supported.
Throws:
NoSuchOperandException - if the supplied operand is not a valid DnD operand.

operandMoved

protected abstract void operandMoved(Object operand)
                              throws NoSuchOperandException,
                                     DropException

operandCopied

protected abstract void operandCopied(Object operand)
                               throws NoSuchOperandException,
                                      DropException

operandLinked

protected abstract void operandLinked(Object operand)
                               throws NoSuchOperandException,
                                      DropException


Copyright © 2000-2001, Regents of the University of Minnesota. All Rights Reserved.