Class Notification
- java.lang.Object
-
- javafx.stage.Window
-
- javafx.stage.PopupWindow
-
- javafx.stage.Popup
-
- com.github.ushiosan23.javafx.notifications.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.
-
-
Field Summary
Fields Modifier and Type Field Description protected javafx.scene.control.LabeldescriptionLabelNotification description labelprotected javafx.scene.layout.VBoxinformationContainerInformation container.protected javafx.scene.layout.BorderPanenotificationContainerNotification containerprotected javafx.scene.NodenotificationIconNotification icon nodeprotected javafx.scene.layout.VBoxnotificationIconContainerContainer iconprotected javafx.scene.control.LabeltitleLabelNotification title label
-
Constructor Summary
Constructors Constructor Description Notification(@Nullable java.lang.CharSequence title, @Nullable java.lang.CharSequence description)Create notification with informationNotification(@Nullable java.lang.CharSequence title, @Nullable java.lang.CharSequence description, @Nullable javafx.scene.image.Image icon)Create notification with all elementsNotification(@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 voidconfigureWindow()Configure popup windowjava.lang.StringgetDescription()Get notification description@Nullable javafx.scene.NodegetIcon()Get notification node iconjavafx.scene.layout.PanegetNotificationContent()Get notification containerjava.lang.StringgetNotificationTitle()Get notification titleprotected voidinitializeComponents()Configure all nodesvoidsetDescription(@Nullable java.lang.CharSequence description)Set notification descriptionvoidsetIcon(@Nullable javafx.scene.image.Image icon)Set icon to notification.voidsetIcon(@Nullable javafx.scene.Node icon)Set notification node iconvoidsetNotificationTitle(@Nullable java.lang.CharSequence title)Set notification titlevoidshowNotify(javafx.stage.Stage owner)Display notification in screen.-
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 titledescription- Notification descriptionicon- 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 titledescription- Notification descriptionicon- 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 titledescription- Notification description
-
-
Method Detail
-
setNotificationTitle
public void setNotificationTitle(@Nullable @Nullable java.lang.CharSequence title)Set notification title- Specified by:
setNotificationTitlein interfaceINotification- Parameters:
title- Target title to show
-
getNotificationTitle
public java.lang.String getNotificationTitle()
Get notification title- Specified by:
getNotificationTitlein interfaceINotification- Returns:
Stringnotification title
-
setDescription
public void setDescription(@Nullable @Nullable java.lang.CharSequence description)Set notification description- Specified by:
setDescriptionin interfaceINotification- Parameters:
description- Description message
-
getDescription
public java.lang.String getDescription()
Get notification description- Specified by:
getDescriptionin interfaceINotification- Returns:
Stringnotification description
-
setIcon
public void setIcon(@Nullable @Nullable javafx.scene.image.Image icon)Set icon to notification.- Specified by:
setIconin interfaceINotification- Parameters:
icon-Imageicon to show
-
setIcon
public void setIcon(@Nullable @Nullable javafx.scene.Node icon)Set notification node icon- Specified by:
setIconin interfaceINotification- Parameters:
icon-Nodeicon
-
getIcon
@Nullable public @Nullable javafx.scene.Node getIcon()
Get notification node icon- Specified by:
getIconin interfaceINotification- Returns:
Nodeicon result
-
getNotificationContent
public javafx.scene.layout.Pane getNotificationContent()
Get notification container- Specified by:
getNotificationContentin interfaceINotification- Returns:
Panecontainer
-
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:
showNotifyin interfaceINotification- Parameters:
owner- Target window owner
-
initializeComponents
protected void initializeComponents()
Configure all nodes
-
configureWindow
protected void configureWindow()
Configure popup window
-
-