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

// -*-Mode: Java-*- 
// $Id: WMotionArrow.java,v 1.2 2003/03/06 00:40:43 moltmans Exp $
// WMotionArrow.java -- 
// Author: Michael Oltmans <moltmans@ai.mit.edu> 
// Created: <Thu May 11 15:47:12 2000> 
// Time-stamp: <2000-05-12 16:17:43 moltmans> 
package rec.annotate.widgets;

import java.awt.Graphics;
import rec.util.*;
import rec.sys.*;
import rec.core.widgets.*;
//import rec.simulate.widgets.*;
//import rec.annotate.*;
import rec.annotate.rules.*;

/**
 * This represents the motion that a body makes as part of its
 * behavior.
 **/
public class WMotionArrow extends WSquiggleArrow
{
  private Arrow m_arrowFact;

  public WMotionArrow( Surface s, WSquiggleArrow arrow ) 
  {
    super( arrow );
    setDefaultColor( "path", "annotation" );
    m_arrowFact = new Arrow( s, this );
  }
  
  public void makeDefaultSuitcase( Surface s )
  {
    DoTransition dt = new DoTransition(s) {
      public void doDo( )
      {
	Notebook book = m_Surface.getNotebook();
	book.assume( m_arrowFact, "WMotionArrow recognized" );
	book.updateNotes();
      }

      public void doUndo( )
      {
	Notebook book = m_Surface.getNotebook();
	book.retract( m_arrowFact, "WMotionArrow recognized" );
	book.updateNotes();
      }

      public String getAction( )
      {
	return "WMotionArrow: " + m_arrowFact;
      }
    };
    super.makeDefaultSuitcase( s );
    addToSuitcase( dt );
  }
}


