Update references to symatapp.com, minor tweaking, prepare to make major changes to editor

master
skylarmt 9 years ago
parent 5a82b88351
commit f0a9bbe84a

Binary file not shown.

@ -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

@ -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");

@ -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;

@ -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) {

@ -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

@ -2,7 +2,7 @@
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
<Properties>
<Property name="defaultCloseOperation" type="int" value="2"/>
<Property name="defaultCloseOperation" type="int" value="3"/>
<Property name="title" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="MainGUI.APP_NAME" type="code"/>
</Property>

@ -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) {

@ -96,7 +96,7 @@
</Property>
<Property name="horizontalAlignment" type="int" value="0"/>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="&quot;Latest version: &quot;+String.valueOf(latestVersion)" type="code"/>
<Connection code="&quot;Latest version: &quot;+latestVersion" type="code"/>
</Property>
</Properties>
</Component>
@ -107,7 +107,7 @@
</Property>
<Property name="horizontalAlignment" type="int" value="0"/>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="&quot;Your version: &quot;+String.valueOf(MainGUI.APP_CODE)" type="code"/>
<Connection code="&quot;Your version: &quot;+MainGUI.VERSION_NAME" type="code"/>
</Property>
</Properties>
</Component>

@ -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

@ -30,7 +30,7 @@
case you should take measures to prevent unauthorized<br>
downloads, such as preventing download access from the <br>
Internet.</p><br>
<p>This application also uses libraries from third-parties.</p>
<h3>This application also uses libraries from third-parties.</h3>
<p><b>Symja (parser), log4j, Java-Prettify:</b></p>
<p>Licensed under the Apache License, Version 2.0 (the "License");<br>
you may not use this file except in compliance with the License.<br>
@ -84,6 +84,32 @@
agrees to be bound by the terms and conditions of this License
Agreement.</p>
<br>
<p><b>RSyntaxTextArea</b></p>
<p>Copyright (c) 2012, Robert Futrell<br>
All rights reserved.<br><br>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:<br>
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.<br>
* 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.<br>
* 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.<br><br>
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.</p>
<br>
<p><b>HtmlCleaner</b></p><br>
<p>Copyright (c) 2006-2014, HtmlCleaner team.<br>
All rights reserved.<br>

Loading…
Cancel
Save