Skip to content

Commit

Permalink
prmr#508 Built NotificationHandler class with basic singleton require…
Browse files Browse the repository at this point in the history
…ments
  • Loading branch information
ArthusWQZ committed Oct 17, 2023
1 parent 4746930 commit f4f404a
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/org/jetuml/gui/NotificationHandler.java
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;
}

}

0 comments on commit f4f404a

Please sign in to comment.