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