diff --git a/build.gradle b/build.gradle index de5cf0978..7dd31ff17 100644 --- a/build.gradle +++ b/build.gradle @@ -29,7 +29,7 @@ allprojects { } } -for (it in tasks.withType(JavaCompile)) { +tasks.withType(JavaCompile).each { it.options.compilerArgs.add('--enable-preview') } diff --git a/dynamic/users/b83a7183-83c0-3203-917e-f187ebcfc6a1/Backgrounds/7pm.jpg b/dynamic/users/b83a7183-83c0-3203-917e-f187ebcfc6a1/Backgrounds/7pm.jpg index 8cd574651..2a823ad70 100644 Binary files a/dynamic/users/b83a7183-83c0-3203-917e-f187ebcfc6a1/Backgrounds/7pm.jpg and b/dynamic/users/b83a7183-83c0-3203-917e-f187ebcfc6a1/Backgrounds/7pm.jpg differ diff --git a/dynamic/users/b83a7183-83c0-3203-917e-f187ebcfc6a1/Userdata.json b/dynamic/users/b83a7183-83c0-3203-917e-f187ebcfc6a1/Userdata.json index 6bdd1fb30..44493ffec 100644 --- a/dynamic/users/b83a7183-83c0-3203-917e-f187ebcfc6a1/Userdata.json +++ b/dynamic/users/b83a7183-83c0-3203-917e-f187ebcfc6a1/Userdata.json @@ -52,4 +52,4 @@ "shownWelcomeMessage": true, "accountCreationTime": 0, "audioPlayerVolumePercent": 13 -} \ No newline at end of file +} diff --git a/src/main/java/cyder/constants/CyderIcons.java b/src/main/java/cyder/constants/CyderIcons.java index 8ceeae447..8f78871ce 100644 --- a/src/main/java/cyder/constants/CyderIcons.java +++ b/src/main/java/cyder/constants/CyderIcons.java @@ -20,7 +20,7 @@ public final class CyderIcons { public static final ImageIcon CYDER_ICON = new ImageIcon(StaticUtil.getStaticPath("CyderIcon.png")); /** - * The x easter egg icon. + * The x Easter egg icon. */ public static final ImageIcon X_ICON = new ImageIcon(StaticUtil.getStaticPath("x.png")); diff --git a/src/main/java/cyder/getter/GetterUtil.java b/src/main/java/cyder/getter/GetterUtil.java index a31fc0bc7..b124af089 100644 --- a/src/main/java/cyder/getter/GetterUtil.java +++ b/src/main/java/cyder/getter/GetterUtil.java @@ -18,6 +18,7 @@ import cyder.ui.label.CyderLabel; import cyder.ui.list.CyderScrollList; import cyder.utils.HtmlUtil; +import cyder.utils.OsUtil; import javax.swing.*; import javax.swing.border.LineBorder; @@ -71,7 +72,7 @@ public static GetterUtil getInstance() { private final ArrayList getFileFrames = new ArrayList<>(); /** - * All the currently active get confirmation confirmation associated with this instance. + * All the currently active get confirmation frames associated with this instance. */ private final ArrayList getConfirmationFrames = new ArrayList<>(); @@ -132,7 +133,7 @@ public void closeAllGetFrames() { /** * Opens up frame with a field and a label for the user to enter input to be returned. *

- * See usage below for how to setup usage of this method so that the calling thread is not blocked. + * See usage below for how to set up usage of this method so that the calling thread is not blocked. *

* Usage: *

@@ -420,7 +421,7 @@ public Optional getInput(GetInputBuilder getInputBuilder) {
     private CyderButton submitFileButton;
 
     /**
-     * The submit text for the submit button.
+     * The "submit" text for the submit button.
      */
     private static final String SUBMIT = "Submit";
 
@@ -438,7 +439,7 @@ public Optional getInput(GetInputBuilder getInputBuilder) {
      * Opens up frame with a field and a file chooser for the user to enter
      * a file location or navigate to a file/directory and submit it.
      * 

- * See usage below for how to setup usage of this method so that the calling thread is not blocked. + * See usage below for how to set up usage of this method so that the calling thread is not blocked. *

* Usage: *

@@ -788,7 +789,7 @@ private void setNavComponentsEnabled(boolean enabled) {
     /**
      * Opens up a frame with a label and a yes/no button for the user to confirm or deny some action.
      * 

- * See usage below for how to setup usage of this method so that the calling thread is not blocked. + * See usage below for how to set up usage of this method so that the calling thread is not blocked. *

* Usage: *

@@ -884,6 +885,7 @@ public boolean getConfirmation(GetConfirmationBuilder getConfirmationBuilder) {
 
                 confirmationFrame.setLocationRelativeTo(relativeTo);
                 confirmationFrame.setVisible(true);
+                OsUtil.setMouseLocation(noButton);
             } catch (Exception e) {
                 ExceptionHandler.handle(e);
             }
diff --git a/src/main/java/cyder/logging/Logger.java b/src/main/java/cyder/logging/Logger.java
index 88c97bf92..3c4025ac2 100644
--- a/src/main/java/cyder/logging/Logger.java
+++ b/src/main/java/cyder/logging/Logger.java
@@ -150,7 +150,7 @@ private static void setupLogFileWithAsciiArt() {
     }
 
     /**
-     * Creates the top level logs directory, the log sub-directory for today,
+     * Creates the top level logs directory, the log subdirectory for today,
      * and the log file for this session if it is not generated or set.
      */
     private static void generateAndSetLogFile() {
@@ -679,7 +679,7 @@ private static void logSpecificObjectsCreated() {
             if (StringUtil.in(bottomLevelClassName, true,
                     Props.specificObjectCreationLogs.getValue().getList())) {
                 String line = bottomLevelClassName + space + "objects created since last delta"
-                        + space + openingParenthesis + objectCreationLogFrequency
+                        + space + openingParenthesis + objectCreationLogFrequency.toMillis()
                         + TimeUtil.MILLISECOND_ABBREVIATION + closingParenthesis
                         + colon + space + objectCreationCounter.get(key).get();
 
@@ -698,7 +698,7 @@ private static void logTotalObjectsCreated() {
             totalObjectsCreated += currentObjectsCreated;
 
             String line = objectsCreatedSinceLastDelta
-                    + space + openingParenthesis + objectCreationLogFrequency
+                    + space + openingParenthesis + objectCreationLogFrequency.toMillis()
                     + TimeUtil.MILLISECOND_ABBREVIATION + closingParenthesis
                     + colon + space + currentObjectsCreated;
 
diff --git a/src/main/java/cyder/props/PropConstants.java b/src/main/java/cyder/props/PropConstants.java
index ec7881d9c..22441c8d2 100644
--- a/src/main/java/cyder/props/PropConstants.java
+++ b/src/main/java/cyder/props/PropConstants.java
@@ -3,6 +3,7 @@
 import cyder.enumerations.Extension;
 import cyder.exceptions.IllegalMethodException;
 import cyder.strings.CyderStrings;
+import cyder.utils.OsUtil;
 
 import java.io.File;
 
@@ -49,7 +50,7 @@ public String getAnnotation() {
     static final String commentPrefix = CyderStrings.hash;
 
     /**
-     * The local props directory.
+     * The local propositional argument directory.
      */
     static final File localPropsDirectory = new File("props");
 
@@ -76,7 +77,8 @@ public String getAnnotation() {
     /**
      * The string to split a prop file contents at to separate the raw file master string into separate lines.
      */
-    static final String splitPropFileContentsAt = CyderStrings.carriageReturnChar + CyderStrings.newline;
+    static final String splitPropFileContentsAt = OsUtil.OPERATING_SYSTEM == OsUtil.OperatingSystem.WINDOWS
+            ? CyderStrings.carriageReturnChar + CyderStrings.newline : CyderStrings.newline;
 
     /**
      * The token to split a string into a list of strings at.
diff --git a/src/main/java/cyder/snakes/PythonUtil.java b/src/main/java/cyder/snakes/PythonUtil.java
index 7e8f59924..5ad911f6a 100644
--- a/src/main/java/cyder/snakes/PythonUtil.java
+++ b/src/main/java/cyder/snakes/PythonUtil.java
@@ -42,7 +42,7 @@ public final class PythonUtil {
     private static final String versionPrefix = "Version" + CyderStrings.colon + CyderStrings.space;
 
     /**
-     * The install keyword for pip installations.
+     * The "install" keyword for pip installations.
      */
     private static final String INSTALL = "install";
 
diff --git a/src/main/java/cyder/subroutines/NecessarySubroutines.java b/src/main/java/cyder/subroutines/NecessarySubroutines.java
index 6bbc4f210..fbbf56af4 100644
--- a/src/main/java/cyder/subroutines/NecessarySubroutines.java
+++ b/src/main/java/cyder/subroutines/NecessarySubroutines.java
@@ -20,7 +20,6 @@
 import cyder.strings.StringUtil;
 import cyder.user.UserUtil;
 import cyder.utils.ArrayUtil;
-import cyder.utils.OsUtil;
 import cyder.utils.ReflectionUtil;
 import cyder.utils.StaticUtil;
 
@@ -125,9 +124,6 @@ public static void executeSubroutines() {
             new Subroutine(NecessarySubroutines::validateWidgets,
                     "Validating Widgets", "Validation of Widgets failed"),
 
-            new Subroutine(() -> !OsUtil.OperatingSystem.OSX.isCurrentOperatingSystem(),
-                    "Ensuring Supported OS", "Unsupported OS"),
-
             new Subroutine(NecessarySubroutines::validateVanillaAnnotations,
                     "Validating vanilla classes", "Validation of vanilla classes failed"),
 
@@ -263,7 +259,7 @@ private static boolean validateWidgets() {
      *     
  • * *

    - * All of the above checks may be skipped if the the method contains a + * All of the above checks may be skipped if the method contains a * {@link CyderInspection#WidgetInspection} suppression. * * @param method the method to validate @@ -309,7 +305,7 @@ private static boolean validateWidget(Method method) { } /** - * Validates all widget classes annotated with with {@link cyder.annotations.Vanilla} annotation. + * Validates all widget classes annotated with {@link cyder.annotations.Vanilla} annotation. * * @return whether all vanilla annotations are valid */ diff --git a/src/main/java/cyder/ui/frame/CyderFrame.java b/src/main/java/cyder/ui/frame/CyderFrame.java index c1f51f111..95162df5f 100644 --- a/src/main/java/cyder/ui/frame/CyderFrame.java +++ b/src/main/java/cyder/ui/frame/CyderFrame.java @@ -1835,12 +1835,12 @@ public void repaint() { */ @Override public void setSize(int width, int height) { - Preconditions.checkArgument(width >= minimumWidth); - Preconditions.checkArgument(height >= minimumHeight); - width = attemptInitialWidthCorrectionIfEnabled(width); height = attemptInitialHeightCorrectionIfEnabled(height); + Preconditions.checkArgument(width >= minimumWidth); + Preconditions.checkArgument(height >= minimumHeight); + boolean sameSizes = this.width == width && this.height == height; super.setSize(width, height); this.width = width; @@ -1854,12 +1854,12 @@ public void setSize(int width, int height) { */ @Override public void setBounds(int x, int y, int width, int height) { - Preconditions.checkArgument(width >= minimumWidth); - Preconditions.checkArgument(height >= minimumHeight); - width = attemptInitialWidthCorrectionIfEnabled(width); height = attemptInitialHeightCorrectionIfEnabled(height); + Preconditions.checkArgument(width >= minimumWidth); + Preconditions.checkArgument(height >= minimumHeight); + boolean sameSizes = this.width == width && this.height == height; super.setBounds(x, y, width, height); this.width = width; diff --git a/src/main/java/cyder/utils/OsUtil.java b/src/main/java/cyder/utils/OsUtil.java index f14ce7344..68d3ac54e 100644 --- a/src/main/java/cyder/utils/OsUtil.java +++ b/src/main/java/cyder/utils/OsUtil.java @@ -58,7 +58,7 @@ private OsUtil() { } /** - * The top-level operating system name (the operating system the JVM is currently being ran on). + * The top-level operating system name (the operating system the JVM is currently running on). */ public static final String OPERATING_SYSTEM_NAME = SystemPropertyKey.OS_NAME.getProperty(); @@ -196,15 +196,6 @@ public static boolean isWindows() { return OperatingSystem.WINDOWS.isCurrentOperatingSystem(); } - /** - * Returns whether the operating system is OSX. - * - * @return whether the operating system is OSX - */ - public static boolean isOsx() { - return OperatingSystem.OSX.isCurrentOperatingSystem(); - } - /** * The length of the prefixes for running a system command. * For windows this is "cmd.exe" and "/C" and for Unix systems @@ -580,7 +571,7 @@ public static boolean isBinaryInExes(String filename) { if (exes.exists()) { File[] exeFiles = exes.listFiles(); - if (exeFiles != null && exeFiles.length > 0) { + if (!ArrayUtil.nullOrEmpty(exeFiles)) { for (File exe : exeFiles) { if (exe.getName().equalsIgnoreCase(filename)) { return true;