forked from prmr/JetUML
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prmr#508 Built NotificationHandler class with basic singleton require…
…ments
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package org.jetuml.gui; | ||
|
||
import javafx.stage.Stage; | ||
|
||
import java.util.LinkedList; | ||
|
||
/** | ||
* Singleton object that manages the notification object positions and display states. | ||
*/ | ||
public final class NotificationHandler | ||
{ | ||
|
||
private static final NotificationHandler INSTANCE = new NotificationHandler(); | ||
|
||
private Stage aMainStage; | ||
private LinkedList<Notification> aNotificationList = new LinkedList<>(); | ||
|
||
private NotificationHandler() | ||
{} | ||
|
||
/** | ||
* @return The NotificationHandler singleton instance | ||
*/ | ||
public static NotificationHandler instance() | ||
{ return INSTANCE; } | ||
|
||
/** | ||
* Sets the parent stage of all the notification stages. | ||
* @param pStage The target parent stage of the notification objects | ||
*/ | ||
public void setMainStage(Stage pStage) | ||
{ | ||
this.aMainStage = pStage; | ||
} | ||
|
||
} |