Search in sources :

Example 1 with CustomStage

use of org.develnext.jphp.ext.javafx.support.tray.models.CustomStage in project jphp by jphp-compiler.

the class TrayNotification method initStage.

private void initStage() {
    stage = new CustomStage(rootNode, horGap, verGap);
    rootNode.setBackground(new Background(new BackgroundFill(Color.WHITE, null, null)));
    stage.getScene().setRoot(rootNode);
    setLocation(NotificationLocation.BOTTOM_RIGHT);
    EventHandler<MouseEvent> value = new EventHandler<MouseEvent>() {

        @Override
        public void handle(MouseEvent event) {
            if (onClickCallback != null) {
                onClickCallback.handle(new ActionEvent(this, null));
            }
            dismiss();
        }
    };
    lblClose.setOnMouseClicked(value);
    stage.getScene().setOnMouseClicked(value);
}
Also used : CustomStage(org.develnext.jphp.ext.javafx.support.tray.models.CustomStage) MouseEvent(javafx.scene.input.MouseEvent) Background(javafx.scene.layout.Background) ActionEvent(javafx.event.ActionEvent) BackgroundFill(javafx.scene.layout.BackgroundFill) EventHandler(javafx.event.EventHandler)

Aggregations

ActionEvent (javafx.event.ActionEvent)1 EventHandler (javafx.event.EventHandler)1 MouseEvent (javafx.scene.input.MouseEvent)1 Background (javafx.scene.layout.Background)1 BackgroundFill (javafx.scene.layout.BackgroundFill)1 CustomStage (org.develnext.jphp.ext.javafx.support.tray.models.CustomStage)1