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

// -*-Mode: Java-*- 
// $Id: AnnotationReasoner.java,v 1.5 2003/03/06 00:40:49 moltmans Exp $
// AnnotationReasoner.java -- 
// Author: Michael Oltmans <moltmans@ai.mit.edu> 
// Created: <Thu Feb 17 08:27:24 2000> 
// Time-stamp: <2000-06-18 23:57:17 moltmans> 
package rec.annotate.reasoners;

import java.io.*;
import java.util.*;
import rec.util.*;
import rec.sys.*;
import rec.annotate.widgets.*;

/**
 * Annotations are better than everything else :-)
 **/
public class AnnotationReasoner extends Reasoner 
{
  private static Vector m_Strong = new Vector();
  private static Vector m_Weak = new Vector();

  static 
  {
    m_Strong.addElement( "rec.annotate.widgets.WMotionArrow" );
    m_Strong.addElement( "rec.annotate.widgets.WSentence" );
    m_Strong.addElement( "rec.annotate.widgets.WPoint" );
    m_Weak.addElement( "rec.sys.WUtterance" );
    m_Weak.addElement( "rec.sys.VisibleWidget" );
    m_Weak.addElement( "rec.core.widgets.WClick" );
  }

  public Iterator getStrongerTypes()
  {
    return m_Strong.iterator();
  }

  public Iterator getWeakerTypes()
  {
    return m_Weak.iterator();
  }

  /** This doesn't apply if weaker is a WMotionArrow. **/
  public boolean match( Surface s, Widget stronger, Widget weaker )
  {
    // doesn't apply to visible widget annotations
    if ( (weaker instanceof WMotionArrow) ||
	 (weaker instanceof WPoint) )
    {
      return false;
    }
    else {
      return true;
    }
  }

  /** Describe the rule **/
  public String summary()
  {
    return "AnnotationReasoner: (Annotations > others)";
  }
}
