Module FXDialogs

Class PopupNotification

java.lang.Object
javafx.stage.Window
javafx.stage.PopupWindow
javafx.stage.Popup
com.amirali.fxdialogs.notifications.PopupNotification
All Implemented Interfaces:
javafx.event.EventTarget
Direct Known Subclasses:
SimplePopupNotification

public class PopupNotification extends javafx.stage.Popup
  • Property Summary

    Properties
    Type
    Property
    Description
    javafx.beans.property.ReadOnlyObjectProperty<javafx.util.Duration>
    elapsed duration of the total duration as a read only property
    returns zero value if timer isn't started yet
    javafx.beans.property.ObjectProperty<javafx.util.Duration>
    notification display duration as a property
    javafx.beans.property.StringProperty
    id of the notification as a property
    javafx.beans.property.ObjectProperty<javafx.geometry.Insets>
    margin property

    Properties inherited from class javafx.stage.PopupWindow

    anchorLocation, anchorX, anchorY, autoFix, autoHide, consumeAutoHidingEvents, hideOnEscape, onAutoHide, ownerNode, ownerWindow

    Properties inherited from class javafx.stage.Window

    eventDispatcher, focused, forceIntegerRenderScale, height, onCloseRequest, onHidden, onHiding, onShowing, onShown, opacity, outputScaleX, outputScaleY, renderScaleX, renderScaleY, scene, showing, width, x, y
  • Nested Class Summary

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

    javafx.stage.PopupWindow.AnchorLocation
  • Constructor Summary

    Constructors
    Constructor
    Description
    PopupNotification(@NotNull javafx.util.Duration duration, javafx.scene.Node... nodes)
    initial notification
    PopupNotification(javafx.scene.Node... nodes)
    initial notification
  • Method Summary

    Modifier and Type
    Method
    Description
    calculates notification position
    javafx.beans.property.ReadOnlyObjectProperty<javafx.util.Duration>
    elapsed duration of the total duration as a read only property
    returns zero value if timer isn't started yet
    javafx.beans.property.ObjectProperty<javafx.util.Duration>
    notification display duration as a property
    javafx.util.Duration
    elapsed duration of the total duration
    returns zero value if timer isn't started yet
    javafx.util.Duration
    notification display duration
    id of the notification
    javafx.geometry.Insets
    gets margin of the notification
    javafx.beans.property.StringProperty
    id of the notification as a property
    javafx.beans.property.ObjectProperty<javafx.geometry.Insets>
    margin property
    void
    setDuration(@NotNull javafx.util.Duration duration)
    sets the notification display duration
    void
    setId(@NotNull String id)
    sets id of the notification
    void
    setMargin(@NotNull javafx.geometry.Insets margin)
    sets margin of the notification
    void
    setPosition(@NotNull NotificationPosition position)
    sets position of the PopupNotification on the screen
    void
    setSound(@NotNull Sounds sound)
    sets the notification sound from Sounds and plays when notification is shown
    Note: You need to add javafx.media dependency to use sounds
    void
    setSound(@NotNull String path)
    sets the notification sound from custom file path and plays when notification is shown
    Note: You need to add javafx.media dependency to use sounds

    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
  • Property Details

    • margin

      public javafx.beans.property.ObjectProperty<javafx.geometry.Insets> marginProperty
      margin property
      See Also:
    • duration

      public javafx.beans.property.ObjectProperty<javafx.util.Duration> durationProperty
      notification display duration as a property
      See Also:
    • currentTime

      public javafx.beans.property.ReadOnlyObjectProperty<javafx.util.Duration> currentTimeProperty
      elapsed duration of the total duration as a read only property
      returns zero value if timer isn't started yet
      See Also:
    • id

      public javafx.beans.property.StringProperty idProperty
      id of the notification as a property
      See Also:
  • Constructor Details

    • PopupNotification

      public PopupNotification(javafx.scene.Node... nodes)
      initial notification
      Parameters:
      nodes - content of the notification
    • PopupNotification

      public PopupNotification(@NotNull @NotNull javafx.util.Duration duration, javafx.scene.Node... nodes)
      initial notification
      Parameters:
      nodes - content of the notification
      duration - display duration
  • Method Details

    • calculatePosition

      public Delta calculatePosition()
      calculates notification position
      Returns:
      Delta
    • setPosition

      public void setPosition(@NotNull @NotNull NotificationPosition position)
      sets position of the PopupNotification on the screen
      Parameters:
      position - NotificationPosition
    • setMargin

      public void setMargin(@NotNull @NotNull javafx.geometry.Insets margin)
      sets margin of the notification
      Parameters:
      margin - Insets
    • getMargin

      public javafx.geometry.Insets getMargin()
      gets margin of the notification
      Returns:
      Insets
    • marginProperty

      public javafx.beans.property.ObjectProperty<javafx.geometry.Insets> marginProperty()
      margin property
      See Also:
    • setSound

      public void setSound(@NotNull @NotNull Sounds sound)
      sets the notification sound from Sounds and plays when notification is shown
      Note: You need to add javafx.media dependency to use sounds
      Parameters:
      sound - default notification sounds
    • setSound

      public void setSound(@NotNull @NotNull String path)
      sets the notification sound from custom file path and plays when notification is shown
      Note: You need to add javafx.media dependency to use sounds
      Parameters:
      path - custom file path
    • setDuration

      public void setDuration(@NotNull @NotNull javafx.util.Duration duration)
      sets the notification display duration
      Parameters:
      duration - display duration
    • getDuration

      public javafx.util.Duration getDuration()
      notification display duration
      Returns:
      Duration
    • durationProperty

      public javafx.beans.property.ObjectProperty<javafx.util.Duration> durationProperty()
      notification display duration as a property
      See Also:
    • getCurrentTime

      public javafx.util.Duration getCurrentTime()
      elapsed duration of the total duration
      returns zero value if timer isn't started yet
      Returns:
      Duration
    • currentTimeProperty

      public javafx.beans.property.ReadOnlyObjectProperty<javafx.util.Duration> currentTimeProperty()
      elapsed duration of the total duration as a read only property
      returns zero value if timer isn't started yet
      See Also:
    • setId

      public void setId(@NotNull @NotNull String id)
      sets id of the notification
      Parameters:
      id - id of the notification
    • getId

      public String getId()
      id of the notification
      Returns:
      String
    • idProperty

      public javafx.beans.property.StringProperty idProperty()
      id of the notification as a property
      See Also: