Add JavaDoc comments to everything

master
Skylar Ittner 9 years ago
parent b454f2058d
commit c463db0138

@ -3,9 +3,9 @@ annotation.processing.enabled.in.editor=false
annotation.processing.processors.list= annotation.processing.processors.list=
annotation.processing.run.all.processors=true annotation.processing.run.all.processors=true
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
application.desc=Math and Programming for People application.desc=Math and programming in style.
application.homepage=https://symatapp.com/ application.homepage=https://symatapp.com/
application.splash=C:\\Users\\Skylar\\Documents\\Apocalypse Labs\\appmedia\\SyMAT\\splashscreen.png application.splash=C:\\Users\\Skylar\\Documents\\Projects\\Assets\\SyMAT\\splashscreen.png
application.title=SyMAT application.title=SyMAT
application.vendor=Netsyms Technologies application.vendor=Netsyms Technologies
auxiliary.org-netbeans-spi-editor-hints-projects.perProjectHintSettingsFile=nbproject/cfg_hints.xml auxiliary.org-netbeans-spi-editor-hints-projects.perProjectHintSettingsFile=nbproject/cfg_hints.xml

@ -26,17 +26,12 @@ import java.util.TimeZone;
/** /**
* A simple, tiny, nicely embeddable HTTP server in Java * A simple, tiny, nicely embeddable HTTP server in Java
* <p/>
* <p/>
* NanoHTTPD * NanoHTTPD
* <p> * <p>
* </p>Copyright (c) 2012-2013 by Paul S. Hawke, 2001,2005-2013 by Jarno Elonen, * </p>Copyright (c) 2012-2013 by Paul S. Hawke, 2001,2005-2013 by Jarno Elonen,
* 2010 by Konstantinos Togias</p> * 2010 by Konstantinos Togias</p>
* <p/>
* <p/>
* <b>Features + limitations: </b> * <b>Features + limitations: </b>
* <ul> * <ul>
* <p/>
* <li>Only one Java file</li> * <li>Only one Java file</li>
* <li>Java 5 compatible</li> * <li>Java 5 compatible</li>
* <li>Released as open source, Modified BSD licence</li> * <li>Released as open source, Modified BSD licence</li>
@ -61,17 +56,11 @@ import java.util.TimeZone;
* <li>Contains a built-in list of most common mime types</li> * <li>Contains a built-in list of most common mime types</li>
* <li>All header names are converted lowercase so they don't vary between * <li>All header names are converted lowercase so they don't vary between
* browsers/clients</li> * browsers/clients</li>
* <p/>
* </ul> * </ul>
* <p/>
* <p/>
* <b>How to use: </b> * <b>How to use: </b>
* <ul> * <ul>
* <p/>
* <li>Subclass and implement serve() and embed to your own program</li> * <li>Subclass and implement serve() and embed to your own program</li>
* <p/>
* </ul> * </ul>
* <p/>
* See the separate "LICENSE.md" file for the distribution license (Modified BSD * See the separate "LICENSE.md" file for the distribution license (Modified BSD
* licence) * licence)
*/ */
@ -263,8 +252,8 @@ public abstract class NanoHTTPD {
/** /**
* Override this to customize the server. * Override this to customize the server.
* <p/> *
* <p/> *
* (By default, this delegates to serveFile() and allows directory listing.) * (By default, this delegates to serveFile() and allows directory listing.)
* *
* @param uri Percent-decoded URI without parameters, for example * @param uri Percent-decoded URI without parameters, for example
@ -283,8 +272,8 @@ public abstract class NanoHTTPD {
/** /**
* Override this to customize the server. * Override this to customize the server.
* <p/> *
* <p/> *
* (By default, this delegates to serveFile() and allows directory listing.) * (By default, this delegates to serveFile() and allows directory listing.)
* *
* @param session The HTTP session * @param session The HTTP session
@ -432,7 +421,6 @@ public abstract class NanoHTTPD {
// ------------------------------------------------------------------------------- // // ------------------------------------------------------------------------------- //
/** /**
* Temp file manager. * Temp file manager.
* <p/>
* <p> * <p>
* Temp file managers are created 1-to-1 with incoming requests, to create * Temp file managers are created 1-to-1 with incoming requests, to create
* and cleanup temporary files created as a result of handling the * and cleanup temporary files created as a result of handling the
@ -447,7 +435,6 @@ public abstract class NanoHTTPD {
/** /**
* A temp file. * A temp file.
* <p/>
* <p> * <p>
* Temp files are responsible for managing the actual temporary storage and * Temp files are responsible for managing the actual temporary storage and
* cleaning themselves up when no longer needed.</p> * cleaning themselves up when no longer needed.</p>
@ -463,7 +450,6 @@ public abstract class NanoHTTPD {
/** /**
* Default threading strategy for NanoHttpd. * Default threading strategy for NanoHttpd.
* <p/>
* <p> * <p>
* By default, the server spawns a new Thread for every incoming request. * By default, the server spawns a new Thread for every incoming request.
* These are set to <i>daemon</i> status, and named according to the request * These are set to <i>daemon</i> status, and named according to the request
@ -485,9 +471,7 @@ public abstract class NanoHTTPD {
/** /**
* Default strategy for creating and cleaning up temporary files. * Default strategy for creating and cleaning up temporary files.
* <p/> * <p>This class stores its files in the standard location (that is,
* <p>
* </p>This class stores its files in the standard location (that is,
* wherever <code>java.io.tmpdir</code> points to). Files are added to an * wherever <code>java.io.tmpdir</code> points to). Files are added to an
* internal list, and deleted when no longer needed (that is, when * internal list, and deleted when no longer needed (that is, when
* <code>clear()</code> is invoked at the end of processing a request).</p> * <code>clear()</code> is invoked at the end of processing a request).</p>
@ -523,7 +507,6 @@ public abstract class NanoHTTPD {
/** /**
* Default strategy for creating and cleaning up temporary files. * Default strategy for creating and cleaning up temporary files.
* <p/>
* <p> * <p>
* </p></[>By default, files are created by * </p></[>By default, files are created by
* <code>File.createTempFile()</code> in the directory specified.</p> * <code>File.createTempFile()</code> in the directory specified.</p>
@ -855,7 +838,7 @@ public abstract class NanoHTTPD {
/** /**
* Adds the files in the request body to the files map. * Adds the files in the request body to the files map.
* *
* @arg files - map to modify * @param files - map to modify
*/ */
void parseBody(Map<String, String> files) throws IOException, ResponseException; void parseBody(Map<String, String> files) throws IOException, ResponseException;
} }

@ -63,10 +63,17 @@ package net.apocalypselabs.symat;
*/ */
public class BadInputException extends Exception { public class BadInputException extends Exception {
/**
*
*/
public BadInputException() { public BadInputException() {
super(); super();
} }
/**
*
* @param msg
*/
public BadInputException(String msg) { public BadInputException(String msg) {
super(msg); super(msg);
} }

@ -81,6 +81,10 @@ public class CodeCompleter {
provider = makeCompletions(); provider = makeCompletions();
} }
/**
*
* @return
*/
public CompletionProvider getProvider() { public CompletionProvider getProvider() {
return provider; return provider;
} }

@ -124,6 +124,12 @@ public class CodeExport extends javax.swing.JInternalFrame {
codeLang = lang; codeLang = lang;
} }
/**
*
* @param code
* @param lang
* @param out
*/
public CodeExport(String code, String lang, String out) { public CodeExport(String code, String lang, String out) {
this(code, lang); this(code, lang);
outputTxt = out; outputTxt = out;

@ -87,14 +87,25 @@ public class CodeRunner {
// What codez are we speaking? // What codez are we speaking?
private String scriptLang = ""; private String scriptLang = "";
/**
*
*/
public CodeRunner() { public CodeRunner() {
this("javascript"); this("javascript");
} }
/**
*
* @param lang
*/
public CodeRunner(int lang) { public CodeRunner(int lang) {
this(lang == 0 ? "js" : (lang == 2 ? "ja" : "py")); this(lang == 0 ? "js" : (lang == 2 ? "ja" : "py"));
} }
/**
*
* @param lang
*/
public CodeRunner(String lang) { public CodeRunner(String lang) {
scriptLang = lang; scriptLang = lang;
switch (lang) { switch (lang) {
@ -162,6 +173,13 @@ public class CodeRunner {
} }
} }
/**
*
* @param name
* @param classLoader
* @return
* @throws IOException
*/
public static List<InputStream> loadResources(final String name, public static List<InputStream> loadResources(final String name,
final ClassLoader classLoader) throws IOException { final ClassLoader classLoader) throws IOException {
final List<InputStream> list = new ArrayList<InputStream>(); final List<InputStream> list = new ArrayList<InputStream>();
@ -205,6 +223,12 @@ public class CodeRunner {
return out; return out;
} }
/**
*
* @param lang
* @param shell
* @deprecated
*/
@Deprecated @Deprecated
public CodeRunner(String lang, boolean shell) { public CodeRunner(String lang, boolean shell) {
this(lang); this(lang);
@ -227,14 +251,26 @@ public class CodeRunner {
} }
} }
/**
*
* @return
*/
public StringWriter getStringWriter() { public StringWriter getStringWriter() {
return sw; return sw;
} }
/**
*
* @return
*/
public PrintWriter getPrintWriter() { public PrintWriter getPrintWriter() {
return pw; return pw;
} }
/**
*
* @return
*/
public String getBufferDump() { public String getBufferDump() {
String dump = sw.toString(); String dump = sw.toString();
sw.getBuffer().setLength(0); sw.getBuffer().setLength(0);
@ -308,10 +344,20 @@ public class CodeRunner {
return eval; return eval;
} }
/**
*
* @param var
* @param val
*/
public void setVar(String var, Object val) { public void setVar(String var, Object val) {
se.put(var, val); se.put(var, val);
} }
/**
*
* @param var
* @return
*/
public Object getVar(String var) { public Object getVar(String var) {
return se.get(var); return se.get(var);
} }

@ -63,7 +63,11 @@ package net.apocalypselabs.symat;
public class Debug { public class Debug {
// If output should be on or off // If output should be on or off
public static boolean debug = true;
/**
*
*/
public static boolean debug = true;
/** /**
* Turn debug output on and off. * Turn debug output on and off.

@ -96,8 +96,19 @@ public class Editor extends javax.swing.JInternalFrame {
private AutoCompletion jsac = new AutoCompletion(jscomp); private AutoCompletion jsac = new AutoCompletion(jscomp);
private AutoCompletion pyac = new AutoCompletion(pycomp); private AutoCompletion pyac = new AutoCompletion(pycomp);
/**
* The JavaScript language.
*/
public static final int JAVASCRIPT = 1; public static final int JAVASCRIPT = 1;
/**
* The Python language.
*/
public static final int PYTHON = 2; public static final int PYTHON = 2;
/**
* The Javs language.
*/
public static final int JAVA = 3; public static final int JAVA = 3;
private File filedata; private File filedata;
@ -217,6 +228,9 @@ public class Editor extends javax.swing.JInternalFrame {
} }
} }
/**
*
*/
public Editor() { public Editor() {
this(false); this(false);
} }
@ -1026,7 +1040,9 @@ public class Editor extends javax.swing.JInternalFrame {
*/ */
private void openSample(String name) { private void openSample(String name) {
String ext = "js"; String ext = "js";
if (!javascriptOption.isSelected()) { if (javaOption.isSelected()) {
ext = "java.txt";
} else if (pythonOption.isSelected()) {
ext = "py"; ext = "py";
} }
String text = ""; String text = "";
@ -1042,10 +1058,10 @@ public class Editor extends javax.swing.JInternalFrame {
} }
} catch (Exception e) { } catch (Exception e) {
text = "Error: Could not open embedded sample file."; text = "Error: Could not open embedded sample file.";
if (ext.equals("js")) { if (ext.startsWith("j")) {
text = "/* " + text + " */"; text = "/* " + text + " */";
} else { } else {
text = "# " + text; text = "## " + text;
} }
} }
openString(text, name + "." + ext, false); openString(text, name + "." + ext, false);

@ -113,6 +113,13 @@ public class FileUtils {
return file; return file;
} }
/**
*
* @param content
* @param path
* @param addToRecent
* @throws IOException
*/
public static void saveFile(String content, String path, boolean addToRecent) public static void saveFile(String content, String path, boolean addToRecent)
throws IOException { throws IOException {
try (PrintStream out = new PrintStream(new FileOutputStream(path))) { try (PrintStream out = new PrintStream(new FileOutputStream(path))) {
@ -146,6 +153,13 @@ public class FileUtils {
return null; return null;
} }
/**
*
* @param url
* @return
* @throws MalformedURLException
* @throws IOException
*/
public static String getUrl(String url) throws MalformedURLException, IOException { public static String getUrl(String url) throws MalformedURLException, IOException {
String out; String out;
try (Scanner sc = new Scanner(new URL(url).openStream(), "UTF-8")) { try (Scanner sc = new Scanner(new URL(url).openStream(), "UTF-8")) {

@ -70,6 +70,10 @@ public class FontOptions extends javax.swing.JPanel {
initComponents(); initComponents();
} }
/**
*
* @param size
*/
public FontOptions(int size) { public FontOptions(int size) {
this(); this();
jSpinner1.setValue(size); jSpinner1.setValue(size);
@ -130,10 +134,18 @@ public class FontOptions extends javax.swing.JPanel {
modified = true; modified = true;
}//GEN-LAST:event_jSpinner1StateChanged }//GEN-LAST:event_jSpinner1StateChanged
/**
*
* @return
*/
public int getResult() { public int getResult() {
return (int) jSpinner1.getValue(); return (int) jSpinner1.getValue();
} }
/**
*
* @return
*/
public boolean isModified() { public boolean isModified() {
return modified; return modified;
} }

@ -95,6 +95,9 @@ import org.python.core.PyList;
*/ */
public class Functions { public class Functions {
/**
*
*/
public static final HashMap<String, Object> GLOBALS = new HashMap<>(); public static final HashMap<String, Object> GLOBALS = new HashMap<>();
private final EvalUtilities util = new EvalUtilities(true, true); private final EvalUtilities util = new EvalUtilities(true, true);
@ -151,7 +154,7 @@ public class Functions {
} }
/** /**
* @see pause() * @see pause(long millis)
* @param millis * @param millis
*/ */
public void sleep(long millis) { public void sleep(long millis) {
@ -222,6 +225,12 @@ public class Functions {
return in.modPow(new BigInteger(b), new BigInteger(m)).toString(); return in.modPow(new BigInteger(b), new BigInteger(m)).toString();
} }
/**
*
* @param a
* @param b
* @return
*/
public long gcd(long a, long b) { public long gcd(long a, long b) {
if (b == 0) { if (b == 0) {
return a; return a;
@ -229,6 +238,12 @@ public class Functions {
return gcd(b, a % b); return gcd(b, a % b);
} }
/**
*
* @param a
* @param b
* @return
*/
public String gcd(String a, String b) { public String gcd(String a, String b) {
return (new BigInteger(a).gcd(new BigInteger(b)).toString()); return (new BigInteger(a).gcd(new BigInteger(b)).toString());
} }
@ -255,11 +270,25 @@ public class Functions {
return diff(function, "x"); return diff(function, "x");
} }
/**
*
* @param function
* @param idv
* @return
* @deprecated
*/
@Deprecated @Deprecated
public String D(String function, String idv) { public String D(String function, String idv) {
return diff(function, idv); return diff(function, idv);
} }
/**
*
* @param function
* @param idv
* @param eq
* @return
*/
public double[] solve(String function, String idv, int eq) { public double[] solve(String function, String idv, int eq) {
String res = $("Solve[" + function + "==" + eq + ", " + idv + "]"); String res = $("Solve[" + function + "==" + eq + ", " + idv + "]");
res = res.substring(1, res.length() - 1); res = res.substring(1, res.length() - 1);
@ -287,10 +316,21 @@ public class Functions {
return out; return out;
} }
/**
*
* @param function
* @param idv
* @return
*/
public double[] solve(String function, String idv) { public double[] solve(String function, String idv) {
return solve(function, idv, 0); return solve(function, idv, 0);
} }
/**
*
* @param function
* @return
*/
public double[] solve(String function) { public double[] solve(String function) {
return solve(function, "x"); return solve(function, "x");
} }
@ -322,6 +362,11 @@ public class Functions {
return out; return out;
} }
/**
*
* @param o
* @return
*/
public String printa(Object o) { public String printa(Object o) {
String out = "["; String out = "[";
if (o instanceof int[]) { if (o instanceof int[]) {
@ -401,6 +446,11 @@ public class Functions {
return integrate(function, "x"); return integrate(function, "x");
} }
/**
*
* @param function
* @return
*/
public String factor(String function) { public String factor(String function) {
return sym("Factor(" + function + ")"); return sym("Factor(" + function + ")");
} }
@ -415,6 +465,11 @@ public class Functions {
return sym("Simplify(" + expr + ")"); return sym("Simplify(" + expr + ")");
} }
/**
*
* @param expr
* @return
*/
public Object vpa(String expr) { public Object vpa(String expr) {
IExpr ans = util.evaluate("N(" + expr + ")"); IExpr ans = util.evaluate("N(" + expr + ")");
if (ans.isNumber()) { if (ans.isNumber()) {
@ -423,6 +478,11 @@ public class Functions {
return ans.toString(); return ans.toString();
} }
/**
*
* @param in
* @return
*/
public int[] primes(int in) { public int[] primes(int in) {
boolean[] prime = new boolean[in]; boolean[] prime = new boolean[in];
for (int i = 0; i < prime.length; i++) { for (int i = 0; i < prime.length; i++) {
@ -450,50 +510,110 @@ public class Functions {
return out; return out;
} }
/**
*
* @param d
* @return
*/
public double sec(double d) { public double sec(double d) {
return 1.0 / Math.cos(d); return 1.0 / Math.cos(d);
} }
/**
*
* @param d
* @return
*/
public double csc(double d) { public double csc(double d) {
return 1.0 / Math.sin(d); return 1.0 / Math.sin(d);
} }
/**
*
* @param d
* @return
*/
public double cot(double d) { public double cot(double d) {
return 1.0 / Math.tan(d); return 1.0 / Math.tan(d);
} }
/**
*
* @param d
* @return
*/
public double asec(double d) { public double asec(double d) {
return Math.acos(1.0 / d); return Math.acos(1.0 / d);
} }
/**
*
* @param d
* @return
*/
public double acsc(double d) { public double acsc(double d) {
return Math.asin(1.0 / d); return Math.asin(1.0 / d);
} }
/**
*
* @param d
* @return
*/
public double acot(double d) { public double acot(double d) {
return Math.atan(1.0 / d); return Math.atan(1.0 / d);
} }
/**
*
* @param d
* @return
*/
public double sinh(double d) { public double sinh(double d) {
return Math.sinh(d); return Math.sinh(d);
} }
/**
*
* @param d
* @return
*/
public double cosh(double d) { public double cosh(double d) {
return Math.cosh(d); return Math.cosh(d);
} }
/**
*
* @param d
* @return
*/
public double tanh(double d) { public double tanh(double d) {
return Math.tanh(d); return Math.tanh(d);
} }
/**
*
* @param d
* @return
*/
public double sech(double d) { public double sech(double d) {
return pow(Math.cosh(d), -1); return pow(Math.cosh(d), -1);
} }
/**
*
* @param d
* @return
*/
public double csch(double d) { public double csch(double d) {
return pow(Math.sinh(d), -1); return pow(Math.sinh(d), -1);
} }
/**
*
* @param d
* @return
*/
public double coth(double d) { public double coth(double d) {
return Math.cosh(d) / Math.sinh(d); return Math.cosh(d) / Math.sinh(d);
} }
@ -610,6 +730,7 @@ public class Functions {
* Add the given numbers together. * Add the given numbers together.
* *
* @param a numbers. Calculates first + second + third, etc. * @param a numbers. Calculates first + second + third, etc.
* @param b
* @return The sum of the numbers or the value of input if there is only one * @return The sum of the numbers or the value of input if there is only one
* input. * input.
*/ */
@ -640,6 +761,7 @@ public class Functions {
* Subtract the given numbers. * Subtract the given numbers.
* *
* @param a numbers. Calculates (first - second) - third, etc. * @param a numbers. Calculates (first - second) - third, etc.
* @param b
* @return The difference of the numbers or the value of input if there is * @return The difference of the numbers or the value of input if there is
* only one input. * only one input.
*/ */
@ -649,6 +771,11 @@ public class Functions {
return ans.toString(); return ans.toString();
} }
/**
*
* @param a
* @return
*/
public double[][] minvert(double a[][]) { public double[][] minvert(double a[][]) {
int n = a.length; int n = a.length;
double x[][] = new double[n][n]; double x[][] = new double[n][n];
@ -762,6 +889,11 @@ public class Functions {
return a; return a;
} }
/**
*
* @param n
* @return
*/
public boolean isprime(long n) { public boolean isprime(long n) {
int i = 2; int i = 2;
while (i <= sqrt(n)) { while (i <= sqrt(n)) {
@ -773,6 +905,11 @@ public class Functions {
return true; return true;
} }
/**
*
* @param nn
* @return
*/
public boolean isprime(String nn) { public boolean isprime(String nn) {
BigInteger n = new BigInteger(nn); BigInteger n = new BigInteger(nn);
BigInteger i = new BigInteger("2"); BigInteger i = new BigInteger("2");
@ -902,7 +1039,7 @@ public class Functions {
* Multiply the given matrix by itself b times. * Multiply the given matrix by itself b times.
* *
* @param a Square matrix * @param a Square matrix
* @param b Power ( >= 0 ) * @param b Power ( &gt;= 0 )
* @return The matrix result * @return The matrix result
* @throws BadInputException if the matrix is not square or power is less * @throws BadInputException if the matrix is not square or power is less
* than 0 * than 0
@ -947,6 +1084,11 @@ public class Functions {
return radians * (180 / PI); return radians * (180 / PI);
} }
/**
*
* @param input
* @return
*/
public String sym(String input) { public String sym(String input) {
return util.evaluate(input).toString(); return util.evaluate(input).toString();
} }
@ -976,7 +1118,7 @@ public class Functions {
/** /**
* Substitute newvar for variable in function and attempt to calculate a * Substitute newvar for variable in function and attempt to calculate a
* numerical answer. * numerical answer.
* <br />Example: subs('32*x','x',2) = 64.0 * <br>Example: subs('32*x','x',2) = 64.0
* *
* @param function Function * @param function Function
* @param variable Variable to substitute * @param variable Variable to substitute
@ -1004,10 +1146,21 @@ public class Functions {
/* /*
Graphing interfaces Graphing interfaces
*/ */
/**
*
* @param xmin
* @param xmax
*/
public void xlim(double xmin, double xmax) { public void xlim(double xmin, double xmax) {
graphwin.setRange(xmin, xmax); graphwin.setRange(xmin, xmax);
} }
/**
*
* @param function
*/
public void plot(String function) { public void plot(String function) {
showGraph(); showGraph();
if (!function.equals("")) { if (!function.equals("")) {
@ -1015,35 +1168,75 @@ public class Functions {
} }
} }
/**
*
* @param x
* @param y
*/
public void plot(double[] x, double[] y) { public void plot(double[] x, double[] y) {
graphwin.plotPoints(x, y); graphwin.plotPoints(x, y);
} }
/**
*
* @param x
* @param y
* @param name
*/
public void plot(double[] x, double[] y, String name) { public void plot(double[] x, double[] y, String name) {
graphwin.plotPoints(x, y, name); graphwin.plotPoints(x, y, name);
} }
/**
*
* @param function
* @param xmin
* @param xmax
*/
public void plot(String function, double xmin, double xmax) { public void plot(String function, double xmin, double xmax) {
graphwin.setRange(xmin, xmax); graphwin.setRange(xmin, xmax);
plot(function); plot(function);
} }
/**
*
* @param f
*/
public void ezplot(String f) { public void ezplot(String f) {
plot(f); plot(f);
} }
/**
*
* @param function
* @param xmin
* @param xmax
*/
public void ezplot(String function, double xmin, double xmax) { public void ezplot(String function, double xmin, double xmax) {
plot(function, xmin, xmax); plot(function, xmin, xmax);
} }
/**
*
* @param f
*/
public void graph(String f) { public void graph(String f) {
plot(f); plot(f);
} }
/**
*
* @return
*/
public String plotname() { public String plotname() {
return graphwin.getTitle(); return graphwin.getTitle();
} }
/**
*
* @param t
* @return
*/
public String plotname(String t) { public String plotname(String t) {
if (t.equals("symatpythonnullplotname")) { if (t.equals("symatpythonnullplotname")) {
return graphwin.getTitle(); return graphwin.getTitle();
@ -1054,31 +1247,60 @@ public class Functions {
} }
} }
/**
*
*/
public void plot() { public void plot() {
showGraph(); showGraph();
} }
/**
*
*/
public void plotclr() { public void plotclr() {
graphwin.clearDraw(); graphwin.clearDraw();
} }
/**
*
*/
public void clearplot() { public void clearplot() {
plotclr(); plotclr();
} }
/**
*
*/
public void plotclear() { public void plotclear() {
plotclr(); plotclr();
} }
/**
*
* @param x
* @param y
*/
public void drawdot(double x, double y) { public void drawdot(double x, double y) {
showGraph(); showGraph();
graphwin.drawDot(x, y); graphwin.drawDot(x, y);
} }
/**
*
* @param path
* @return
* @throws IOException
*/
public String readfile(String path) throws IOException { public String readfile(String path) throws IOException {
return FileUtils.readFile(path); return FileUtils.readFile(path);
} }
/**
*
* @param content
* @param path
* @throws IOException
*/
public void savefile(String content, String path) throws IOException { public void savefile(String content, String path) throws IOException {
FileUtils.saveFile(content, path, false); FileUtils.saveFile(content, path, false);
} }
@ -1098,10 +1320,20 @@ public class Functions {
return ""; return "";
} }
/**
*
* @param data
* @return
*/
public String md5sum(String data) { public String md5sum(String data) {
return FileUtils.MD5(data); return FileUtils.MD5(data);
} }
/**
*
* @param key
* @param val
*/
public void save(String key, String val) { public void save(String key, String val) {
Preferences prefs = Preferences.userNodeForPackage(Functions.class); Preferences prefs = Preferences.userNodeForPackage(Functions.class);
prefs.put(key, val); prefs.put(key, val);
@ -1112,6 +1344,11 @@ public class Functions {
} }
} }
/**
*
* @param key
* @return
*/
public String load(String key) { public String load(String key) {
Preferences prefs = Preferences.userNodeForPackage(Functions.class); Preferences prefs = Preferences.userNodeForPackage(Functions.class);
return prefs.get(key, ""); return prefs.get(key, "");
@ -1120,6 +1357,12 @@ public class Functions {
/* /*
Other Other
*/ */
/**
*
* @return
*/
public String sysinfo() { public String sysinfo() {
String info = "==Java Information==\n"; String info = "==Java Information==\n";
info += "Java version: " + System.getProperty("java.version"); info += "Java version: " + System.getProperty("java.version");
@ -1145,6 +1388,10 @@ public class Functions {
} }
} }
/**
*
* @return
*/
public String license() { public String license() {
String expires = "Error"; String expires = "Error";
if (PrefStorage.getSetting("licensetype").equals("demo")) { if (PrefStorage.getSetting("licensetype").equals("demo")) {
@ -1191,10 +1438,18 @@ public class Functions {
graphwin.toFront(); graphwin.toFront();
} }
/**
*
* @return
*/
public TextBox textbox() { public TextBox textbox() {
return new TextBox(); return new TextBox();
} }
/**
*
* @return
*/
public WebBrowser browser() { public WebBrowser browser() {
return new WebBrowser(); return new WebBrowser();
} }
@ -1202,10 +1457,17 @@ public class Functions {
Constructor. Constructor.
*/ */
/**
*
*/
public Functions() { public Functions() {
Main.loadFrame(graphwin, false); Main.loadFrame(graphwin, false);
} }
/**
*
* @param l
*/
public void setLang(String l) { public void setLang(String l) {
lang = l; lang = l;
} }

@ -99,6 +99,10 @@ public class Graph extends javax.swing.JInternalFrame {
init(); init();
} }
/**
*
* @param isInternal
*/
public Graph(boolean isInternal) { public Graph(boolean isInternal) {
init(); init();
standalone = !isInternal; standalone = !isInternal;
@ -125,6 +129,9 @@ public class Graph extends javax.swing.JInternalFrame {
} }
} }
/**
*
*/
public void forceClose() { public void forceClose() {
dispose(); dispose();
} }
@ -379,10 +386,21 @@ public class Graph extends javax.swing.JInternalFrame {
private void formComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentShown private void formComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentShown
}//GEN-LAST:event_formComponentShown }//GEN-LAST:event_formComponentShown
/**
*
* @param x
* @param y
*/
public void plotPoints(double[] x, double[] y) { public void plotPoints(double[] x, double[] y) {
plotPoints(x, y, "Points"); plotPoints(x, y, "Points");
} }
/**
*
* @param x
* @param y
* @param name
*/
public void plotPoints(double[] x, double[] y, String name) { public void plotPoints(double[] x, double[] y, String name) {
plot.addLinePlot(name, x, y); plot.addLinePlot(name, x, y);
} }
@ -398,6 +416,11 @@ public class Graph extends javax.swing.JInternalFrame {
return 15.0; return 15.0;
} }
/**
*
* @param x
* @param y
*/
public void drawDot(double x, double y) { public void drawDot(double x, double y) {
double[] xpt = {x}; double[] xpt = {x};
double[] ypt = {y}; double[] ypt = {y};
@ -455,6 +478,11 @@ public class Graph extends javax.swing.JInternalFrame {
return range; return range;
} }
/**
*
* @param min
* @param max
*/
public void setRange(double min, double max) { public void setRange(double min, double max) {
xmin = min; xmin = min;
xmax = max; xmax = max;
@ -486,6 +514,10 @@ public class Graph extends javax.swing.JInternalFrame {
plotBtnActionPerformed(null); plotBtnActionPerformed(null);
} }
/**
*
* @param label
*/
public void setLabel(String label) { public void setLabel(String label) {
lbl.setText(label); lbl.setText(label);
} }

@ -84,6 +84,10 @@ public class InstallPlugin extends javax.swing.JInternalFrame {
initComponents(); initComponents();
} }
/**
*
* @param f
*/
public InstallPlugin(File f) { public InstallPlugin(File f) {
this(); this();
openPlugin(f); openPlugin(f);

@ -145,6 +145,9 @@ public class Interpreter extends javax.swing.JInternalFrame {
inputBox.requestFocus(); inputBox.requestFocus();
} }
/**
*
*/
public Interpreter() { public Interpreter() {
this("default"); this("default");
} }

@ -67,14 +67,26 @@ public class KeyValListItem {
private String VAL = ""; private String VAL = "";
private String KEY = ""; private String KEY = "";
/**
*
*/
public KeyValListItem() { public KeyValListItem() {
} }
/**
*
* @param key
*/
public KeyValListItem(String key) { public KeyValListItem(String key) {
KEY = key; KEY = key;
} }
/**
*
* @param key
* @param val
*/
public KeyValListItem(String key, String val) { public KeyValListItem(String key, String val) {
KEY = key; KEY = key;
VAL = val; VAL = val;

@ -314,11 +314,19 @@ public class License extends javax.swing.JInternalFrame {
} }
} }
/**
*
* @param email
* @return
*/
public static boolean checkEmail(String email) { public static boolean checkEmail(String email) {
String regex = "^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]+$"; String regex = "^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]+$";
return (email.matches(regex)); return (email.matches(regex));
} }
/**
*
*/
public void exit() { public void exit() {
dispose(); dispose();
} }

@ -134,13 +134,32 @@ public class Main extends JRibbonFrame {
* Becomes default sans-serif if something bad happens. * Becomes default sans-serif if something bad happens.
*/ */
public static Font ubuntuRegular; public static Font ubuntuRegular;
/**
*
*/
public static boolean skipPython = false; // Skip python init on start? public static boolean skipPython = false; // Skip python init on start?
/**
*
*/
public static boolean skipEditor = false; // Skip editor init on start? public static boolean skipEditor = false; // Skip editor init on start?
private static boolean recentItemsMinimized = false; private static boolean recentItemsMinimized = false;
/**
*
*/
public static boolean updateAvailable = false; // Update available? public static boolean updateAvailable = false; // Update available?
/**
*
*/
public static String updateString = ""; public static String updateString = "";
/**
*
*/
public static boolean licValid = false; // License valid? public static boolean licValid = false; // License valid?
/** /**
@ -153,8 +172,14 @@ public class Main extends JRibbonFrame {
*/ */
public static SingleInstanceServer sisrv; public static SingleInstanceServer sisrv;
/**
*
*/
public static Main maingui; public static Main maingui;
/**
*
*/
public JRibbonBand pluginband; public JRibbonBand pluginband;
/** /**
@ -440,12 +465,22 @@ public class Main extends JRibbonFrame {
ribbon.addTask(plugintask); ribbon.addTask(plugintask);
} }
/**
*
* @param name
* @return
*/
public static ResizableIcon getRibbonIcon(String name) { public static ResizableIcon getRibbonIcon(String name) {
return ImageWrapperResizableIcon.getIcon( return ImageWrapperResizableIcon.getIcon(
Main.class.getResource("images/" + name + ".png"), Main.class.getResource("images/" + name + ".png"),
new Dimension(100, 76)); new Dimension(100, 76));
} }
/**
*
* @param name
* @return
*/
public static ResizableIcon getTinyRibbonIcon(String name) { public static ResizableIcon getTinyRibbonIcon(String name) {
int d = 32; int d = 32;
return ImageWrapperResizableIcon.getIcon( return ImageWrapperResizableIcon.getIcon(
@ -453,6 +488,10 @@ public class Main extends JRibbonFrame {
new Dimension(d, d)); new Dimension(d, d));
} }
/**
*
* @param restricted
*/
public static void licenseRestrict(boolean restricted) { public static void licenseRestrict(boolean restricted) {
graphbtn.setEnabled(!restricted); graphbtn.setEnabled(!restricted);
padsbtn.setEnabled(!restricted); padsbtn.setEnabled(!restricted);
@ -474,6 +513,10 @@ public class Main extends JRibbonFrame {
mainPane.getWidth(), mainPane.getHeight()); mainPane.getWidth(), mainPane.getHeight());
} }
/**
*
* @param recent
*/
public static void loadRibbonMenu(RibbonApplicationMenuEntrySecondary[] recent) { public static void loadRibbonMenu(RibbonApplicationMenuEntrySecondary[] recent) {
RibbonApplicationMenuEntryPrimary helpbtn RibbonApplicationMenuEntryPrimary helpbtn
= new RibbonApplicationMenuEntryPrimary( = new RibbonApplicationMenuEntryPrimary(
@ -1074,24 +1117,63 @@ public class Main extends JRibbonFrame {
}); });
} }
/**
*
*/
public static JCommandButton shellbtn public static JCommandButton shellbtn
= new JCommandButton("Shell", getRibbonIcon("shell")); = new JCommandButton("Shell", getRibbonIcon("shell"));
/**
*
*/
public static JCommandButton editorbtn public static JCommandButton editorbtn
= new JCommandButton("Editor", getRibbonIcon("editor")); = new JCommandButton("Editor", getRibbonIcon("editor"));
/**
*
*/
public static JCommandButton graphbtn public static JCommandButton graphbtn
= new JCommandButton("Graph", getRibbonIcon("graph")); = new JCommandButton("Graph", getRibbonIcon("graph"));
/**
*
*/
public static JCommandButton notepadbtn public static JCommandButton notepadbtn
= new JCommandButton("Notepad", getRibbonIcon("notepad")); = new JCommandButton("Notepad", getRibbonIcon("notepad"));
/**
*
*/
public static JCommandButton wikibtn public static JCommandButton wikibtn
= new JCommandButton("Wiki", getRibbonIcon("wiki")); = new JCommandButton("Wiki", getRibbonIcon("wiki"));
/**
*
*/
public static JCommandButton forumbtn public static JCommandButton forumbtn
= new JCommandButton("Forum", getRibbonIcon("forum")); = new JCommandButton("Forum", getRibbonIcon("forum"));
/**
*
*/
public static JCommandButton padsbtn public static JCommandButton padsbtn
= new JCommandButton("Pads", getRibbonIcon("pads")); = new JCommandButton("Pads", getRibbonIcon("pads"));
/**
*
*/
public static JCommandButton tasksbtn public static JCommandButton tasksbtn
= new JCommandButton("Tasks", getRibbonIcon("tasks")); = new JCommandButton("Tasks", getRibbonIcon("tasks"));
/**
*
*/
public static JCommandButton installpluginbtn public static JCommandButton installpluginbtn
= new JCommandButton("Install", getRibbonIcon("installplugin")); = new JCommandButton("Install", getRibbonIcon("installplugin"));
/**
*
*/
public static RibbonApplicationMenuEntryPrimary openbtn; public static RibbonApplicationMenuEntryPrimary openbtn;
// Variables declaration - do not modify//GEN-BEGIN:variables // Variables declaration - do not modify//GEN-BEGIN:variables

@ -75,6 +75,11 @@ public class PackagePlugin extends javax.swing.JInternalFrame {
private final JFileChooser fcexp = new JFileChooser(); private final JFileChooser fcexp = new JFileChooser();
private ImageIcon icon; private ImageIcon icon;
/**
*
* @param code
* @param lang
*/
public PackagePlugin(String code, int lang) { public PackagePlugin(String code, int lang) {
this(); this();
try { try {

@ -69,6 +69,9 @@ import org.etherpad_lite_client.EPLiteException;
*/ */
public class Pads extends javax.swing.JInternalFrame { public class Pads extends javax.swing.JInternalFrame {
/**
* URL of the pad server.
*/
public static final String PADS_URL = "http://pad.symatapp.com"; public static final String PADS_URL = "http://pad.symatapp.com";
/** /**
@ -113,7 +116,7 @@ public class Pads extends javax.swing.JInternalFrame {
/** /**
* Delete the pad with the given ID from local memory. * Delete the pad with the given ID from local memory.
* <br />It will still exist online. * <br>It will still exist online.
* *
* @param id the pad ID. * @param id the pad ID.
*/ */
@ -179,8 +182,8 @@ public class Pads extends javax.swing.JInternalFrame {
/** /**
* Generate a random pad ID with length 15. * Generate a random pad ID with length 15.
* <br />There are about 1.217 x 10^26 possibilities (121 septillion). * <br>There are about 1.217 x 10^26 possibilities (121 septillion).
* <br />If this starts giving out used IDs, I'll be too rich to care. * <br>If this starts giving out used IDs, I'll be too rich to care.
* *
* @return the ID. * @return the ID.
*/ */

@ -70,14 +70,28 @@ public class PrefStorage {
private static final Preferences prefs = Preferences.userNodeForPackage(PrefStorage.class); private static final Preferences prefs = Preferences.userNodeForPackage(PrefStorage.class);
/**
*
* @param key
* @param value
*/
public static void saveSetting(String key, String value) { public static void saveSetting(String key, String value) {
prefs.put(key, value); prefs.put(key, value);
} }
/**
*
* @param key
* @return
*/
public static boolean isset(String key) { public static boolean isset(String key) {
return !getSetting(key, "NULL").equals("NULL"); return !getSetting(key, "NULL").equals("NULL");
} }
/**
*
* @param key
*/
public static void unset(String key) { public static void unset(String key) {
saveSetting(key, ""); saveSetting(key, "");
save(); save();
@ -85,14 +99,29 @@ public class PrefStorage {
save(); save();
} }
/**
*
* @param key
* @return
*/
public static String getSetting(String key) { public static String getSetting(String key) {
return prefs.get(key, ""); return prefs.get(key, "");
} }
/**
*
* @param key
* @param emptyResponse
* @return
*/
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);
} }
/**
*
* @return
*/
public static boolean save() { public static boolean save() {
try { try {
prefs.flush(); prefs.flush();

@ -24,6 +24,10 @@ import syntaxhighlight.ParseResult;
import syntaxhighlight.Style; import syntaxhighlight.Style;
import syntaxhighlight.Theme; import syntaxhighlight.Theme;
/**
*
* @author Skylar
*/
public class PrettifyToHtml { public class PrettifyToHtml {
private static final String MAIN_CLASS = "prettyprint"; private static final String MAIN_CLASS = "prettyprint";
@ -58,6 +62,11 @@ public class PrettifyToHtml {
return sb.toString(); return sb.toString();
} }
/**
*
* @param theme
* @return
*/
public static String toCss(Theme theme) { public static String toCss(Theme theme) {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append("." + MAIN_CLASS + " {"); sb.append("." + MAIN_CLASS + " {");

@ -68,6 +68,10 @@ import java.net.URL;
*/ */
public class SingleInstanceClient { public class SingleInstanceClient {
/**
*
* @param arg
*/
public SingleInstanceClient(String arg) { public SingleInstanceClient(String arg) {
String response = ""; String response = "";
String args = (arg.equals("") ? "" : "?arg=" + arg); String args = (arg.equals("") ? "" : "?arg=" + arg);

@ -65,6 +65,9 @@ import java.util.Map;
*/ */
public class SingleInstanceServer extends NanoHTTPD { public class SingleInstanceServer extends NanoHTTPD {
/**
*
*/
public SingleInstanceServer() { public SingleInstanceServer() {
super(26879); super(26879);
} }

@ -91,6 +91,10 @@ public class Tasks extends javax.swing.JInternalFrame {
initComponents(); initComponents();
} }
/**
*
* @param f
*/
public Tasks(File f) { public Tasks(File f) {
this(); this();
try { try {

@ -149,6 +149,10 @@ public class TasksExport extends javax.swing.JInternalFrame {
}); });
} }
/**
*
* @param content
*/
public void loadString(final String content) { public void loadString(final String content) {
Platform.runLater(new Runnable() { Platform.runLater(new Runnable() {
@Override @Override

@ -131,6 +131,10 @@ public class Theme {
} }
} }
/**
*
* @return
*/
public static String getTheme() { public static String getTheme() {
switch (currentTheme) { switch (currentTheme) {
case THEME_DARK: case THEME_DARK:
@ -143,6 +147,10 @@ public class Theme {
} }
} }
/**
*
* @return
*/
public static Color textColor() { public static Color textColor() {
if (currentTheme == THEME_NEO) { if (currentTheme == THEME_NEO) {
return Color.GREEN; return Color.GREEN;
@ -150,22 +158,42 @@ public class Theme {
return (currentTheme == THEME_LIGHT) ? BLACK : WHITE; return (currentTheme == THEME_LIGHT) ? BLACK : WHITE;
} }
/**
*
* @return
*/
public static Color boxColor() { public static Color boxColor() {
return (currentTheme == THEME_LIGHT) ? WHITE : DBACK; return (currentTheme == THEME_LIGHT) ? WHITE : DBACK;
} }
/**
*
* @return
*/
public static Color notepadColor() { public static Color notepadColor() {
return (currentTheme == THEME_LIGHT) ? NTPAD : DBACK; return (currentTheme == THEME_LIGHT) ? NTPAD : DBACK;
} }
/**
*
* @return
*/
public static Color windowColor() { public static Color windowColor() {
return (currentTheme == THEME_LIGHT) ? LGRAY : DGRAY; return (currentTheme == THEME_LIGHT) ? LGRAY : DGRAY;
} }
/**
*
* @return
*/
public static Color tabColor() { public static Color tabColor() {
return (currentTheme == THEME_LIGHT) ? LBACK : DBACK; return (currentTheme == THEME_LIGHT) ? LBACK : DBACK;
} }
/**
*
* @return
*/
public static String editorTheme() { public static String editorTheme() {
if (currentTheme == THEME_NEO) { if (currentTheme == THEME_NEO) {
return "neo"; return "neo";

@ -91,9 +91,24 @@ public class WebBrowser extends javax.swing.JInternalFrame {
private Group root; private Group root;
private Scene scene; private Scene scene;
/**
*
*/
public static final int DEFAULT_LOGO = 0; public static final int DEFAULT_LOGO = 0;
/**
*
*/
public static final int WIKI_LOGO = 1; public static final int WIKI_LOGO = 1;
/**
*
*/
public static final int FORUM_LOGO = 2; public static final int FORUM_LOGO = 2;
/**
*
*/
public static final int PAD_LOGO = 3; public static final int PAD_LOGO = 3;
private JInternalFrame thisFrame; private JInternalFrame thisFrame;
@ -165,12 +180,20 @@ public class WebBrowser extends javax.swing.JInternalFrame {
browserBox.add(jfxPanel, BorderLayout.CENTER); browserBox.add(jfxPanel, BorderLayout.CENTER);
} }
/**
*
* @param title
*/
public WebBrowser(String title) { public WebBrowser(String title) {
this(); this();
setTitle(title); setTitle(title);
loadURL("http://wiki.symatapp.com/"); loadURL("http://wiki.symatapp.com/");
} }
/**
*
* @return
*/
public String homepage() { public String homepage() {
try { try {
String text = ""; String text = "";
@ -188,12 +211,23 @@ public class WebBrowser extends javax.swing.JInternalFrame {
} }
} }
/**
*
* @param title
* @param url
*/
public WebBrowser(String title, String url) { public WebBrowser(String title, String url) {
this(); this();
setTitle(title); setTitle(title);
loadURL(url); loadURL(url);
} }
/**
*
* @param title
* @param url
* @param icon
*/
public WebBrowser(String title, String url, int icon) { public WebBrowser(String title, String url, int icon) {
this(title, url); this(title, url);
switch (icon) { switch (icon) {
@ -215,17 +249,30 @@ public class WebBrowser extends javax.swing.JInternalFrame {
} }
/**
*
* @param url
* @param isurl
*/
public WebBrowser(String url, boolean isurl) { public WebBrowser(String url, boolean isurl) {
this(); this();
loadURL(url); loadURL(url);
} }
/**
*
* @param yesno
*/
public void showNavbar(boolean yesno) { public void showNavbar(boolean yesno) {
navBar.setVisible(yesno); navBar.setVisible(yesno);
goBtn.setEnabled(yesno); goBtn.setEnabled(yesno);
backBtn.setEnabled(yesno); backBtn.setEnabled(yesno);
} }
/**
*
* @param url
*/
public void loadURL(final String url) { public void loadURL(final String url) {
Platform.runLater(new Runnable() { Platform.runLater(new Runnable() {
@Override @Override
@ -237,10 +284,17 @@ public class WebBrowser extends javax.swing.JInternalFrame {
urlBox.setText(url); urlBox.setText(url);
} }
/**
*
*/
public void open() { public void open() {
Main.loadFrame(this, true); Main.loadFrame(this, true);
} }
/**
*
* @param content
*/
public void loadString(final String content) { public void loadString(final String content) {
Platform.runLater(new Runnable() { Platform.runLater(new Runnable() {
@Override @Override

@ -0,0 +1,3 @@
String formula = ask("Enter formula:");
plot(formula);
plotname("Cool graph!");

@ -0,0 +1,7 @@
public class HelloWorld {
public static void main(String[] args) {
print("Hello world");
}
}
HelloWorld.main(null);

@ -67,10 +67,22 @@ public class Task extends javax.swing.JPanel {
private int percent = 0; private int percent = 0;
/**
*
* @param complete
* @param name
* @param desc
*/
public Task(boolean complete, String name, String desc) { public Task(boolean complete, String name, String desc) {
this((complete ? 100 : 0), name, desc); this((complete ? 100 : 0), name, desc);
} }
/**
*
* @param complete
* @param name
* @param desc
*/
public Task(int complete, String name, String desc) { public Task(int complete, String name, String desc) {
this(); this();
percent = complete; percent = complete;
@ -92,10 +104,18 @@ public class Task extends javax.swing.JPanel {
return taskName.getText(); return taskName.getText();
} }
/**
*
* @return
*/
public String getDesc() { public String getDesc() {
return taskDesc.getText(); return taskDesc.getText();
} }
/**
*
* @return
*/
public int getComplete() { public int getComplete() {
return percent; return percent;
} }

@ -70,6 +70,10 @@ public class TaskList implements Serializable {
private final ArrayList<SingleTask> tasks = new ArrayList<>(); private final ArrayList<SingleTask> tasks = new ArrayList<>();
private String title = "Untitled"; private String title = "Untitled";
/**
*
* @param t
*/
public void addTask(Task t) { public void addTask(Task t) {
SingleTask st = new SingleTask(); SingleTask st = new SingleTask();
st.name = t.toString(); st.name = t.toString();
@ -78,6 +82,10 @@ public class TaskList implements Serializable {
tasks.add(st); tasks.add(st);
} }
/**
*
* @return
*/
public Task[] getTasks() { public Task[] getTasks() {
Task[] a = new Task[tasks.size()]; Task[] a = new Task[tasks.size()];
for (int i = 0; i < tasks.size(); i++) { for (int i = 0; i < tasks.size(); i++) {
@ -89,14 +97,25 @@ public class TaskList implements Serializable {
return a; return a;
} }
/**
*
* @param t
*/
public void setTitle(String t) { public void setTitle(String t) {
title = t; title = t;
} }
/**
*
* @return
*/
public String getTitle() { public String getTitle() {
return title; return title;
} }
/**
*
*/
public TaskList() { public TaskList() {
} }

@ -92,10 +92,18 @@ public class TaskMenu extends javax.swing.JPanel {
loadTheme(); loadTheme();
} }
/**
*
* @return
*/
public int getPercent() { public int getPercent() {
return percentSlider.getValue(); return percentSlider.getValue();
} }
/**
*
* @return
*/
public boolean deleteMe() { public boolean deleteMe() {
return delCheck.isSelected(); return delCheck.isSelected();
} }

@ -77,18 +77,33 @@ public class TextBox extends javax.swing.JInternalFrame {
textBox.setFont(Main.ubuntuRegular.deriveFont((float) font_size)); textBox.setFont(Main.ubuntuRegular.deriveFont((float) font_size));
} }
/**
*
* @param txt
*/
public void set(String txt) { public void set(String txt) {
textBox.setText(txt); textBox.setText(txt);
} }
/**
*
* @return
*/
public String get() { public String get() {
return textBox.getText(); return textBox.getText();
} }
/**
*
* @param is
*/
public void edit(boolean is) { public void edit(boolean is) {
textBox.setEditable(is); textBox.setEditable(is);
} }
/**
*
*/
public void open() { public void open() {
Main.loadFrame(this, true); Main.loadFrame(this, true);
} }

@ -81,6 +81,14 @@ public class LoadPlugin {
private Plugin p; private Plugin p;
/**
*
* @param f
* @throws FileNotFoundException
* @throws IOException
* @throws ClassNotFoundException
* @throws InvalidClassException
*/
public LoadPlugin(File f) throws FileNotFoundException, IOException, ClassNotFoundException, InvalidClassException { public LoadPlugin(File f) throws FileNotFoundException, IOException, ClassNotFoundException, InvalidClassException {
FileInputStream fin = new FileInputStream(f); FileInputStream fin = new FileInputStream(f);
ObjectInputStream ois = new ObjectInputStream(fin); ObjectInputStream ois = new ObjectInputStream(fin);
@ -88,6 +96,13 @@ public class LoadPlugin {
ois.close(); ois.close();
} }
/**
*
* @param path
* @throws FileNotFoundException
* @throws IOException
* @throws ClassNotFoundException
*/
public LoadPlugin(String path) throws FileNotFoundException, IOException, ClassNotFoundException { public LoadPlugin(String path) throws FileNotFoundException, IOException, ClassNotFoundException {
this(new File(path)); this(new File(path));
} }
@ -103,6 +118,10 @@ public class LoadPlugin {
} }
} }
/**
*
* @return
*/
public JCommandButton getRibbonBtn() { public JCommandButton getRibbonBtn() {
JCommandButton b = new JCommandButton((p.getTitle().equals("") ? "Untitled" : p.getTitle()), getRibbonIcon()); JCommandButton b = new JCommandButton((p.getTitle().equals("") ? "Untitled" : p.getTitle()), getRibbonIcon());
if (!p.getLongTitle().equals("")) { if (!p.getLongTitle().equals("")) {
@ -119,6 +138,10 @@ public class LoadPlugin {
return b; return b;
} }
/**
*
* @return
*/
public JCommandToggleButton getGalleryBtn() { public JCommandToggleButton getGalleryBtn() {
JCommandToggleButton b = new JCommandToggleButton((p.getTitle().equals("") ? "Untitled" : p.getTitle()), getRibbonIcon()); JCommandToggleButton b = new JCommandToggleButton((p.getTitle().equals("") ? "Untitled" : p.getTitle()), getRibbonIcon());
if (!p.getLongTitle().equals("")) { if (!p.getLongTitle().equals("")) {
@ -134,11 +157,18 @@ public class LoadPlugin {
return b; return b;
} }
/**
*
*/
public void exec() { public void exec() {
CodeRunner cr = new CodeRunner(p.getLang()); CodeRunner cr = new CodeRunner(p.getLang());
cr.evalString(p.getScript()); cr.evalString(p.getScript());
} }
/**
*
* @return
*/
public Plugin getPlugin() { public Plugin getPlugin() {
return p; return p;
} }

@ -65,8 +65,19 @@ public class Plugin implements Serializable {
private static final long serialVersionUID = 13371L; private static final long serialVersionUID = 13371L;
/**
*
*/
public final int LANG_JS = 0; public final int LANG_JS = 0;
/**
*
*/
public final int LANG_PY = 1; public final int LANG_PY = 1;
/**
*
*/
public final int LANG_JAVA = 2; public final int LANG_JAVA = 2;
private ImageIcon icon; private ImageIcon icon;
@ -81,6 +92,9 @@ public class Plugin implements Serializable {
private String version = ""; private String version = "";
private int lang = LANG_JS; private int lang = LANG_JS;
/**
*
*/
public Plugin() { public Plugin() {
} }

@ -87,6 +87,9 @@ public class BackgroundSync extends Thread {
} }
} }
/**
*
*/
public BackgroundSync() { public BackgroundSync() {
} }

@ -78,6 +78,7 @@ public class Start extends javax.swing.JPanel {
/** /**
* Creates new form Start * Creates new form Start
* @param parent
*/ */
public Start(JInternalFrame parent) { public Start(JInternalFrame parent) {
parentComponent = parent; parentComponent = parent;

@ -63,7 +63,14 @@ package net.apocalypselabs.symat.sync;
public class UserLogin extends javax.swing.JPanel { public class UserLogin extends javax.swing.JPanel {
/**
*
*/
public static final int LOGIN_MODE = 0; public static final int LOGIN_MODE = 0;
/**
*
*/
public static final int SIGNUP_MODE = 1; public static final int SIGNUP_MODE = 1;
private static final String signup_help = "Sign up for a Sync acount."; private static final String signup_help = "Sign up for a Sync acount.";
/** /**
@ -77,10 +84,18 @@ public class UserLogin extends javax.swing.JPanel {
} }
} }
/**
*
* @return
*/
public String getEmail() { public String getEmail() {
return emailBox.getText(); return emailBox.getText();
} }
/**
*
* @return
*/
public String getPassword() { public String getPassword() {
return new String(passwdBox.getPassword()); return new String(passwdBox.getPassword());
} }

@ -4,13 +4,13 @@ import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
/** /**
* A client for talking to Etherpad Lite's HTTP JSON API.<br /> * A client for talking to Etherpad Lite's HTTP JSON API.<br>
* <br /> * <br>
* Example:<br /> * Example:<br>
* <br /> * <br>
* <code> * <code>
* EPLiteClient api = new EPLiteClient("http://etherpad.mysite.com", "FJ7jksalksdfj83jsdflkj");<br /> * EPLiteClient api = new EPLiteClient("http://etherpad.mysite.com", "FJ7jksalksdfj83jsdflkj");<br>
* HashMap pad = api.getText("my_pad");<br /> * HashMap pad = api.getText("my_pad");<br>
* String pad = pad.get("text").toString(); * String pad = pad.get("text").toString();
* </code> * </code>
*/ */
@ -217,15 +217,15 @@ public class EPLiteClient {
/** /**
* Create a new session for the given author in the given group, valid until the given UNIX time. * Create a new session for the given author in the given group, valid until the given UNIX time.
* The session id will be returned in "sessionID".<br /> * The session id will be returned in "sessionID".<br>
* <br /> * <br>
* Example:<br /> * Example:<br>
* <br /> * <br>
* <code> * <code>
* import java.util.Date;<br /> * import java.util.Date;<br>
* ...<br /> * ...<br>
* Date now = new Date();<br /> * Date now = new Date();<br>
* long in1Hour = (now.getTime() + (60L * 60L * 1000L) / 1000L);<br /> * long in1Hour = (now.getTime() + (60L * 60L * 1000L) / 1000L);<br>
* String sessID1 = api.createSession(groupID, authorID, in1Hour).get("sessionID").toString(); * String sessID1 = api.createSession(groupID, authorID, in1Hour).get("sessionID").toString();
* </code> * </code>
* *
@ -244,18 +244,18 @@ public class EPLiteClient {
/** /**
* Create a new session for the given author in the given group valid for the given number of hours. * Create a new session for the given author in the given group valid for the given number of hours.
* The session id will be returned in "sessionID".<br /> * The session id will be returned in "sessionID".<br>
* <br /> * <br>
* Example:<br /> * Example:<br>
* <br /> * <br>
* <code> * <code>
* // in 2 hours<br /> * // in 2 hours<br>
* String sessID1 = api.createSession(groupID, authorID, 2).get("sessionID").toString(); * String sessID1 = api.createSession(groupID, authorID, 2).get("sessionID").toString();
* </code> * </code>
* *
* @param groupID string * @param groupID string
* @param authorID string * @param authorID string
* @param validUntil int length of session in hours * @param length int length of session in hours
* @return HashMap * @return HashMap
*/ */
public HashMap createSession(String groupID, String authorID, int length) { public HashMap createSession(String groupID, String authorID, int length) {
@ -265,19 +265,19 @@ public class EPLiteClient {
/** /**
* Create a new session for the given author in the given group, valid until the given datetime. * Create a new session for the given author in the given group, valid until the given datetime.
* The session id will be returned in "sessionID".<br /> * The session id will be returned in "sessionID".<br>
* <br /> * <br>
* Example:<br /> * Example:<br>
* <br /> * <br>
* <code> * <code>
* import java.util.Date;<br /> * import java.util.Date;<br>
* import java.text.DateFormat;<br /> * import java.text.DateFormat;<br>
* import java.text.SimpleDateFormat;<br /> * import java.text.SimpleDateFormat;<br>
* import java.util.TimeZone;<br /> * import java.util.TimeZone;<br>
* ...<br /> * ...<br>
* DateFormat dfm = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");<br /> * DateFormat dfm = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");<br>
* dfm.setTimeZone(TimeZone.getTimeZone("GMT-5"));<br /> * dfm.setTimeZone(TimeZone.getTimeZone("GMT-5"));<br>
* Date longTime = dfm.parse("2056-01-15 20:15:00");<br /> * Date longTime = dfm.parse("2056-01-15 20:15:00");<br>
* String sessID = api.createSession(groupID, authorID, longTime).get("sessionID").toString(); * String sessID = api.createSession(groupID, authorID, longTime).get("sessionID").toString();
* </code> * </code>
* *
@ -562,10 +562,10 @@ public class EPLiteClient {
/** /**
* Gets the pad's public status. The boolean is in "publicStatus". * Gets the pad's public status. The boolean is in "publicStatus".
* This is only applicable to group pads.<br /> * This is only applicable to group pads.<br>
* <br /> * <br>
* Example:<br /> * Example:<br>
* <br /> * <br>
* <code> * <code>
* Boolean is_public = (Boolean)api.getPublicStatus("g.kjsdfj7ask$foo").get("publicStatus"); * Boolean is_public = (Boolean)api.getPublicStatus("g.kjsdfj7ask$foo").get("publicStatus");
* </code> * </code>
@ -594,10 +594,10 @@ public class EPLiteClient {
/** /**
* Checks whether the pad is password-protected or not. The boolean is in "isPasswordProtected". * Checks whether the pad is password-protected or not. The boolean is in "isPasswordProtected".
* This is only applicable to group pads.<br /> * This is only applicable to group pads.<br>
* <br /> * <br>
* Example:<br /> * Example:<br>
* <br /> * <br>
* <code> * <code>
* Boolean pass = (Boolean)api.isPasswordProtected("g.kjsdfj7ask$foo").get("isPasswordProtected"); * Boolean pass = (Boolean)api.isPasswordProtected("g.kjsdfj7ask$foo").get("isPasswordProtected");
* </code> * </code>

Loading…
Cancel
Save