Package gui

Source Code of gui.FigureCircle

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);
  }
TOP

Related Classes of gui.FigureCircle

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.