From 15bc8379dcc9c2521acf59a198bb4c3a47a76caa Mon Sep 17 00:00:00 2001 From: skylarmt Date: Sat, 18 Apr 2015 01:41:17 -0600 Subject: [PATCH] Recursive OCD code/comment formatting --- .../symat/BadInputException.java | 8 +- src/net/apocalypselabs/symat/Debug.java | 11 +- src/net/apocalypselabs/symat/Editor.java | 1 - src/net/apocalypselabs/symat/FontOptions.java | 5 +- src/net/apocalypselabs/symat/Functions.java | 2 +- .../apocalypselabs/symat/InstallPlugin.java | 1 - .../apocalypselabs/symat/KeyValListItem.java | 27 ++-- src/net/apocalypselabs/symat/License.java | 2 +- .../apocalypselabs/symat/PackagePlugin.java | 1 - .../symat/SingleInstanceServer.java | 6 +- src/net/apocalypselabs/symat/Tasks.java | 2 +- src/net/apocalypselabs/symat/Theme.java | 6 +- .../apocalypselabs/symat/components/Task.java | 12 +- .../symat/components/TaskList.java | 22 +-- .../symat/components/TaskMenu.java | 14 +- .../symat/components/TextBox.java | 9 +- .../apocalypselabs/symat/plugin/Plugin.java | 97 ++++++++----- .../apocalypselabs/symat/resources/dark.xml | 130 +++++++++--------- .../symat/resources/default.xml | 130 +++++++++--------- 19 files changed, 262 insertions(+), 224 deletions(-) diff --git a/src/net/apocalypselabs/symat/BadInputException.java b/src/net/apocalypselabs/symat/BadInputException.java index 321ad4c..28e8282 100644 --- a/src/net/apocalypselabs/symat/BadInputException.java +++ b/src/net/apocalypselabs/symat/BadInputException.java @@ -47,16 +47,16 @@ package net.apocalypselabs.symat; /** * - * Bad input exception. Useful for throwing errors in user code. - * + * Bad input exception. Useful for throwing errors in user code. + * * @author Skylar */ public class BadInputException extends Exception { - + public BadInputException() { super(); } - + public BadInputException(String msg) { super(msg); } diff --git a/src/net/apocalypselabs/symat/Debug.java b/src/net/apocalypselabs/symat/Debug.java index e83c782..1b8bfd2 100644 --- a/src/net/apocalypselabs/symat/Debug.java +++ b/src/net/apocalypselabs/symat/Debug.java @@ -18,17 +18,19 @@ public class Debug { // If output should be on or off public static boolean debug = true; - + /** * Turn debug output on and off. - * @param b + * + * @param b */ public static void setDebug(boolean b) { debug = b; } - + /** * Check if debug output is enabled. + * * @return true if it is. */ public static boolean getDebug() { @@ -37,6 +39,7 @@ public class Debug { /** * Call System.out.println(data) if debug output enabled. + * * @param data Data to print. */ public static void println(Object data) { @@ -47,6 +50,7 @@ public class Debug { /** * Call System.err.println(data) if debug output enabled. + * * @param data Data to print. */ public static void printerr(Object data) { @@ -57,6 +61,7 @@ public class Debug { /** * Call e.printStackTrace() if debug output enabled. + * * @param e an Exception. */ @SuppressWarnings(value = {"CallToPrintStackTrace"}) diff --git a/src/net/apocalypselabs/symat/Editor.java b/src/net/apocalypselabs/symat/Editor.java index 51f3a8e..9ffebdf 100644 --- a/src/net/apocalypselabs/symat/Editor.java +++ b/src/net/apocalypselabs/symat/Editor.java @@ -1000,7 +1000,6 @@ public class Editor extends javax.swing.JInternalFrame { } } - // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton clearBtn; private javax.swing.JMenu codeLangMenu; diff --git a/src/net/apocalypselabs/symat/FontOptions.java b/src/net/apocalypselabs/symat/FontOptions.java index de4549b..b5fad53 100644 --- a/src/net/apocalypselabs/symat/FontOptions.java +++ b/src/net/apocalypselabs/symat/FontOptions.java @@ -52,6 +52,7 @@ package net.apocalypselabs.symat; public class FontOptions extends javax.swing.JPanel { private boolean modified = false; + /** * Creates new form FontOptions */ @@ -111,9 +112,9 @@ public class FontOptions extends javax.swing.JPanel { }// //GEN-END:initComponents private void jSpinner1StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSpinner1StateChanged - if ((int)jSpinner1.getValue() <= 0) { + if ((int) jSpinner1.getValue() <= 0) { jSpinner1.setValue(1); - } else if ((int)jSpinner1.getValue() > 64) { + } else if ((int) jSpinner1.getValue() > 64) { jSpinner1.setValue(64); } modified = true; diff --git a/src/net/apocalypselabs/symat/Functions.java b/src/net/apocalypselabs/symat/Functions.java index dfda029..ce86084 100644 --- a/src/net/apocalypselabs/symat/Functions.java +++ b/src/net/apocalypselabs/symat/Functions.java @@ -1184,7 +1184,7 @@ public class Functions { public TextBox textbox() { return new TextBox(); } - + public WebBrowser browser() { return new WebBrowser(); } diff --git a/src/net/apocalypselabs/symat/InstallPlugin.java b/src/net/apocalypselabs/symat/InstallPlugin.java index ee89257..00b0bd6 100644 --- a/src/net/apocalypselabs/symat/InstallPlugin.java +++ b/src/net/apocalypselabs/symat/InstallPlugin.java @@ -286,7 +286,6 @@ public class InstallPlugin extends javax.swing.JInternalFrame { } }//GEN-LAST:event_installBtnActionPerformed - // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JTextField author; private javax.swing.JLabel iconBox; diff --git a/src/net/apocalypselabs/symat/KeyValListItem.java b/src/net/apocalypselabs/symat/KeyValListItem.java index b334aed..5d39653 100644 --- a/src/net/apocalypselabs/symat/KeyValListItem.java +++ b/src/net/apocalypselabs/symat/KeyValListItem.java @@ -47,63 +47,70 @@ package net.apocalypselabs.symat; /** * A simple key/value pair for lists and stuff. + * * @author Skylar */ public class KeyValListItem { + // I know, not Java code standards. // But it's easier and cleaner this way. private String VAL = ""; private String KEY = ""; - + public KeyValListItem() { - + } - + public KeyValListItem(String key) { KEY = key; } - + public KeyValListItem(String key, String val) { KEY = key; VAL = val; } - + /** * Get the key. + * * @return the key. */ @Override public String toString() { return KEY; } - + /** * Get the value of this pair. + * * @return duh. */ public String getValue() { return VAL; } - + /** * Set the key. *
To get it back use toString(). + * * @param key the key. */ public void setKey(String key) { KEY = key; } - + /** * Set the value for this pair. - * @param value + * + * @param value */ public void setValue(String value) { VAL = value; } - + /** * Is this pair populated? + * * @return True if key and value are empty. */ public boolean isEmpty() { diff --git a/src/net/apocalypselabs/symat/License.java b/src/net/apocalypselabs/symat/License.java index eed98eb..21fb228 100644 --- a/src/net/apocalypselabs/symat/License.java +++ b/src/net/apocalypselabs/symat/License.java @@ -303,7 +303,7 @@ public class License extends javax.swing.JInternalFrame { return false; } } - + public static boolean checkEmail(String email) { String regex = "^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]+$"; return (email.matches(regex)); diff --git a/src/net/apocalypselabs/symat/PackagePlugin.java b/src/net/apocalypselabs/symat/PackagePlugin.java index 1a985c0..a0bfc51 100644 --- a/src/net/apocalypselabs/symat/PackagePlugin.java +++ b/src/net/apocalypselabs/symat/PackagePlugin.java @@ -429,7 +429,6 @@ public class PackagePlugin extends javax.swing.JInternalFrame { } }//GEN-LAST:event_defaultIconBtnActionPerformed - // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JTextField author; private javax.swing.JTextArea codeBox; diff --git a/src/net/apocalypselabs/symat/SingleInstanceServer.java b/src/net/apocalypselabs/symat/SingleInstanceServer.java index a74b5ef..a51d806 100644 --- a/src/net/apocalypselabs/symat/SingleInstanceServer.java +++ b/src/net/apocalypselabs/symat/SingleInstanceServer.java @@ -69,9 +69,11 @@ public class SingleInstanceServer extends NanoHTTPD { } return new NanoHTTPD.Response(msg); } - + private class LaunchThread extends Thread { + String arg; + @Override public void run() { if (arg.endsWith(".sytt")) { @@ -92,7 +94,7 @@ public class SingleInstanceServer extends NanoHTTPD { } }); } - + public LaunchThread(String a) { arg = a; } diff --git a/src/net/apocalypselabs/symat/Tasks.java b/src/net/apocalypselabs/symat/Tasks.java index a5ceace..f5dbbb3 100644 --- a/src/net/apocalypselabs/symat/Tasks.java +++ b/src/net/apocalypselabs/symat/Tasks.java @@ -69,7 +69,7 @@ public class Tasks extends javax.swing.JInternalFrame { private String tltitle = "Untitled"; private final JFileChooser fc = new JFileChooser(); - + private File ondisk = null; /** diff --git a/src/net/apocalypselabs/symat/Theme.java b/src/net/apocalypselabs/symat/Theme.java index c543fcf..851032b 100644 --- a/src/net/apocalypselabs/symat/Theme.java +++ b/src/net/apocalypselabs/symat/Theme.java @@ -58,7 +58,7 @@ public class Theme { private static final Color WHITE = Color.WHITE; private static final Color BLACK = Color.BLACK; private static final Color DBACK = new Color(41, 49, 52); - private static final Color LBACK = new Color(240,240,240); + private static final Color LBACK = new Color(240, 240, 240); private static final Color DGRAY = Color.DARK_GRAY; private static final Color LGRAY = Color.LIGHT_GRAY; @@ -125,11 +125,11 @@ public class Theme { public static Color windowColor() { return (currentTheme == THEME_LIGHT) ? LGRAY : DGRAY; } - + public static Color tabColor() { return (currentTheme == THEME_LIGHT) ? LBACK : DBACK; } - + public static String editorTheme() { return (currentTheme == THEME_LIGHT) ? "default" : "dark"; } diff --git a/src/net/apocalypselabs/symat/components/Task.java b/src/net/apocalypselabs/symat/components/Task.java index ee323d6..3d92ebf 100644 --- a/src/net/apocalypselabs/symat/components/Task.java +++ b/src/net/apocalypselabs/symat/components/Task.java @@ -59,15 +59,15 @@ public class Task extends javax.swing.JPanel { public Task(boolean complete, String name, String desc) { this((complete ? 100 : 0), name, desc); } - + public Task(int complete, String name, String desc) { this(); percent = complete; setComplete(percent); taskName.setText(name); - taskDesc.setText(desc); + taskDesc.setText(desc); } - + @Override public String toString() { return taskName.getText(); @@ -76,10 +76,11 @@ public class Task extends javax.swing.JPanel { public String getDesc() { return taskDesc.getText(); } - + public int getComplete() { return percent; } + /** * Creates new form Task */ @@ -96,7 +97,7 @@ public class Task extends javax.swing.JPanel { ))); statusLabel.setToolTipText(i == 100 ? "Complete" : "Incomplete"); percentDone.setValue(i); - percentDone.setString(i+"%"); + percentDone.setString(i + "%"); } /** @@ -183,7 +184,6 @@ public class Task extends javax.swing.JPanel { } }//GEN-LAST:event_menuBtnActionPerformed - // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JScrollPane jScrollPane1; private javax.swing.JButton menuBtn; diff --git a/src/net/apocalypselabs/symat/components/TaskList.java b/src/net/apocalypselabs/symat/components/TaskList.java index 2003913..65d1d49 100644 --- a/src/net/apocalypselabs/symat/components/TaskList.java +++ b/src/net/apocalypselabs/symat/components/TaskList.java @@ -9,15 +9,16 @@ import java.util.ArrayList; /** * Container to save tasks. + * * @author Skylar */ public class TaskList implements Serializable { - + private static final long serialVersionUID = 6754527404697894562L; - + private final ArrayList tasks = new ArrayList<>(); private String title = "Untitled"; - + public void addTask(Task t) { SingleTask st = new SingleTask(); st.name = t.toString(); @@ -25,7 +26,7 @@ public class TaskList implements Serializable { st.percent = t.getComplete(); tasks.add(st); } - + public Task[] getTasks() { Task[] a = new Task[tasks.size()]; for (int i = 0; i < tasks.size(); i++) { @@ -36,22 +37,23 @@ public class TaskList implements Serializable { } return a; } - + public void setTitle(String t) { title = t; } - + public String getTitle() { return title; } - + public TaskList() { - + } - + class SingleTask implements Serializable { + public String name = ""; public String desc = ""; public int percent = 0; } -} \ No newline at end of file +} diff --git a/src/net/apocalypselabs/symat/components/TaskMenu.java b/src/net/apocalypselabs/symat/components/TaskMenu.java index fa22005..2a7ccd8 100644 --- a/src/net/apocalypselabs/symat/components/TaskMenu.java +++ b/src/net/apocalypselabs/symat/components/TaskMenu.java @@ -53,6 +53,7 @@ public class TaskMenu extends javax.swing.JPanel { /** * Creates new TaskMenu + * * @param percent Task completion percentage. * @param name Task name * @param desc Task description @@ -63,33 +64,35 @@ public class TaskMenu extends javax.swing.JPanel { nameBox.setText(name); descBox.setText(desc); } - + /** * Creates new TaskMenu */ public TaskMenu() { initComponents(); } - + public int getPercent() { return percentSlider.getValue(); } - + public boolean deleteMe() { return delCheck.isSelected(); } - + /** * Get the name of the task. + * * @return Task name. */ @Override public String toString() { return nameBox.getText(); } - + /** * Get the task description. + * * @return The description. */ public String getDesc() { @@ -171,7 +174,6 @@ public class TaskMenu extends javax.swing.JPanel { ); }// //GEN-END:initComponents - // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JCheckBox delCheck; private javax.swing.JTextArea descBox; diff --git a/src/net/apocalypselabs/symat/components/TextBox.java b/src/net/apocalypselabs/symat/components/TextBox.java index a3d07fa..e9a18d2 100644 --- a/src/net/apocalypselabs/symat/components/TextBox.java +++ b/src/net/apocalypselabs/symat/components/TextBox.java @@ -66,15 +66,15 @@ public class TextBox extends javax.swing.JInternalFrame { } textBox.setFont(Main.ubuntuRegular.deriveFont((float) font_size)); } - + public void set(String txt) { textBox.setText(txt); } - + public String get() { return textBox.getText(); } - + public void edit(boolean is) { textBox.setEditable(is); } @@ -82,7 +82,7 @@ public class TextBox extends javax.swing.JInternalFrame { public void open() { Main.loadFrame(this, true); } - + /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always @@ -122,7 +122,6 @@ public class TextBox extends javax.swing.JInternalFrame { pack(); }// //GEN-END:initComponents - // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTextArea textBox; diff --git a/src/net/apocalypselabs/symat/plugin/Plugin.java b/src/net/apocalypselabs/symat/plugin/Plugin.java index 79f3f90..467336b 100644 --- a/src/net/apocalypselabs/symat/plugin/Plugin.java +++ b/src/net/apocalypselabs/symat/plugin/Plugin.java @@ -11,12 +11,12 @@ import javax.swing.ImageIcon; * Plugin container class. */ public class Plugin implements Serializable { - + private static final long serialVersionUID = 13371L; public final int LANG_JS = 0; public final int LANG_PY = 1; - + private ImageIcon icon; private String packageName = ""; private String script = ""; @@ -28,38 +28,42 @@ public class Plugin implements Serializable { private String other = ""; private String version = ""; private int lang = LANG_JS; - + public Plugin() { - + } - + /** * Get plugin version. - * @return + * + * @return */ public String getVersion() { return version; } - + /** * Set plugin version. - * @param v + * + * @param v */ public void setVersion(String v) { version = v; } - + /** * Get the plugin package name. - * @return + * + * @return */ public String getPackage() { return packageName; } - + /** * Set the plugin package name. - * @param pkg + * + * @param pkg */ public void setPackage(String pkg) { packageName = pkg; @@ -67,55 +71,62 @@ public class Plugin implements Serializable { /** * Get the plugin author name. - * @return + * + * @return */ public String getAuthor() { return author; } - + /** * Set the plugin author name. - * @param s + * + * @param s */ public void setAuthor(String s) { author = s; } - + /** * Get the plugin website. - * @return + * + * @return */ public String getWebsite() { return website; } - + /** * Set the plugin website. - * @param url + * + * @param url */ public void setWebsite(String url) { website = url; } - + /** * Get extra text data. - * @return + * + * @return */ public String getOther() { return other; } - + /** * Set extra text data. - * @param o + * + * @param o */ public void setOther(String o) { other = o; } - + /** * Get the plugin icon. - * @return + * + * @return */ public ImageIcon getIcon() { return icon; @@ -123,7 +134,8 @@ public class Plugin implements Serializable { /** * Set the plugin icon. - * @param i + * + * @param i */ public void setIcon(ImageIcon i) { icon = i; @@ -131,7 +143,8 @@ public class Plugin implements Serializable { /** * Get the plugin code. - * @return + * + * @return */ public String getScript() { return script; @@ -139,7 +152,8 @@ public class Plugin implements Serializable { /** * Set the plugin code. - * @param s + * + * @param s */ public void setScript(String s) { script = s; @@ -147,7 +161,8 @@ public class Plugin implements Serializable { /** * See getTitle(). - * @return + * + * @return */ @Override public String toString() { @@ -156,7 +171,8 @@ public class Plugin implements Serializable { /** * Get the plugin short name/title. - * @return + * + * @return */ public String getTitle() { return title; @@ -164,7 +180,8 @@ public class Plugin implements Serializable { /** * Set the plugin short name/title. - * @param n + * + * @param n */ public void setTitle(String n) { title = n; @@ -172,7 +189,8 @@ public class Plugin implements Serializable { /** * Get the plugin description text. - * @return + * + * @return */ public String getDesc() { return desc; @@ -180,7 +198,8 @@ public class Plugin implements Serializable { /** * Set the plugin description text. - * @param d + * + * @param d */ public void setDesc(String d) { desc = d; @@ -188,7 +207,8 @@ public class Plugin implements Serializable { /** * Get the long title/short description. - * @return + * + * @return */ public String getLongTitle() { return longtitle; @@ -196,22 +216,25 @@ public class Plugin implements Serializable { /** * Set the long title/short description. - * @param t + * + * @param t */ public void setLongTitle(String t) { longtitle = t; } - + /** * Get the script language. + * * @return LANG_JS or LANG_PY */ public int getLang() { return lang; } - + /** * Set the script language. + * * @param l LANG_JS or LANG_PY */ public void setLang(int l) { diff --git a/src/net/apocalypselabs/symat/resources/dark.xml b/src/net/apocalypselabs/symat/resources/dark.xml index 9b51fbc..90f9cb0 100644 --- a/src/net/apocalypselabs/symat/resources/dark.xml +++ b/src/net/apocalypselabs/symat/resources/dark.xml @@ -2,77 +2,77 @@ - - + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - + + + + + - - -