// (c) MIT 2003.  All rights reserved.

package rec.fsm;

///////////////////////////////////////////////////////////////////////////////
//
// FILE:	EdgeDescriber.java
//
// AUTHOR:      Luke Weisman
//              luke@ai.mit.edu
//
// DATE:	June, 1998
//
// COPYRIGHT:	Massachusetts Institute of Technology
//		All rights reserved.
//
//
///////////////////////////////////////////////////////////////////////////////


import java.util.*;
import rec.util.*;
import rec.sys.*;
import rec.core.*;

public class EdgeDescriber extends Aligner
{

  public EdgeDescriber()
  {
  }


  public boolean recognize( Surface s, Widget w )
  {
    Edge n = null;

    // somehow get the node to remove
    Widget ta = ( (WSelection)w ).getWidget();
    if ( ta instanceof rec.fsm.Edge )
      {
	n = (Edge)ta;
	System.err.println( "Here is edge: " );
	System.err.println( "ed: " + ta );
	System.err.println( "ed- head node: " + n.getNode(true) );
	System.err.println( "ed- tail node: " + n.getNode(false) );

	s.removeWidget( w );

	return true;
      }

    return false;
  }


  public Iterator getInputTypes()
  {
    Vector v = new Vector();

    v.addElement( "rec.core.WSelection" );

    return( v.iterator() );
  }

  public Iterator getOutputTypes()
  {
    Vector v = new Vector();
    v.addElement( "rec.fsm.Edge" );

    return v.iterator();
  }
  
}


