private void savePerformed() {
        List<String> validationErrors = getValidationErrors();
        if (validationErrors.isEmpty()) {
            if (creation) {
                figureModel.addFigure(getFigure());
                figureTableModel.fireTableRowsInserted(figureModel.getFigureCount() - 1, figureModel.getFigureCount() - 1);
            } else {
                figureModel.setFigure(indexToEdit, getFigure());
                figureTableModel.fireTableRowsUpdated(indexToEdit, indexToEdit);
            }
            setVisible(false);
            dispose();
        } else {
            StringBuilder message = new StringBuilder();
            for (String validationError : validationErrors) {
                message.append(validationError).append("\n");
            }
            JOptionPane.showMessageDialog(this, message.toString(), "Validation Problems", JOptionPane.ERROR_MESSAGE);
        }
    }