package de.renew.draw.ui.impl.services;

import java.util.Vector;

import CH.ifa.draw.standard.FigureException;
import de.renew.draw.storables.ontology.Drawing;
import de.renew.draw.storables.ontology.Figure;
import de.renew.draw.ui.api.services.ErrorService;
import de.renew.draw.ui.ontology.ErrorState;

/**
 * Contains the functionalities for the ErrorService.
 *
 * It acts as a facade by not providing the functionality itself but redirecting its calls to
 * {@link FigureException}.
 */
public class ErrorServiceImpl implements ErrorService {

    @Override
    public ErrorState createErrorState(
        String title, String message, Drawing drawing, Figure offendingFigure)
    {
        return new FigureException(title, message, drawing, offendingFigure);
    }

    @Override
    public ErrorState createErrorState(
        String title, String message, Drawing drawing, Vector<? extends Figure> offendingFigures)
    {
        return new FigureException(title, message, drawing, offendingFigures);
    }

    @Override
    public ErrorState createErrorState(
        String message, int line, int column, Drawing drawing, Figure specificErrorFigure,
        Vector<Figure> errorFigures, Object problemSpecificInformation)
    {
        return new FigureException(
            message, line, column, drawing, specificErrorFigure, errorFigures,
            problemSpecificInformation);
    }

    @Override
    public ErrorState createErrorState(
        String message, int line, int column, Drawing drawing, Figure specificErrorFigure,
        Object problemSpecificInformation)
    {
        return new FigureException(
            message, line, column, drawing, specificErrorFigure, problemSpecificInformation);
    }
}
