package be.iminds.ilabt.jfed.ui.javafx.util;

import javafx.geometry.Rectangle2D;
import javafx.scene.image.Image;
import javafx.stage.Screen;
import javafx.stage.Stage;

/**
 * User: twalcari
 * Date: 8/13/2015
 * Time: 08:48
 */
public class StageUtils {

    private StageUtils(){}

    public static void setJFedStageIcons(Stage stage) {
        stage.getIcons().addAll(new Image(StageUtils.class.getResource("/images/jfed-logo_16.png").toExternalForm())
                , new Image(StageUtils.class.getResource("/images/jfed-logo_32.png").toExternalForm())
                , new Image(StageUtils.class.getResource("/images/jfed-logo_64.png").toExternalForm()));

    }

    public static void fillScreen(Stage stage, Screen screen){
        Rectangle2D screenBounds = screen.getVisualBounds();

        stage.setX(screenBounds.getMinX());
        stage.setY(screenBounds.getMinY());
        stage.setWidth(screenBounds.getWidth());
        stage.setHeight(screenBounds.getHeight());
        stage.setMinHeight(480);
        stage.setMinWidth(640);
    }

    public static void fillPrimaryScreen(Stage stage){
        fillScreen(stage, Screen.getPrimary());

    }



}
