[snow-cvs] r58 - in trunk: docs examples/swixml src/java/snow

Alessio Stalla astalla at common-lisp.net
Wed Feb 10 19:42:08 UTC 2010


Author: astalla
Date: Wed Feb 10 14:42:07 2010
New Revision: 58

Log:
Updated tutorial
Updated library reference in Snow.java
Updated HelloWorld.java example


Modified:
   trunk/docs/tutorial.html
   trunk/examples/swixml/HelloWorld.java
   trunk/src/java/snow/Snow.java

Modified: trunk/docs/tutorial.html
==============================================================================
--- trunk/docs/tutorial.html	(original)
+++ trunk/docs/tutorial.html	Wed Feb 10 14:42:07 2010
@@ -23,15 +23,14 @@
   <li><h4>Java applications:</h4>simply make sure snow.jar and all the jars in the lib/ folder are in the classpath of your application. Snow uses JSR-223 and is built with Java 1.6, so that's the minimum Java version you can use. However, it should be possible to run Snow on 1.5 as well, but you'll need to recompile both Snow and ABCL from sources with a JSR-223 implementation in your classpath. See the <a href="#embedding">Embedding Snow</a> section below for details about using Snow inside your Java application.</li>
   <li><h4>Lisp applications:</h4>
     <ul>
-      <li>Snow comes prepackaged with ABCL 0.17, and it wraps the ABCL launcher with its own, that makes sure to load Snow prior to your application. So you can just follow the procedure for Java applications above, and use the snow.Snow class in place of org.armedbear.lisp.Main as the main Java class to launch, e.g. via a shell script. The only difference is that, when launched with no command-line switches, Snow will pop up a GUI repl. You can pass a dummy --no-gui-repl switch to inhibit that. If you are new to Java, the classpath is a list of search places that the JVM uses to resolve classes (think asdf:*central-registry* if you will). It can be set with the environment variable CLASSPATH or with the -classpath command line switch to the java bytecode interpreter (the 'java' command). It is a list of directories and/or .jar files, separated by a platform-dependent character (':' on Linux, ';' on Windows, I don't know about Macs). So for example, you can launch Snow on Linux with '<code>java -classpath snow.jar:lib/abcl.jar:lib/binding-2.0.6.jar:lib/commons-logging.jar:lib/miglayout-3.7.1.jar snow.Snow</code>'.</li>
-      <li>Also, Snow has its own version of Cells built in. It is a random and not too recent version from CVS, with some fixes to make it run on ABCL. I'm looking forward to having those fixes merged with trunk, so you'll be able to freely update Cells independently.</li>
-      <li>Last but not least, Snow is built with ASDF, so if you are brave enough you can extract the contents of snow.jar (it is a regular zip file), it will create a directory tree full of .lisp source files, fasls and compiled Java classes (.class files). You will then be able to load Snow with ASDF using your own version of ABCL and/or Cells, provided you still meet the requirements about the classpath for Java applications. (there are two .asd files, one in snow/ and one in snow/swing).</li>
+      <li>Snow comes prepackaged with a modified version of ABCL 0.18.1, and it wraps the ABCL launcher with its own, that makes sure to load Snow prior to your application. So you can just follow the procedure for Java applications above, and use the snow.Snow class in place of org.armedbear.lisp.Main as the main Java class to launch, e.g. via a shell script. The only difference is that, when launched with no command-line switches, Snow will pop up a GUI repl. You can pass a dummy --no-gui-repl switch to inhibit that. If you are new to Java, the classpath is a list of search places that the JVM uses to resolve classes (think asdf:*central-registry* if you will). It can be set with the environment variable CLASSPATH or with the -classpath command line switch to the java bytecode interpreter (the 'java' command). It is a list of directories and/or .jar files, separated by a platform-dependent character (':' on Linux, ';' on Windows). So for example, you can launch Snow on Linux with '<code>java -classpath snow.jar:lib/abcl.jar:lib/binding-2.0.6.jar:lib/commons-logging.jar:lib/miglayout-3.7.1.jar snow.Snow</code>'.</li>
+      <li>The snow.jar files contains prepackaged and precompiled the Lisp libraries it uses (Cells, named-readtables, cl-utilities). Currently there's no way to use other versions of those libraries loaded from outside the jar; you have to recompile Snow with your own versions from scratch. If you are brave enough you can also  extract the contents of snow.jar (it is a regular zip file), it will create a directory tree full of .lisp source files, fasls and compiled Java classes (.class files). You will then be able to load Snow with ASDF using your own version of ABCL and/or Cells, provided you still meet the requirements about the classpath for Java applications. (there are two .asd files, one in snow/ and one in snow/swing). Essentially this latter option is what Snow does under the cover to load the Lisp part of itself.</li>
     </ul>
   </li>
 </ul>
 Currently Snow, when run from the jar, requires a temporary directory to load itself; make sure your application has write permissions on your OS's tmp directory. Snow should automatically clear its temporary files when the application exits.
 <a name="building" /><h3>Building Snow from source (optional)</h3>
-Snow is built using the Ant program (a Java make-like tool). You can get it from <<a href="http://ant.apache.org/">http://ant.apache.org/</a>>. To obtain the source code for Snow, either download a source release from the <a href="http://common-lisp.net/project/snow">project page</a> or, if you want the latest & greatest stuff, follow the instructions at <<a href="http://common-lisp.net/faq.shtml">http://common-lisp.net/faq.shtml</a>> to checkout it from the SVN repository. Once you have the source in a given directory, cd to that directory and issue the command <code>ant snow.jar</code> to build Snow. <code>ant snow.clean</code> removes all compiled files.
+Snow is built using the Ant program (a Java make-like tool). You can get it from <<a href="http://ant.apache.org/">http://ant.apache.org/</a>>. To obtain the source code for Snow, either download a source release from the <a href="http://common-lisp.net/project/snow">project page</a> or, if you want the latest & greatest stuff, follow the instructions at <<a href="http://common-lisp.net/faq.shtml">http://common-lisp.net/faq.shtml</a>> to checkout it from the SVN repository. Once you have the source in a given directory, you should find a lib/ subdirectory in it: libraries will go there. Refer to the README file in the lib directory for instructions on how to obtain the libraries. Once you have the libraries in place, cd to Snow's source directory and issue the command <code>ant snow.jar</code> to build Snow. <code>ant snow.clean</code> removes all compiled files.
 <a name="repl" /><h3>The Snow REPL</h3>
 Being based on Lisp, Snow offers a REPL (read-eval-print-loop), an interactive prompt that allows you to evaluate arbitrary pieces of code. If you launch Snow through its main class (snow.Snow) with no command-line arguments, it will show a window containing the REPL. It should print
 <br /><br />
@@ -149,7 +148,7 @@
   <li>if a Java backing bean is present (see further below), and it has a property with the same name as the id, it will be injected the widget through the setter method of that property. The name of the id symbol will be translated from lisp-hyphenated-convention to javaCamelCasedConvention.</li>
 </ul>
 <h4>special variable <code>*backing-bean*</code></h4>
-This variable is usually set from Java code embedding Snow (see the <a href="#embedding">appropriate section</a>). It is used delegate some things to a Java object instead of coding them in Lisp. Apart from the injection of widgets to properties matching their :id mentioned above, a backing bean can also be used to implement event handlers; see <a href="#events">Event handling</a> for more information.
+This variable is usually set from Java code embedding Snow (see the <a href="#embedding">appropriate section</a>). It is used to delegate some things to a Java object instead of coding them in Lisp. Apart from the injection of widgets to properties matching their :id mentioned above, a backing bean can also be used to implement event handlers; see <a href="#events">Event handling</a> for more information.
 <a name="layout" /><h3>Layout</h3>
 By default, Snow uses <a href="www.miglayout.com/">MiG Layout</a> as the layout manager to organize components inside a container. When you create a component that will be automatically added to <code>*parent*</code> by Snow, you can use the pseudo-property <code>:layout</code> to specify (as a string) additional information for the layout manager. Here's a quick cheat sheet of the constraints you can use with MiG Layout: <a href="http://www.migcalendar.com/miglayout/cheatsheet.html">http://www.migcalendar.com/miglayout/cheatsheet.html</a> (look for "Component Constraints").<br />
 You can use another layout instead of MiG: to do so, use the <code>layout-manager</code> property of the container. The values you can pass are:

Modified: trunk/examples/swixml/HelloWorld.java
==============================================================================
--- trunk/examples/swixml/HelloWorld.java	(original)
+++ trunk/examples/swixml/HelloWorld.java	Wed Feb 10 14:42:07 2010
@@ -7,7 +7,7 @@
     /** submit counter */
     private int clicks;
     
-    /** JTextField member gets instantiated through Swixml (look for id="tf" in xml descriptor) */
+    /** JTextField member; gets injected by Snow (look for :id tf in the Lisp file) */
     private JTextField tf;
     
     /** Jlabel to display number of button clicks */

Modified: trunk/src/java/snow/Snow.java
==============================================================================
--- trunk/src/java/snow/Snow.java	(original)
+++ trunk/src/java/snow/Snow.java	Wed Feb 10 14:42:07 2010
@@ -149,7 +149,7 @@
 	    }
 	    addToAsdfCentralRegistry(lispEngine, baseDir, "snow");
 	    addToAsdfCentralRegistry(lispEngine, baseDir, "snow", "swing");
-	    addToAsdfCentralRegistry(lispEngine, libDir, "cl-utilities-1.2.4");
+	    addToAsdfCentralRegistry(lispEngine, libDir, "cl-utilities");
 	    addToAsdfCentralRegistry(lispEngine, libDir, "named-readtables");
 	    addToAsdfCentralRegistry(lispEngine, libDir, "cells");
 	    addToAsdfCentralRegistry(lispEngine, libDir, "cells", "utils-kt");




More information about the snow-cvs mailing list