Main Page   Packages   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

DraggableMethodTree.java

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 /**
00011  * Insert the type's description here.
00012  * Creation date: (00-11-16 14:21:59)
00013  * @author: 
00014  */
00015 public class DraggableMethodTree extends DraggableTree {
00016 
00017 /**
00018  * MethodTree constructor comment.
00019  */
00020 public DraggableMethodTree() {
00021     super();
00022 }
00023 /**
00024  * MethodTree constructor comment.
00025  * @param model javax.swing.tree.TreeModel
00026  */
00027 public DraggableMethodTree(javax.swing.tree.TreeModel model) {
00028     super(model);
00029 }
00030 // DragGestureListener
00031 
00032 public void dragGestureRecognized(DragGestureEvent dragGestureEvent) {
00033     TreePath path = getSelectionPath();
00034     if (path == null) {
00035         // Nothing selected, nothing to drag
00036         currentDraggingTreeNode = null;
00037         draggingTreeNode = false;
00038         System.out.println("Nothing selected - beep");
00039         getToolkit().beep();
00040     } else {
00041         DefaultMutableTreeNode selection = (DefaultMutableTreeNode) path.getLastPathComponent();
00042         currentDraggingTreeNode = new TransferableTreeNode(selection);
00043         draggingTreeNode = true;
00044         dragSource.startDrag(dragGestureEvent, DragSource.DefaultCopyDrop, currentDraggingTreeNode, DraggableMethodTree.this.dragSourceListener);
00045     }
00046 }
00047 }

Generated at Thu Feb 7 06:44:38 2002 for Bandera by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001