net.iharder.dnd.DnDList Class Reference

List of all members.

Detailed Description

An extension of javax.swing.JList that supports drag and drop to rearrange its contents and to move objects in and out of the list.

The objects in the list will be passed either as a String by calling the object's toString() object, or if your drag and drop target accepts the TransferableObject.DATA_FLAVOR data flavor then the actual object will be passed.

I'm releasing this code into the Public Domain. Enjoy.

Original author: Robert Harder, rharder@usa.net

Author:
Robert Harder

rharder@usa.net

Version:
1.1


Public Member Functions

 DnDList ()
 Constructs a default DnDList using a javax.swing.DefaultListModel.
 DnDList (java.util.Vector data)
 Constructs a DnDList by filling in a javax.swing.DefaultListModel with the passed java.util.Vector of objects.
 DnDList (javax.swing.DefaultListModel model)
 Constructs a DnDList using the passed list model that must be extended from javax.swing.DefaultListModel.
 DnDList (Object[] data)
 Constructs a DnDList by filling in a javax.swing.DefaultListModel with the passed array of objects.
void dragDropEnd (java.awt.dnd.DragSourceDropEvent evt)
void dragEnter (java.awt.dnd.DragSourceDragEvent evt)
void dragEnter (java.awt.dnd.DropTargetDragEvent evt)
void dragExit (java.awt.dnd.DragSourceEvent evt)
void dragExit (java.awt.dnd.DropTargetEvent evt)
void dragGestureRecognized (java.awt.dnd.DragGestureEvent event)
 (non-Javadoc)
void dragOver (java.awt.dnd.DragSourceDragEvent evt)
void dragOver (java.awt.dnd.DropTargetDragEvent evt)
void drop (java.awt.dnd.DropTargetDropEvent evt)
void dropActionChanged (java.awt.dnd.DragSourceDragEvent evt)
void dropActionChanged (java.awt.dnd.DropTargetDragEvent evt)

Private Member Functions

void initComponents ()

Private Attributes

java.awt.dnd.DragSource dragSource = null
int sourceIndex = -1

Static Private Attributes

static final long serialVersionUID = 4590546834426010393L
 Prevent serialization collisons.


Constructor & Destructor Documentation

net.iharder.dnd.DnDList.DnDList (  ) 

Constructs a default DnDList using a javax.swing.DefaultListModel.

Since:
1.1

net.iharder.dnd.DnDList.DnDList ( java.util.Vector  data  ) 

Constructs a DnDList by filling in a javax.swing.DefaultListModel with the passed java.util.Vector of objects.

Parameters:
data The data from which to construct a list
Since:
1.1

net.iharder.dnd.DnDList.DnDList ( javax.swing.DefaultListModel  model  ) 

Constructs a DnDList using the passed list model that must be extended from javax.swing.DefaultListModel.

Parameters:
model The model to use
Since:
1.1

net.iharder.dnd.DnDList.DnDList ( Object[]  data  ) 

Constructs a DnDList by filling in a javax.swing.DefaultListModel with the passed array of objects.

Parameters:
data The data from which to construct a list
Since:
1.1


Member Function Documentation

void net.iharder.dnd.DnDList.dragGestureRecognized ( java.awt.dnd.DragGestureEvent  event  ) 

(non-Javadoc)

See also:
java.awt.dnd.DragGestureListener.dragGestureRecognized(java.awt.dnd.DragGestureEvent)

This will be called when the transfer data is requested at the very end. At this point we can remove the object from its original place in the list.


Member Data Documentation

final long net.iharder.dnd.DnDList.serialVersionUID = 4590546834426010393L [static, private]

Prevent serialization collisons.


The documentation for this class was generated from the following file:
Generated on Wed Aug 8 17:02:59 2007 for CALO by  doxygen 1.5.2