package Action;

import IHM.WorkingImage;
import Window.Interface;

import javax.swing.*;
import java.awt.event.ActionEvent;

public class ActionRedo extends AbstractAction {

    public ActionRedo(String name, String desc, Integer mnemonic) {
        super(name);
        putValue(SHORT_DESCRIPTION, desc);
        putValue(Action.MNEMONIC_KEY, mnemonic);
        if (WorkingImage.getInstance().getImages().size() == 0)
            setEnabled(false);
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        WorkingImage.getInstance().redo();
        Interface.getInstance().showWindow();
    }
}