Refactor CodeEditor to Editor to better fit naming conventions

master
skylarmt 9 years ago
parent 882a3c469a
commit 6a071547b6

Binary file not shown.

@ -82,7 +82,7 @@ public class CodeCompleter {
for (String fileid : files) {
BufferedReader reader = new BufferedReader(
new InputStreamReader(
CodeEditor.class.getResourceAsStream("resources/" + lang + fileid + ".txt")));
CodeCompleter.class.getResourceAsStream("resources/" + lang + fileid + ".txt")));
String line;
while ((line = reader.readLine()) != null) {
switch (fileid) {

@ -70,7 +70,7 @@ import org.fife.ui.rtextarea.RTextScrollPane;
*
* @author Skylar
*/
public class CodeEditor extends javax.swing.JInternalFrame {
public class Editor extends javax.swing.JInternalFrame {
private final JFileChooser fc = new JFileChooser();
private boolean isSaved = false;
@ -88,7 +88,7 @@ public class CodeEditor extends javax.swing.JInternalFrame {
/**
* Creates new form CodeEditor
*/
public CodeEditor() {
public Editor() {
initComponents();
FileFilter filter = new FileNameExtensionFilter("SyMAT JavaScript (.syjs)", "syjs");
@ -151,12 +151,12 @@ public class CodeEditor extends javax.swing.JInternalFrame {
});
}
public CodeEditor(String text) {
public Editor(String text) {
this();
codeBox.setText(text);
}
public CodeEditor(String text, boolean openSaveDialog) {
public Editor(String text, boolean openSaveDialog) {
this(text);
if (openSaveDialog) {
saveAsMenuActionPerformed(null);
@ -165,7 +165,7 @@ public class CodeEditor extends javax.swing.JInternalFrame {
private void setEditorTheme(String themeName) {
try {
Theme theme = Theme.load(CodeEditor.class
Theme theme = Theme.load(Editor.class
.getResourceAsStream("resources/" + themeName + ".xml"));
theme.apply(codeBox);
} catch (Exception e) {
@ -833,7 +833,7 @@ public class CodeEditor extends javax.swing.JInternalFrame {
try {
BufferedReader reader = new BufferedReader(
new InputStreamReader(
CodeEditor.class
Editor.class
.getResourceAsStream("codesamples/" + name + "." + ext)));
String line;
while ((line = reader.readLine()) != null) {

@ -73,11 +73,11 @@ import javax.swing.UIManager;
/**
* This class is like the Force: A light theme, a dark theme, and it binds the
* app together. Also like duct tape, but that's not as cool.
Contains a bunch of important variables and constants that are used all over.
There should be only one Main per app instance, the important things are
static.
*
* Contains a bunch of important variables and constants that are used all over.
*
* There should be only one Main per app instance, the important things are
* static.
*
* @author Skylar Ittner
*/
@ -118,9 +118,9 @@ public class Main extends javax.swing.JFrame {
* Application icon, for setting frame icons.
*/
public static ArrayList<Image> symatlogo = new ArrayList<>();
public static SingleInstanceServer sisrv;
public static Main maingui;
/**
@ -162,7 +162,7 @@ public class Main extends javax.swing.JFrame {
// Open initial windows
boolean loaded = false;
if (!argfile.equals("")) {
CodeEditor ed = new CodeEditor();
Editor ed = new Editor();
loadFrame(ed);
ed.openFileFromName(argfile);
argfile = "";
@ -804,7 +804,7 @@ public class Main extends javax.swing.JFrame {
}//GEN-LAST:event_graphBtnActionPerformed
private void editorBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editorBtnActionPerformed
loadFrame(new CodeEditor());
loadFrame(new Editor());
}//GEN-LAST:event_editorBtnActionPerformed
private void shellBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_shellBtnActionPerformed
@ -819,7 +819,7 @@ public class Main extends javax.swing.JFrame {
if (file.isEmpty()) {
return;
}
CodeEditor edit = new CodeEditor();
Editor edit = new Editor();
Debug.println(file.getValue());
edit.openFileFromName(file.getValue());
loadFrame(edit);
@ -1011,9 +1011,9 @@ public class Main extends javax.swing.JFrame {
break;
}
}
SingleInstanceClient sicli = new SingleInstanceClient(argfile);
try {
new SingleInstanceServer().start();
} catch (IOException ex) {

@ -484,7 +484,7 @@ public class Pads extends javax.swing.JInternalFrame {
}//GEN-LAST:event_purgeBtnActionPerformed
private void saveBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveBtnActionPerformed
Main.loadFrame(new CodeEditor(getPad(getSelectedPad()), true));
Main.loadFrame(new Editor(getPad(getSelectedPad()), true));
updateList();
}//GEN-LAST:event_saveBtnActionPerformed

@ -64,7 +64,7 @@ public class SingleInstanceServer extends NanoHTTPD {
String msg = "OK";
Map<String, String> parms = session.getParms();
if (parms.get("arg") != null) {
CodeEditor ed = new CodeEditor();
Editor ed = new Editor();
Main.loadFrame(ed);
ed.openFileFromName(parms.get("arg"));
java.awt.EventQueue.invokeLater(new Runnable() {

@ -167,7 +167,7 @@ public class SplashScreen extends javax.swing.JFrame {
System.out.println("Preparing editor, to skip run with argument 'skipeditor'");
setProgress("Preparing editor...");
// Get editor going too
CodeEditor edit = new CodeEditor();
Editor edit = new Editor();
}
setProgress("Checking for updates...");

Loading…
Cancel
Save