//import java.awt.datatransfer.*;

package graphbrowser;

import jowgraphservice.*;
import graph.*;

import java.util.*;

public class MyClipBoard {
  public Object data=null;

  /*
  public final static int COPY=0;
  public final static int CUT=10;

  public final static int CLONE_REFERENCE=1;
  public final static int CLONE_ONELAYER=2;
  public final static int CLONE_ONELAYER_REFERENCE=4;

  public final static int CLONE_RECURSION=3;
  public final static int CLONE_RECURSION_REFERENCE=5;
  */
  private int mode=0;

  public void setContents(Object trans,Object owner,int mode) {
    // change owner
    this.data=trans;
    this.mode=mode;
    GraphWindow gw=null;
    GraphApplet ga=null;
    if (owner instanceof GraphPanel) {
        gw = ( (GraphPanel) owner).graphWindow;
        ga = gw.source;
    // change the Edit Paste mode
    /*    if (trans instanceof Node) {
            Node node=(Node) trans;
            MIME_Type mt=node.getContentType();
            if (mt==null) return;
            if (mt.getType()==MIME_Type.GRAPH) {
                // Node content is graph
                for ( Enumeration e1= ga.WindowList.elements(); e1.hasMoreElements() ;) {
                  System.out.println("window enumeration");
                  ((GraphWindow) e1.nextElement()).setPasteMenu(true);
                }
             }
               else {
                //Node content is non-graph
                for ( Enumeration e2= ga.WindowList.elements(); e2.hasMoreElements() ;) {
                  ( (GraphWindow) e2.nextElement()).setPasteMenu(false);
                }
                }
        }
     */

        // enable or disable all the other menu
     }

  }

  public Object getContents(Object owner) {
    return data;
  }

  public int getMode(){
    return mode;
  }
}

