server

Clone or download

update license

Modified Files

package com.StreamPi.Server.Info;
package com.StreamPi.Server.Info;
public class License {
public class License {
public static String getLicense()
public static String getLicense()
{
{
return "StreamPi - Free & Opensource Modular Cross-Platform Programmable Macropad\n" +
return "StreamPi - Free & Opensource Modular Cross-Platform Programmable Macropad\n" +
"Copyright (C) 2020 StreamPi Team\n" +
"Copyright (C) 2020 Debayan Sutradhar, Samuel Quiñones\n" +
"\n" +
"\n" +
"This program is free software: you can redistribute it and/or modify\n" +
"This program is free software: you can redistribute it and/or modify\n" +
"it under the terms of the GNU General Public License as published by\n" +
"it under the terms of the GNU General Public License as published by\n" +
"the Free Software Foundation, either version 3 of the License, or\n" +
"the Free Software Foundation, either version 3 of the License, or\n" +
"(at your option) any later version.\n" +
"(at your option) any later version.\n" +
"\n" +
"\n" +
"This program is distributed in the hope that it will be useful,\n" +
"This program is distributed in the hope that it will be useful,\n" +
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" +
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" +
"GNU General Public License for more details.\n";
"GNU General Public License for more details.\n" +
"\n\n"+
"Opensource Libararies used :\n"+
"1. JavaFX - GNU General Public License with Classpath Exception\nhttp://openjdk.java.net/legal/gplv2+ce.html\n\n"+
"2. org.json - The JSON License\nhttps://www.json.org/license.html\n\n"+
"3. Ikonli - Apache License\nhttps://github.com/kordamp/ikonli/blob/master/LICENSE\n\n";
}
}
}
}
package com.StreamPi.Server.Window.Settings;
package com.StreamPi.Server.Window.Settings;
import com.StreamPi.ActionAPI.ActionAPI;
import com.StreamPi.ActionAPI.ActionAPI;
import com.StreamPi.Server.Info.License;
import com.StreamPi.Server.Info.License;
import com.StreamPi.Server.Info.ServerInfo;
import com.StreamPi.Server.Info.ServerInfo;
import com.StreamPi.Server.Main;
import com.StreamPi.Server.Main;
import com.StreamPi.Util.Platform.Platform;
import com.StreamPi.Util.Platform.Platform;
import com.StreamPi.Util.Platform.ReleaseStatus;
import com.StreamPi.Util.Platform.ReleaseStatus;
import javafx.application.HostServices;
import javafx.application.HostServices;
import javafx.geometry.Insets;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.geometry.Pos;
import javafx.scene.control.Hyperlink;
import javafx.scene.control.Hyperlink;
import javafx.scene.control.Label;
import javafx.scene.control.Label;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextArea;
import javafx.scene.image.Image;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.image.ImageView;
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.scene.layout.VBox;
import javafx.scene.layout.VBox;
import java.io.IOException;
import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URL;
public class About extends VBox{
public class About extends VBox{
private HostServices hostServices;
private HostServices hostServices;
public About(HostServices hostServices)
public About(HostServices hostServices)
{
{
getStyleClass().add("about");
getStyleClass().add("about");
this.hostServices = hostServices;
this.hostServices = hostServices;
setAlignment(Pos.TOP_CENTER);
setAlignment(Pos.TOP_CENTER);
Image appIcon = new Image(Main.class.getResourceAsStream("app_icon.png"));
Image appIcon = new Image(Main.class.getResourceAsStream("app_icon.png"));
ImageView appIconImageView = new ImageView(appIcon);
ImageView appIconImageView = new ImageView(appIcon);
appIconImageView.setFitHeight(196);
appIconImageView.setFitHeight(196);
appIconImageView.setFitWidth(182);
appIconImageView.setFitWidth(182);
Label headerLabel = new Label("StreamPi");
// Label headerLabel = new Label("StreamPi");
headerLabel.getStyleClass().add("settings_about_streampi_header");
// headerLabel.getStyleClass().add("settings_about_streampi_header");
Label licenseLabel = new Label("License");
Label licenseLabel = new Label("License");
licenseLabel.getStyleClass().add("settings_about_license_label");
licenseLabel.getStyleClass().add("settings_about_license_label");
VBox.setMargin(licenseLabel, new Insets(20, 0 , 10 ,0));
VBox.setMargin(licenseLabel, new Insets(20, 0 , 10 ,0));
TextArea licenseTextArea = new TextArea(License.getLicense());
TextArea licenseTextArea = new TextArea(License.getLicense());
licenseTextArea.setWrapText(false);
licenseTextArea.setWrapText(false);
licenseTextArea.setEditable(false);
licenseTextArea.setEditable(false);
licenseTextArea.setMaxWidth(500);
licenseTextArea.setMaxWidth(500);
VBox.setVgrow(licenseTextArea, Priority.ALWAYS);
VBox.setVgrow(licenseTextArea, Priority.ALWAYS);
HBox links = new HBox();
HBox links = new HBox();
Hyperlink github = new Hyperlink("GitHub");
Hyperlink github = new Hyperlink("GitHub");
github.setOnAction(event -> {
github.setOnAction(event -> {
openWebpage("https://github.com/Stream-Pi");
openWebpage("https://github.com/Stream-Pi");
});
});
Hyperlink discord = new Hyperlink("Discord");
Hyperlink discord = new Hyperlink("Discord");
discord.setOnAction(event -> {
discord.setOnAction(event -> {
openWebpage("https://discord.gg/BExqGmk");
openWebpage("https://discord.gg/BExqGmk");
});
});
Hyperlink website = new Hyperlink("Website");
Hyperlink website = new Hyperlink("Website");
website.setOnAction(event -> {
website.setOnAction(event -> {
openWebpage("https://stream-pi.com");
openWebpage("https://stream-pi.com");
});
});
Hyperlink twitter = new Hyperlink("Twitter");
Hyperlink twitter = new Hyperlink("Twitter");
twitter.setOnAction(event -> {
twitter.setOnAction(event -> {
openWebpage("https://twitter.com/Stream_Pi");
openWebpage("https://twitter.com/Stream_Pi");
});
});
links.setSpacing(15);
links.setSpacing(30);
links.setAlignment(Pos.CENTER);
links.setAlignment(Pos.CENTER);
links.getChildren().addAll(github, discord, website, twitter);
links.getChildren().addAll(github, discord, website, twitter);
Hyperlink donateButton = new Hyperlink("DONATE");
Hyperlink donateButton = new Hyperlink("DONATE");
donateButton.setOnAction(event -> {
donateButton.setOnAction(event -> {
openWebpage("https://www.patreon.com/streampi");
openWebpage("https://www.patreon.com/streampi");
});
});
donateButton.getStyleClass().add("settings_about_donate_hyperlink");
donateButton.getStyleClass().add("settings_about_donate_hyperlink");
Region gap = new Region();
Region gap = new Region();
VBox.setVgrow(gap, Priority.ALWAYS);
VBox.setVgrow(gap, Priority.ALWAYS);
ServerInfo serverInfo = ServerInfo.getInstance();
ServerInfo serverInfo = ServerInfo.getInstance();
Label versionText = new Label(serverInfo.getVersion().getText() + " - "+ serverInfo.getPlatformType().getUIName() + " - "+ serverInfo.getReleaseStatus().getUIName());
Label versionText = new Label(serverInfo.getVersion().getText() + " - "+ serverInfo.getPlatformType().getUIName() + " - "+ serverInfo.getReleaseStatus().getUIName());
Label commAPILabel = new Label("CommAPI "+serverInfo.getCommAPIVersion().getText());
Label commAPILabel = new Label("CommAPI "+serverInfo.getCommAPIVersion().getText());
Label minThemeAPILabel = new Label("Min ThemeAPI "+serverInfo.getMinThemeSupportVersion().getText());
Label minThemeAPILabel = new Label("Min ThemeAPI "+serverInfo.getMinThemeSupportVersion().getText());
Label minActionAPILabel = new Label("Min ActionAPI "+serverInfo.getMinPluginSupportVersion().getText());
Label minActionAPILabel = new Label("Min ActionAPI "+serverInfo.getMinPluginSupportVersion().getText());
Label currentActionAPILabel = new Label("ActionAPI "+ ActionAPI.API_VERSION.getText());
Label currentActionAPILabel = new Label("ActionAPI "+ ActionAPI.API_VERSION.getText());
setSpacing(3);
setSpacing(3);
getChildren().addAll(appIconImageView, headerLabel, licenseLabel, licenseTextArea, links, donateButton, gap, versionText, commAPILabel, minThemeAPILabel, minActionAPILabel, currentActionAPILabel);
getChildren().addAll(appIconImageView, licenseLabel, licenseTextArea, links, donateButton, gap, versionText, commAPILabel, minThemeAPILabel, minActionAPILabel, currentActionAPILabel);
}
}
public void openWebpage(String url) {
public void openWebpage(String url) {
hostServices.showDocument(url);
hostServices.showDocument(url);
}
}
}
}