Revision: 4210 http://vexi.svn.sourceforge.net/vexi/?rev=4210&view=rev Author: clrg Date: 2011-08-21 02:01:36 +0000 (Sun, 21 Aug 2011)
Log Message: ----------- More jsdoc stuff Modified Paths: -------------- trunk/org.vexi-build.jsdoc/src/poke/java/vexi/jsdoc/RunOnVexi.java trunk/org.vexi-core.main/src/main/java/org/vexi/core/Surface.java trunk/org.vexi-core.main/src/main/jpp/org/vexi/core/Box.jpp trunk/org.vexi-library.js/src/main/java/org/ibex/js/JSBoolean.java trunk/org.vexi-library.js/src/main/java/org/ibex/js/JSNumber.java trunk/org.vexi-library.js/src/main/java/org/ibex/js/JSString.java trunk/org.vexi-library.js/src/main/jpp/org/ibex/js/ECMADate.jpp trunk/org.vexi-library.js/src/main/jpp/org/vexi/js/VexiJS.jpp Modified: trunk/org.vexi-build.jsdoc/src/poke/java/vexi/jsdoc/RunOnVexi.java =================================================================== --- trunk/org.vexi-build.jsdoc/src/poke/java/vexi/jsdoc/RunOnVexi.java 2011-08-18 06:27:15 UTC (rev 4209) +++ trunk/org.vexi-build.jsdoc/src/poke/java/vexi/jsdoc/RunOnVexi.java 2011-08-21 02:01:36 UTC (rev 4210) @@ -46,6 +46,8 @@ addLibraryRoot("vexi", "org.vexi.core.Vexi"); addConcept("Overview", "org.vexi.core.Vexi"); + addConcept("Booleans", "org.ibex.js.JSBoolean"); + addConcept("Numbers", "org.ibex.js.JSNumber"); addConcept("Biscuits", "org.vexi.core.Vexi"); addConcept("Box Model", "org.vexi.core.Box"); addConcept("Cloning", "org.ibex.js.JS"); Modified: trunk/org.vexi-core.main/src/main/java/org/vexi/core/Surface.java =================================================================== --- trunk/org.vexi-core.main/src/main/java/org/vexi/core/Surface.java 2011-08-18 06:27:15 UTC (rev 4209) +++ trunk/org.vexi-core.main/src/main/java/org/vexi/core/Surface.java 2011-08-21 02:01:36 UTC (rev 4210) @@ -26,7 +26,7 @@ * <p>Each top-level window in a Vexi UI is called a <i>surface</i>. There are two kinds of * surfaces, <i>frames</i> and <i>windows</i>. * - * <h3>Surface Frames</h3> + * <h3>Frames</h3> * * <p>Frames usually have a platform-specific titlebar and border.</p> * @@ -36,7 +36,7 @@ * * <pre>vexi.ui.frame = thisbox;</pre> * - * <h2>Surface Windows</h2> + * <h3>Windows</h3> * * <p>Windows never have any additional platform-specific decorations.</p> * @@ -46,7 +46,7 @@ * * <pre>vexi.ui.window = thisbox;</pre> * - * <h2>Surface Behaviour</h2> + * <h3>Surface Behaviour</h3> * * <p>Whenever we refer to the size or position of a surface, we are referring to the size or * position of the UI-accessible portion of the surface; this does not include any Modified: trunk/org.vexi-core.main/src/main/jpp/org/vexi/core/Box.jpp =================================================================== --- trunk/org.vexi-core.main/src/main/jpp/org/vexi/core/Box.jpp 2011-08-18 06:27:15 UTC (rev 4209) +++ trunk/org.vexi-core.main/src/main/jpp/org/vexi/core/Box.jpp 2011-08-21 02:01:36 UTC (rev 4210) @@ -202,13 +202,6 @@ // useful debugging reflow problems //private static final int depth(Box b) { return b.parent==null ? 0 : depth(b.parent)+1; } - private static final void deprecated(String old, String now) { - try { - throw new JSExn("deprecated property '"+old+"' - now called '"+now+"'"); - } catch (JSExn e) { - Log.warn(Box.class, e); - } - } private static final int min(int a, int b) { return (a<b) ? a : b; } private static final int max(int a, int b) { return (a>b) ? a : b; } @@ -2251,10 +2244,6 @@ * @nofollow * */ case "reflow": return METHOD; - /* @skip */ - case "forcereflow": - deprecated("forcereflow", "reflow"); - return get(SC_reflow); /* <p>Renders a box and it's content to an image, returning a box containing the * image as it's fill property.</p> @@ -2281,10 +2270,6 @@ * @return(null) * */ case "inputevent": return METHOD; - /* @skip */ - case "sendEvent": - deprecated("sendEvent", "inputevent"); - return get(SC_event); /* <p>This special property is read only - alter it by placing a read trap. Puts to this * property will have no effect and do not throw an error.</p> Modified: trunk/org.vexi-library.js/src/main/java/org/ibex/js/JSBoolean.java =================================================================== --- trunk/org.vexi-library.js/src/main/java/org/ibex/js/JSBoolean.java 2011-08-18 06:27:15 UTC (rev 4209) +++ trunk/org.vexi-library.js/src/main/java/org/ibex/js/JSBoolean.java 2011-08-21 02:01:36 UTC (rev 4210) @@ -1,4 +1,63 @@ +// Copyright 2000-2011 the Contributors, as shown in the revision logs. +// Licensed under the Apache Software License 2.0 ("the License"). +// You may not use this file except in compliance with the License. + package org.ibex.js; + +/*@PAGE(concept=Booleans) + * + * <p>A simple <code>true</code> or <code>false</code> value.</p> + * + * <p>A boolean is a primitive, so all <a href="vexi.js.String.html">string</a> functions are valid.</p> + * + * <h3>Boolean evaluation as false</h3> + * + * <p>The following values equate to <b><code>false</code></b> when considered as an expression (e.g. if) result:<p> + * + * <ul><li><code>null</code></li> + * <li><code>0</code></li> + * <li><code>""</code></li></ul> + * + * <p>For example:</p> + * + * <pre> if (0) { + * // not reached + * }</pre> + * + * <h3>Boolean evaluation as true</h3> + * + * <p>The following values equate to <b><code>true</code></b> when used in expressions:<p> + * + * <ul><li>Any non-<code>null</code> object</li> + * <li>Any non-<code>0</code> number</li> + * <li>Any non-empty string</li></ul> + * + * <p>For example:</p> + * + * <pre> if ("abc") { + * // reached + * }</pre> + * + * <h3>Boolean evaluation as equals</h3> + * + * <p>However, when used in boolean operations as part of the equals (==) operator, values that equate to + * false or true when used in an expression will not usually be considered equal. + * + * <p>The exception to this is <code>0</code> as <code>false</code> is internally stored as a '0', thus + * <code>0 == false</code> evaluates to <code>true</code>. + * + * <p>Consider:</p> + * + * <pre> if (null == false) { + * // not reached + * } + * + * if ("abc" == true) { + * // not reached + * }</pre> + * + * */ + final public class JSBoolean extends JSPrimitive { static final public JSBoolean TRUE = new JSBoolean(true); static final public JSBoolean FALSE = new JSBoolean(false); @@ -16,62 +75,4 @@ public JS type() { return SC_boolean; } public boolean isTruthy(){ return b; } public boolean instanceOf(JS constructor) { return constructor==Constructor; } - public JS get(JS key) throws JSExn { - //#noswitch - leave, needed for jsdoc - /*@PAGE(varname=Boolean,humanname=Booleans) - * - * <p>A simple <code>true</code> or <code>false</code> value.</p> - * - * <p>A boolean is a primitive, so all <a href="vexi.js.String.html">string</a> functions are valid.</p> - * - * <h3>Boolean evaluation as false</h3> - * - * <p>The following values equate to <b><code>false</code></b> when considered as an expression (e.g. if) result:<p> - * - * <ul><li><code>null</code></li> - * <li><code>0</code></li> - * <li><code>""</code></li></ul> - * - * <p>For example:</p> - * - * <pre> if (0) { - * // not reached - * }</pre> - * - * <h3>Boolean evaluation as true</h3> - * - * <p>The following values equate to <b><code>true</code></b> when used in expressions:<p> - * - * <ul><li>Any non-<code>null</code> object</li> - * <li>Any non-<code>0</code> number</li> - * <li>Any non-empty string</li></ul> - * - * <p>For example:</p> - * - * <pre> if ("abc") { - * // reached - * }</pre> - * - * <h3>Boolean evaluation as equals</h3> - * - * <p>However, when used in boolean operations as part of the equals (==) operator, values that equate to - * false or true when used in an expression will not usually be considered equal. - * - * <p>The exception to this is <code>0</code> as <code>false</code> is internally stored as a '0', thus - * <code>0 == false</code> evaluates to <code>true</code>. - * - * <p>Consider:</p> - * - * <pre> if (null == false) { - * // not reached - * } - * - * if ("abc" == true) { - * // not reached - * }</pre> - * - * */ - //#end - return super.get(key); - } } \ No newline at end of file Modified: trunk/org.vexi-library.js/src/main/java/org/ibex/js/JSNumber.java =================================================================== --- trunk/org.vexi-library.js/src/main/java/org/ibex/js/JSNumber.java 2011-08-18 06:27:15 UTC (rev 4209) +++ trunk/org.vexi-library.js/src/main/java/org/ibex/js/JSNumber.java 2011-08-21 02:01:36 UTC (rev 4210) @@ -1,9 +1,22 @@ -// Copyright 2000-2008 the Contributors, as shown in the revision logs. +// Copyright 2000-2011 the Contributors, as shown in the revision logs. // Licensed under the Apache Software License 2.0 ("the License"). // You may not use this file except in compliance with the License. package org.ibex.js; +/*@PAGE(varname=Numbers) + * + * <p>Numbers in vexiscript are just like their javascript counterparts.</p> + * + * <p>A number is a primitive, so all <a href="vexi.js.String.html">string</a> functions are valid.</p> + * + * <p>There is no distinction in javascript between different types of numbers. Integers and non-integers + * are both of type <code>"number"</code>.</p> + * + * <p>The precision of js numbers can not be guaranteed. For situations requiring precision use + * <a href="vexi.js.Decimal.html">Decimal</a>.</p> + */ + public abstract class JSNumber extends JSPrimitive { static public JS Constructor = new JS.Constructor("Number"); @@ -21,22 +34,6 @@ } return false; } - - public JS get(JS key) throws JSExn { - //#noswitch - leave, needed for jsdoc - /*@PAGE(varname=Number,humanname=Numbers) - * - * <p>A standard javscript number.</p> - * - * <p>A number is a primitive, so all <a href="vexi.js.String.html">string</a> functions are valid.</p> - * - * <p>There is no distinction in javascript between different types of numbers. Integers and non-integers - * are both of type <code>"number"</code>.</p> - * - * */ - //#end - return super.get(key); - } // FEATURE: Better hash function? (if d != (int) d then do something double specific) public int hashCode() { return toInt(); } @@ -51,7 +48,7 @@ public boolean isTruthy(){ return toInt()!=0; } public boolean instanceOf(JS constructor) { return constructor==Constructor; } - + /** JavaScript Integer */ final static public class I extends JSNumber { final public int i; I(int i) { this.i = i; } @@ -59,7 +56,8 @@ public String coerceToString() { return Integer.toString(i); } public String toString() { return coerceToString(); } } - + + /** JavaScript Long */ final static class L extends JSNumber { private final long l; L(long l) { this.l = l; } @@ -67,7 +65,8 @@ long toLong() { return l; } public String coerceToString() { return Long.toString(l); } } - + + /** JavaScript Double */ final static class D extends JSNumber { private final double d; D(double d) { this.d = d; } Modified: trunk/org.vexi-library.js/src/main/java/org/ibex/js/JSString.java =================================================================== --- trunk/org.vexi-library.js/src/main/java/org/ibex/js/JSString.java 2011-08-18 06:27:15 UTC (rev 4209) +++ trunk/org.vexi-library.js/src/main/java/org/ibex/js/JSString.java 2011-08-21 02:01:36 UTC (rev 4210) @@ -22,7 +22,6 @@ public int hashCode() { return s.hashCode(); } public JS type() { return SC_string; } public boolean isTruthy(){ return !"".equals(s); } - public boolean equals(Object o) { if (o == this) { Modified: trunk/org.vexi-library.js/src/main/jpp/org/ibex/js/ECMADate.jpp =================================================================== --- trunk/org.vexi-library.js/src/main/jpp/org/ibex/js/ECMADate.jpp 2011-08-18 06:27:15 UTC (rev 4209) +++ trunk/org.vexi-library.js/src/main/jpp/org/ibex/js/ECMADate.jpp 2011-08-21 02:01:36 UTC (rev 4210) @@ -46,6 +46,13 @@ */ public class ECMADate extends JS.Immutable { + static public JS Constructor = new JS.Constructor("ECMADate") { + public JS new_(JS[] args) throws JSExn { + return new ECMADate(args); + } + }; + + public ECMADate() { if (thisTimeZone == null) { // j.u.TimeZone is synchronized, so setting class statics from it Modified: trunk/org.vexi-library.js/src/main/jpp/org/vexi/js/VexiJS.jpp =================================================================== --- trunk/org.vexi-library.js/src/main/jpp/org/vexi/js/VexiJS.jpp 2011-08-18 06:27:15 UTC (rev 4209) +++ trunk/org.vexi-library.js/src/main/jpp/org/vexi/js/VexiJS.jpp 2011-08-21 02:01:36 UTC (rev 4210) @@ -226,98 +226,100 @@ * objects ‘NaN’ and ‘Infinity’.</p> * */ - /* The constant ‘e’ + /* <p>The constant ‘e’</p> * @type(Number) */ case "E": return E; - /* The result of <code>ln(10)</code> + /* <p>The result of <code>ln(10)</code></p> * @type(Number) */ case "LN10": return LN10; - /* The result of <code>ln(2)</code> + /* <p>The result of <code>ln(2)</code></p> * @type(Number) */ case "LN2": return LN2; - /* The result of <code>log10(e)</code> + /* <p>The result of <code>log10(e)</code></p> * @type(Number) */ case "LOG10E": return LOG10E; - /* The result of <code>log2(e)</code> + /* <p>The result of <code>log2(e)</code></p> * @type(Number) */ case "LOG2E": return LOG2E; - /* The constant ‘pi’ + /* <p>The constant ‘pi’</p> * @type(Number) */ case "PI": return PI; - /* The result of <code>1 / sqrt(2)</code> + /* <p>The result of <code>1 / sqrt(2)</code></p> * @type(Number) */ case "SQRT1_2": return SQRT1_2; - /* The result of <code>sqrt(2)</code> + /* <p>The result of <code>sqrt(2)</code></p> * @type(Number) */ case "SQRT2": return SQRT2; - /* The Number object that represents a non-representable number e.g. 1/0 + /* <p>The Number object that represents a non-representable number e.g. 1/0</p> * @type(Number) */ case "NaN": return NC_NaN; - /* The Number that represents a infinity + /* <p>The Number that represents a infinity</p> * @type(Number) */ case "Infinity": return NC_Infinity; - /* Returns the absolute value of ‘num’ + /* <p>Returns the absolute value of ‘num’</p> * @param(num) @return(Number) */ case "abs": return METHOD; - /* Returns the arc cosine of ‘num’ in radians + /* <p>Returns the arc cosine of ‘num’ in radians</p> * @param(num) @return(Number) */ case "acos": return METHOD; - /* Returns the arc sine of ‘num’ in radians + /* <p>Returns the arc sine of ‘num’ in radians</p> * @param(num) @return(Number) */ case "asin": return METHOD; - /* Returns the arc tangent of ‘num’ in radians + /* <p>Returns the arc tangent of ‘num’ in radians</p> * @param(num) @return(Number) */ case "atan": return METHOD; - /* Converts the rectangular coordinates ‘x, y’ into polar coordinates and - * returns the angle portion of the polar coordinates + /* <p>Converts the rectangular coordinates ‘x, y’ into polar coordinates and + * returns the angle portion of the polar coordinates</p> * @param(x) @param(y) @return(Number) */ case "atan2": return METHOD; - /* Returns the smallest integer that is larger than ‘num’ + /* <p>Returns the smallest integer that is larger than ‘num’</p> * @param(num) @return(Number) */ case "ceil": return METHOD; - /* Returns the cosine of num where ‘num’ is in radians + /* <p>Returns the cosine of num where ‘num’ is in radians</p> * @param(num) @return(Number) */ case "cos": return METHOD; - /* Returns <code>e^num</code> (‘e’ raised to the power ‘num’) + /* <p>Returns <code>e^num</code> (‘e’ raised to the power ‘num’)</p> * @param(num) @return(Number) */ case "exp": return METHOD; - /* Returns the largest integer that is smaller than lsquo;num’ + /* <p>Returns the largest integer that is smaller than lsquo;num’</p> * @param(num) @return(Number) */ case "floor": return METHOD; - /* Returns <code>true</code> if ‘num’ represents a finite number - * i.e. is not the <code>vexi.math.Infinity</code> object + /* <p>Returns <code>true</code> if ‘num’ represents a finite number + * i.e. is not the <code>vexi.math.Infinity</code> object</p> * @param(num) @return(Boolean) */ case "isFinite": return METHOD; - /* Returns <code>true</code> if ‘num’ is not a number - * i.e. equals the <code>vexi.math.NaN</code> object + /* <p>Returns <code>true</code> if ‘num’ is not a number + * i.e. equals the <code>vexi.math.NaN</code> object</p> * @param(num) @return(Boolean) */ case "isNaN": return METHOD; - /* Returns the natural logarithm of ‘num’ i.e. <code>ln(num)</code> + /* <p>Returns the natural logarithm of ‘num’ i.e. <code>ln(num)</code></p> * @param(num) @return(Number) */ case "log": return METHOD; - /* Returns the greater of ‘n1’ and ‘n2’ + /* <p>Returns the greater of ‘n1’ and ‘n2’</p> * @param(n1) @param(n2) @return(Number) */ case "max": return METHOD; - /* Returns the lesser of ‘n1’ and ‘n2’ + /* <p>Returns the lesser of ‘n1’ and ‘n2’</p> * @param(n1) @param(n2) @return(Number) */ case "min": return METHOD; - /* Returns <code>num^p</code> (‘num’ raised to the power ‘p’) - * @param(num) @return(Number) */ + /* <p>Returns <code>num^p</code> (‘num’ raised to the power ‘p’)</p> + * @param(num) + * @param(p) + * @return(Number) */ case "pow": return METHOD; - /* Returns a random floating-point number between 0 and 1 + /* <p>Returns a random floating-point number between 0 and 1</p> * @param(num) @return(Number) */ case "random": return METHOD; - /* Returns the closest integer to ‘num’ + /* <p>Returns the closest integer to ‘num’</p> * @param(num) @return(Number) */ case "round": return METHOD; - /* Returns the sine of num where ‘num’ is in radians + /* <p>Returns the sine of num where ‘num’ is in radians</p> * @param(num) @return(Number) */ case "sin": return METHOD; - /* Returns the square root of ‘num’ + /* <p>Returns the square root of ‘num’</p> * @param(num) @return(Number) */ case "sqrt": return METHOD; - /* Returns the tangent of num where ‘num’ is in radians + /* <p>Returns the tangent of num where ‘num’ is in radians</p> * @param(num) @return(Number) */ case "tan": return METHOD; //#end @@ -521,23 +523,52 @@ /* <p>Creates an array with an initial size. Passing in the size makes no semantic * difference, but is used to detirmine an amount of space to preallocate. It is an - * optimisation to avoid resizing and over allocation.</p> + * optimisation to avoid resizing and over allocation.</p> * * @param(name=size,optional=true)*/ case "Array": return org.ibex.js.JSArray.Constructor; + + /* @skip */ case "Boolean": return org.ibex.js.JSBoolean.Constructor; + + /* <p>Creates a new date object representing the given year, month, and date.</p> + * + * @param(name=year) + * @param(name=month,optional=true) + * @param(name=date,optional=true) */ case "Date": return org.ibex.js.JSDate.Constructor; + + /* <p>Creates a new decimal from the given number input. The number can + * be as a string, number, or another decimal.</p> + * + * @param(name=number) */ case "Decimal": return org.ibex.js.JSDecimal.Constructor; -// case "ECMADate": return org.ibex.js.ECMADate.Constructor; + + /* <p>Creates a new ECMA-compliant date object.</p> + * + * @param(name=dateString) */ + case "ECMADate": return org.ibex.js.ECMADate.Constructor; + + /* @param(name=message,optional=true)*/ case "Exception": return org.ibex.js.JSExn.Constructor; + + /* <p>Creates a new object; equivalent to <code>{}</code> in script. */ case "Object": return org.ibex.js.JS.Obj.Constructor; + + /* @skip */ case "Number": return org.ibex.js.JSNumber.Constructor; + + /* <p>Creates a proxy object. */ case "Proxy": return org.ibex.js.JS.Proxy.Constructor; + + /* <p>Creates a new proxylist (array-like) object. */ case "ProxyList": return org.ibex.js.JS.ProxyList.Constructor; + /* @jpp(org.ibex.js.JSPrimitive) */ case "String": return org.ibex.js.JSString.Constructor; case "constructorsOf": return METHOD; + /* <p>Creates a deep copy of the input, with all referenced arrays/objects * also copied.</p> * @method @@ -545,6 +576,7 @@ * @return(<i>varies</i>) * */ case "deepcopy": return METHOD; + /* <p>Evaluates the given string as JS.</p> * * <p><b>Hint:</b> if you want the evaluated JS to return its result then @@ -554,12 +586,14 @@ * @return(<i>varies</i>) * */ case "eval": return METHOD; + /* <p>Converts the input in to a nicely formatted string.</p> * @method * @param(name=js) * @return(String) * */ case "format": return script().get(key); + /* <p>Takes the given JS and returns a JSON string.</p> * @method * @param(name=js) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Get a FREE DOWNLOAD! and learn more about uberSVN rich system, user administration capabilities and model configuration. Take the hassle out of deploying and managing Subversion and the tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2 _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn