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

////////////////////////////////////////////////////////////////////////////////
//
// FILE:	WClick.java
//
// AUTHOR:	Manoj D. Muzumdar
//		archon@ai.mit.edu
//
//              Adapted from code written by Luke Weisman
//              luke@ai.mit.edu
//
// DATE:	06-XX-98
//
// COPYRIGHT:	Massachusetts Institute of Technology
//		All rights reserved.
//
// PURPOSE:	Drawing recognition
//
// HISTORY:     11-15-98 archon
//              Now aware of new rec.geo package
//
////////////////////////////////////////////////////////////////////////////////

package rec.core.widgets;

import java.awt.*;
import rec.util.*;
import rec.geo.*;
import rec.sys.*;

public class WClick extends LocatableWidget
{
  public WClick( GPoint gp )
  {
    
    super( gp );
    setEnglishName( "Mouse Click" );
    //Console.writeln( "click created at (" + gp.getIntX() + ", "
    //                     + gp.getIntY() + ")" );

  }

  //////////////////////////////////////////////////////////////////////////////
  public void draw( Graphics g )
  {
    

    //super.draw( g );

    int x = (int)m_Point.x;
    int y = (int)m_Point.y;

    g.drawLine( x, y - 15, x, y + 15 );
    g.drawLine( x - 15, y, x + 15, y );
    
    g.setColor( Color.yellow );
    g.drawString( "C", x + 3, y - 5 );
  }

  // a click has no actions when it is elected, so it should kill itself
  public void makeDefaultSuitcase( Surface s )
  {
    m_Suitcase = new TransitionSuitcase();
    m_Suitcase.addTransition( new DieTransition( s, this ) ); 
  }

}

