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

package rec.fun;

import java.util.*;
import java.awt.*;
import rec.util.*;
import rec.geo.*;
import rec.sys.*;

public class GridFinder extends Recognizer
{


  public GridFinder()
  {
  }


  public boolean recognize( Surface s, Widget w )
  {

    if ( !( w instanceof Grid ) )
      {
	Grid g = new Grid( s, (Squiggle)w );
    	s.addWidget( g );
	s.shuffleToBottom( g );

	return true;
      }

    return false;
  }

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

    v.addElement( "rec.sys.Squiggle" );

    return( v.iterator() );
  }

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

    v.addElement( "rec.fun.Grid" );

    return( v.iterator() );
  }
}


