/**
* enables this component to be a dropTarget
*/
DropTarget dropTarget = null;
/**
* enables this component to be a Drag Source
*/
DragSource dragSource = null;
boolean acceptDrop = true;
private [[#variablef351560]][] selection1;
private [[#variablef351560]][] selection2;
int index = -1;
private boolean dndAction = false;
// Where, in the drag image, the mouse was clicked
public [[#variablef3514e0]]() {
super();
addListSelectionListener(this );
dropTarget = new DropTarget(this, this );
dragSource = DragSource.getDefaultDragSource();
if (acceptDrop == true) {
dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY_OR_MOVE, this );
}
else {
dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY, this );
}
}
public [[#variablef3514e0]]( [[#variablef351480]] model) {
super(model);
addListSelectionListener(this );
dropTarget = new DropTarget(this, this );
dragSource = new DragSource();
if (acceptDrop == true) {
dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY_OR_MOVE, this );
}
else {
dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY, this );
}
}
public void setAcceptDrop(boolean b) {
acceptDrop = b;
}
/**
* is invoked when you are dragging over the DropSite
*
*/
public void dragEnter(DropTargetDragEvent event) {
// debug messages for diagnostics
if (acceptDrop == true) {
event.acceptDrag(DnDConstants.ACTION_COPY_OR_MOVE);
}
else {
event.acceptDrag(DnDConstants.ACTION_COPY);
}
}
/**
* is invoked when you are exit the DropSite without dropping
*
*/
public void dragExit(DropTargetEvent event) {
}
/**
* is invoked when a drag operation is going on
*
*/
public void dragOver(DropTargetDragEvent event) {
}
|