package Common.Visual.Windows;
import Common.Passes.Pass;
import Common.Utils.Utils_;
import Common.Visual.Windows.Dialog.Dialog;

import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
public class PassForm extends Dialog<Pass, PassFields> {
    public PassForm(Pass pass_in) {
        super(PassFields.class);
        Result = pass_in;
        addWindowListener(new WindowAdapter() {
            @Override
            public void windowOpened(WindowEvent e) {
                Result.animation_sem.release();
            }
        });
    }
    public boolean ShowDialog() {
        return super.ShowDialog("");
    }
    @Override
    public int getDefaultWidth() {
        return 600;
    }
    @Override
    public int getDefaultHeight() {
        return 250;
    }
    //кнопок нет
    @Override
    public void CreateButtons() {
    }
    @Override
    protected void onCancel() {
        try {
            Result.Interrupt();
        } catch (Exception e) {
            Utils_.MainLog.PrintException(e);
        }
    }
    @Override
    public String getTitleText() {
        return Result.getDescription();
    }
}
