package cz.vutbr.feec.project;

import java.io.File;
import java.util.HashSet;

import javafx.concurrent.Task;
import javafx.fxml.FXML;
import javafx.scene.canvas.Canvas;
import javafx.scene.canvas.GraphicsContext;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.MenuItem;
import javafx.scene.control.ProgressBar;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.Tab;
import javafx.scene.control.TabPane;
import javafx.scene.control.TextField;
import javafx.scene.control.ToggleButton;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.paint.Color;
import javafx.stage.Stage;

import cz.vutbr.feec.gui.AccidentCanvas;
import cz.vutbr.feec.gui.OtherCanvas;
import cz.vutbr.feec.gui.ReckCanvas;
import cz.vutbr.feec.stockElements.CoridorCell;
import cz.vutbr.feec.stockElements.RackCell;
import cz.vutbr.feec.stockElements.RouterCell;
import cz.vutbr.feec.stockElements.routeInStockSearching;

public final class GlobalParameters {
	
	
	public static final int INFINITY = 999999999;
	public static final HashSet<RackCell> cellsInRecks = new HashSet<>();
	public static final HashSet<RouterCell> cellsInRouters = new HashSet<>();
	public static final HashSet<CoridorCell> cellsInCoridor = new HashSet<>();
	public static final HashSet<CoridorCell> cellsInPaths = new HashSet<>();
	public static final HashSet<CoridorCell> allCoridorCells = new HashSet<>();
	public static double factor = 1.2;
	public static int meterPerSecond= 1;
	public static int lengthField = 1;// nejaka hodnota nech to neblbne
	public static int widthField = 1;
	public static final Edit edit = Edit.getInstance();
	public static GraphicsContext gc;
	public static Canvas mainCanvas;
	public static ReckCanvas reckCanvas;
	public static OtherCanvas otherCanvas;
	public static AccidentCanvas accidentCanvas;
	public static Button metricButton;
	public static TextField metricTextField;
	public static Tab creatingTab; 
	public static Tab maintenanceTab;
	public static Tab workTab;
	public static TabPane tabPane;
	public static javafx.scene.control.MenuBar menuBar;
	public static Label progressLabel;
	public static ProgressBar progressRT;
	public static Button cancelProgress;
	// farby
	public static Color backgroundColor = Color.GRAY;
	public static Color reckColor = Color.RED;
	public static Color delimiterColor = Color.BLACK;
	public static Color borderColor = Color.BLUE;
	public static Color accidentColor = Color.ORANGE;

	public static Image reckImage = new Image("graphics/reck.jpg");
	public static Image reckRotatedImage = new Image(
			"graphics/reckRotated.jpg");
	public static Image coridorImage = new Image("graphics/coridor.jpg");
	public static Image rampImage = new Image("graphics/ramp.jpg");
	public static Image accidentImage = new Image("graphics/accident.png");
	public static Image deleteImage = new Image("graphics/accident.jpg");
	public static Image borderImage = new Image("graphics/border.jpg");
	public static Image currentImage = new Image("graphics/current.png");
	public static Image routerImage = new Image("graphics/router.png");
	public static Image routeImage = new Image("graphics/route.png");
	public static Image routeSelectedImage = new Image("graphics/routeSelected.png");
	public static Image startFlag = new Image("graphics/startFlag.png");
	public static Image dstFlag = new Image("graphics/dstFlag.png");

	public static Stage primaryStage;
	public static File fileProject;
	public static boolean isSaved = true;
	public static routeInStockSearching routeShow = new routeInStockSearching();
	public static boolean isSkeletonImage = false;
	public static boolean progressCanceled = false;
	
	public static ImageView newIcon;
	public static ImageView openIcon;
	public static ImageView undoIcon;
	public static ImageView redoIcon;
	public static ImageView toCreatingStepIcon;
	public static ImageView toWorkingStepIcon;
	public static ToggleButton deleteButton;
	public static ToggleButton netButton;
	public static ToggleButton meterButton;
	public static Canvas mainCreatingCanvas; 
	public static Canvas mainMaintenanceCanvas;
	public static Canvas mainWorkingCanvas;
	public static MenuItem undo;
	public static MenuItem redo; 
	public static ScrollPane mainScrollPane;
	
	private GlobalParameters() {
		// bezparametricky konstruktor
	}

	public static String getNameProject() {
		String name = fileProject.getName();
			// TODO Auto-generated method stub
		return name;
	}

	public static void clearCells() {
		cellsInRecks.clear();
		cellsInRouters.clear();
		cellsInCoridor.clear();
		cellsInPaths.clear();
		allCoridorCells.clear();
	}

}
