Fixed #11: Application now scales correctly

This commit is contained in:
Rohit Awate 2018-05-08 22:35:40 +05:30
parent ee956baed6
commit 79861e0d7e
No known key found for this signature in database
GPG key ID: 1051D7B79CF2EE25
4 changed files with 14 additions and 10 deletions

View file

@ -155,7 +155,7 @@ public class DashboardController implements Initializable {
}); });
errorTitle.setText("Oops... That's embarrassing!"); errorTitle.setText("Oops... That's embarrassing!");
errorDetails.setText("Something went wrong. Try to make another getRequest.\nRestart Everest if that doesn't work."); errorDetails.setText("Something went wrong. Try to make another request.\nRestart Everest if that doesn't work.");
visualizer = new Visualizer(); visualizer = new Visualizer();
visualizerTab.setContent(visualizer); visualizerTab.setContent(visualizer);
@ -199,7 +199,6 @@ public class DashboardController implements Initializable {
configureRequestManager(); configureRequestManager();
requestManager.start(); requestManager.start();
break; break;
// DataDispatchRequestManager will generate appropriate getRequest based on the type.
case "POST": case "POST":
case "PUT": case "PUT":
case "PATCH": case "PATCH":
@ -274,7 +273,7 @@ public class DashboardController implements Initializable {
Services.loggingService.logSevere("Request execution failed.", E, LocalDateTime.now()); Services.loggingService.logSevere("Request execution failed.", E, LocalDateTime.now());
errorLayer.setVisible(true); errorLayer.setVisible(true);
errorTitle.setText("Oops... That's embarrassing!"); errorTitle.setText("Oops... That's embarrassing!");
errorDetails.setText("Something went wrong. Try to make another getRequest.\nRestart Everest if that doesn't work."); errorDetails.setText("Something went wrong. Try to make another request.\nRestart Everest if that doesn't work.");
} }
} }
@ -290,7 +289,7 @@ public class DashboardController implements Initializable {
promptLayer.setVisible(false); promptLayer.setVisible(false);
Throwable throwable = requestManager.getException(); Throwable throwable = requestManager.getException();
Exception exception = (Exception) throwable; Exception exception = (Exception) throwable;
Services.loggingService.logWarning(httpMethodBox.getValue() + " getRequest could not be processed.", exception, LocalDateTime.now()); Services.loggingService.logWarning(httpMethodBox.getValue() + " request could not be processed.", exception, LocalDateTime.now());
if (throwable.getClass() == UnreliableResponseException.class) { if (throwable.getClass() == UnreliableResponseException.class) {
UnreliableResponseException URE = (UnreliableResponseException) throwable; UnreliableResponseException URE = (UnreliableResponseException) throwable;
@ -311,7 +310,7 @@ public class DashboardController implements Initializable {
if (requestManager.getClass() == DataDispatchRequestManager.class) { if (requestManager.getClass() == DataDispatchRequestManager.class) {
if (throwable.getCause() != null && throwable.getCause().getClass() == IllegalArgumentException.class) { if (throwable.getCause() != null && throwable.getCause().getClass() == IllegalArgumentException.class) {
errorTitle.setText("Did you forget something?"); errorTitle.setText("Did you forget something?");
errorDetails.setText("Please specify at least one body part for your " + httpMethodBox.getValue() + " getRequest."); errorDetails.setText("Please specify at least one body part for your " + httpMethodBox.getValue() + " request.");
} else if (throwable.getClass() == FileNotFoundException.class) { } else if (throwable.getClass() == FileNotFoundException.class) {
errorTitle.setText("File(s) not found:"); errorTitle.setText("File(s) not found:");
errorDetails.setText(throwable.getMessage()); errorDetails.setText(throwable.getMessage());

View file

@ -21,9 +21,11 @@ import com.rohitawate.everest.util.settings.SettingsLoader;
import com.rohitawate.everest.util.themes.ThemeManager; import com.rohitawate.everest.util.themes.ThemeManager;
import javafx.application.Application; import javafx.application.Application;
import javafx.fxml.FXMLLoader; import javafx.fxml.FXMLLoader;
import javafx.geometry.Rectangle2D;
import javafx.scene.Parent; import javafx.scene.Parent;
import javafx.scene.Scene; import javafx.scene.Scene;
import javafx.scene.image.Image; import javafx.scene.image.Image;
import javafx.stage.Screen;
import javafx.stage.Stage; import javafx.stage.Stage;
public class Main extends Application { public class Main extends Application {
@ -41,6 +43,10 @@ public class Main extends Application {
Stage dashboardStage = new Stage(); Stage dashboardStage = new Stage();
ThemeManager.setTheme(homeWindow); ThemeManager.setTheme(homeWindow);
Rectangle2D screenBounds = Screen.getPrimary().getBounds();
dashboardStage.setWidth(screenBounds.getWidth() * 0.83);
dashboardStage.setHeight(screenBounds.getHeight() * 0.74);
dashboardStage.getIcons().add(new Image(getClass().getResource("/assets/Logo.png").toExternalForm())); dashboardStage.getIcons().add(new Image(getClass().getResource("/assets/Logo.png").toExternalForm()));
dashboardStage.setScene(new Scene(homeWindow)); dashboardStage.setScene(new Scene(homeWindow));
dashboardStage.setTitle("Everest"); dashboardStage.setTitle("Everest");

View file

@ -22,9 +22,8 @@
<?import javafx.scene.image.*?> <?import javafx.scene.image.*?>
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?> <?import javafx.scene.text.*?>
<StackPane fx:id="dashboard" minHeight="720.0" minWidth="1280.0" stylesheets="@../../css/Adreana.css" <StackPane fx:id="dashboard" stylesheets="@../../css/Adreana.css" xmlns="http://javafx.com/javafx/8.0.141"
xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.rohitawate.everest.controllers.DashboardController">
fx:controller="com.rohitawate.everest.controllers.DashboardController">
<children> <children>
<VBox prefHeight="200.0" prefWidth="100.0"> <VBox prefHeight="200.0" prefWidth="100.0">
<children> <children>

View file

@ -22,12 +22,12 @@
<?import javafx.scene.image.*?> <?import javafx.scene.image.*?>
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<?import javafx.scene.text.Font?> <?import javafx.scene.text.Font?>
<StackPane fx:id="homeWindowSP" stylesheets="@../../css/Adreana.css" xmlns="http://javafx.com/javafx/8.0.111" <StackPane fx:id="homeWindowSP" stylesheets="@../../css/Adreana.css" xmlns="http://javafx.com/javafx/8.0.141"
xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.rohitawate.everest.controllers.HomeWindowController"> xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.rohitawate.everest.controllers.HomeWindowController">
<children> <children>
<SplitPane fx:id="splitPane" dividerPositions="0.3"> <SplitPane fx:id="splitPane" dividerPositions="0.3">
<items> <items>
<VBox fx:id="historyPane" alignment="TOP_CENTER" maxWidth="500.0" minWidth="400.0" <VBox fx:id="historyPane" alignment="TOP_CENTER" maxWidth="450.0" minWidth="400.0"
SplitPane.resizableWithParent="false"> SplitPane.resizableWithParent="false">
<children> <children>
<HBox fx:id="historySearchFieldBox" alignment="CENTER" fillHeight="false"> <HBox fx:id="historySearchFieldBox" alignment="CENTER" fillHeight="false">