[Japi-cvs] SF.net SVN: japi:[1270] tools/scriptInterpreter/trunk
Status: Beta
Brought to you by:
christianhujer
From: <chr...@us...> - 2009-03-22 13:46:40
|
Revision: 1270 http://japi.svn.sourceforge.net/japi/?rev=1270&view=rev Author: christianhujer Date: 2009-03-22 13:46:23 +0000 (Sun, 22 Mar 2009) Log Message: ----------- Added missing function documentation to the EcmaScript examples. Modified Paths: -------------- tools/scriptInterpreter/trunk/action.js tools/scriptInterpreter/trunk/test.js Modified: tools/scriptInterpreter/trunk/action.js =================================================================== --- tools/scriptInterpreter/trunk/action.js 2009-03-11 18:00:39 UTC (rev 1269) +++ tools/scriptInterpreter/trunk/action.js 2009-03-22 13:46:23 UTC (rev 1270) @@ -15,14 +15,25 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +/** This is a simple test case for accessing AWT / Swing from the script interpreter. + */ + +/** ActionListener that prints a message. + * @param e ActionEvent. + */ function aa(e) { print("Test.\n"); } + +/** WindowListener that closes the window. + * @param e WindowEvent. + */ function wl1(e) { if (e.ID == java.awt.event.WindowEvent.WINDOW_CLOSING) { e.source.dispose(); } } + frame = new javax.swing.JFrame("Test"); button = new javax.swing.JButton("Click"); button.addActionListener(aa); Modified: tools/scriptInterpreter/trunk/test.js =================================================================== --- tools/scriptInterpreter/trunk/test.js 2009-03-11 18:00:39 UTC (rev 1269) +++ tools/scriptInterpreter/trunk/test.js 2009-03-22 13:46:23 UTC (rev 1270) @@ -15,9 +15,13 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +/** Prints a message. + * @param i Number to print in that message. + */ function foo(i) { print("hello, world " + i + "\n"); } + for (i = 0; i < 10; i++) { foo(i); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |