Example usage for javafx.scene Scene setFill

List of usage examples for javafx.scene Scene setFill

Introduction

In this page you can find the example usage for javafx.scene Scene setFill.

Prototype

public final void setFill(Paint value) 

Source Link

Usage

From source file:io.bitsquare.gui.main.overlays.Overlay.java

public void display() {
    if (owner == null)
        owner = MainView.getRootContainer();

    if (owner != null) {
        Scene rootScene = owner.getScene();
        if (rootScene != null) {
            Scene scene = new Scene(gridPane);
            scene.getStylesheets().setAll(rootScene.getStylesheets());
            scene.setFill(Color.TRANSPARENT);

            setupKeyHandler(scene);/*from   w ww  .j a v a2  s.c o m*/

            stage = new Stage();
            stage.setScene(scene);
            Window window = rootScene.getWindow();
            setModality();
            stage.initStyle(StageStyle.TRANSPARENT);
            stage.show();

            layout();

            addEffectToBackground();

            // On Linux the owner stage does not move the child stage as it does on Mac
            // So we need to apply centerPopup. Further with fast movements the handler loses
            // the latest position, with a delay it fixes that.
            // Also on Mac sometimes the popups are positioned outside of the main app, so keep it for all OS
            positionListener = (observable, oldValue, newValue) -> {
                if (stage != null) {
                    layout();
                    if (centerTime != null)
                        centerTime.stop();

                    centerTime = UserThread.runAfter(this::layout, 3);
                }
            };
            window.xProperty().addListener(positionListener);
            window.yProperty().addListener(positionListener);
            window.widthProperty().addListener(positionListener);

            animateDisplay();
        }
    }
}

From source file:ua.com.ecotep.debtprevention.VnaklController.java

@FXML
private void handleDocSelectorAction(ActionEvent event) {
    if (selCl == null) {
        AlertDialog.showSimpleMessage("?    .",
                AlertDialog.ICON_INFO, parentInterface.getCurrentWindow());
        return;/*from  w  w  w .j a v a  2  s  . c om*/
    }
    Task<Object> task = DPSession.getInstance().getTask();
    if ((task != null) && (task.isRunning())) {
        AlertDialog.showSimpleMessage(
                "?    ?, -? .",
                AlertDialog.ICON_FORBIDDEN, parentInterface.getCurrentWindow());
        return;
    }
    Scene sceneParent = parentInterface.getCurrentWindow().getScene();
    final Point2D windowCoord = new Point2D(sceneParent.getWindow().getX(), sceneParent.getWindow().getY());
    final Point2D sceneCoord = new Point2D(sceneParent.getX(), sceneParent.getY());
    final Point2D nodeCoord = addDocButton.localToScene(0.0, 0.0);
    final double coordX = Math.round(windowCoord.getX() + sceneCoord.getX() + nodeCoord.getX());
    final double coordY = Math
            .round(windowCoord.getY() + sceneCoord.getY() + nodeCoord.getY() + addDocButton.getHeight() + 6);

    try {
        selectorPopup = new Popup();
        selectorPopup.setAutoHide(true);
        selectorPopup.setAutoFix(true);
        selectorPopup.setHideOnEscape(true);

        FXMLLoader loader = new FXMLLoader();
        loader.setLocation(getClass().getResource("/fxml/DocSelectScene.fxml"));

        AnchorPane root = (AnchorPane) loader.load();
        DocSelectController controller = loader.getController();
        controller.setParentInterface(this);
        Scene scene = new Scene(root);
        scene.setFill(null);
        selectorPopup.getContent().add(root);

        selectorPopup.setX(coordX);
        selectorPopup.setY(coordY);
        selectorPopup.show(parentInterface.getCurrentWindow());

    } catch (IOException ex) {
        Logger.getLogger(MainController.class.getName()).log(Level.SEVERE, null, ex);
        AlertDialog.showSimpleMessage(
                "? ?    !",
                AlertDialog.ICON_ERROR, parentInterface.getCurrentWindow());
    }
}