package Action;

import Window.Interface;

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

public class ActionQuit extends AbstractAction {

    public ActionQuit(String text, String desc, Integer mnemonic) {
        super(text);
        putValue(SHORT_DESCRIPTION, desc);
        putValue(MNEMONIC_KEY, mnemonic);
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        Interface.getInstance().dispatchEvent(new WindowEvent(Interface.getInstance(), WindowEvent.WINDOW_CLOSING));
    }
}