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

package rec.core.widgets;

import java.awt.*;
import java.awt.geom.*;
import rec.util.*;
import rec.geo.*;
import rec.sys.*;
import edu.mit.sketch.geom.Arc;
import edu.mit.sketch.geom.Point;

public class WToolkitArc extends VisibleWidget
{
    private GToolkitArc m_Arc;

    public WToolkitArc (Arc arc)
    {
	setEnglishName( "Arc" );
	GToolkitArc newArc;
	newArc= new GToolkitArc(arc);
	m_Arc = newArc; 
    }

    public WToolkitArc( GToolkitArc arc )
    {
	setEnglishName( "Arc" );
	m_Arc = arc;
    }

    public GToolkitArc getArc(){
	return m_Arc;
    }
         
    public GPoint getHeadPoint(){
	return m_Arc.getHead();
    }
    
    public GPoint getTailPoint(){
	return m_Arc.getTail();
    }

    public boolean getClockwise(){
	return m_Arc.getClockwise();
    }

    public void draw( Graphics g )
    {
	m_Arc.display( g );
    }
    
    public boolean includes( GPoint gp, double offset )
    {
	boolean returnme = m_Arc.includes(gp, offset );
	
	return returnme;
    }
    
    public boolean contains( GPoint gp )
    {
	//System.out.println("CONTAINS");
	return( m_Arc.contains( gp ) );
    }

    public void move( GPoint gp )
    {
	double xtran = gp.x - getLocation().getCenter().x;
	double ytran = gp.y - getLocation().getCenter().y;

	m_Arc.translate(xtran,ytran);
	
    }
    
    public void translate( GPoint gp )
    {
	m_Arc.translate( gp.x, gp.y );
    }
    
    public void rotate( GPoint gp, double angle )
    {
	m_Arc.rotate(gp, angle);
    }
    
    public Location getLocation()
    {
	return( new Location( m_Arc.getBounds() ) );
    }
    
    public Rectangle getBounds()
    {
	return( m_Arc.getBounds() );
    }
    
    public Object clone()
    {
	return( new WToolkitArc( m_Arc ) );
    }
    
    public double size()
    {
	//System.out.println("ARC - size");
	return 0;
    }
    
    public void resize( double scaleFactor )
    {
	m_Arc.resize(scaleFactor);
    }
}
