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

// $Id: SquiggleConsumer.java,v 1.4 2003/03/06 00:40:39 moltmans Exp $
// Time-stamp: <2000-03-11 18:59:36 moltmans>
package rec.sys;


////////////////////////////////////////////////////////////////////////////////
//
// FILE:	SquiggleConsumer.java
//
// AUTHOR:	Manoj D. Muzumdar
//		archon@ai.mit.edu
//
//              Adapted from code written by Luke Weisman
//              luke@mit.edu
//
// DATE:	September, 1998
//
// COPYRIGHT:	Massachusetts Institute of Technology
//		All rights reserved.
//
// PURPOSE:	Drawing recognition
//
// HISTORY:
//
///////////////////////////////////////////////////////////////////////////////


import java.io.*;
import java.util.*;

public class SquiggleConsumer extends Consumer
{
  public SquiggleConsumer()
  {
  }

  /////////////////////////////////////////////////////////////////////////////

  /**
   * This eats a stroke so it will not be placed on the surface.
   */
  public boolean recognize( Surface s, Widget w )
  {
    // consumes a stroke
    if( !( w instanceof Squiggle ) )
      throw new RuntimeException(
          "SquiggleConsumer got fed a non-stroke object." );

    s.removeWidget( w );

    return( true );
  }

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

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

    return( v.iterator() );
  }
}

////////////////////////////////////////////////////////////////////////////////
