util
Clone or download
Modified Files
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<modelVersion>4.0.0</modelVersion>
<groupId>com.StreamPi</groupId>
<groupId>com.StreamPi</groupId>
<artifactId>Util</artifactId>
<artifactId>Util</artifactId>
<version>1.0.0</version>
<version>1.0.0</version>
<build>
<build>
<plugins>
<plugins>
<plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.0</version>
<version>3.1.0</version>
<executions>
<executions>
<execution>
<execution>
<id>test-jar</id>
<id>test-jar</id>
<phase>package</phase>
<phase>package</phase>
<goals>
<goals>
<goal>test-jar</goal>
<goal>test-jar</goal>
</goals>
</goals>
</execution>
</execution>
</executions>
</executions>
</plugin>
</plugin>
<plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.8.1</version>
<configuration>
<configuration>
<release>11</release>
<release>11</release>
</configuration>
</configuration>
</plugin>
</plugin>
</plugins>
</plugins>
</build>
</build>
<properties>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.target>11</maven.compiler.target>
<CommonsBeanUtilsVersion>1.9.4</CommonsBeanUtilsVersion>
<CommonsConfigurationVersion>2.7</CommonsConfigurationVersion>
<SL4JVersion>1.7.30</SL4JVersion>
<IkonliVersion>11.5.0</IkonliVersion>
<IkonliVersion>11.5.0</IkonliVersion>
<IkonliFA5PackVersion>11.5.0</IkonliFA5PackVersion>
<IkonliFA5PackVersion>11.5.0</IkonliFA5PackVersion>
<JavaFXVersion>16-ea+4</JavaFXVersion>
<JavaFXVersion>16-ea+4</JavaFXVersion>
</properties>
</properties>
<dependencies>
<dependencies>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>${CommonsBeanUtilsVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-configuration2</artifactId>
<version>${CommonsConfigurationVersion}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${SL4JVersion}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${SL4JVersion}</version>
</dependency>
<dependency>
<dependency>
<groupId>org.kordamp.ikonli</groupId>
<groupId>org.kordamp.ikonli</groupId>
<artifactId>ikonli-fontawesome5-pack</artifactId>
<artifactId>ikonli-fontawesome5-pack</artifactId>
<version>${IkonliFA5PackVersion}</version>
<version>${IkonliFA5PackVersion}</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>org.openjfx</groupId>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<artifactId>javafx-controls</artifactId>
<version>${JavaFXVersion}</version>
<version>${JavaFXVersion}</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>org.openjfx</groupId>
<groupId>org.openjfx</groupId>
<artifactId>javafx-base</artifactId>
<artifactId>javafx-base</artifactId>
<version>${JavaFXVersion}</version>
<version>${JavaFXVersion}</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>org.kordamp.ikonli</groupId>
<groupId>org.kordamp.ikonli</groupId>
<artifactId>ikonli-javafx</artifactId>
<artifactId>ikonli-javafx</artifactId>
<version>${IkonliVersion}</version>
<version>${IkonliVersion}</version>
</dependency>
</dependency>
</dependencies>
</dependencies>
</project>
</project>
package com.StreamPi.Util.FormHelper;
package com.StreamPi.Util.FormHelper;
import javafx.geometry.Insets;
import javafx.geometry.Insets;
import javafx.scene.control.CheckBox;
import javafx.scene.control.CheckBox;
import javafx.scene.control.Label;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.control.TextField;
import javafx.scene.layout.HBox;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Priority;
import javafx.scene.layout.Priority;
import javafx.scene.layout.Region;
import javafx.scene.layout.Region;
public class HBoxInputBox extends HBox {
public class HBoxInputBox extends HBox {
private TextField textField;
private TextField textField;
public HBoxInputBox(String labelText, TextField textField, CheckBox enablerCheckBox)
public HBoxInputBox(String labelText, TextField textField, int prefWidth, CheckBox enablerCheckBox)
{
{
textField.setPrefWidth(100);
textField.setPrefWidth(prefWidth);
Label label = new Label(labelText);
Label label = new Label(labelText);
getChildren().addAll(label, new SpaceFiller(SpaceFiller.FillerType.HBox), textField);
getChildren().addAll(label, new SpaceFiller(SpaceFiller.FillerType.HBox), textField);
if(enablerCheckBox != null)
if(enablerCheckBox != null)
{
{
textField.disableProperty().bind(enablerCheckBox.selectedProperty());
textField.disableProperty().bind(enablerCheckBox.selectedProperty());
HBox.setMargin(enablerCheckBox, new Insets(0, 0, 0, 45));
HBox.setMargin(enablerCheckBox, new Insets(0, 0, 0, 45));
getChildren().add(enablerCheckBox);
getChildren().add(enablerCheckBox);
}
}
this.textField = textField;
this.textField = textField;
}
}
public HBoxInputBox(String labelText, TextField textField, CheckBox enablerCheckBox)
{
this(labelText, textField, 100, enablerCheckBox);
}
public HBoxInputBox(String labelText, TextField textField)
public HBoxInputBox(String labelText, TextField textField)
{
{
this(labelText, textField, null);
this(labelText, textField, 100, null);
}
}
public HBoxInputBox(String labelText, TextField textField, int prefWidth)
{
this(labelText, textField, prefWidth, null);
}
public TextField getTextField()
public TextField getTextField()
{
{
return textField;
return textField;
}
}
}
}
package com.StreamPi.Util.FormHelper;
package com.StreamPi.Util.FormHelper;
import javafx.geometry.Insets;
import javafx.geometry.Insets;
import javafx.scene.control.Button;
import javafx.scene.control.Button;
import javafx.scene.control.CheckBox;
import javafx.scene.control.CheckBox;
import javafx.scene.control.Label;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.control.TextField;
import javafx.scene.layout.HBox;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Priority;
import javafx.scene.layout.Priority;
import javafx.scene.layout.Region;
import javafx.scene.layout.Region;
import javafx.stage.FileChooser;
import javafx.stage.FileChooser;
import javafx.stage.Window;
import javafx.stage.Window;
import org.kordamp.ikonli.javafx.FontIcon;
import org.kordamp.ikonli.javafx.FontIcon;
import java.io.File;
import java.io.File;
public class HBoxInputBoxWithFileChooser extends HBox {
public class HBoxInputBoxWithFileChooser extends HBox {
public HBoxInputBoxWithFileChooser(String labelText, TextField textField, CheckBox enablerCheckBox, FileChooser.ExtensionFilter extensionFilter)
public HBoxInputBoxWithFileChooser(String labelText, TextField textField, CheckBox enablerCheckBox, FileChooser.ExtensionFilter extensionFilter)
{
{
HBoxInputBox hBoxInputBox = new HBoxInputBox(labelText, textField);
textField.setDisable(true);
HBoxInputBox hBoxInputBox = new HBoxInputBox(labelText, textField, 300);
setHgrow(hBoxInputBox, Priority.ALWAYS);
setHgrow(hBoxInputBox, Priority.ALWAYS);
getChildren().addAll(hBoxInputBox);
getChildren().addAll(hBoxInputBox);
setSpacing(5.0);
setSpacing(5.0);
TextField tf = hBoxInputBox.getTextField();
tf.setPrefWidth(300);
tf.setDisable(true);
Button button = new Button();
Button button = new Button();
FontIcon fontIcon = new FontIcon("far-folder");
FontIcon fontIcon = new FontIcon("far-folder");
//fontIcon.setIconColor(Paint.valueOf(iconColorHex));
//fontIcon.setIconColor(Paint.valueOf(iconColorHex));
//fontIcon.setIconSize(iconSize);
//fontIcon.setIconSize(iconSize);
button.setGraphic(fontIcon);
button.setGraphic(fontIcon);
button.setOnAction(event -> {
button.setOnAction(event -> {
FileChooser fileChooser = new FileChooser();
FileChooser fileChooser = new FileChooser();
fileChooser.getExtensionFilters().addAll(
fileChooser.getExtensionFilters().addAll(
extensionFilter
extensionFilter
);
);
try {
try {
File selectedDirectory = fileChooser.showOpenDialog(button.getScene().getWindow());
File selectedDirectory = fileChooser.showOpenDialog(button.getScene().getWindow());
textField.setText(selectedDirectory.getAbsolutePath());
textField.setText(selectedDirectory.getAbsolutePath());
}
}
catch (NullPointerException e)
catch (NullPointerException e)
{
{
// No folder selected
// No folder selected
}
}
});
});
getChildren().add(button);
getChildren().add(button);
if(enablerCheckBox!=null)
if(enablerCheckBox!=null)
{
{
button.disableProperty().bind(enablerCheckBox.selectedProperty());
button.disableProperty().bind(enablerCheckBox.selectedProperty());
HBox.setMargin(enablerCheckBox, new Insets(0, 0, 0, 45));
HBox.setMargin(enablerCheckBox, new Insets(0, 0, 0, 45));
getChildren().add(enablerCheckBox);
getChildren().add(enablerCheckBox);
}
}
}
}
}
}
module com.StreamPi.Util {
module com.StreamPi.Util {
requires org.apache.commons.configuration2;
requires org.slf4j;
requires org.kordamp.ikonli.javafx;
requires org.kordamp.ikonli.javafx;
requires org.kordamp.ikonli.fontawesome5;
requires org.kordamp.ikonli.fontawesome5;
requires javafx.base;
requires javafx.base;
requires javafx.controls;
requires javafx.controls;
exports com.StreamPi.Util.Version;
exports com.StreamPi.Util.Version;
exports com.StreamPi.Util.Exception;
exports com.StreamPi.Util.Exception;
exports com.StreamPi.Util.Platform;
exports com.StreamPi.Util.Platform;
exports com.StreamPi.Util.FormHelper;
exports com.StreamPi.Util.FormHelper;
}
}