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

package rec.simulate.recognizers;

// -*-Mode: Java-*- 
// ForceRecognizer.java -- 
// Author: Christine Alvarado <calvarad@ai.mit.edu> 
// Maintainer: Christine Alvarado <calvarad@ai.mit.edu> 
// Version: 
// Created: <Thu May 20 13:29:19 1999> 
// Time-stamp: <> 
// Keywords: 

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

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

  public boolean recognize( Surface s, Widget w )
  {
    WMForce f = (WMForce)w;
    
    WSimForce f_sim = ((SimulateSurface)s).makeSimForce( f );

    // since a force is a constraint, we will check for attachments later.
    s.replaceWidget( f, f_sim );
    return true;
    
    
    
  }

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

    v.addElement( "rec.meche.WMForce" );

    return( v.iterator() );
  }

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

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

    return( v.iterator() );
  }
}
