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

package rec.house;

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


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

public class WallRecognizer extends Recognizer
{

  public WallRecognizer()
  {
  }

  /////////////////////////////////////////////////////////////////////////////
  
  /**
   * Each new stroke generated gets put into the pipe here.
   *     It will remove and add objects to the 'out' target
   *     as it deems fit.
   *
   * @return a boolean if changes were made.
   */
  public boolean recognize( Surface s, Widget w )
  {
    WLine c = (WLine)w;
    Console.writeln( "Wall online" );

    Wall wall = new Wall( s, c.getHead(), c.getTail() );
    
    s.replaceWidget( c, wall );

    return true;
  }

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

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

    return( v.iterator() );
  }

  public Iterator getOutputTypes()
  {
    Vector v = new Vector();
    v.addElement( "rec.house.Wall" );

    return v.iterator();
  }
}

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