package controllers.NewTab;

import java.net.URL;
import java.util.ResourceBundle;

import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Label;
import objects.ResultsDTO;

public class EkipageController extends MainContent implements Initializable {

    @FXML Label ekipageNameLabel;
    @FXML Label avgTimeLabel;
    @FXML Label avgTimeLabelTotal;
    @FXML Label avgTimeLabelCompare;

    @FXML Label avgTimeLimit5Label;
    @FXML Label avgTimeLimit5LabelTotal;
    @FXML Label avgTimeLimit5LabelCompare;
    @FXML Label avgTimeLimit10Label;
    @FXML Label avgTimeLimit10LabelTotal;
    @FXML Label avgTimeLimit10LabelCompare;
    @FXML Label avgTimeLimit15Label;
    @FXML Label avgTimeLimit15LabelTotal;
    @FXML Label avgTimeLimit15LabelCompare;

    @FXML Label avgTimeDistanceLabel;
    @FXML Label avgTimeDistanceLabelTotal;
    @FXML Label avgTimeDistanceLabelCompare;
    @FXML Label avgTimeDistanceLimit5Label;
    @FXML Label avgTimeDistanceLimit5LabelTotal;
    @FXML Label avgTimeDistanceLimit5LabelCompare;
    @FXML Label avgTimeDistanceLimit10Label;
    @FXML Label avgTimeDistanceLimit10LabelTotal;
    @FXML Label avgTimeDistanceLimit10LabelCompare;
    @FXML Label avgTimeDistanceLimit15Label;
    @FXML Label avgTimeDistanceLimit15LabelTotal;
    @FXML Label avgTimeDistanceLimit15LabelCompare;

    @FXML Label avgPosition;
    @FXML Label avgPositionCompare;
    @FXML Label avgPositionLast5;
    @FXML Label avgPositionLast10;
    @FXML Label avgPositionLast15;
    @FXML Label avgPositionLast5Compare;
    @FXML Label avgPositionLast10Compare;
    @FXML Label avgPositionLast15Compare;
    @FXML Label avgPositionDistanceLast5;
    @FXML Label avgPositionDistanceLast10;
    @FXML Label avgPositionDistanceLast15;
    @FXML Label avgPositionDistanceLast5Compare;
    @FXML Label avgPositionDistanceLast10Compare;
    @FXML Label avgPositionDistanceLast15Compare;

    @FXML Label avgPositionVS;
    @FXML Label avgPositionDistanceLast5VS;
    @FXML Label avgPositionDistanceLast10VS;
    @FXML Label avgPositionDistanceLast15VS;
    @FXML Label avgPositionLast5VS;
    @FXML Label avgPositionLast10VS;
    @FXML Label avgPositionLast15VS;

    private static EkipageController controller;

    @Override
    public void initialize(URL arg0, ResourceBundle arg1) {
        controller = this;
    }

    public static EkipageController getController() {
        return controller;
    }

    public void setEkipageName(String name) {
        ekipageNameLabel.setText(name);
    }

    public void setAvgTimeLabel(String value) {
        avgTimeLabel.setText(value);

        avgTimeLabelCompare.setDisable(true);
        avgTimeLabelCompare.setOpacity(0);

        avgTimeLabelTotal.setDisable(true);
        avgTimeLabelTotal.setOpacity(0);
    }

    public void setAvgTimeLabel(ResultsDTO firstValue, Float globalAvg, ResultsDTO compareValue) {
        super.setAvgTimeLabel(avgTimeLabel, avgTimeLabelCompare, avgTimeLabelTotal, firstValue, globalAvg, compareValue);
    }

    public void setAvgTimeLimit5Label(ResultsDTO firstValue, Float globalAvg, ResultsDTO compareValue) {
        super.setAvgTimeLimit5Label(avgTimeLimit5Label,
                avgTimeLimit5LabelCompare,
                avgTimeLimit5LabelTotal,
                firstValue,
                globalAvg,
                compareValue);
    }

    public void setAvgTimeLimit10Label(ResultsDTO firstValue, Float globalAvg, ResultsDTO compareValue) {
        super.setAvgTimeLimit10Label(avgTimeLimit10Label,
                avgTimeLimit10LabelCompare,
                avgTimeLimit10LabelTotal,
                firstValue,
                globalAvg,
                compareValue);
    }

    public void setAvgTimeLimit15Label(ResultsDTO firstValue, Float globalAvg, ResultsDTO compareValue) {
        super.setAvgTimeLimit15Label(avgTimeLimit15Label,
                avgTimeLimit15LabelCompare,
                avgTimeLimit15LabelTotal,
                firstValue,
                globalAvg,
                compareValue);
    }

    public void setAvgTimeLimit5Label(ResultsDTO value) {
        avgTimeLimit5Label.setText(value.getRes() + "(" + value.getCount() + ")");

        avgTimeLimit5LabelCompare.setDisable(true);
        avgTimeLimit5LabelCompare.setOpacity(0);

        avgTimeLimit5LabelTotal.setDisable(true);
        avgTimeLimit5LabelTotal.setOpacity(0);
    }

    public void setAvgTimeLimit10Label(ResultsDTO value) {
        avgTimeLimit10Label.setText(value.getRes() + "(" + value.getCount() + ")");

        avgTimeLimit10LabelCompare.setDisable(true);
        avgTimeLimit10LabelCompare.setOpacity(0);

        avgTimeLimit10LabelTotal.setDisable(true);
        avgTimeLimit10LabelTotal.setOpacity(0);
    }

    public void setAvgTimeLimit15Label(ResultsDTO value) {
        avgTimeLimit15Label.setText(value.getRes() + "(" + value.getCount() + ")");

        avgTimeLimit15LabelCompare.setDisable(true);
        avgTimeLimit15LabelCompare.setOpacity(0);

        avgTimeLimit15LabelTotal.setDisable(true);
        avgTimeLimit15LabelTotal.setOpacity(0);
    }

    public void setAvgTimeDistanceLimit5Label(String value) {
        avgTimeDistanceLimit5Label.setText(value);

        avgTimeDistanceLimit5LabelCompare.setDisable(true);
        avgTimeDistanceLimit5LabelCompare.setOpacity(0);

        avgTimeDistanceLimit5LabelTotal.setDisable(true);
        avgTimeDistanceLimit5LabelTotal.setOpacity(0);
    }

    public void setAvgTimeDistanceLabel(String value) {
        avgTimeDistanceLabel.setText(value);
        avgTimeDistanceLabelCompare.setDisable(true);
        avgTimeDistanceLabelCompare.setOpacity(0);

        avgTimeDistanceLabelTotal.setDisable(true);
        avgTimeDistanceLabelTotal.setOpacity(0);
    }

    public void setAvgTimeDistance5LabelWithCompare(ResultsDTO firstValue, Float globalAvg, ResultsDTO compareValue) {
        super.setAvgTimeDistance5LabelWithCompare(avgTimeDistanceLimit5Label,
                avgTimeDistanceLimit5LabelCompare,
                avgTimeDistanceLimit5LabelTotal,
                firstValue,
                globalAvg,
                compareValue);
    }

    public void setAvgTimeDistanceLabel(ResultsDTO firstValue, Float globalAvg, ResultsDTO compareValue) {
        super.setAvgTimeDistanceLabel(avgTimeDistanceLabel,
                avgTimeDistanceLabelCompare,
                avgTimeDistanceLabelTotal,
                firstValue,
                globalAvg,
                compareValue);
    }

    public void setAvgTimeDistanceLimit10Label(String value) {
        avgTimeDistanceLimit10Label.setText(value);

        avgTimeDistanceLimit10LabelCompare.setDisable(true);
        avgTimeDistanceLimit10LabelCompare.setOpacity(0);

        avgTimeDistanceLimit10LabelTotal.setDisable(true);
        avgTimeDistanceLimit10LabelTotal.setOpacity(0);
    }

    public void setAvgTimeDistanceLimit10Label(ResultsDTO firstValue, Float globalAvg, ResultsDTO compareValue) {
        super.setAvgTimeDistanceLimit10Label(avgTimeDistanceLimit10Label,
                avgTimeDistanceLimit10LabelCompare,
                avgTimeDistanceLimit10LabelTotal,
                firstValue,
                globalAvg,
                compareValue);
    }

    public void setAvgTimeDistanceLimit15Label(String value) {
        avgTimeDistanceLimit15Label.setText(value);

        avgTimeDistanceLimit15LabelCompare.setDisable(true);
        avgTimeDistanceLimit15LabelCompare.setOpacity(0);

        avgTimeDistanceLimit15LabelTotal.setDisable(true);
        avgTimeDistanceLimit15LabelTotal.setOpacity(0);
    }

    public void setAvgTimeDistanceLimit15Label(ResultsDTO firstValue, Float globalAvg, ResultsDTO compareValue) {
        super.setAvgTimeDistanceLimit15Label(avgTimeDistanceLimit15Label,
                avgTimeDistanceLimit15LabelCompare,
                avgTimeDistanceLimit15LabelTotal,
                firstValue,
                globalAvg,
                compareValue);
    }

    public void setAvgPosition(String value) {
        avgPosition.setText(value);

        avgPositionCompare.setDisable(true);
        avgPositionCompare.setOpacity(0);

        avgPositionVS.setDisable(true);
        avgPositionVS.setOpacity(0);
    }

    public void setAvgPosition(ResultsDTO firstValue, ResultsDTO compareValue) {
        super.setAvgPosition(avgPosition, avgPositionCompare, avgPositionVS, firstValue, compareValue);
    }

    public void setAvgPositionLast5(String value) {
        avgPositionLast5.setText(value);

        avgPositionLast5Compare.setDisable(true);
        avgPositionLast5Compare.setOpacity(0);

        avgPositionLast5VS.setDisable(true);
        avgPositionLast5VS.setOpacity(0);
    }

    public void setAvgPositionLast5(ResultsDTO firstValue, ResultsDTO compareValue) {
        super.setAvgPositionLast5(avgPositionLast5, avgPositionLast5Compare, avgPositionLast5VS, firstValue, compareValue);
    }

    public void setAvgPositionLast10(String value) {
        avgPositionLast10.setText(value);

        avgPositionLast10Compare.setDisable(true);
        avgPositionLast10Compare.setOpacity(0);

        avgPositionLast10VS.setDisable(true);
        avgPositionLast10VS.setOpacity(0);
    }

    public void setAvgPositionLast10(ResultsDTO firstValue, ResultsDTO compareValue) {
        super.setAvgPositionLast10(avgPositionLast10, avgPositionLast10Compare, avgPositionLast10VS, firstValue, compareValue);
    }

    public void setAvgPositionLast15(String value) {
        avgPositionLast15.setText(value);

        avgPositionLast15Compare.setDisable(true);
        avgPositionLast15Compare.setOpacity(0);

        avgPositionLast15VS.setDisable(true);
        avgPositionLast15VS.setOpacity(0);
    }

    public void setAvgPositionLast15(ResultsDTO firstValue, ResultsDTO compareValue) {
        super.setAvgPositionLast15(avgPositionLast15, avgPositionLast15Compare, avgPositionLast15VS, firstValue, compareValue);
    }

    public void setAvgPositionDistanceLast5(String value) {
        avgPositionDistanceLast5.setText(value);

        avgPositionDistanceLast5Compare.setDisable(true);
        avgPositionDistanceLast5Compare.setOpacity(0);

        avgPositionDistanceLast5VS.setDisable(true);
        avgPositionDistanceLast5VS.setOpacity(0);
    }

    public void setAvgPositionDistanceLast5(ResultsDTO firstValue, ResultsDTO compareValue) {
        super.setAvgPositionDistanceLast5(avgPositionDistanceLast5,
                avgPositionDistanceLast5Compare,
                avgPositionDistanceLast5VS,
                firstValue,
                compareValue);
    }

    public void setAvgPositionDistanceLast10(String value) {
        avgPositionDistanceLast10.setText(value);

        avgPositionDistanceLast10Compare.setDisable(true);
        avgPositionDistanceLast10Compare.setOpacity(0);

        avgPositionDistanceLast10VS.setDisable(true);
        avgPositionDistanceLast10VS.setOpacity(0);
    }

    public void setAvgPositionDistanceLast10(ResultsDTO firstValue, ResultsDTO compareValue) {
        super.setAvgPositionDistanceLast10(avgPositionDistanceLast10,
                avgPositionDistanceLast10Compare,
                avgPositionDistanceLast10VS,
                firstValue,
                compareValue);
    }

    public void setAvgPositionDistanceLast15(String value) {
        avgPositionDistanceLast15.setText(value);

        avgPositionDistanceLast15Compare.setDisable(true);
        avgPositionDistanceLast15Compare.setOpacity(0);

        avgPositionDistanceLast15VS.setDisable(true);
        avgPositionDistanceLast15VS.setOpacity(0);
    }

    public void setAvgPositionDistanceLast15(ResultsDTO firstValue, ResultsDTO secondValue) {
        super.setAvgPositionDistanceLast15(avgPositionDistanceLast15,
                avgPositionDistanceLast15Compare,
                avgPositionDistanceLast15VS,
                firstValue,
                secondValue);
    }
}
