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

// $Id: WeakenTransition.java,v 1.4 2003/03/06 00:40:39 moltmans Exp $
// Time-stamp: <2000-03-11 18:59:36 moltmans>
package rec.sys;



import rec.util.*;
import java.util.*;

/**
 * Remove ONLY the widget in question (w).  Set the parent and child
 * links as if it was never there.
 */
public class WeakenTransition extends DoTransition
{
  protected Widget m_Widget;
  double m_OldStrength;
  double m_NewStrength;

  // this strength stuff as GOT to be changed, I hate the way it
  // is right now.
  public WeakenTransition( Surface s, Widget w, double new_strength )
  {
    super( s );
    m_Widget = w;
    m_OldStrength = w.getStrength();
    m_NewStrength = new_strength;
  }

  public WeakenTransition( Surface s, Widget w, Widget weaker_than )
  {
    this( s, w, weaker_than.getStrength()-1 );
  }


  /**
   * perform the transition 
   */
  public void doDo() 
  {
    // hack hack hack
//      m_Widget.weaken( m_Widget.getStrength() );
//      m_Widget.strengthen( m_NewStrength );
  }

  /**
   * undoes the transition 
   */
  public void doUndo() 
  {
    // hack hack hack
    //    m_Widget.weaken( m_Widget.getStrength() );
  }

  /**
   * get the effects of the action without performing the do 
   */
  // for now this is just a string, soon it will be an action object
  // that can be more easily reasoned about.
  public String getAction()
  {
    return( "weaken " + m_Widget + " to " + m_NewStrength );
  }

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

}

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