diff --git a/lib/rsyntaxtextarea-2.5.6.jar b/lib/rsyntaxtextarea-2.5.6.jar new file mode 100644 index 0000000..b60def6 Binary files /dev/null and b/lib/rsyntaxtextarea-2.5.6.jar differ diff --git a/nbproject/project.properties b/nbproject/project.properties index 3cbc6c2..327010f 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -38,6 +38,7 @@ file.reference.js-engine.jar=lib/js-engine.jar file.reference.js.jar=lib/js.jar file.reference.jython-standalone-2.7-b3.jar=lib/jython-standalone-2.7-b3.jar file.reference.log4j-1.2.11.jar=lib/log4j-1.2.11.jar +file.reference.rsyntaxtextarea-2.5.6.jar=lib/rsyntaxtextarea-2.5.6.jar file.reference.symja-2014-11-01.jar=lib/symja-2014-11-01.jar includes=** jar.archive.disabled=${jnlp.enabled} @@ -51,7 +52,8 @@ javac.classpath=\ ${file.reference.htmlcleaner-2.10.jar}:\ ${file.reference.js-engine.jar}:\ ${file.reference.js.jar}:\ - ${file.reference.jython-standalone-2.7-b3.jar} + ${file.reference.jython-standalone-2.7-b3.jar}:\ + ${file.reference.rsyntaxtextarea-2.5.6.jar} # Space-separated list of extra javac options javac.compilerargs= javac.deprecation=false diff --git a/src/net/apocalypselabs/symat/CodeEditor.java b/src/net/apocalypselabs/symat/CodeEditor.java index 37b8a3c..55e371a 100644 --- a/src/net/apocalypselabs/symat/CodeEditor.java +++ b/src/net/apocalypselabs/symat/CodeEditor.java @@ -423,8 +423,8 @@ public class CodeEditor extends javax.swing.JInternalFrame { private void execCode(String lang) { CodeRunner cr = new CodeRunner(lang); - System.out.println(lang); - System.out.println(codeBox.getText()); + Debug.println(lang); + Debug.println(codeBox.getText()); Object result = cr.evalString(codeBox.getText()); try { outputBox.append(result.toString() + "\n"); diff --git a/src/net/apocalypselabs/symat/CodeRunner.java b/src/net/apocalypselabs/symat/CodeRunner.java index 0fe238c..ce4b53d 100644 --- a/src/net/apocalypselabs/symat/CodeRunner.java +++ b/src/net/apocalypselabs/symat/CodeRunner.java @@ -145,7 +145,6 @@ public class CodeRunner { private String wrapMath(String eval) { if (wrapRequired) { String with = "with(SyMAT_Functions){with(Math){" + eval + "}}"; - //System.out.println(with); return with; } return eval; diff --git a/src/net/apocalypselabs/symat/Debug.java b/src/net/apocalypselabs/symat/Debug.java index 5e11355..99e1997 100644 --- a/src/net/apocalypselabs/symat/Debug.java +++ b/src/net/apocalypselabs/symat/Debug.java @@ -35,7 +35,7 @@ package net.apocalypselabs.symat; public class Debug { // If output should be on or off - public static final boolean DEBUG = true; + public static final boolean DEBUG = false; public static void println(Object data) { if (DEBUG) { diff --git a/src/net/apocalypselabs/symat/MainGUI.java b/src/net/apocalypselabs/symat/MainGUI.java index 18f7449..6ee3cd8 100644 --- a/src/net/apocalypselabs/symat/MainGUI.java +++ b/src/net/apocalypselabs/symat/MainGUI.java @@ -45,7 +45,8 @@ import javax.swing.JInternalFrame; public class MainGUI extends javax.swing.JFrame { public static final String APP_NAME = "SyMAT 0.7"; - public static final double APP_CODE = 0.7; + public static final double APP_CODE = 7; + public static final String VERSION_NAME = "0.7"; public static String argfile = ""; public static boolean skipPython = false; // Skip python init on start? @@ -57,24 +58,25 @@ public class MainGUI extends javax.swing.JFrame { setIconImage((new ImageIcon(getClass().getResource("icon.png"))).getImage()); setLocationRelativeTo(null); try { - URL url = new URL("http://symat.aplabs.us/version.txt"); + URL url = new URL("http://symatapp.com/version.txt"); InputStream is = url.openStream(); BufferedReader br = new BufferedReader(new InputStreamReader(is)); String line = br.readLine(); br.close(); is.close(); - double version = Double.parseDouble(line); + double version = Double.parseDouble(line.split("\\|")[0]); if (version > APP_CODE) { if (PrefStorage.getSetting("update-ignore").equals(APP_CODE + "|" + version)) { System.out.println("An update was found, but has been ignored by the user."); } else { - loadFrame(new Update(version)); + loadFrame(new Update(line.split("\\|")[1])); } } } catch (IOException | NumberFormatException e) { System.err.println("Fail: Cannot check update server. \n" + " Assuming local copy up-to-date."); + e.printStackTrace(); } // Open shell unless prog was run with argument diff --git a/src/net/apocalypselabs/symat/SplashScreen.form b/src/net/apocalypselabs/symat/SplashScreen.form index 65b9430..c52fc59 100644 --- a/src/net/apocalypselabs/symat/SplashScreen.form +++ b/src/net/apocalypselabs/symat/SplashScreen.form @@ -2,7 +2,7 @@
- + diff --git a/src/net/apocalypselabs/symat/SplashScreen.java b/src/net/apocalypselabs/symat/SplashScreen.java index 0248f36..108d3b6 100644 --- a/src/net/apocalypselabs/symat/SplashScreen.java +++ b/src/net/apocalypselabs/symat/SplashScreen.java @@ -57,7 +57,7 @@ public class SplashScreen extends javax.swing.JFrame { progBar = new javax.swing.JProgressBar(); jLabel5 = new javax.swing.JLabel(); - setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle(MainGUI.APP_NAME); setMaximumSize(new java.awt.Dimension(320, 260)); setMinimumSize(new java.awt.Dimension(320, 260)); @@ -100,7 +100,7 @@ public class SplashScreen extends javax.swing.JFrame { }//GEN-LAST:event_formComponentShown /** - * Load things that take a while. + * Bootstrapping everything. */ private class Loader extends Thread { @@ -112,7 +112,7 @@ public class SplashScreen extends javax.swing.JFrame { if (!MainGUI.skipPython) { // Python laggggsss when used for first time, this fixes the wait later. System.out.println("Warming up Python engine, to skip run with argument 'skippython'"); - setProgress(20, "Initializing Python engine"); + setProgress(20, "Initializing code engine"); try { CodeRunner python = new CodeRunner(true); } catch (Exception ex) { @@ -126,6 +126,11 @@ public class SplashScreen extends javax.swing.JFrame { dispose(); } + /** + * Set the progress bar. + * @param progress how full to make it (0 <= progress <= 100) + * @param label The String to put on the label. + */ private void setProgress(int progress, String label) { final int prog = progress; final String lbl = label; @@ -139,6 +144,11 @@ public class SplashScreen extends javax.swing.JFrame { }); } + /** + * Animate the dots on the progress bar label. + * + * This way people know it's not "frozen", so they don't "let it go". + */ private class DotThread extends Thread { private boolean doRun = true; @@ -151,16 +161,17 @@ public class SplashScreen extends javax.swing.JFrame { public void run() { String val = progBar.getString(); if (val.endsWith("...")) { - progBar.setString(val.replace("...", "")); - } else if (val.endsWith("..")) { - progBar.setString(val.replace("..", "...")); - } else if (val.endsWith(".")) { - progBar.setString(val.replace(".", "..")); - } else if (!val.endsWith(".")) { - progBar.setString(val+"."); + progBar.setString(val.replace("...", " ")); + } else if (val.endsWith(".. ")) { + progBar.setString(val.replace(".. ", "...")); + } else if (val.endsWith(". ")) { + progBar.setString(val.replace(". ", ".. ")); + } else if (!val.endsWith(" ")) { + progBar.setString(val+". "); } } }); + Debug.println("dotsupdate"); try { Thread.sleep(500); } catch (InterruptedException ex) { diff --git a/src/net/apocalypselabs/symat/Update.form b/src/net/apocalypselabs/symat/Update.form index e78c929..87e99b6 100644 --- a/src/net/apocalypselabs/symat/Update.form +++ b/src/net/apocalypselabs/symat/Update.form @@ -96,7 +96,7 @@ - + @@ -107,7 +107,7 @@ - + diff --git a/src/net/apocalypselabs/symat/Update.java b/src/net/apocalypselabs/symat/Update.java index 7da0322..5bcb9ea 100644 --- a/src/net/apocalypselabs/symat/Update.java +++ b/src/net/apocalypselabs/symat/Update.java @@ -39,14 +39,14 @@ import javax.swing.JOptionPane; */ public class Update extends javax.swing.JInternalFrame { - private final double latestVersion; + private final String latestVersion; /** * Creates new form Update * * @param latest The new version. */ - public Update(double latest) { + public Update(String latest) { latestVersion = latest; initComponents(); } @@ -82,11 +82,11 @@ public class Update extends javax.swing.JInternalFrame { jLabel3.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); - jLabel3.setText("Latest version: "+String.valueOf(latestVersion)); + jLabel3.setText("Latest version: "+latestVersion); jLabel4.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); - jLabel4.setText("Your version: "+String.valueOf(MainGUI.APP_CODE)); + jLabel4.setText("Your version: "+MainGUI.VERSION_NAME); jButton1.setBackground(new java.awt.Color(51, 153, 255)); jButton1.setFont(new java.awt.Font("Tahoma", 3, 18)); // NOI18N @@ -146,12 +146,12 @@ public class Update extends javax.swing.JInternalFrame { private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed if (Desktop.isDesktopSupported()) { try { - Desktop.getDesktop().browse(new URI("http://symat.aplabs.us/")); + Desktop.getDesktop().browse(new URI("http://symatapp.com/")); } catch (IOException | URISyntaxException ex) { - JOptionPane.showInternalMessageDialog(this, "Cannot open browser. Please go to symat.aplabs.us."); + JOptionPane.showInternalMessageDialog(this, "Cannot open browser. Please go to symatapp.com."); } } else { - JOptionPane.showInternalMessageDialog(this, "Cannot open browser. Please go to symat.aplabs.us."); + JOptionPane.showInternalMessageDialog(this, "Cannot open browser. Please go to symatapp.com."); } }//GEN-LAST:event_jButton1ActionPerformed diff --git a/src/net/apocalypselabs/symat/help/licenses.html b/src/net/apocalypselabs/symat/help/licenses.html index 4ec70c6..6196f3c 100644 --- a/src/net/apocalypselabs/symat/help/licenses.html +++ b/src/net/apocalypselabs/symat/help/licenses.html @@ -30,7 +30,7 @@ case you should take measures to prevent unauthorized
downloads, such as preventing download access from the
Internet.


-

This application also uses libraries from third-parties.

+

This application also uses libraries from third-parties.

Symja (parser), log4j, Java-Prettify:

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -84,6 +84,32 @@ agrees to be bound by the terms and conditions of this License Agreement.


+

RSyntaxTextArea

+

Copyright (c) 2012, Robert Futrell
+ All rights reserved.

+ + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution.
+ * Neither the name of the author nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission.

+ + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL ROBERT FUTRELL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+

HtmlCleaner


Copyright (c) 2006-2014, HtmlCleaner team.
All rights reserved.