001package jmri.jmrit.display.controlPanelEditor.shape;
002
003import java.awt.Rectangle;
004import java.awt.geom.Ellipse2D;
005import jmri.jmrit.display.Editor;
006
007/**
008 * @author Pete Cressman Copyright (c) 2012
009 */
010public class DrawEllipse extends DrawRectangle {
011
012    public DrawEllipse(String which, String title, PositionableShape ps, Editor ed, boolean create) {
013        super(which, title, ps, ed, create);
014    }
015
016    @Override
017    protected PositionableShape makeFigure(Rectangle r, Editor ed) {
018        if (r != null) {
019            _width = r.width;
020            _height = r.height;
021            Ellipse2D.Double rr = new Ellipse2D.Double(0, 0, _width, _height);
022            _shape = new PositionableEllipse(ed, rr);
023        }
024        return _shape;
025    }
026}