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

import java.awt.Image;

import CH.ifa.draw.DrawPlugin;
import CH.ifa.draw.util.Iconkit;
import de.renew.draw.ui.api.services.ImageService;

/**
 * Contains the image functionalities for the ImageService.
 * It acts as a facade by not providing the functionality itself but redirecting its calls to the {@link Iconkit} and {@link DrawPlugin}.
 */
public class ImageServiceImpl implements ImageService {
    @Override
    public Image getImage(String fileName) {
        return Iconkit.instance().getImage(fileName);
    }

    @Override
    public void registerImage(String fileName) {
        Iconkit.instance().registerImage(fileName);
    }

    @Override
    public Image loadImage(String fileName) {
        return Iconkit.instance().loadImage(fileName);
    }

    @Override
    public Image registerAndLoadImage(String fileName) {
        return Iconkit.instance().registerAndLoadImage(null, fileName);
    }

    @Override
    public Image getIconImage() {
        return DrawPlugin.getGui().getIconImage();
    }
}
