util
Clone or download
Modified Files
--- 'a/pom.xml'
+++ b/pom.xml
@@ -8,6 +8,8 @@
<artifactId>Util</artifactId>
<version>1.0.0</version>
+ <url>https://stream-pi.com/</url>
+
<build>
<plugins>
<plugin>
--- 'a/src/main/java/com/StreamPi/Util/Alert/StreamPiAlert.java'
+++ b/src/main/java/com/StreamPi/Util/Alert/StreamPiAlert.java
@@ -5,6 +5,7 @@ import com.StreamPi.Util.FormHelper.Spac
import org.kordamp.ikonli.javafx.FontIcon;
+import javafx.collections.ListChangeListener;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Node;
@@ -31,6 +32,23 @@ public class StreamPiAlert {
stackPaneParent = parent;
stackPaneParent.getStyleClass().add("alert_pane_parent");
+
+ stackPaneParent.getChildren().addListener(new ListChangeListener<Node>()
+ {
+ @Override
+ public void onChanged(Change<? extends Node> c) {
+ if(stackPaneParent.getChildren().size() > 0)
+ {
+ stackPaneParent.setVisible(true);
+ stackPaneParent.toFront();
+ }
+ else
+ {
+ stackPaneParent.setVisible(false);
+ stackPaneParent.toBack();
+ }
+ }
+ });
}
public static StackPane getParent() {
@@ -171,17 +189,15 @@ public class StreamPiAlert {
return contentPane;
}
+ private Node popupNode;
public void show()
{
- stackPaneParent.getChildren().add(getAlertPane(getTitle(), getContentPane()));
- stackPaneParent.toFront();
- stackPaneParent.setVisible(true);
+ popupNode = getAlertPane(getTitle(), getContentPane());
+ stackPaneParent.getChildren().add(popupNode);
}
public void destroy()
{
- stackPaneParent.getChildren().clear();
- stackPaneParent.toBack();
- stackPaneParent.setVisible(false);
+ stackPaneParent.getChildren().remove(popupNode);
}
}
--- 'a/src/main/java/com/StreamPi/Util/ComboBox/StreamPiComboBox.java'
+++ b/src/main/java/com/StreamPi/Util/ComboBox/StreamPiComboBox.java
@@ -8,6 +8,8 @@ import com.StreamPi.Util.FormHelper.Spac
import org.kordamp.ikonli.javafx.FontIcon;
+import javafx.collections.ListChangeListener;
+import javafx.scene.Node;
import javafx.scene.control.Label;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.ToggleButton;
@@ -26,6 +28,23 @@ public class StreamPiComboBox<T> extends
stackPaneParent = parent;
stackPaneParent.getStyleClass().add("combobox_pane_parent");
+
+ stackPaneParent.getChildren().addListener(new ListChangeListener<Node>()
+ {
+ @Override
+ public void onChanged(Change<? extends Node> c) {
+ if(stackPaneParent.getChildren().size() > 0)
+ {
+ stackPaneParent.setVisible(true);
+ stackPaneParent.toFront();
+ }
+ else
+ {
+ stackPaneParent.setVisible(false);
+ stackPaneParent.toBack();
+ }
+ }
+ });
}
public StreamPiComboBox(List<T> options)
@@ -144,18 +163,16 @@ public class StreamPiComboBox<T> extends
this.streamPiComboBoxListener = streamPiComboBoxListener;
}
+ private Node popupNode;
public void show()
{
- stackPaneParent.getChildren().add(getPopupScrollPane());
- stackPaneParent.toFront();
- stackPaneParent.setVisible(true);
+ popupNode = getPopupScrollPane();
+ stackPaneParent.getChildren().add(popupNode);
}
public void destroy()
{
- stackPaneParent.getChildren().clear();
- stackPaneParent.toBack();
- stackPaneParent.setVisible(false);
+ stackPaneParent.getChildren().remove(popupNode);
}
private StreamPiComboBoxFactory<T> streamPiComboBoxFactory;