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

package rec.simulate.recognizers;

// -*-Mode: Java-*- 
// SimSpringRecognizer.java -- 
// Author: Christine Alvarado <calvarad@ai.mit.edu> 
// Maintainer: Christine Alvarado <calvarad@ai.mit.edu> 
// Version: 
// Created: <Sat Apr 17 17:58:18 1999> 
// Time-stamp: <> 
// Keywords: 

import java.util.*;
import java.awt.*;
import rec.util.*;
import rec.sys.*;
import rec.core.widgets.*;
import rec.simulate.*;
import rec.simulate.widgets.*;

public class SimRodRecognizer extends Recognizer
{
  public SimRodRecognizer()
  {
  }

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

  public boolean recognize( Surface s, Widget w )
  {
    WSimRod rod = ((SimulateSurface)s).makeSimRod( (WLine)w );
    
    s.replaceWidget( w, rod );
    

    return true;
  }

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

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

    return( v.iterator() );
  }

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

    v.addElement( "rec.simulate.widgets.WSimRod" );

    return( v.iterator() );
  }
}
