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
TypePropertyDescriptionjavafx.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 yetjavafx.beans.property.ObjectProperty<javafx.util.Duration>
notification display duration as a propertyjavafx.beans.property.StringProperty
id of the notification as a propertyjavafx.beans.property.ObjectProperty<javafx.geometry.Insets>
margin propertyProperties 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
ConstructorDescriptionPopupNotification
(@NotNull javafx.util.Duration duration, javafx.scene.Node... nodes) initial notificationPopupNotification
(javafx.scene.Node... nodes) initial notification -
Method Summary
Modifier and TypeMethodDescriptioncalculates notification positionjavafx.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 yetjavafx.beans.property.ObjectProperty<javafx.util.Duration>
notification display duration as a propertyjavafx.util.Duration
elapsed duration of the total duration
returns zero value if timer isn't started yetjavafx.util.Duration
notification display durationgetId()
id of the notificationjavafx.geometry.Insets
gets margin of the notificationjavafx.beans.property.StringProperty
id of the notification as a propertyjavafx.beans.property.ObjectProperty<javafx.geometry.Insets>
margin propertyvoid
setDuration
(@NotNull javafx.util.Duration duration) sets the notification display durationvoid
sets id of the notificationvoid
setMargin
(@NotNull javafx.geometry.Insets margin) sets margin of the notificationvoid
setPosition
(@NotNull NotificationPosition position) sets position of the PopupNotification on the screenvoid
sets the notification sound from Sounds and plays when notification is shown
Note: You need to add javafx.media dependency to use soundsvoid
sets the notification sound from custom file path and plays when notification is shown
Note: You need to add javafx.media dependency to use soundsMethods 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
-
Property Details
-
margin
public javafx.beans.property.ObjectProperty<javafx.geometry.Insets> marginPropertymargin property- See Also:
-
duration
public javafx.beans.property.ObjectProperty<javafx.util.Duration> durationPropertynotification display duration as a property- See Also:
-
currentTime
public javafx.beans.property.ReadOnlyObjectProperty<javafx.util.Duration> currentTimePropertyelapsed 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 idPropertyid 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 notificationduration
- display duration
-
-
Method Details
-
calculatePosition
calculates notification position- Returns:
- Delta
-
setPosition
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
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
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
sets id of the notification- Parameters:
id
- id of the notification
-
getId
id of the notification- Returns:
- String
-
idProperty
public javafx.beans.property.StringProperty idProperty()id of the notification as a property- See Also:
-