Class Notification

  • All Implemented Interfaces:
    INotification, javafx.event.EventTarget

    public class Notification
    extends javafx.stage.Popup
    implements INotification
    Notification control. This control create a notification control to display in screen like notification. Unfortunately is not possible to show notification when owner window is hide.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class javafx.stage.PopupWindow

        javafx.stage.PopupWindow.AnchorLocation
    • Constructor Summary

      Constructors 
      Constructor Description
      Notification​(@Nullable java.lang.CharSequence title, @Nullable java.lang.CharSequence description)
      Create notification with information
      Notification​(@Nullable java.lang.CharSequence title, @Nullable java.lang.CharSequence description, @Nullable javafx.scene.image.Image icon)
      Create notification with all elements
      Notification​(@Nullable java.lang.CharSequence title, @Nullable java.lang.CharSequence description, @Nullable javafx.scene.Node icon)
      Create notification with all elements
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void configureWindow()
      Configure popup window
      java.lang.String getDescription()
      Get notification description
      @Nullable javafx.scene.Node getIcon()
      Get notification node icon
      javafx.scene.layout.Pane getNotificationContent()
      Get notification container
      java.lang.String getNotificationTitle()
      Get notification title
      protected void initializeComponents()
      Configure all nodes
      void setDescription​(@Nullable java.lang.CharSequence description)
      Set notification description
      void setIcon​(@Nullable javafx.scene.image.Image icon)
      Set icon to notification.
      void setIcon​(@Nullable javafx.scene.Node icon)
      Set notification node icon
      void setNotificationTitle​(@Nullable java.lang.CharSequence title)
      Set notification title
      void showNotify​(javafx.stage.Stage owner)
      Display notification in screen.
      • Methods inherited from class javafx.stage.Popup

        getContent
      • Methods inherited from class javafx.stage.PopupWindow

        anchorLocationProperty, anchorXProperty, anchorYProperty, autoFixProperty, autoHideProperty, consumeAutoHidingEventsProperty, getAnchorLocation, getAnchorX, getAnchorY, getConsumeAutoHidingEvents, getOnAutoHide, getOwnerNode, getOwnerWindow, hide, hideOnEscapeProperty, isAutoFix, isAutoHide, isHideOnEscape, onAutoHideProperty, ownerNodeProperty, ownerWindowProperty, setAnchorLocation, setAnchorX, setAnchorY, setAutoFix, setAutoHide, setConsumeAutoHidingEvents, setHideOnEscape, setOnAutoHide, setScene, show, show, show
      • Methods inherited from class javafx.stage.Window

        addEventFilter, addEventHandler, buildEventDispatchChain, centerOnScreen, eventDispatcherProperty, fireEvent, focusedProperty, forceIntegerRenderScaleProperty, getEventDispatcher, getHeight, getOnCloseRequest, getOnHidden, getOnHiding, getOnShowing, getOnShown, getOpacity, getOutputScaleX, getOutputScaleY, getProperties, getRenderScaleX, getRenderScaleY, getScene, getUserData, getWidth, getWindows, getX, getY, hasProperties, heightProperty, isFocused, isForceIntegerRenderScale, isShowing, onCloseRequestProperty, onHiddenProperty, onHidingProperty, onShowingProperty, onShownProperty, opacityProperty, outputScaleXProperty, outputScaleYProperty, removeEventFilter, removeEventHandler, renderScaleXProperty, renderScaleYProperty, requestFocus, sceneProperty, setEventDispatcher, setEventHandler, setForceIntegerRenderScale, setHeight, setOnCloseRequest, setOnHidden, setOnHiding, setOnShowing, setOnShown, setOpacity, setRenderScaleX, setRenderScaleY, setUserData, setWidth, setX, setY, show, showingProperty, sizeToScene, widthProperty, xProperty, yProperty
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface com.github.ushiosan23.javafx.notifications.INotification

        hide
    • Field Detail

      • notificationContainer

        protected javafx.scene.layout.BorderPane notificationContainer
        Notification container
      • informationContainer

        protected javafx.scene.layout.VBox informationContainer
        Information container. This node contains title and description nodes.
      • notificationIconContainer

        protected javafx.scene.layout.VBox notificationIconContainer
        Container icon
      • notificationIcon

        protected javafx.scene.Node notificationIcon
        Notification icon node
      • titleLabel

        protected javafx.scene.control.Label titleLabel
        Notification title label
      • descriptionLabel

        protected javafx.scene.control.Label descriptionLabel
        Notification description label
    • Constructor Detail

      • Notification

        public Notification​(@Nullable
                            @Nullable java.lang.CharSequence title,
                            @Nullable
                            @Nullable java.lang.CharSequence description,
                            @Nullable
                            @Nullable javafx.scene.image.Image icon)
        Create notification with all elements
        Parameters:
        title - Notification title
        description - Notification description
        icon - Notification icon
      • Notification

        public Notification​(@Nullable
                            @Nullable java.lang.CharSequence title,
                            @Nullable
                            @Nullable java.lang.CharSequence description,
                            @Nullable
                            @Nullable javafx.scene.Node icon)
        Create notification with all elements
        Parameters:
        title - Notification title
        description - Notification description
        icon - Notification node icon
      • Notification

        public Notification​(@Nullable
                            @Nullable java.lang.CharSequence title,
                            @Nullable
                            @Nullable java.lang.CharSequence description)
        Create notification with information
        Parameters:
        title - Notification title
        description - Notification description
    • Method Detail

      • setNotificationTitle

        public void setNotificationTitle​(@Nullable
                                         @Nullable java.lang.CharSequence title)
        Set notification title
        Specified by:
        setNotificationTitle in interface INotification
        Parameters:
        title - Target title to show
      • getNotificationTitle

        public java.lang.String getNotificationTitle()
        Get notification title
        Specified by:
        getNotificationTitle in interface INotification
        Returns:
        String notification title
      • setDescription

        public void setDescription​(@Nullable
                                   @Nullable java.lang.CharSequence description)
        Set notification description
        Specified by:
        setDescription in interface INotification
        Parameters:
        description - Description message
      • getDescription

        public java.lang.String getDescription()
        Get notification description
        Specified by:
        getDescription in interface INotification
        Returns:
        String notification description
      • setIcon

        public void setIcon​(@Nullable
                            @Nullable javafx.scene.image.Image icon)
        Set icon to notification.
        Specified by:
        setIcon in interface INotification
        Parameters:
        icon - Image icon to show
      • setIcon

        public void setIcon​(@Nullable
                            @Nullable javafx.scene.Node icon)
        Set notification node icon
        Specified by:
        setIcon in interface INotification
        Parameters:
        icon - Node icon
      • getIcon

        @Nullable
        public @Nullable javafx.scene.Node getIcon()
        Get notification node icon
        Specified by:
        getIcon in interface INotification
        Returns:
        Node icon result
      • getNotificationContent

        public javafx.scene.layout.Pane getNotificationContent()
        Get notification container
        Specified by:
        getNotificationContent in interface INotification
        Returns:
        Pane container
      • showNotify

        public void showNotify​(javafx.stage.Stage owner)
        Display notification in screen. You only can show this window if application is already started.
        Specified by:
        showNotify in interface INotification
        Parameters:
        owner - Target window owner
      • initializeComponents

        protected void initializeComponents()
        Configure all nodes
      • configureWindow

        protected void configureWindow()
        Configure popup window