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

package rec.simulate.recognizers;

// -*-Mode: Java-*- 
// SimRectRecognizer.java -- 
// Author: Christine Alvarado <calvarad@ai.mit.edu> 
// Maintainer: Christine Alvarado <calvarad@ai.mit.edu> 
// Version: 
// Created: <Mon Mar 29 16:58:39 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 SimTriangleRecognizer extends Recognizer
{
  public SimTriangleRecognizer()
  {
  }

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

  public boolean recognize( Surface s, Widget w )
  {
   
    WTriangle t = (WTriangle)w;
    
    WSimTriangle t_sim = ((SimulateSurface)s).makeSimTriangle( t );
    s.replaceWidget( t, t_sim );
    
    return ( true );
   
  }

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

    v.addElement( "rec.core.widgets.WTriangle" );
    v.addElement( "rec.core.widgets.WEquilateralTriangle" );

    return( v.iterator() );
  }

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

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

    return( v.iterator() );
  }
}
