com.metamatrix.toolbox.ui.widget.transfer
Class AbstractDragAndDropController

java.lang.Object
  extended by com.metamatrix.toolbox.ui.widget.transfer.AbstractDragAndDropController
All Implemented Interfaces:
DragAndDropController, java.awt.dnd.DragGestureListener, java.awt.dnd.DragSourceListener, java.awt.dnd.DropTargetListener, java.util.EventListener
Direct Known Subclasses:
AbstractTreeNodeDragAndDropController

public abstract class AbstractDragAndDropController
extends java.lang.Object
implements DragAndDropController, java.awt.dnd.DragGestureListener, java.awt.dnd.DragSourceListener, java.awt.dnd.DropTargetListener

Since:
2.1
Version:
2.1
Author:
John P. A. Verhaeg

Constructor Summary
protected AbstractDragAndDropController()
           
 
Method Summary
protected  void constructAbstractDragAndDropController()
           
protected  void debug(java.lang.String message)
           
 void dragDropEnd(java.awt.dnd.DragSourceDropEvent event)
          Sets drag-in-progress indicator to false.
 void dragEnter(java.awt.dnd.DragSourceDragEvent event)
          Does nothing.
 void dragEnter(java.awt.dnd.DropTargetDragEvent event)
          Implemented to determine the actual drop action applicable to the drop target (assuming the drag source is valid).
 void dragExit(java.awt.dnd.DragSourceEvent event)
          Does nothing.
 void dragExit(java.awt.dnd.DropTargetEvent event)
          Does nothing.
 void dragGestureRecognized(java.awt.dnd.DragGestureEvent event)
          Sets drag-in-progress indicator to true.
 void dragOver(java.awt.dnd.DragSourceDragEvent event)
          Does nothing.
 void dragOver(java.awt.dnd.DropTargetDragEvent event)
          Does nothing.
 void drop(java.awt.dnd.DropTargetDropEvent event)
          Does nothing.
 void dropActionChanged(java.awt.dnd.DragSourceDragEvent event)
          Does nothing.
 void dropActionChanged(java.awt.dnd.DropTargetDragEvent event)
          Does nothing.
protected  int getActualDropAction()
           
 int getAllowedDragActions()
          Gets the allowed drag actions.
 int getAllowedDropActions()
          Gets the allowed drop actions.
 java.awt.Component getComponent()
          Gets the Component upon which drag and drop operations can occur.
protected  int getDefaultAllowedDragActions()
          Gets the default allowed drag actions.
protected  int getDefaultAllowedDropActions()
          Gets the default allowed drop actions.
 java.lang.Object getDragSource()
          Returns the object being dragged.
 java.lang.Object getDropTarget()
          Returns the object that would receive the dragged object if it were dropped at the current mouse position.
 boolean isDragging()
          Returns whether a drag is in progress.
 void setAllowedDragActions(int actions)
          Sets the allowed drag actions.
 void setAllowedDropActions(int actions)
          Sets the allowed drop actions.
 void setComponent(java.awt.Component component)
          Sets the Component upon which drag and drop operations can occur.
 void setDragSource(java.lang.Object source)
           
 void setDropTarget(java.lang.Object target)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDragAndDropController

protected AbstractDragAndDropController()
Since:
2.1
Method Detail

constructAbstractDragAndDropController

protected void constructAbstractDragAndDropController()
Since:
2.1

debug

protected void debug(java.lang.String message)
Since:
2.1

dragDropEnd

public void dragDropEnd(java.awt.dnd.DragSourceDropEvent event)
Sets drag-in-progress indicator to false.

Specified by:
dragDropEnd in interface java.awt.dnd.DragSourceListener
Parameters:
event - Not used
Since:
2.1

dragEnter

public void dragEnter(java.awt.dnd.DragSourceDragEvent event)
Does nothing.

Specified by:
dragEnter in interface java.awt.dnd.DragSourceListener
Since:
2.1

dragEnter

public void dragEnter(java.awt.dnd.DropTargetDragEvent event)
Implemented to determine the actual drop action applicable to the drop target (assuming the drag source is valid).

Specified by:
dragEnter in interface java.awt.dnd.DropTargetListener
Since:
2.1

dragExit

public void dragExit(java.awt.dnd.DragSourceEvent event)
Does nothing.

Specified by:
dragExit in interface java.awt.dnd.DragSourceListener
Since:
2.1

dragExit

public void dragExit(java.awt.dnd.DropTargetEvent event)
Does nothing.

Specified by:
dragExit in interface java.awt.dnd.DropTargetListener
Since:
2.1

dragGestureRecognized

public void dragGestureRecognized(java.awt.dnd.DragGestureEvent event)
Sets drag-in-progress indicator to true.

Specified by:
dragGestureRecognized in interface java.awt.dnd.DragGestureListener
Parameters:
event - Not used
Since:
2.1

dragOver

public void dragOver(java.awt.dnd.DragSourceDragEvent event)
Does nothing.

Specified by:
dragOver in interface java.awt.dnd.DragSourceListener
Since:
2.1

dragOver

public void dragOver(java.awt.dnd.DropTargetDragEvent event)
Does nothing.

Specified by:
dragOver in interface java.awt.dnd.DropTargetListener
Since:
2.1

drop

public void drop(java.awt.dnd.DropTargetDropEvent event)
Does nothing.

Specified by:
drop in interface java.awt.dnd.DropTargetListener
Since:
2.1

dropActionChanged

public void dropActionChanged(java.awt.dnd.DragSourceDragEvent event)
Does nothing.

Specified by:
dropActionChanged in interface java.awt.dnd.DragSourceListener
Since:
2.1

dropActionChanged

public void dropActionChanged(java.awt.dnd.DropTargetDragEvent event)
Does nothing.

Specified by:
dropActionChanged in interface java.awt.dnd.DropTargetListener
Since:
2.1

getActualDropAction

protected int getActualDropAction()
Since:
2.1

getAllowedDragActions

public int getAllowedDragActions()
Gets the allowed drag actions.

Specified by:
getAllowedDragActions in interface DragAndDropController
Returns:
The allowed drag actions
Since:
2.1
See Also:
DnDConstants.ACTION_COPY, DnDConstants.ACTION_MOVE, DnDConstants.ACTION_COPY_OR_MOVE

getAllowedDropActions

public int getAllowedDropActions()
Gets the allowed drop actions.

Specified by:
getAllowedDropActions in interface DragAndDropController
Returns:
The allowed drop actions
Since:
2.1
See Also:
DnDConstants.ACTION_COPY, DnDConstants.ACTION_MOVE, DnDConstants.ACTION_COPY_OR_MOVE

getComponent

public java.awt.Component getComponent()
Description copied from interface: DragAndDropController
Gets the Component upon which drag and drop operations can occur.

Specified by:
getComponent in interface DragAndDropController
Returns:
The Component upon which drag and drop operations can occur.
Since:
2.1

getDefaultAllowedDragActions

protected int getDefaultAllowedDragActions()
Gets the default allowed drag actions.

Since:
2.1

getDefaultAllowedDropActions

protected int getDefaultAllowedDropActions()
Gets the default allowed drop actions.

Since:
2.1

getDragSource

public java.lang.Object getDragSource()
Description copied from interface: DragAndDropController
Returns the object being dragged.

Specified by:
getDragSource in interface DragAndDropController
Returns:
The object being dragged
Since:
2.1

getDropTarget

public java.lang.Object getDropTarget()
Description copied from interface: DragAndDropController
Returns the object that would receive the dragged object if it were dropped at the current mouse position.

Specified by:
getDropTarget in interface DragAndDropController
Returns:
The node being dragged
Since:
2.1

isDragging

public boolean isDragging()
Returns whether a drag is in progress.

Specified by:
isDragging in interface DragAndDropController
Returns:
True if a drag is in progress
Since:
2.1

setAllowedDragActions

public void setAllowedDragActions(int actions)
Sets the allowed drag actions.

Specified by:
setAllowedDragActions in interface DragAndDropController
Parameters:
actions - The allowed drag actions
Since:
2.1
See Also:
DnDConstants.ACTION_COPY, DnDConstants.ACTION_MOVE, DnDConstants.ACTION_COPY_OR_MOVE

setAllowedDropActions

public void setAllowedDropActions(int actions)
Sets the allowed drop actions.

Specified by:
setAllowedDropActions in interface DragAndDropController
Parameters:
actions - The allowed drop actions
Since:
2.1
See Also:
DnDConstants.ACTION_COPY, DnDConstants.ACTION_MOVE, DnDConstants.ACTION_COPY_OR_MOVE

setComponent

public void setComponent(java.awt.Component component)
Sets the Component upon which drag and drop operations can occur.

Specified by:
setComponent in interface DragAndDropController
Parameters:
component - An instance of Component
Since:
2.1

setDragSource

public void setDragSource(java.lang.Object source)
Since:
2.1

setDropTarget

public void setDropTarget(java.lang.Object target)
Since:
2.1


Copyright © 2009. All Rights Reserved.