diff --git a/src/net/apocalypselabs/symat/CodeRunner.java b/src/net/apocalypselabs/symat/CodeRunner.java index ab7e83d..b27922c 100644 --- a/src/net/apocalypselabs/symat/CodeRunner.java +++ b/src/net/apocalypselabs/symat/CodeRunner.java @@ -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(); } /** diff --git a/src/net/apocalypselabs/symat/Display.java b/src/net/apocalypselabs/symat/Display.java index 5909bb5..ac6d398 100644 --- a/src/net/apocalypselabs/symat/Display.java +++ b/src/net/apocalypselabs/symat/Display.java @@ -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(); diff --git a/src/net/apocalypselabs/symat/Interpreter.java b/src/net/apocalypselabs/symat/Interpreter.java index 85de96f..7d44cf0 100644 --- a/src/net/apocalypselabs/symat/Interpreter.java +++ b/src/net/apocalypselabs/symat/Interpreter.java @@ -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(); diff --git a/src/net/apocalypselabs/symat/MainGUI.java b/src/net/apocalypselabs/symat/MainGUI.java index 4c11414..c74f257 100644 --- a/src/net/apocalypselabs/symat/MainGUI.java +++ b/src/net/apocalypselabs/symat/MainGUI.java @@ -494,7 +494,6 @@ public class MainGUI extends javax.swing.JFrame { // // - // 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 diff --git a/src/net/apocalypselabs/symat/PrefStorage.java b/src/net/apocalypselabs/symat/PrefStorage.java index ba40528..559abf6 100644 --- a/src/net/apocalypselabs/symat/PrefStorage.java +++ b/src/net/apocalypselabs/symat/PrefStorage.java @@ -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(); diff --git a/src/net/apocalypselabs/symat/TextLineNumber.java b/src/net/apocalypselabs/symat/TextLineNumber.java index d3695a3..6f71be1 100644 --- a/src/net/apocalypselabs/symat/TextLineNumber.java +++ b/src/net/apocalypselabs/symat/TextLineNumber.java @@ -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