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

// -*-Mode: Java-*- 
// $Id: Arrow.java,v 1.2 2003/03/06 00:40:43 moltmans Exp $
// Arrow.java -- 
// Author: Michael Oltmans <moltmans@ai.mit.edu> 
// Created: <Wed May 10 15:49:49 2000> 
// Time-stamp: <2000-05-12 17:41:02 moltmans> 
package rec.annotate.rules;

import java.util.*;
import rec.annotate.*;
import rec.util.*;
import rec.sys.*;
import rec.annotate.widgets.*;
import rec.simulate.widgets.*;
import rec.tms.*;
//import rec.core.widgets.*;

/**
 * This class is for storing information about arrows (paths).
 * Actulaly it is just a wrapper for wsquiggle arrows, but hey, who
 * cares?
 **/
public class Arrow implements Annotation
{
  protected Surface m_surface;
  protected WMotionArrow m_arrow;

  public Arrow( Surface s, WMotionArrow arrow )
  {
    Assert.notNull( arrow,
		    "Cannot make Arrow with null WMotionArrow" );
    m_surface = s;
    m_arrow = arrow;
  }

  public WMotionArrow getArrow()
  {
    return m_arrow;
  }

  public String getFactType() 
  {
    return Type.ARROW;
  }

  public boolean sameFact( Fact fact ) 
  {
    if( fact instanceof Arrow ) {
      Arrow arrow = (Arrow)fact;
      return m_arrow.equals( arrow.m_arrow );
    }
    return false;
  }

  public String toString() 
  {
    return "<Arrow: [" + Console.stripPackaging( m_arrow ) + "]>";
  }
}
