Bugfixes and startup optimizations, update README.md
This commit is contained in:
parent
db689e81b6
commit
8a5cdb94d1
@ -15,4 +15,4 @@ http://symatapp.com/
|
||||
|
||||
Report a Bug
|
||||
------
|
||||
To report bugs, go to: http://bugs.aplabs.us/thebuggenie/symat/issues/new
|
||||
To report bugs, go to: https://github.com/ApocalypseLaboratories/SyMAT/issues
|
@ -39,6 +39,7 @@ file.reference.flamingo-6.3.jar=lib/flamingo-6.3.jar
|
||||
file.reference.htmlcleaner-2.10.jar=lib/htmlcleaner-2.10.jar
|
||||
file.reference.iText-4.2.0-com.itextpdf.jar=lib/iText-4.2.0-com.itextpdf.jar
|
||||
file.reference.JavaPrettify-1.2.1.jar=lib\\JavaPrettify-1.2.1.jar
|
||||
file.reference.JGoogleAnalytics_0.4.jar=lib\\JGoogleAnalytics_0.4.jar
|
||||
file.reference.jmathplot.jar=lib/jmathplot.jar
|
||||
file.reference.js-engine.jar=lib/js-engine.jar
|
||||
file.reference.js.jar=lib/js.jar
|
||||
@ -70,7 +71,8 @@ javac.classpath=\
|
||||
${file.reference.seaglasslookandfeel-0.2.jar}:\
|
||||
${file.reference.symja-2014-11-01.jar}:\
|
||||
${file.reference.trident-6.3.jar}:\
|
||||
${file.reference.JavaPrettify-1.2.1.jar}
|
||||
${file.reference.JavaPrettify-1.2.1.jar}:\
|
||||
${file.reference.JGoogleAnalytics_0.4.jar}
|
||||
# Space-separated list of extra javac options
|
||||
javac.compilerargs=
|
||||
javac.deprecation=false
|
||||
|
@ -56,17 +56,12 @@ import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FilenameFilter;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@ -104,7 +99,7 @@ public class Main extends JRibbonFrame {
|
||||
/**
|
||||
* Version name, as it should be displayed.
|
||||
*/
|
||||
public static final String VERSION_NAME = "2.0";
|
||||
public static final String VERSION_NAME = "2.0.1";
|
||||
|
||||
/**
|
||||
* The word "SyMAT".
|
||||
@ -117,7 +112,7 @@ public class Main extends JRibbonFrame {
|
||||
/**
|
||||
* Version number, for updates and //needs in scripts
|
||||
*/
|
||||
public static final double APP_CODE = 21;
|
||||
public static final double APP_CODE = 22;
|
||||
/**
|
||||
* Base URL for building API calls
|
||||
*/
|
||||
@ -139,6 +134,7 @@ public class Main extends JRibbonFrame {
|
||||
|
||||
public static boolean updateAvailable = false; // Update available?
|
||||
public static String updateString = "";
|
||||
public static boolean licValid = false; // License valid?
|
||||
|
||||
/**
|
||||
* Application icon, for setting frame icons. Has different sizes.
|
||||
@ -205,47 +201,18 @@ public class Main extends JRibbonFrame {
|
||||
}
|
||||
loaded = true;
|
||||
}
|
||||
boolean licValid = false;
|
||||
if (PrefStorage.getSetting("license").equals("")
|
||||
|| PrefStorage.getSetting("licensetype").equals("demo")) {
|
||||
if (PrefStorage.getSetting("licensetype").equals("demo")) {
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.setTime(new Date());
|
||||
try {
|
||||
long expire = Long.parseLong(PrefStorage.getSetting("license"));
|
||||
if (expire > c.getTimeInMillis()) {
|
||||
licValid = true;
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
Debug.println("Checking license...");
|
||||
URL url = new URL(API_URL + "liccheck.php?email="
|
||||
+ PrefStorage.getSetting("license")
|
||||
+ "&quick=1");
|
||||
String line;
|
||||
try (InputStream is = url.openStream();
|
||||
BufferedReader br
|
||||
= new BufferedReader(new InputStreamReader(is))) {
|
||||
line = br.readLine();
|
||||
}
|
||||
if (line.equals("ok")) {
|
||||
licValid = true;
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
// Assume valid
|
||||
licValid = true;
|
||||
}
|
||||
}
|
||||
if (!licValid) {
|
||||
licenseRestrict(true);
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
loadFrame(new License());
|
||||
}
|
||||
});
|
||||
loaded = true;
|
||||
}
|
||||
// Only load shell if nothing else is going on
|
||||
|
||||
if (argfile.equals("") && !loaded) {
|
||||
loadFrame(new Interpreter());
|
||||
}
|
||||
|
@ -7,16 +7,10 @@
|
||||
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
|
||||
<Color id="Default Cursor"/>
|
||||
</Property>
|
||||
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[500, 400]"/>
|
||||
</Property>
|
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[500, 400]"/>
|
||||
</Property>
|
||||
<Property name="undecorated" type="boolean" value="true"/>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[500, 400]"/>
|
||||
</Property>
|
||||
<Property name="resizable" type="boolean" value="false"/>
|
||||
<Property name="type" type="java.awt.Window$Type" editor="org.netbeans.modules.form.editors.EnumEditor">
|
||||
<Value id="POPUP"/>
|
||||
|
@ -54,6 +54,8 @@ import java.io.InputStreamReader;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import javax.swing.SwingUtilities;
|
||||
import static net.apocalypselabs.symat.Main.API_URL;
|
||||
import static net.apocalypselabs.symat.Main.APP_CODE;
|
||||
@ -202,13 +204,16 @@ public class SplashScreen extends javax.swing.JFrame {
|
||||
Debug.stacktrace(ex);
|
||||
}
|
||||
|
||||
setProgress("Checking license...");
|
||||
checkLicense();
|
||||
|
||||
if (!PrefStorage.getSetting("skipupdates").equals("yes")) {
|
||||
setProgress("Checking for updates...");
|
||||
checkUpdates();
|
||||
}
|
||||
|
||||
setProgress("Loading main interface...");
|
||||
Main main = new Main();
|
||||
new Main();
|
||||
setProgress("Done!");
|
||||
dispose();
|
||||
}
|
||||
@ -221,6 +226,43 @@ public class SplashScreen extends javax.swing.JFrame {
|
||||
Debug.println("Loaded toolkit " + file.getName());
|
||||
}
|
||||
|
||||
private void checkLicense() {
|
||||
if (PrefStorage.getSetting("license").equals("")
|
||||
|| PrefStorage.getSetting("licensetype").equals("demo")) {
|
||||
if (PrefStorage.getSetting("licensetype").equals("demo")) {
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.setTime(new Date());
|
||||
try {
|
||||
long expire = Long.parseLong(PrefStorage.getSetting("license"));
|
||||
if (expire > c.getTimeInMillis()) {
|
||||
Main.licValid = true;
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
Debug.println("Checking license...");
|
||||
URL url = new URL(API_URL + "liccheck.php?email="
|
||||
+ PrefStorage.getSetting("license")
|
||||
+ "&quick=1");
|
||||
String line;
|
||||
try (InputStream is = url.openStream();
|
||||
BufferedReader br
|
||||
= new BufferedReader(new InputStreamReader(is))) {
|
||||
line = br.readLine();
|
||||
}
|
||||
if (line.equals("ok")) {
|
||||
Main.licValid = true;
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
// Assume valid
|
||||
Main.licValid = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void checkUpdates() {
|
||||
// Check for updates.
|
||||
try {
|
||||
|
@ -120,5 +120,14 @@
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JPanel" name="browserBox">
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
||||
<BorderConstraints direction="Center"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
|
@ -110,7 +110,7 @@ public class WebBrowser extends javax.swing.JInternalFrame {
|
||||
webEngine.loadContent(homepage());
|
||||
}
|
||||
});
|
||||
getContentPane().add(jfxPanel, BorderLayout.CENTER);
|
||||
browserBox.add(jfxPanel, BorderLayout.CENTER);
|
||||
}
|
||||
|
||||
public WebBrowser(String title) {
|
||||
@ -168,6 +168,12 @@ public class WebBrowser extends javax.swing.JInternalFrame {
|
||||
loadURL(url);
|
||||
}
|
||||
|
||||
public void showNavbar(boolean yesno) {
|
||||
navBar.setVisible(yesno);
|
||||
goBtn.setEnabled(yesno);
|
||||
backBtn.setEnabled(yesno);
|
||||
}
|
||||
|
||||
public void loadURL(final String url) {
|
||||
Platform.runLater(new Runnable() {
|
||||
@Override
|
||||
@ -207,6 +213,7 @@ public class WebBrowser extends javax.swing.JInternalFrame {
|
||||
backBtn = new javax.swing.JButton();
|
||||
urlBox = new javax.swing.JTextField();
|
||||
goBtn = new javax.swing.JButton();
|
||||
browserBox = new javax.swing.JPanel();
|
||||
|
||||
setClosable(true);
|
||||
setIconifiable(true);
|
||||
@ -293,6 +300,9 @@ public class WebBrowser extends javax.swing.JInternalFrame {
|
||||
|
||||
getContentPane().add(navBar, java.awt.BorderLayout.PAGE_START);
|
||||
|
||||
browserBox.setLayout(new java.awt.BorderLayout());
|
||||
getContentPane().add(browserBox, java.awt.BorderLayout.CENTER);
|
||||
|
||||
pack();
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
@ -344,15 +354,16 @@ public class WebBrowser extends javax.swing.JInternalFrame {
|
||||
Platform.runLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
jfxPanel.setSize(getWidth(), getHeight());
|
||||
browser.setPrefSize(getWidth() - 12, getHeight() - 32);
|
||||
browser.resize(getWidth() - 12, getHeight() - 32);
|
||||
jfxPanel.setSize(browserBox.getWidth(), browserBox.getHeight());
|
||||
browser.setPrefSize(browserBox.getWidth(), browserBox.getHeight());
|
||||
browser.resize(browserBox.getWidth(), browserBox.getHeight());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton backBtn;
|
||||
private javax.swing.JPanel browserBox;
|
||||
private javax.swing.JButton goBtn;
|
||||
private javax.swing.JToolBar navBar;
|
||||
private javax.swing.JTextField urlBox;
|
||||
|
Loading…
x
Reference in New Issue
Block a user