1 package com.opensymphony.workflow.designer.dnd; 2 3 import java.awt.dnd.DragGestureEvent ; 4 import java.awt.dnd.DragGestureListener ; 5 import java.awt.dnd.DragSource ; 6 import java.awt.dnd.DragSourceDragEvent ; 7 import java.awt.dnd.DragSourceDropEvent ; 8 import java.awt.dnd.DragSourceEvent ; 9 import java.awt.dnd.DragSourceListener ; 10 11 15 public class TypeDragGesture implements DragGestureListener , DragSourceListener 16 { 17 18 private DragSource ds; 19 private DragData type; 20 21 public TypeDragGesture(DragSource ds, DragData type) 22 { 23 this.ds = ds; 24 this.type = type; 25 } 26 27 DragDataTransferable transferable; 28 29 public void dragGestureRecognized(DragGestureEvent dge) 30 { 31 32 transferable = new DragDataTransferable(type); 33 34 ds.startDrag(dge, DragSource.DefaultCopyDrop, transferable, this); 35 } 36 37 public void dragEnter(DragSourceDragEvent dsde) 38 { 39 40 } 41 42 public void dragOver(DragSourceDragEvent dsde) 43 { 44 45 } 46 47 public void dropActionChanged(DragSourceDragEvent dsde) 48 { 49 50 } 51 52 public void dragDropEnd(DragSourceDropEvent dsde) 53 { 54 if(dsde.getDropSuccess()) 55 { 56 } 58 else 59 { 60 } 62 } 63 64 public void dragExit(DragSourceEvent dse) 65 { 66 } 67 68 } 69 | Popular Tags |