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

// -*-Mode: Java-*- 
// WMSquare.java -- 
// Author: Christine Alvarado <calvarad@ai.mit.edu> 
// Maintainer: Christine Alvarado <calvarad@ai.mit.edu> 
// Version: 
// Created: <Wed Mar 10 19:09:22 1999> 
// Time-stamp: <1999-11-08 21:23:45 calvarad> 
// Keywords: 
package rec.simulate.widgets.wm;

import java.awt.*;
import java.io.*;  //????
import rec.util.*;
import rec.geo.*;
import rec.sys.*;
import rec.core.widgets.*;
import java.math.*;
import rec.simulate.*;
import rec.simulate.widgets.*;

// class used when an interface to Working Model is desired.
// this is a rectangle, but for working model we must convert it to 
// a polygon if it is not stright up and down.  For now assume all 
// rectangles that we get at WM rectangles and deal with the rest later.
public class WMSimCircle extends WSimCircle
{

  public WMSimCircle( WCircle c )
  {
    super( c );
  }

  public String load( WMSimulatorRegistryBase reg ) 
  {
    GPoint newCenter = reg.convert( getLocation().getCenter() );
    double newRad = reg.convert( m_Radius );
    String output;
    
    Console.writeln( "loading circle" );
    Console.writeln( "Circle is at " + newCenter );
    
    output = "Dim " + m_Name + " as WMBody\n";
    
    output += "center.X = " + newCenter.x + " : center.Y = " + 
      newCenter.y + "\n";
    output += "Set " + m_Name + " = Draw_Circle( " + newRad +
      ", center )\n";

    return output;

  }

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

}
