Release version 0.7
This commit is contained in:
parent
15c8a3276b
commit
c1506c5bee
@ -31,7 +31,9 @@ import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import javax.script.*;
|
||||
import javax.script.ScriptEngine;
|
||||
import javax.script.ScriptEngineManager;
|
||||
import javax.script.ScriptException;
|
||||
import javax.swing.JOptionPane;
|
||||
|
||||
/**
|
||||
@ -85,9 +87,10 @@ public class CodeRunner {
|
||||
this(lang);
|
||||
isShell = shell;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Inits the Python engine.
|
||||
*
|
||||
* @param fakeInit Set it to true.
|
||||
*/
|
||||
public CodeRunner(boolean fakeInit) {
|
||||
@ -101,7 +104,6 @@ public class CodeRunner {
|
||||
+ "Could not properly initialize " + scriptLang + " scripting engine."
|
||||
+ "\n\nSome functions may not work.\n\n"
|
||||
+ "(" + ex.getMessage() + ")");
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -245,10 +245,10 @@ public class Display extends javax.swing.JInternalFrame {
|
||||
}
|
||||
if (!PrefStorage.save()) {
|
||||
// Something dun goofed...
|
||||
JOptionPane.showInternalMessageDialog(this,
|
||||
JOptionPane.showInternalMessageDialog(this,
|
||||
"Error: Problem occured while saving settings. "
|
||||
+ "This error is outside the control of "
|
||||
+ "the application.");
|
||||
+ "This error is outside the control of "
|
||||
+ "the application.");
|
||||
}
|
||||
MainGUI.updateDisplay();
|
||||
dispose();
|
||||
|
@ -51,20 +51,20 @@ public class Interpreter extends javax.swing.JInternalFrame {
|
||||
*/
|
||||
public Interpreter(String useLang) {
|
||||
initComponents();
|
||||
|
||||
|
||||
// Setup code runner
|
||||
lang = useLang;
|
||||
if (lang.equals("default")) {
|
||||
lang = PrefStorage.getSetting("shellLang", "javascript");
|
||||
}
|
||||
cr = new CodeRunner(lang, true);
|
||||
|
||||
|
||||
// Set selected lang menu
|
||||
if (lang.equals("python")) {
|
||||
javascriptMenu.setSelected(false);
|
||||
pythonMenu.setSelected(true);
|
||||
}
|
||||
|
||||
|
||||
// Set font
|
||||
int font_size = 12;
|
||||
try {
|
||||
@ -73,7 +73,7 @@ public class Interpreter extends javax.swing.JInternalFrame {
|
||||
}
|
||||
mainBox.setFont(new Font(Font.MONOSPACED, Font.PLAIN, font_size));
|
||||
inputBox.setFont(new Font(Font.MONOSPACED, Font.PLAIN, font_size));
|
||||
|
||||
|
||||
// Set theme
|
||||
if (PrefStorage.getSetting("theme").equals("dark")) {
|
||||
mainBox.setBackground(Color.BLACK);
|
||||
@ -88,7 +88,7 @@ public class Interpreter extends javax.swing.JInternalFrame {
|
||||
inputBox.setForeground(Color.BLACK);
|
||||
setBackground(Color.LIGHT_GRAY);
|
||||
}
|
||||
|
||||
|
||||
// Misc. setup
|
||||
mainBox.setText(">>");
|
||||
inputBox.requestFocus();
|
||||
|
@ -494,7 +494,6 @@ public class MainGUI extends javax.swing.JFrame {
|
||||
//</editor-fold>
|
||||
|
||||
//</editor-fold>
|
||||
|
||||
// Command line args
|
||||
for (String arg : args) {
|
||||
if (arg.equals("skippython")) {
|
||||
@ -503,7 +502,7 @@ public class MainGUI extends javax.swing.JFrame {
|
||||
argfile = args[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Create and display the form */
|
||||
java.awt.EventQueue.invokeLater(new Runnable() {
|
||||
@Override
|
||||
|
@ -27,8 +27,6 @@
|
||||
*/
|
||||
package net.apocalypselabs.symat;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.prefs.BackingStoreException;
|
||||
import java.util.prefs.Preferences;
|
||||
|
||||
@ -47,7 +45,7 @@ public class PrefStorage {
|
||||
public static boolean isset(String key) {
|
||||
return !getSetting(key, "NULL").equals("NULL");
|
||||
}
|
||||
|
||||
|
||||
public static void unset(String key) {
|
||||
prefs.remove(key);
|
||||
}
|
||||
@ -59,7 +57,7 @@ public class PrefStorage {
|
||||
public static String getSetting(String key, String emptyResponse) {
|
||||
return prefs.get(key, emptyResponse);
|
||||
}
|
||||
|
||||
|
||||
public static boolean save() {
|
||||
try {
|
||||
prefs.flush();
|
||||
|
@ -18,13 +18,33 @@
|
||||
*/
|
||||
package net.apocalypselabs.symat;
|
||||
|
||||
import java.awt.*;
|
||||
import java.beans.*;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Font;
|
||||
import java.awt.FontMetrics;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Insets;
|
||||
import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.util.HashMap;
|
||||
import javax.swing.*;
|
||||
import javax.swing.border.*;
|
||||
import javax.swing.event.*;
|
||||
import javax.swing.text.*;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.border.Border;
|
||||
import javax.swing.border.CompoundBorder;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
import javax.swing.border.MatteBorder;
|
||||
import javax.swing.event.CaretEvent;
|
||||
import javax.swing.event.CaretListener;
|
||||
import javax.swing.event.DocumentEvent;
|
||||
import javax.swing.event.DocumentListener;
|
||||
import javax.swing.text.AttributeSet;
|
||||
import javax.swing.text.BadLocationException;
|
||||
import javax.swing.text.Element;
|
||||
import javax.swing.text.JTextComponent;
|
||||
import javax.swing.text.StyleConstants;
|
||||
import javax.swing.text.Utilities;
|
||||
|
||||
/**
|
||||
* This class will display line numbers for a related text component. The text
|
||||
|
Loading…
x
Reference in New Issue
Block a user