From 8a88a147f2a0376e21a788898cb8ce8a09087bdb Mon Sep 17 00:00:00 2001 From: Brendan Robert Date: Sat, 12 Sep 2015 18:40:08 -0500 Subject: [PATCH] Converted text entry to a bigger area, allowing multi-line entry. Added rudimentary spell checking (it's not perfect at the momenent) --- .../badvision/outlaweditor/MythosEditor.java | 45 +- .../outlaweditor/data/DataUtilities.java | 132 + .../outlaweditor/spelling/SpellChecker.java | 108 + .../outlaweditor/spelling/SpellResponse.java | 30 + .../outlaweditor/spelling/Suggestion.java | 26 + .../src/main/resources/mythos/dictionary.txt | 274927 +++++++++++++++ .../mythos-editor/js/mythos_uncompressed.js | 200 +- 7 files changed, 275453 insertions(+), 15 deletions(-) create mode 100644 OutlawEditor/src/main/java/org/badvision/outlaweditor/spelling/SpellChecker.java create mode 100644 OutlawEditor/src/main/java/org/badvision/outlaweditor/spelling/SpellResponse.java create mode 100644 OutlawEditor/src/main/java/org/badvision/outlaweditor/spelling/Suggestion.java create mode 100644 OutlawEditor/src/main/resources/mythos/dictionary.txt diff --git a/OutlawEditor/src/main/java/org/badvision/outlaweditor/MythosEditor.java b/OutlawEditor/src/main/java/org/badvision/outlaweditor/MythosEditor.java index 917b01e6..efd71575 100644 --- a/OutlawEditor/src/main/java/org/badvision/outlaweditor/MythosEditor.java +++ b/OutlawEditor/src/main/java/org/badvision/outlaweditor/MythosEditor.java @@ -17,6 +17,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; import java.util.stream.Collectors; @@ -41,6 +42,9 @@ import org.badvision.outlaweditor.data.xml.Scope; import org.badvision.outlaweditor.data.xml.Script; import org.badvision.outlaweditor.data.xml.UserType; import org.badvision.outlaweditor.data.xml.Variable; +import org.badvision.outlaweditor.spelling.SpellChecker; +import org.badvision.outlaweditor.spelling.SpellResponse; +import org.badvision.outlaweditor.spelling.Suggestion; import org.badvision.outlaweditor.ui.ApplicationUIController; import org.badvision.outlaweditor.ui.MythosScriptEditorController; import org.w3c.dom.Document; @@ -58,10 +62,12 @@ public class MythosEditor { Stage primaryStage; MythosScriptEditorController controller; public static final String XML_HEADER = "\n"; + SpellChecker spellChecker; public MythosEditor(Script theScript, Scope theScope) { script = theScript; scope = theScope; + spellChecker = new SpellChecker(); } public void show() { @@ -146,7 +152,6 @@ public class MythosEditor { // Called when the name of the root block is changed in the JS editor public void setFunctionName(String name) { if (script == null) { - System.out.println("How can the script be null?? wanted to set script name to " + name); return; } script.setName(name); @@ -165,9 +170,11 @@ public class MythosEditor { public List