package gui;
import java.awt.geom.Ellipse2D;
import tikzmodel.TikzCircle;
public class FigureCircle extends Figure {
/**
* Create a new FigureCircle in the origin.
*/
public FigureCircle() {
this(new TikzCircle());
}
/**
* Create a FigureCircle using the given Circle object <code>c</code>.
*
* @param c
* Circle to be used for this figure.
*/
public FigureCircle(TikzCircle c) {
super(c);
}
@Override
public void updateShape() {
TikzCircle c = (TikzCircle) f;
double radius = c.getRadius().getValue();
double x = c.getCenter().getX().getValue() - radius;
double y = c.getCenter().getY().getValue() - radius;
s = new Ellipse2D.Double(x,y,2*radius,2*radius);
}
}