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

TransferableSliceVariable.java

00001 package edu.ksu.cis.bandera.pdgslicer.dependency;
00002 
00003 import javax.swing.tree.*;
00004 import java.awt.dnd.*;
00005 import java.awt.datatransfer.*;
00006 import java.io.*;
00007 import edu.ksu.cis.bandera.pdgslicer.datastructure.*;
00008 
00009 public class TransferableSliceVariable extends SliceVariable implements Transferable {
00010   final static int SLICE_VARIABLE = 0;
00011 
00012 
00013 
00014   final public static DataFlavor SLICE_VARIABLE_FLAVOR = 
00015     new DataFlavor(SliceVariable.class, "Slice Variable");
00016 
00017   static DataFlavor flavors[] = {SLICE_VARIABLE_FLAVOR};
00018   //, DataFlavor.stringFlavor, DataFlavor.plainTextFlavor};
00019 //  static DataFlavor flavors[] = {DEFAULT_MUTABLE_TREENODE_FLAVOR}; // works fine
00020 
00021   private SliceVariable data;
00022                            
00023   public TransferableSliceVariable(SliceVariable data) {
00024     this.data = data;
00025   }  
00026 public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException {
00027     //Object returnObject;
00028     if (isDataFlavorSupported(flavor))
00029         return this.data;
00030     return null;
00031 }
00032   public DataFlavor[] getTransferDataFlavors() {
00033    return flavors;
00034   }  
00035 public boolean isDataFlavorSupported(DataFlavor flavor) {
00036     boolean returnValue = false;
00037     for (int i = 0, n = flavors.length; i < n; i++) {
00038         if (flavor.equals(flavors[i])) {
00039             returnValue = true;
00040             break;
00041         }
00042     }
00043     return returnValue;
00044 }
00045 /**
00046  * Insert the method's description here.
00047  * Creation date: (00-11-21 10:24:54)
00048  * @return java.lang.String
00049  */
00050 public String toString() {
00051     return data.toString();
00052 }
00053 }

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