package Modellus.WinUI.Animator; import javafx.event.EventHandler; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.input.MouseButton; import javafx.scene.input.MouseEvent; import javafx.scene.paint.Color; import javafx.scene.shape.Rectangle; import java.awt.*; public class Background extends Rectangle{ AnimationScene scene; public Background(AnimationScene scene) { this.scene = scene; setFill(Color.WHITE); widthProperty().bind(scene.widthProperty()); heightProperty().bind(scene.heightProperty()); setupPopup(); } private void setupPopup() { setOnMouseReleased(new EventHandler() { @Override public void handle(MouseEvent mouseEvent) { if(mouseEvent.getButton() == MouseButton.SECONDARY) { AnimationPopupMenu.instance(scene).show(scene.getRoot(), mouseEvent); } } }); } }