package meerkat.voting.gui.panels.cast_or_audit;

import javafx.fxml.FXML;
import javafx.scene.input.MouseEvent;
import meerkat.voting.gui.managment.TwoWayNode;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Created by Vladimir Eliezer Tokarev on 8/27/2016.
 * CastOrAuditController handle the behavior of cast or audit screen
 */
public class CastOrAuditController extends TwoWayNode {

    private final Logger logger = LoggerFactory.getLogger(CastOrAuditController.class);

    @FXML
    private void GetToVoteHaveBeenCast(MouseEvent mousePressed) {
        this.currentStage.close();
        this.currentStage.setScene(this.next.GetCurrentScene());
        this.next.UpdateNode();
        this.currentStage.show();
        this.logger.debug("Jumping to vote have been cast panel.");
    }

    @FXML
    private void GetToThankForAuditing(MouseEvent mousePressed) {
        this.currentStage.close();
        this.currentStage.setScene(this.previous.GetCurrentScene());
        this.previous.UpdateNode();
        this.currentStage.show();
        this.logger.debug("Jumping to thank for auditing panel.");
    }

    @Override
    public void UpdateNode() {
       // Maybe one of the buttons should be disabled ?
    }
}
