Package gui

Source Code of gui.FigureRectangle

package gui;

import java.awt.geom.Rectangle2D;
import tikzmodel.TikzRectangle;

public class FigureRectangle extends Figure {

  public FigureRectangle(TikzRectangle rect) {
    super(rect);
  }

  @Override
  public void updateShape() {   
    TikzRectangle rect = (TikzRectangle) f;

    double x    = rect.getOrigin().getX().getValue();
    double y    = rect.getOrigin().getY().getValue();
    double width  = rect.getSize().getX().getValue()-x;
    double height  = rect.getSize().getY().getValue()-y;
    s = new Rectangle2D.Double(x, y, width, height);
  }

}
TOP

Related Classes of gui.FigureRectangle

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.