00001 package edu.ksu.cis.bandera.pdgslicer.dependency;
00002
00003 import javax.swing.*;
00004 import javax.swing.tree.*;
00005 import javax.swing.plaf.TreeUI;
00006 import java.awt.*;
00007 import java.awt.dnd.*;
00008 import java.awt.datatransfer.*;
00009 import java.io.IOException;
00010 public abstract class DraggableTree extends JTree implements DragGestureListener {
00011 static Transferable currentDraggingTreeNode;
00012 static boolean draggingTreeNode;
00013 DragSource dragSource = DragSource.getDefaultDragSource();
00014 DragSourceListener dragSourceListener = new MyDragSourceListener();
00015 class MyDragSourceListener implements DragSourceListener {
00016 public void dragDropEnd(DragSourceDropEvent DragSourceDropEvent) {
00017
00018
00019 draggingTreeNode = false;
00020 }
00021 public void dragEnter(DragSourceDragEvent DragSourceDragEvent) {
00022
00023 }
00024 public void dragExit(DragSourceEvent DragSourceEvent) {
00025
00026
00027 draggingTreeNode=false;
00028 }
00029 public void dragOver(DragSourceDragEvent DragSourceDragEvent) {
00030
00031 }
00032 public void dropActionChanged(DragSourceDragEvent DragSourceDragEvent) {
00033
00034 }
00035 }
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052 public DraggableTree () {
00053 dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY_OR_MOVE, this);
00054 }
00055 public DraggableTree (TreeModel model) {
00056 super (model);
00057 dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY_OR_MOVE, this);
00058 }
00059
00060
00061 public abstract void dragGestureRecognized(DragGestureEvent dragGestureEvent)
00062 ;
00063 }