From: rnayabed Date: Wed, 10 Feb 2021 14:55:49 +0530 Subject: work --- work --- --- 'a/src/main/java/com/stream_pi/client/connection/Client.java' +++ b/src/main/java/com/stream_pi/client/connection/Client.java @@ -77,7 +77,7 @@ public class Client extends Thread{ clientListener.setConnected(false); clientListener.updateSettingsConnectDisconnectButton(); - throw new MinorException("connection Error", "Unable to connect to server. Please check settings and connection and try again."); + throw new MinorException("Connection Error", "Unable to connect to server. Please check settings and connection and try again."); } try --- 'a/src/main/java/com/stream_pi/client/window/Base.java' +++ b/src/main/java/com/stream_pi/client/window/Base.java @@ -23,6 +23,7 @@ import com.stream_pi.util.loggerhelper.S import com.stream_pi.util.loggerhelper.StreamPiLogFileHandler; import com.stream_pi.util.platform.Platform; +import javafx.geometry.Insets; import javafx.scene.CacheHint; import javafx.scene.Cursor; import javafx.scene.input.KeyCombination; @@ -137,6 +138,7 @@ public abstract class Base extends Stack settingsBase.setCacheHint(CacheHint.SPEED); alertStackPane = new StackPane(); + alertStackPane.setPadding(new Insets(10)); alertStackPane.setVisible(false); StreamPiAlert.setParent(alertStackPane); @@ -158,6 +160,7 @@ public abstract class Base extends Stack { clearStylesheets(); applyDefaultStylesheet(); + applyDefaultIconsStylesheet(); getChildren().add(firstTimeUse); firstTimeUse.toFront(); @@ -186,9 +189,12 @@ public abstract class Base extends Stack } else { + clearStylesheets(); + applyDefaultStylesheet(); + applyDefaultIconsStylesheet(); + getStage().show(); throw new SevereException("No storage permission. Give it!"); } - } catch (Exception e) { @@ -252,6 +258,11 @@ public abstract class Base extends Stack getStylesheets().add(Main.class.getResource("style.css").toExternalForm()); } + public void applyDefaultIconsStylesheet() + { + Font.loadFont(Main.class.getResourceAsStream("Roboto.ttf"), 13); + getStylesheets().add(Main.class.getResource("default_icons.css").toExternalForm()); + } public Config getConfig() @@ -287,8 +298,9 @@ public abstract class Base extends Stack currentTheme = t; clearStylesheets(); - getStylesheets().addAll(t.getStylesheets()); applyDefaultStylesheet(); + getStylesheets().addAll(t.getStylesheets()); + applyDefaultIconsStylesheet(); logger.info("... Done!"); } --- 'a/src/main/java/com/stream_pi/client/window/firsttimeuse/WelcomePane.java' +++ b/src/main/java/com/stream_pi/client/window/firsttimeuse/WelcomePane.java @@ -10,9 +10,13 @@ public class WelcomePane extends VBox{ getStyleClass().add("first_time_use_pane_welcome"); Label welcomeLabel = new Label("Welcome!"); + welcomeLabel.setWrapText(true); + welcomeLabel.setAlignment(Pos.CENTER); welcomeLabel.getStyleClass().add("first_time_use_welcome_pane_welcome_label"); Label nextToContinue = new Label("Please click \"Next\" to start the Setup process"); + nextToContinue.setWrapText(true); + nextToContinue.setAlignment(Pos.CENTER); nextToContinue.getStyleClass().add("first_time_use_welcome_pane_next_to_continue_label"); --- 'a/src/main/java/com/stream_pi/client/window/settings/SettingsBase.java' +++ b/src/main/java/com/stream_pi/client/window/settings/SettingsBase.java @@ -413,7 +413,10 @@ public class SettingsBase extends VBox { boolean breakConnection = false; if(!Config.getInstance().getCurrentThemeFullName().equals(themeComboBox.getCurrentSelectedItem().getFullName())) + { + breakConnection = true; toBeReloaded = true; + } Config.getInstance().setCurrentThemeFullName(themeComboBox.getCurrentSelectedItem().getFullName()); @@ -496,7 +499,10 @@ public class SettingsBase extends VBox { if(breakConnection) { if(clientListener.isConnected()) - clientListener.disconnect("Client connection settings were changed."); + { + clientListener.disconnect("Client connection settings were changed. Client will reconnect again."); + clientListener.setupClientConnection(); + } } if(toBeReloaded) Binary files 'a/src/main/resources/com/stream_pi/client/Default.obj' and b/src/main/resources/com/stream_pi/client/Default.obj differ --- /dev/null +++ b/src/main/resources/com/stream_pi/client/default_icons.css @@ -0,0 +1,14 @@ +.alert_error_icon +{ + -fx-icon-color: RED; +} + +.alert_information_icon +{ + -fx-icon-color: BLUE; +} + +.alert_warning_icon +{ + -fx-icon-color: #ffcc00; +} \ No newline at end of file --- 'a/src/main/resources/com/stream_pi/client/style.css' +++ b/src/main/resources/com/stream_pi/client/style.css @@ -49,21 +49,6 @@ -fx-icon-size : 30; } -.alert_error_icon -{ - -fx-icon-color: RED; -} - -.alert_information_icon -{ - -fx-icon-color: BLUE; -} - -.alert_warning_icon -{ - -fx-icon-color: #ffcc00; -} - .alert_content_pane { -fx-padding: 5; @@ -181,3 +166,33 @@ -fx-focus-color:transparent; -fx-faint-focus-color:transparent; } + +/*Alert Classes added to default stylesheet to show init error, if occurs */ +.action_box_display_text_label +{ + -fx-font-size : 16; + -fx-background-color : transparent; +} + +.alert_pane +{ + -fx-background-color : white; + -fx-border-color : white; +} + +.alert_content_pane +{ + -fx-background-color: white; + -fx-padding: 5; +} + +.alert_scroll_pane +{ + -fx-background: white; + -fx-border-color:white; +} + +.alert_button_bar +{ + -fx-background-color:white; +} \ No newline at end of file