public static FigureEditorDialog buildCreateFigureDialog(JFrame frame, FigureModel figureModel, FigureTableModel figureTableModel, FigureType figureType) {
        switch (figureType) {
            case RECTANGLE:
                return new RectangleEditorDialog(frame, figureModel, figureTableModel, true, new Rectangle(), -1);
            case OVAL:
                return new OvalEditorDialog(frame, figureModel, figureTableModel, true, new Oval(), -1);
            default:
                throw new IllegalArgumentException();
        }
    }