При добавлении в Pane обьектов, их не видно JavaFX

pane.toFront() делал, уже перепробовал кучу вариантов, нет толку Кидаю сюда класс, в котором добавляються обьекты, весь проект могу на почту скинуть введите сюда описание изображения

package sample;

import javafx.geometry.Bounds;
import javafx.geometry.Pos;
import javafx.scene.Node;
import javafx.scene.canvas.Canvas;
import javafx.scene.canvas.GraphicsContext;

import javafx.scene.control.Label;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.scene.shape.Rectangle;
import javafx.scene.shape.Shape;
import javafx.scene.text.Font;


import java.util.ArrayList;
import java.util.HashMap;
import java.util.Objects;

public class MiniMap {
    final static private double SCALE = 0.07;
    private Pane pane;
    private double baseX;
    private double baseY;
    private ArrayList<WarriorFirst> arr;
    private ArrayList<Castle> ctl;
    private Rectangle mainArea;
    private Rectangle rectangle;
    private Rectangle border;
    private Label label;
    public static ArrayList<ImageView> iw;
    public static ArrayList<ImageView> iwc;

    public MiniMap() {
        this.pane = new Pane();
        this.pane.setMinWidth(Main.groupWar.getMinWidth() * MiniMap.SCALE);
        this.pane.setMinHeight(Main.groupWar.getMinHeight() * MiniMap.SCALE + 10);
        this.pane.setLayoutX(Main.groupWar.getLayoutX() + 1252);
        this.pane.setLayoutY(0);
        arr = new ArrayList<>();
        ctl = new ArrayList<>();
        iw = new ArrayList<>();
        iwc = new ArrayList<>();


        rectangle = new Rectangle(0, 0, pane.getMinWidth(), pane.getMinHeight() + 10);
        rectangle.setFill(Color.LIGHTGREY);
        border = new Rectangle(0, 0, pane.getMinWidth(), pane.getMinHeight() + 10);
        border.setFill(Color.TRANSPARENT);
        border.setStrokeWidth(2);
        border.setStroke(Color.BLACK);
        label = new Label("Map");
        label.setFont(new Font("Times New Roman", 16));
        label.setLayoutX(300);

        mainArea = new Rectangle(0, 0, 134.68, 76.75);
        mainArea.setFill(Color.TRANSPARENT);
        mainArea.setStrokeWidth(2);
        mainArea.setStroke(Color.RED);
        this.pane.getChildren().addAll(rectangle, border, label, mainArea);

        this.pane.setOnMousePressed(event -> {
            //this.moveTo(event.getX(), event.getY());
        });
    }

//    public void moveTo(double x, double y) {
//        if (x < mainArea.getWidth() / 2) {
//            Main.getScrollPane().setHvalue(0);
//        } else if (x > pane.getWidth() - mainArea.getWidth() / 2) {
//            Main.getScrollPane().setHvalue(1);
//        } else Main.getScrollPane().setHvalue(x / pane.getWidth());
//
//        if (y < mainArea.getHeight() / 2) {
//            Main.getScrollPane().setVvalue(0);
//        } else if (y > pane.getHeight() - mainArea.getHeight() / 2) {
//            Main.getScrollPane().setVvalue(1);
//        } else Main.getScrollPane().setVvalue(y / pane.getHeight());
//    }


    public Rectangle getBorder() {
        return border;
    }

    public void setPane(Pane pane) {
        this.pane = pane;
    }

    public double getBaseX() {
        return baseX;
    }

    public void setBaseX(double baseX) {
        this.baseX = baseX;
    }

    public double getBaseY() {
        return baseY;
    }

    public void setBaseY(double baseY) {
        this.baseY = baseY;
    }

    public ArrayList<WarriorFirst> getArr() {
        return arr;
    }

    public void setArr(ArrayList<WarriorFirst> arr) {
        this.arr = arr;
    }

    public ArrayList<Castle> getCtl() {
        return ctl;
    }

    public void setCtl(ArrayList<Castle> ctl) {
        this.ctl = ctl;
    }

    public void setMainArea(Rectangle mainArea) {
        this.mainArea = mainArea;
    }

    public Label getLabel() {
        return label;
    }

    public void setLabel(Label label) {
        this.label = label;
    }

    public void setBorder(Rectangle border) {
        this.border = border;
    }

    public Rectangle getRectangle() {
        return rectangle;
    }

    public void setRectangle(Rectangle rectangle) {
        this.rectangle = rectangle;
    }

    public Pane getPane() {
        return pane;
    }

    public Rectangle getMainArea() {
        return mainArea;
    }

    public void setbaseX(double baseX) {
        this.baseX = baseX;
    }

    public void setbaseY(double baseY) {
        this.baseY = baseY;
    }

    public static double getSCALE() {
        return SCALE;
    }

    public void addWarrior(WarriorFirst w) {
        ImageView imageView;
        switch (w.getType()) {
            case 1:
                imageView = new ImageView(new Image("sample/Воїн0Спокій.png"));
                break;
            case 2:
                imageView = new ImageView(new Image("sample/Воїн2Спокій.png"));
                break;
            default:
                imageView = new ImageView(new Image("sample/Воїн1Спокій.png"));
                break;
        }

        imageView.setLayoutX(w.getImgact().getX() * MiniMap.SCALE);
        imageView.setLayoutY(w.getImgact().getY() * MiniMap.SCALE);
        imageView.setPreserveRatio(true);
        imageView.setFitHeight(250 * MiniMap.SCALE);
        iw.add(imageView);
        arr.add(w);
        pane.getChildren().add(imageView);
    }

    public void deleteAWarrior(WarriorFirst w) {
        pane.getChildren().remove(w);
        arr.remove(w);
    }

    public void addCastle(Castle c) {
        ImageView imageVie;
        imageVie = new ImageView(new Image("sample/SmallMacro.png"));
        imageVie.setLayoutX(c.getImgCastle().getX() * MiniMap.SCALE);
        imageVie.setLayoutY(c.getImgCastle().getY() * MiniMap.SCALE);
        imageVie.setPreserveRatio(true);
        imageVie.setFitHeight(250 * MiniMap.SCALE);
        iwc.add(imageVie);
        ctl.add(c);
        pane.getChildren().add(imageVie);
    }

    public void updateMap(){
        pane.toFront();
        for(int i = 0; i<arr.size(); i++){
            iw.get(i).setLayoutX(this.arr.get(i).getImgact().getX()* MiniMap.SCALE);
            iw.get(i).setLayoutY(this.arr.get(i).getImgact().getY()* MiniMap.SCALE);
        }
        for(int i = 0; i<ctl.size(); i++){
            iwc.get(i).setLayoutX(ctl.get(i).getImgCastle().getX()*MiniMap.SCALE);
            iwc.get(i).setLayoutY(ctl.get(i).getImgCastle().getY()*MiniMap.SCALE);
        }
    }

    public void updateMap(double x, double y) {
        this.setbaseX(-x);
        this.setbaseY(-y);

        this.pane.setLayoutX(baseX + 1252);
        this.pane.setLayoutY(baseY);
        this.rectangle.setX(0);
        this.rectangle.setY(0);
        this.border.setX(0);
        this.border.setY(0);
        this.label.setLayoutX(300);
        this.label.setLayoutY(0);
        this.mainArea.setX(baseX/5/(Main.groupWar.getWidth()/this.getPane().getMinWidth()));
        this.mainArea.setY(baseY/(4.4)/(Main.groupWar.getHeight()/this.getPane().getMinHeight()));

//        for (WarriorFirst w : Main.arr) {
//            ImageView imageView = w.getImgpas();
//            imageView.setLayoutX(w.getBaseX() * MiniMap.SCALE);
//            imageView.setLayoutY(w.getBaseY() * MiniMap.SCALE);
//            if(!(Main.groupWar.getChildren().contains(w))){
//                this.getPane().getChildren().add(imageView);
//            }
//        }
    }
}

Ответы (0 шт):