server

Clone or download

Made welcome page better

Modified Files

package com.StreamPi.Server.Window.FirstTimeUse;
package com.StreamPi.Server.Window.FirstTimeUse;
import com.StreamPi.Server.Main;
import com.StreamPi.Server.Main;
import com.StreamPi.Server.Connection.ServerListener;
import com.StreamPi.Server.Connection.ServerListener;
import com.StreamPi.Server.Window.ExceptionAndAlertHandler;
import com.StreamPi.Server.Window.ExceptionAndAlertHandler;
import com.StreamPi.Util.FormHelper.SpaceFiller;
import com.StreamPi.Util.FormHelper.SpaceFiller;
import com.StreamPi.Util.FormHelper.SpaceFiller.FillerType;
import com.StreamPi.Util.FormHelper.SpaceFiller.FillerType;
import javafx.event.ActionEvent;
import javafx.event.ActionEvent;
import javafx.geometry.Insets;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.geometry.Pos;
import javafx.scene.control.Button;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.Label;
import javafx.scene.layout.HBox;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Pane;
import javafx.scene.layout.Pane;
import javafx.scene.layout.Priority;
import javafx.scene.layout.Priority;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.scene.layout.VBox;
import javafx.scene.text.Font;
import javafx.scene.text.Font;
public class FirstTimeUse extends VBox{
public class FirstTimeUse extends VBox{
public FirstTimeUse(ExceptionAndAlertHandler exceptionAndAlertHandler, ServerListener serverListener)
public FirstTimeUse(ExceptionAndAlertHandler exceptionAndAlertHandler, ServerListener serverListener)
{
{
Font.loadFont(Main.class.getResourceAsStream("Roboto.ttf"), 13);
Font.loadFont(Main.class.getResourceAsStream("Roboto.ttf"), 13);
getStylesheets().add(Main.class.getResource("style.css").toExternalForm());
getStylesheets().add(Main.class.getResource("style.css").toExternalForm());
getStyleClass().add("first_time_use_pane");
getStyleClass().add("first_time_use_pane");
setSpacing(10.0);
setSpacing(10.0);
setPadding(new Insets(5));
setPadding(new Insets(5));
headingLabel = new Label();
headingLabel = new Label();
headingLabel.getStyleClass().add("first_time_use_pane_heading_label");
headingLabel.getStyleClass().add("first_time_use_pane_heading_label");
StackPane stackPane = new StackPane();
StackPane stackPane = new StackPane();
stackPane.getStyleClass().add("first_time_use_pane_stackpane");
stackPane.getStyleClass().add("first_time_use_pane_stackpane");
VBox.setVgrow(stackPane, Priority.ALWAYS);
VBox.setVgrow(stackPane, Priority.ALWAYS);
welcomePane = new WelcomePane();
welcomePane = new WelcomePane();
licensePane = new LicensePane();
licensePane = new LicensePane();
finalConfigPane = new FinalConfigPane(exceptionAndAlertHandler, serverListener);
finalConfigPane = new FinalConfigPane(exceptionAndAlertHandler, serverListener);
stackPane.getChildren().addAll(
stackPane.getChildren().addAll(
welcomePane,
welcomePane,
licensePane,
licensePane,
finalConfigPane
finalConfigPane
);
);
nextButton = new Button("Next");
nextButton = new Button("Next");
nextButton.setOnAction(event-> onNextButtonClicked());
nextButton.setOnAction(event-> onNextButtonClicked());
previousButton = new Button("Previous");
previousButton = new Button("Previous");
previousButton.setOnAction(event-> onPreviousButtonClicked());
previousButton.setOnAction(event-> onPreviousButtonClicked());
HBox buttonBar = new HBox(previousButton, new SpaceFiller(FillerType.HBox), nextButton);
HBox buttonBar = new HBox(previousButton, new SpaceFiller(FillerType.HBox), nextButton);
buttonBar.setSpacing(10.0);
buttonBar.setSpacing(10.0);
getChildren().addAll(headingLabel, stackPane, buttonBar);
getChildren().addAll(headingLabel, stackPane, buttonBar);
setWindow(WindowName.WELCOME);
setWindow(WindowName.WELCOME);
}
}
private Label headingLabel;
private Label headingLabel;
private Button nextButton;
private Button nextButton;
private Button previousButton;
private Button previousButton;
private WelcomePane welcomePane;
private WelcomePane welcomePane;
private LicensePane licensePane;
private LicensePane licensePane;
private FinalConfigPane finalConfigPane;
private FinalConfigPane finalConfigPane;
private WindowName windowName;
private WindowName windowName;
private void onNextButtonClicked()
private void onNextButtonClicked()
{
{
if(windowName == WindowName.WELCOME)
if(windowName == WindowName.WELCOME)
{
{
setWindow(WindowName.LICENSE);
setWindow(WindowName.LICENSE);
}
}
else if(windowName == WindowName.LICENSE)
else if(windowName == WindowName.LICENSE)
{
{
setWindow(WindowName.FINAL);
setWindow(WindowName.FINAL);
}
}
}
}
private void onPreviousButtonClicked()
private void onPreviousButtonClicked()
{
{
if(windowName == WindowName.FINAL)
if(windowName == WindowName.FINAL)
{
{
setWindow(WindowName.LICENSE);
setWindow(WindowName.LICENSE);
}
}
else if(windowName == WindowName.LICENSE)
else if(windowName == WindowName.LICENSE)
{
{
setWindow(WindowName.WELCOME);
setWindow(WindowName.WELCOME);
}
}
}
}
private void setWindow(WindowName windowName)
private void setWindow(WindowName windowName)
{
{
if (windowName == WindowName.WELCOME)
if (windowName == WindowName.WELCOME)
{
{
this.windowName = WindowName.WELCOME;
this.windowName = WindowName.WELCOME;
welcomePane.toFront();
welcomePane.toFront();
welcomePane.setVisible(true);
welcomePane.setVisible(true);
licensePane.setVisible(false);
licensePane.setVisible(false);
finalConfigPane.setVisible(false);
finalConfigPane.setVisible(false);
headingLabel.setText("Welcome!");
headingLabel.setText("");
nextButton.setDisable(false);
nextButton.setDisable(false);
previousButton.setDisable(true);
previousButton.setDisable(true);
}
}
else if (windowName == WindowName.LICENSE)
else if (windowName == WindowName.LICENSE)
{
{
this.windowName = WindowName.LICENSE;
this.windowName = WindowName.LICENSE;
licensePane.toFront();
licensePane.toFront();
welcomePane.setVisible(false);
welcomePane.setVisible(false);
licensePane.setVisible(true);
licensePane.setVisible(true);
finalConfigPane.setVisible(false);
finalConfigPane.setVisible(false);
headingLabel.setText("License Agreement");
headingLabel.setText("License Agreement");
nextButton.setDisable(false);
nextButton.setDisable(false);
previousButton.setDisable(false);
previousButton.setDisable(false);
}
}
else if (windowName == WindowName.FINAL)
else if (windowName == WindowName.FINAL)
{
{
this.windowName = WindowName.FINAL;
this.windowName = WindowName.FINAL;
finalConfigPane.toFront();
finalConfigPane.toFront();
welcomePane.setVisible(false);
welcomePane.setVisible(false);
licensePane.setVisible(false);
licensePane.setVisible(false);
finalConfigPane.setVisible(true);
finalConfigPane.setVisible(true);
headingLabel.setText("Finishing up ...");
headingLabel.setText("Finishing up ...");
nextButton.setDisable(true);
nextButton.setDisable(true);
previousButton.setDisable(false);
previousButton.setDisable(false);
}
}
}
}
}
}
package com.StreamPi.Server.Window.FirstTimeUse;
package com.StreamPi.Server.Window.FirstTimeUse;
import javafx.geometry.Pos;
import javafx.scene.control.Label;
import javafx.scene.control.Label;
import javafx.scene.layout.VBox;
import javafx.scene.layout.VBox;
public class WelcomePane extends VBox{
public class WelcomePane extends VBox{
public WelcomePane()
public WelcomePane()
{
{
getStyleClass().add("first_time_use_pane_welcome");
getStyleClass().add("first_time_use_pane_welcome");
Label label = new Label("Welcome to StreamPi!\nClick on 'Next' to continue with the setup.");
Label welcomeLabel = new Label("Welcome!");
welcomeLabel.getStyleClass().add("first_time_use_welcome_pane_welcome_label");
getChildren().add(label);
Label nextToContinue = new Label("Click on Next to continue with the setup.");
nextToContinue.getStyleClass().add("first_time_use_welcome_pane_next_to_continue_label");
setAlignment(Pos.CENTER);
setSpacing(5.0);
getChildren().addAll(welcomeLabel, nextToContinue);
setVisible(false);
setVisible(false);
}
}
}
}
.root {
.root {
-fx-font-family : 'Roboto';
-fx-font-family : 'Roboto';
}
}
.settings_about_streampi_header
.settings_about_streampi_header
{
{
-fx-font-size : 25;
-fx-font-size : 25;
}
}
.settings_about_donate_hyperlink
.settings_about_donate_hyperlink
{
{
-fx-font-size : 19;
-fx-font-size : 19;
-fx-font-weight : bold;
-fx-font-weight : bold;
}
}
.settings_about_license_label
.settings_about_license_label
{
{
-fx-font-size : 16;
-fx-font-size : 16;
}
}
.settings_plugins_each_action, .settings_themes_each_theme, .settings_clients_each_client
.settings_plugins_each_action, .settings_themes_each_theme, .settings_clients_each_client
{
{
-fx-border-width : 0 0 1 0;
-fx-border-width : 0 0 1 0;
-fx-border-color : grey;
-fx-border-color : grey;
}
}
.settings_plugins_each_action_heading, .settings_themes_each_theme_heading, .settings_client_nick_name_label
.settings_plugins_each_action_heading, .settings_themes_each_theme_heading, .settings_client_nick_name_label
{
{
-fx-font-size : 19;
-fx-font-size : 19;
}
}
.action_box
.action_box
{
{
-fx-border-width: 1px;
-fx-border-width: 1px;
-fx-shape: "M100,100 h200 a20,20 0 0 1 20,20 v200 a20,20 0 0 1 -20,20 h-200 a20,20 0 0 1 -20,-20 v-200 a20,20 0 0 1 20,-20 z";
-fx-shape: "M100,100 h200 a20,20 0 0 1 20,20 v200 a20,20 0 0 1 -20,20 h-200 a20,20 0 0 1 -20,-20 v-200 a20,20 0 0 1 20,-20 z";
}
}
.action_box_icon_present
.action_box_icon_present
{
{
}
}
.action_box_icon_not_present
.action_box_icon_not_present
{
{
}
}
.action_box_valid
.action_box_valid
{
{
-fx-border-color: grey;
-fx-border-color: grey;
}
}
.action_box_invalid
.action_box_invalid
{
{
-fx-border-color: red;
-fx-border-color: red;
}
}
.action_box_display_text_label
.action_box_display_text_label
{
{
-fx-font-size : 16;
-fx-font-size : 16;
-fx-background-color : transparent;
-fx-background-color : transparent;
}
}
.action_details_pane_action_heading_label
.action_details_pane_action_heading_label
{
{
-fx-font-size : 16;
-fx-font-size : 16;
}
}
.settings_client_socket_connection_label
.settings_client_socket_connection_label
{
{
-fx-font-size : 16;
-fx-font-size : 16;
}
}
.alert_header
.alert_header
{
{
-fx-padding: 5;
-fx-padding: 5;
}
}
.alert_pane
.alert_pane
{
{
-fx-background-color : white;
-fx-background-color : white;
-fx-border-color : white;
-fx-border-color : white;
-fx-border-width : 5;
-fx-border-width : 5;
-fx-border-radius : 5;
-fx-border-radius : 5;
-fx-background-radius : 5;
-fx-background-radius : 5;
-fx-max-width : 400;
-fx-max-width : 400;
-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.6) , 5, 0.0 , 0.0 , 0 );
-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.6) , 5, 0.0 , 0.0 , 0 );
}
}
.alert_header_icon
.alert_header_icon
{
{
-fx-icon-size : 30;
-fx-icon-size : 30;
}
}
.alert_error_icon
.alert_error_icon
{
{
-fx-icon-color: RED;
-fx-icon-color: RED;
}
}
.alert_information_icon
.alert_information_icon
{
{
-fx-icon-color: BLUE;
-fx-icon-color: BLUE;
}
}
.alert_warning_icon
.alert_warning_icon
{
{
-fx-icon-color: #ffcc00;
-fx-icon-color: #ffcc00;
}
}
.alert_content_pane
.alert_content_pane
{
{
-fx-background-color: white;
-fx-background-color: white;
-fx-padding: 5;
-fx-padding: 5;
}
}
.alert_pane_parent, .combobox_pane_parent
.alert_pane_parent, .combobox_pane_parent
{
{
-fx-background-color : rgba(0,0,0,0.5);
-fx-background-color : rgba(0,0,0,0.5);
}
}
.alert_pane_header_text
.alert_pane_header_text
{
{
-fx-font-size: 18;
-fx-font-size: 18;
}
}
.alert_button_bar
.alert_button_bar
{
{
-fx-background-color: white;
-fx-background-color: white;
-fx-alignment: CENTER_RIGHT;
-fx-alignment: CENTER_RIGHT;
-fx-spacing: 5;
-fx-spacing: 5;
-fx-padding: 5;
-fx-padding: 5;
}
}
.alert_scroll_pane {
.alert_scroll_pane {
-fx-background: #FFFFFF;
-fx-background: #FFFFFF;
-fx-border-color:#FFFFFF;
-fx-border-color:#FFFFFF;
-fx-max-height : 300;
-fx-max-height : 300;
/*-fx-focus-color: #FFFFFF;
/*-fx-focus-color: #FFFFFF;
-fx-faint-focus-color:#FFFFFF;*/
-fx-faint-focus-color:#FFFFFF;*/
}
}
.dashboard_plugins_pane_action_icon_imageview
.dashboard_plugins_pane_action_icon_imageview
{
{
-fx-width:20;
-fx-width:20;
-fx-height:20;
-fx-height:20;
}
}
.donate_request_popup_patreon_link
.donate_request_popup_patreon_link
{
{
-fx-padding : 10 0 0 0;
-fx-padding : 10 0 0 0;
-fx-font-size : 15;
-fx-font-size : 15;
}
}
.first_time_use_pane
.first_time_use_pane
{
{
-fx-padding : 5;
-fx-padding : 5;
}
}
.first_time_use_pane_heading_label
.first_time_use_pane_heading_label
{
{
-fx-font-size: 20;
-fx-font-size: 20;
}
}
.first_time_use_pane_stackpane
.first_time_use_pane_stackpane
{
{
}
}
.first_time_use_pane_welcome
.first_time_use_pane_welcome
{
{
}
}
.first_time_use_pane_license
.first_time_use_pane_license
{
{
-fx-spacing : 10;
-fx-spacing : 10;
}
}
.first_time_use_pane_final_config
.first_time_use_pane_final_config
{
{
}
}
.first_time_use_pane_final_config_label
.first_time_use_pane_final_config_label
{
{
-fx-padding: 0 0 30 0;
-fx-padding: 0 0 30 0;
}
.first_time_use_welcome_pane_welcome_label
{
-fx-font-size: 30;
}
.first_time_use_welcome_pane_next_to_continue_label
{
-fx-font-size: 15;
}
}