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

// $Id: LocatableWidget.java,v 1.7 2003/03/06 00:40:40 moltmans Exp $
// Time-stamp: <2000-03-22 13:49:18 moltmans>
package rec.sys;


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


public abstract class LocatableWidget extends SpatialWidget
{

  protected GPoint m_Point;

  public LocatableWidget( GPoint p ) 
  {
    m_Point = new GPoint( p );
  }

  public double size() 
  {
    return 0.0;
  }

  public void resize( double scaleFactor )
  {
  }

  public void move( GPoint gp )
  {
    m_Point = new GPoint( gp );
  }

  /**
   * @param p      The point of rotation.
   * @param angle  The angle to be rotated in radians.
   */
  public void rotate( GPoint gp, double angle )
  {
  }

  public Location getLocation()
  {
    return( new Location( m_Point ) );
  }

  public Rectangle getBounds()
  {
    return m_Point.getBounds();
  }

  public boolean includes( GPoint p, double offset )
  {
    Assert.error( "WHY ARE WE HERE?" );
    return false;
  }
  
  public boolean contains( GPoint p )
  {
    Assert.error( "WHY ARE WE HERE?" );
    return false;
  }

  // should override
  protected void makeDefaultSuitcase( Surface s )
  {
  }

  public void draw( Graphics g )
  {
    Assert.error( "must define a draw function for a widget to be drawn" );
  }
  

}
