You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by gb...@apache.org on 2009/10/07 02:51:42 UTC

svn commit: r822545 - in /incubator/pivot/trunk/tutorials: src/org/apache/pivot/tutorials/buttons/ src/org/apache/pivot/tutorials/layout/ www/

Author: gbrown
Date: Wed Oct  7 00:51:41 2009
New Revision: 822545

URL: http://svn.apache.org/viewvc?rev=822545&view=rev
Log:
Update tutorials to use ScriptApplication as appropriate.

Removed:
    incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/buttons/Checkboxes.java
    incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/buttons/LinkButtons.java
    incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/buttons/ToggleButtons.java
    incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/layout/Borders.java
    incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/layout/Panels.java
    incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/layout/StackPanes.java
Modified:
    incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/buttons/checkboxes.wtkx
    incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/buttons/link_buttons.wtkx
    incubator/pivot/trunk/tutorials/www/borders.template.html
    incubator/pivot/trunk/tutorials/www/box_panes.template.html
    incubator/pivot/trunk/tutorials/www/checkboxes.template.html
    incubator/pivot/trunk/tutorials/www/expanders.template.html
    incubator/pivot/trunk/tutorials/www/forms.template.html
    incubator/pivot/trunk/tutorials/www/labels_and_image_views.template.html
    incubator/pivot/trunk/tutorials/www/link_buttons.template.html
    incubator/pivot/trunk/tutorials/www/menu_bars.template.html
    incubator/pivot/trunk/tutorials/www/menu_buttons.template.html
    incubator/pivot/trunk/tutorials/www/panels.template.html
    incubator/pivot/trunk/tutorials/www/panoramas.template.html
    incubator/pivot/trunk/tutorials/www/rollups.template.html
    incubator/pivot/trunk/tutorials/www/scroll_panes.template.html
    incubator/pivot/trunk/tutorials/www/separators.template.html
    incubator/pivot/trunk/tutorials/www/spinners.template.html
    incubator/pivot/trunk/tutorials/www/stack_panes.template.html
    incubator/pivot/trunk/tutorials/www/table_panes.template.html
    incubator/pivot/trunk/tutorials/www/toggle_buttons.template.html

Modified: incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/buttons/checkboxes.wtkx
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/buttons/checkboxes.wtkx?rev=822545&r1=822544&r2=822545&view=diff
==============================================================================
Binary files - no diff available.

Modified: incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/buttons/link_buttons.wtkx
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/buttons/link_buttons.wtkx?rev=822545&r1=822544&r2=822545&view=diff
==============================================================================
Binary files - no diff available.

Modified: incubator/pivot/trunk/tutorials/www/borders.template.html
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/www/borders.template.html?rev=822545&r1=822544&r2=822545&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/www/borders.template.html (original)
+++ incubator/pivot/trunk/tutorials/www/borders.template.html Wed Oct  7 00:51:41 2009
@@ -44,9 +44,10 @@
     width:320,
     height:240
 };
-var parameters = {application_class_name:"org.apache.pivot.tutorials.layout.Borders",
+var parameters = {application_class_name:"org.apache.pivot.wtk.ScriptApplication",
     codebase_lookup:false,
-    java_arguments:"-Dsun.awt.noerasebackground=true -Dsun.awt.erasebackgroundonresize=true"
+    java_arguments:"-Dsun.awt.noerasebackground=true -Dsun.awt.erasebackgroundonresize=true",
+    startup_properties:"src=org/apache/pivot/tutorials/layout/borders.wtkx"
 };
 deployJava.writeAppletTag(attributes, parameters);
 </script>
@@ -87,46 +88,7 @@
 &lt;/Window&gt;
 </pre>
 
-<p>The Java source simply serves to load the WTKX:</p>
-
-<pre class="brush:java">
-package org.apache.pivot.tutorials.layout;
-
-import org.apache.pivot.collections.Map;
-import org.apache.pivot.wtk.Application;
-import org.apache.pivot.wtk.DesktopApplicationContext;
-import org.apache.pivot.wtk.Display;
-import org.apache.pivot.wtk.Window;
-import org.apache.pivot.wtkx.WTKXSerializer;
-
-public class Borders implements Application {
-    private Window window = null;
-
-    public void startup(Display display, Map&lt;String, String&gt; properties) throws Exception {
-        WTKXSerializer wtkxSerializer = new WTKXSerializer();
-        window = (Window)wtkxSerializer.readObject(this, "borders.wtkx");
-        window.open(display);
-    }
-
-    public boolean shutdown(boolean optional) {
-        if (window != null) {
-            window.close();
-        }
-
-        return false;
-    }
-
-    public void suspend() {
-    }
-
-    public void resume() {
-    }
-
-    public static void main(String[] args) {
-        DesktopApplicationContext.main(Borders.class, args);
-    }
-}
-</pre>
+<p>Since this example contains no logic, there is no associated Java source.</p>
 
 <p>Next: <a href="stack_panes.html">Stack Panes</a></p>
 </body>

Modified: incubator/pivot/trunk/tutorials/www/box_panes.template.html
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/www/box_panes.template.html?rev=822545&r1=822544&r2=822545&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/www/box_panes.template.html (original)
+++ incubator/pivot/trunk/tutorials/www/box_panes.template.html Wed Oct  7 00:51:41 2009
@@ -39,11 +39,11 @@
 <p>Box panes support a number of styles that allow a caller to customize the arrangement of child components:</p>
 
 <ul>
-<li><tt>padding</tt> - the amount of space the box pane reserves around the perimeter of the container.</li>
-<li><tt>spacing</tt> - the amount of space the box pane inserts between components.</li>
-<li><tt>horizontalAlignment</tt> - how the box pane aligns components on the x-axis.</li>
-<li><tt>verticalAlignment</tt> - how the box pane aligns components on the y-axis.</li>
-<li><tt>fill</tt> - whether or not the box pane should size all components to fill the available space; if <tt>true</tt>, horizontal box panes will make all components the same height, and vertical box panes will make all components the same width.</li>
+<li>"padding" - the amount of space the box pane reserves around the perimeter of the container.</li>
+<li>"spacing" - the amount of space the box pane inserts between components.</li>
+<li>"horizontalAlignment" - how the box pane aligns components on the x-axis.</li>
+<li>"verticalAlignment" - how the box pane aligns components on the y-axis.</li>
+<li>"fill" - whether or not the box pane should size all components to fill the available space; if <tt>true</tt>, horizontal box panes will make all components the same height, and vertical box panes will make all components the same width.</li>
 </ul>
 
 <p>How the alignment values are handled varies depending on the box pane's orientation. Below is a sample application that demonstrates the effect each alignment value has on the box pane's components:</p>

Modified: incubator/pivot/trunk/tutorials/www/checkboxes.template.html
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/www/checkboxes.template.html?rev=822545&r1=822544&r2=822545&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/www/checkboxes.template.html (original)
+++ incubator/pivot/trunk/tutorials/www/checkboxes.template.html Wed Oct  7 00:51:41 2009
@@ -43,9 +43,10 @@
     height:100,
     style:"border:solid 1px #999999"
 };
-var parameters = {application_class_name:"org.apache.pivot.tutorials.buttons.Checkboxes",
+var parameters = {application_class_name:"org.apache.pivot.wtk.ScriptApplication",
     codebase_lookup:false,
-    java_arguments:"-Dsun.awt.noerasebackground=true -Dsun.awt.erasebackgroundonresize=true"
+    java_arguments:"-Dsun.awt.noerasebackground=true -Dsun.awt.erasebackgroundonresize=true",
+    startup_properties:"src=org/apache/pivot/tutorials/buttons/checkboxes.wtkx"
 };
 deployJava.writeAppletTag(attributes, parameters);
 </script>
@@ -68,21 +69,24 @@
             &lt;rows&gt;
                 &lt;TablePane.Row height="24"&gt;
                     &lt;BoxPane styles="{verticalAlignment:'center'}"&gt;
-                        &lt;Checkbox wtkx:id="bellCheckbox" buttonData="Bell"/&gt;
+                        &lt;Checkbox buttonData="Bell"
+                            ButtonPressListener.buttonPressed="bellImageView.setVisible(!bellImageView.isVisible());"/&gt;
                     &lt;/BoxPane&gt;
                     &lt;ImageView wtkx:id="bellImageView" image="org/apache/pivot/tutorials/bell.png" visible="false"/&gt;
                 &lt;/TablePane.Row&gt;
 
                 &lt;TablePane.Row height="24"&gt;
                     &lt;BoxPane styles="{verticalAlignment:'center'}"&gt;
-                        &lt;Checkbox wtkx:id="clockCheckbox" buttonData="Clock"/&gt;
+                        &lt;Checkbox buttonData="Clock"
+                            ButtonPressListener.buttonPressed="clockImageView.setVisible(!clockImageView.isVisible());"/&gt;
                     &lt;/BoxPane&gt;
                     &lt;ImageView wtkx:id="clockImageView" image="org/apache/pivot/tutorials/clock.png" visible="false"/&gt;
                 &lt;/TablePane.Row&gt;
 
                 &lt;TablePane.Row height="24"&gt;
                     &lt;BoxPane styles="{verticalAlignment:'center'}"&gt;
-                        &lt;Checkbox wtkx:id="houseCheckbox" buttonData="House"/&gt;
+                        &lt;Checkbox buttonData="House"
+                            ButtonPressListener.buttonPressed="houseImageView.setVisible(!houseImageView.isVisible());"/&gt;
                     &lt;/BoxPane&gt;
                     &lt;ImageView wtkx:id="houseImageView" image="org/apache/pivot/tutorials/house.png" visible="false"/&gt;
                 &lt;/TablePane.Row&gt;
@@ -94,82 +98,9 @@
 
 <p>Note that this example uses the <tt>TablePane</tt> layout container. <tt>TablePane</tt> defines a two-dimensional grid structure and is similar to an HTML table. It is discussed in more detail in the <a href="layout_containers.html">Layout Containers</a> section.</p>
 
-<p>The following is the Java source for the example. A button press handler is assigned to each checkbox. When the handler is invoked, it simply toggles the visibility of the corresponding image view, causing the image to appear and disappear based on the checkbox's selection state.</p>
+<p>Note also that this example defines some button handler logic directly within the WTKX file. The "ButtonPressListener.buttonPressed" attribute of each <tt>PushButton</tt> contains JavaScript code that toggles the visibility of the corresponding image view when the handler is invoked, causing the image to appear and disappear based on the checkbox's selection state. It is common in Pivot development to implement simple event handlers in script code this way, since it can often be much less verbose than performing the same logic in Java.</p>
 
-<pre class="brush:java">
-package org.apache.pivot.tutorials.buttons;
-
-import org.apache.pivot.collections.Map;
-import org.apache.pivot.wtk.Application;
-import org.apache.pivot.wtk.Button;
-import org.apache.pivot.wtk.ButtonPressListener;
-import org.apache.pivot.wtk.Checkbox;
-import org.apache.pivot.wtk.DesktopApplicationContext;
-import org.apache.pivot.wtk.Display;
-import org.apache.pivot.wtk.ImageView;
-import org.apache.pivot.wtk.Window;
-import org.apache.pivot.wtkx.WTKXSerializer;
-
-public class Checkboxes implements Application {
-    private Window window = null;
-    private Checkbox bellCheckbox = null;
-    private Checkbox clockCheckbox = null;
-    private Checkbox houseCheckbox = null;
-    private ImageView bellImageView = null;
-    private ImageView clockImageView = null;
-    private ImageView houseImageView = null;
-
-    public void startup(Display display, Map&lt;String, String&gt; properties) throws Exception {
-        WTKXSerializer wtkxSerializer = new WTKXSerializer();
-        window = (Window)wtkxSerializer.readObject(this, "checkboxes.wtkx");
-        bellCheckbox = (Checkbox)wtkxSerializer.get("bellCheckbox");
-        clockCheckbox = (Checkbox)wtkxSerializer.get("clockCheckbox");
-        houseCheckbox = (Checkbox)wtkxSerializer.get("houseCheckbox");
-        bellImageView = (ImageView)wtkxSerializer.get("bellImageView");
-        clockImageView = (ImageView)wtkxSerializer.get("clockImageView");
-        houseImageView = (ImageView)wtkxSerializer.get("houseImageView");
-
-        // Wire up event listeners
-        bellCheckbox.getButtonPressListeners().add(new ButtonPressListener() {
-            public void buttonPressed(Button button) {
-                bellImageView.setVisible(!bellImageView.isVisible());
-            }
-        });
-
-        clockCheckbox.getButtonPressListeners().add(new ButtonPressListener() {
-            public void buttonPressed(Button button) {
-                clockImageView.setVisible(!clockImageView.isVisible());
-            }
-        });
-
-        houseCheckbox.getButtonPressListeners().add(new ButtonPressListener() {
-            public void buttonPressed(Button button) {
-                houseImageView.setVisible(!houseImageView.isVisible());
-            }
-        });
-
-        window.open(display);
-    }
-
-    public boolean shutdown(boolean optional) {
-        if (window != null) {
-            window.close();
-        }
-
-        return false;
-    }
-
-    public void suspend() {
-    }
-
-    public void resume() {
-    }
-
-    public static void main(String[] args) {
-        DesktopApplicationContext.main(Checkboxes.class, args);
-    }
-}
-</pre>
+<p>In fact, this application does not implement any logic in Java and is launched using the <tt>ScriptApplication</tt> class.</p>
 
 <p>Next: <a href="link_buttons.html">Link Buttons</a></p>
 </body>

Modified: incubator/pivot/trunk/tutorials/www/expanders.template.html
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/www/expanders.template.html?rev=822545&r1=822544&r2=822545&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/www/expanders.template.html (original)
+++ incubator/pivot/trunk/tutorials/www/expanders.template.html Wed Oct  7 00:51:41 2009
@@ -86,7 +86,7 @@
 &lt;/Window&gt;
 </pre>
 
-<p>The Java source for this is extremely simple. It serves only to load and display the content defined in the WTKX source:</p>
+<p>The Java source for this is extremely simple. It loads the WTKX source, and then simply attaches an expander listener that ensures that the entire expander is visible when it becomes expanded:</p>
 
 <pre class="brush:java">
 package org.apache.pivot.tutorials.navigation;

Modified: incubator/pivot/trunk/tutorials/www/forms.template.html
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/www/forms.template.html?rev=822545&r1=822544&r2=822545&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/www/forms.template.html (original)
+++ incubator/pivot/trunk/tutorials/www/forms.template.html Wed Oct  7 00:51:41 2009
@@ -133,7 +133,7 @@
 &lt;/Window&gt;
 </pre>
 
-<p>Also note the use of the "Form.label" attribute - this is an example of an "attached property", also called an "attribute" in WTK. An attribute is a property that can be specified on a component only when it is a child of the container that defines the property. The same result can be achieved programmatically by calling the static <tt>Form.setName()</tt> method on a component after it has been added to the form. Several other containers, including <tt>TabPane</tt> and <tt>TablePane</tt>, define similar attributes.</p>
+<p>Also note the use of the <tt>Form.label</tt> attribute - this is an example of an "attached property", also called an "attribute" in WTK. An attribute is a property that can be specified on a component only when it is a child of the container that defines the property. The same result can be achieved programmatically by calling the static <tt>Form.setName()</tt> method on a component after it has been added to the form. Several other containers, including <tt>TabPane</tt> and <tt>TablePane</tt>, define similar attributes.</p>
 
 <p>Note also that section components are not required to be typical form elements such as <tt>TextInput</tt> or <tt>PushButton</tt>. They can also be containers, allowing the arrangement of components within a section to be customized.</p>
 

Modified: incubator/pivot/trunk/tutorials/www/labels_and_image_views.template.html
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/www/labels_and_image_views.template.html?rev=822545&r1=822544&r2=822545&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/www/labels_and_image_views.template.html (original)
+++ incubator/pivot/trunk/tutorials/www/labels_and_image_views.template.html Wed Oct  7 00:51:41 2009
@@ -109,6 +109,10 @@
 }
 </pre>
 
+<p>In fact, because this application does not include any special logic, it could actually have been launched using the <tt>org.apache.pivot.wtk.ScriptApplication</tt> class. This class, which is included with the Pivot platform, implements the <tt>Application</tt> interface and takes the name of a WTKX file to launch as a startup property. The WTKX file is expected to contain a root element representing a <tt>Window</tt> subclass.</p>
+
+<p>The class is named <tt>ScriptApplication</tt> because it is often used to launch applications whose logic is defined entirely in script; however, it can actually be used to launch any application whose main window is defined in a single WTKX file. Many of the examples in the following sections are launched using this class.</p>
+
 <p>Next: <a href="buttons.html">Buttons</a></p>
 </body>
 </html>

Modified: incubator/pivot/trunk/tutorials/www/link_buttons.template.html
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/www/link_buttons.template.html?rev=822545&r1=822544&r2=822545&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/www/link_buttons.template.html (original)
+++ incubator/pivot/trunk/tutorials/www/link_buttons.template.html Wed Oct  7 00:51:41 2009
@@ -34,7 +34,7 @@
 <body>
 <h1>Link Buttons</h1>
 
-<p>The following example demonstrates use of the <tt>LinkButton</tt> class in a Pivot application. Clicking the links allows the user to navigate between two "pages":</p>
+<p>The following example demonstrates use of the <tt>LinkButton</tt> class in a Pivot application. Clicking the links allows the user to navigate between two "pages", each containing a single image:</p>
 
 <script>
 var attributes = {code:"org.apache.pivot.wtk.BrowserApplicationContext$HostApplet",
@@ -43,9 +43,10 @@
     height:360,
     style:"border:solid 1px #999999"
 };
-var parameters = {application_class_name:"org.apache.pivot.tutorials.buttons.LinkButtons",
+var parameters = {application_class_name:"org.apache.pivot.wtk.ScriptApplication",
     codebase_lookup:false,
-    java_arguments:"-Dsun.awt.noerasebackground=true -Dsun.awt.erasebackgroundonresize=true"
+    java_arguments:"-Dsun.awt.noerasebackground=true -Dsun.awt.erasebackgroundonresize=true",
+    startup_properties:"src=org/apache/pivot/tutorials/buttons/link_buttons.wtkx"
 };
 deployJava.writeAppletTag(attributes, parameters);
 </script>
@@ -61,19 +62,39 @@
         &lt;CardPane wtkx:id="cardPane" selectedIndex="0" styles="{selectionChangeEffect:'horizontal_slide'}"&gt;
             &lt;BoxPane orientation="vertical" styles="{horizontalAlignment:'center', verticalAlignment:'center'}"&gt;
                 &lt;ImageView image="org/apache/pivot/tutorials/IMG_0735_2.jpg"/&gt;
-                &lt;LinkButton wtkx:id="nextButton"&gt;
+                &lt;LinkButton&gt;
                     &lt;buttonData&gt;
                         &lt;content:ButtonData text="Next" icon="@resultset_next.png"/&gt;
                     &lt;/buttonData&gt;
+
+                    &lt;buttonPressListeners&gt;
+                        &lt;wtkx:script&gt;
+                        &lt;![CDATA[
+                        function buttonPressed(button) {
+                            cardPane.setSelectedIndex(1);
+                        }
+                        ]]&gt;
+                        &lt;/wtkx:script&gt;
+                    &lt;/buttonPressListeners&gt;
                 &lt;/LinkButton&gt;
             &lt;/BoxPane&gt;
 
             &lt;BoxPane orientation="vertical" styles="{horizontalAlignment:'center', verticalAlignment:'center'}"&gt;
                 &lt;ImageView image="org/apache/pivot/tutorials/IMG_0767_2.jpg"/&gt;
-                &lt;LinkButton wtkx:id="previousButton"&gt;
+                &lt;LinkButton&gt;
                     &lt;buttonData&gt;
                         &lt;content:ButtonData text="Previous" icon="@resultset_previous.png"/&gt;
                     &lt;/buttonData&gt;
+
+                    &lt;buttonPressListeners&gt;
+                        &lt;wtkx:script&gt;
+                        &lt;![CDATA[
+                        function buttonPressed(button) {
+                            cardPane.setSelectedIndex(0);
+                        }
+                        ]]&gt;
+                        &lt;/wtkx:script&gt;
+                    &lt;/buttonPressListeners&gt;
                 &lt;/LinkButton&gt;
             &lt;/BoxPane&gt;
         &lt;/CardPane&gt;
@@ -83,69 +104,11 @@
 
 <p>This example uses the <tt>CardPane</tt> layout container. A card pane lays out its components like a stack of cards, only one of which is visible at a time. <tt>CardPane</tt> is discussed in more detail in the <a href="navigation_containers.html">Navigation Containers</a> section.</p>
 
-<p>The following is the Java source for the example. A button press handler that simply sets the selected index of the card pane is assigned to each link button:</p>
+<p>This example demonstrates another means of defining event handlers in WTKX: within an element that refers to a listener list property of its parent element. The <tt>&lt;buttonPressListeners&gt;</tt> element of each <tt>LinkButton</tt> contains script code that will be executed in response to a button press. In this case, the handlers simply set the selected index of the card pane is assigned to each link button. However, it is possible to define more complex logic in a handler declared this way, and element-based event handlers such as this are often used when the event logic is more complex than can be represented in a single line (such as might be used in an attribute-based handler).</p>
 
-<pre class="brush:java">
-package org.apache.pivot.tutorials.buttons;
+<p>Though it is not obvious from this example, other listener methods can also be defined within the same script block (if, for example, the <tt>ButtonPressListener</tt> interface declared additional methods). However, in such cases, callers are not required to provide implementations for all listener methods, only the ones they are interested in (similar to using an <tt>Adapter</tt> class in Java code).</p>
 
-import org.apache.pivot.collections.Map;
-import org.apache.pivot.wtk.Application;
-import org.apache.pivot.wtk.Button;
-import org.apache.pivot.wtk.ButtonPressListener;
-import org.apache.pivot.wtk.CardPane;
-import org.apache.pivot.wtk.DesktopApplicationContext;
-import org.apache.pivot.wtk.Display;
-import org.apache.pivot.wtk.LinkButton;
-import org.apache.pivot.wtk.Window;
-import org.apache.pivot.wtkx.WTKXSerializer;
-
-public class LinkButtons implements Application {
-    private Window window = null;
-    private CardPane cardPane = null;
-    private LinkButton nextButton = null;
-    private LinkButton previousButton = null;
-
-    public void startup(Display display, Map&lt;String, String&gt; properties) throws Exception {
-        WTKXSerializer wtkxSerializer = new WTKXSerializer();
-        window = (Window)wtkxSerializer.readObject(this, "link_buttons.wtkx");
-        cardPane = (CardPane)wtkxSerializer.get("cardPane");
-        nextButton = (LinkButton)wtkxSerializer.get("nextButton");
-        previousButton = (LinkButton)wtkxSerializer.get("previousButton");
-
-        nextButton.getButtonPressListeners().add(new ButtonPressListener() {
-            public void buttonPressed(Button button) {
-                cardPane.setSelectedIndex(1);
-            }
-        });
-
-        previousButton.getButtonPressListeners().add(new ButtonPressListener() {
-            public void buttonPressed(Button button) {
-                cardPane.setSelectedIndex(0);
-            }
-        });
-
-        window.open(display);
-    }
-
-    public boolean shutdown(boolean optional) {
-        if (window != null) {
-            window.close();
-        }
-
-        return false;
-    }
-
-    public void suspend() {
-    }
-
-    public void resume() {
-    }
-
-    public static void main(String[] args) {
-        DesktopApplicationContext.main(LinkButtons.class, args);
-    }
-}
-</pre>
+<p>Since all of the logic for this application is implemented in script, there is no Java source associated with this example.</p>
 
 <p>Next: <a href="lists.html">Lists</a></p>
 </body>

Modified: incubator/pivot/trunk/tutorials/www/menu_bars.template.html
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/www/menu_bars.template.html?rev=822545&r1=822544&r2=822545&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/www/menu_bars.template.html (original)
+++ incubator/pivot/trunk/tutorials/www/menu_bars.template.html Wed Oct  7 00:51:41 2009
@@ -38,13 +38,13 @@
 
 <p>Like all other components, menu bars can actually be placed anywhere in an application's user interface. However, they are most often located at the top of an application's main window. Pivot provides framework-level support for simplifying the task of defining a menu bar positioned in this way. The <tt>Frame</tt> class defines a "menuBar" property that is handled specially by the application using the <tt>configureMenuBar()</tt> and <tt>cleanupMenuBar()</tt> methods of the <tt>MenuHandler</tt> interface. These methods are called by the framework as the focus changes within a window, to allow the application to customize the contents of the menu bar based on the currently focused component.</p>
 
-<p>The example application below shows a menu bar containing two common top-level menu items: "File" and "Edit":</p>
+<p>The example application below shows a menu bar containing two common top-level menu items: "File" and "Edit" (note that the applet is signed since it makes use of the <tt>FileBrowserSheet</tt> component, which requires access to the local file system):</p>
 
 <script>
 var attributes = {code:"org.apache.pivot.wtk.BrowserApplicationContext$HostApplet",
-    archive:"lib/@project_name@-core-@version@.jar,lib/@project_name@-wtk-@version@.jar,lib/@project_name@-wtk-@version@.terra.jar,lib/@project_name@-tutorials-@version@.jar",
-    width:480,
-    height:360
+    archive:"lib/@project_name@-core-@version@.signed.jar,lib/@project_name@-wtk-@version@.signed.jar,lib/@project_name@-wtk-@version@.terra.signed.jar,lib/@project_name@-tutorials-@version@.signed.jar",
+    width:640,
+    height:480
 };
 var parameters = {application_class_name:"org.apache.pivot.tutorials.menus.MenuBars",
     codebase_lookup:false,

Modified: incubator/pivot/trunk/tutorials/www/menu_buttons.template.html
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/www/menu_buttons.template.html?rev=822545&r1=822544&r2=822545&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/www/menu_buttons.template.html (original)
+++ incubator/pivot/trunk/tutorials/www/menu_buttons.template.html Wed Oct  7 00:51:41 2009
@@ -33,7 +33,247 @@
 </head>
 <body>
 <h1>Menu Buttons</h1>
-This section is not yet complete.
+
+<p>Menu buttons are similar to <a href="list_buttons.html">list buttons</a>, but provide access to "drop-down" menus rather than list views. They are often used in toolbars, but can be placed anywhere within an application's user interface.</p>
+
+<p>The following sample application demonstrates the use of a menu button. The application's toolbar contains a menu button containing a list of shapes, and a list button containing a list of colors. Selecting an item from the shape menu button adds the selected shape to the drawing shown in the application's content area:</p>
+
+<script>
+var attributes = {code:"org.apache.pivot.wtk.BrowserApplicationContext$HostApplet",
+    archive:"lib/@project_name@-core-@version@.jar,lib/@project_name@-wtk-@version@.jar,lib/@project_name@-wtk-@version@.terra.jar,lib/@project_name@-tutorials-@version@.jar",
+    width:640,
+    height:480
+};
+var parameters = {application_class_name:"org.apache.pivot.tutorials.menus.MenuButtons",
+    codebase_lookup:false,
+    java_arguments:"-Dsun.awt.noerasebackground=true -Dsun.awt.erasebackgroundonresize=true"
+};
+deployJava.writeAppletTag(attributes, parameters);
+</script>
+
+<p>The WTKX source for the application is as follows:</p>
+
+<pre class="brush:xml">
+&lt;Window title="Menu Buttons" maximized="true"
+    xmlns:wtkx="http://pivot.apache.org/wtkx"
+    xmlns:collections="org.apache.pivot.collections"
+    xmlns:content="org.apache.pivot.wtk.content"
+    xmlns="org.apache.pivot.wtk"&gt;
+    &lt;content&gt;
+        &lt;Border&gt;
+            &lt;content&gt;
+                &lt;TablePane styles="{verticalSpacing:2}"&gt;
+                    &lt;columns&gt;
+                        &lt;TablePane.Column width="1*"/&gt;
+                    &lt;/columns&gt;
+                    &lt;rows&gt;
+                        &lt;TablePane.Row height="-1"&gt;
+                            &lt;BoxPane styles="{fill:true}"&gt;
+                                &lt;MenuButton&gt;
+                                    &lt;buttonData&gt;
+                                        &lt;content:ButtonData icon="@shape_square_add.png" text="New Shape"/&gt;
+                                    &lt;/buttonData&gt;
+                                    &lt;menu&gt;
+                                        &lt;Menu&gt;
+                                            &lt;sections&gt;
+                                                &lt;Menu.Section&gt;
+                                                    &lt;Menu.Item buttonData="Circle" action="newCircle"/&gt;
+                                                    &lt;Menu.Item buttonData="Square" action="newSquare"/&gt;
+                                                    &lt;Menu.Item buttonData="Text" action="newText"/&gt;
+                                                &lt;/Menu.Section&gt;
+                                            &lt;/sections&gt;
+                                        &lt;/Menu&gt;
+                                    &lt;/menu&gt;
+                                &lt;/MenuButton&gt;
+
+                                &lt;ListButton wtkx:id="colorListButton" selectedIndex="0" styles="{listSize:6}"&gt;
+                                    &lt;listData&gt;
+                                        &lt;collections:ArrayList&gt;
+                                            &lt;content:ColorItem color="#000000" name="Black"/&gt;
+                                            &lt;content:ColorItem color="#0000AA" name="Blue"/&gt;
+                                            &lt;content:ColorItem color="#00AA00" name="Green"/&gt;
+                                            &lt;content:ColorItem color="#00AAAA" name="Cyan"/&gt;
+                                            &lt;content:ColorItem color="#AA0000" name="Red"/&gt;
+                                            &lt;content:ColorItem color="#AA00AA" name="Magenta"/&gt;
+                                            &lt;content:ColorItem color="#AA5500" name="Brown"/&gt;
+                                            &lt;content:ColorItem color="#AAAAAA" name="Light Gray"/&gt;
+                                            &lt;content:ColorItem color="#555555" name="Dark Gray"/&gt;
+                                            &lt;content:ColorItem color="#5555FF" name="Bright Blue"/&gt;
+                                            &lt;content:ColorItem color="#55FF55" name="Bright Green"/&gt;
+                                            &lt;content:ColorItem color="#55FFFF" name="Bright Cyan"/&gt;
+                                            &lt;content:ColorItem color="#FF5555" name="Bright Red"/&gt;
+                                            &lt;content:ColorItem color="#FF55FF" name="Bright Magenta"/&gt;
+                                            &lt;content:ColorItem color="#FFFF55" name="Bright Yellow"/&gt;
+                                            &lt;content:ColorItem color="#FFFFFF" name="White"/&gt;
+                                        &lt;/collections:ArrayList&gt;
+                                    &lt;/listData&gt;
+                                    &lt;dataRenderer&gt;
+                                        &lt;content:ListButtonColorRenderer/&gt;
+                                    &lt;/dataRenderer&gt;
+                                    &lt;itemRenderer&gt;
+                                        &lt;content:ListViewColorRenderer/&gt;
+                                    &lt;/itemRenderer&gt;
+                                &lt;/ListButton&gt;
+                            &lt;/BoxPane&gt;
+                        &lt;/TablePane.Row&gt;
+                        &lt;TablePane.Row height="1*"&gt;
+                            &lt;Border&gt;
+                                &lt;content&gt;
+                                    &lt;ScrollPane&gt;
+                                        &lt;view&gt;
+                                            &lt;ImageView wtkx:id="imageView"/&gt;
+                                        &lt;/view&gt;
+                                    &lt;/ScrollPane&gt;
+                                &lt;/content&gt;
+                            &lt;/Border&gt;
+                        &lt;/TablePane.Row&gt;
+                    &lt;/rows&gt;
+                &lt;/TablePane&gt;
+            &lt;/content&gt;
+        &lt;/Border&gt;
+    &lt;/content&gt;
+&lt;/Window&gt;
+</pre>
+
+<p>Like the previous example, it defines a set of menu items that are associated with named actions. The Java source, which defines the actions, is shown below:</p>
+
+<pre class="brush:java">
+package org.apache.pivot.tutorials.menus;
+
+import java.awt.Color;
+import java.awt.Paint;
+
+import org.apache.pivot.collections.Map;
+import org.apache.pivot.wtk.Action;
+import org.apache.pivot.wtk.Application;
+import org.apache.pivot.wtk.Bounds;
+import org.apache.pivot.wtk.DesktopApplicationContext;
+import org.apache.pivot.wtk.Display;
+import org.apache.pivot.wtk.ImageView;
+import org.apache.pivot.wtk.ListButton;
+import org.apache.pivot.wtk.Point;
+import org.apache.pivot.wtk.Window;
+import org.apache.pivot.wtk.content.ColorItem;
+import org.apache.pivot.wtk.media.Drawing;
+import org.apache.pivot.wtk.media.drawing.Ellipse;
+import org.apache.pivot.wtk.media.drawing.Rectangle;
+import org.apache.pivot.wtk.media.drawing.Shape;
+import org.apache.pivot.wtk.media.drawing.Text;
+import org.apache.pivot.wtkx.WTKXSerializer;
+
+public class MenuButtons implements Application {
+    private Window window = null;
+    private ListButton colorListButton = null;
+    private ImageView imageView = null;
+
+    private Drawing drawing = null;
+
+    public static final int MAX_X = 480;
+    public static final int MAX_Y = 360;
+
+    public MenuButtons() {
+        Action.getNamedActions().put("newCircle", new Action() {
+            @Override
+            public void perform() {
+                Ellipse ellipse = new Ellipse();
+                ellipse.setSize(50, 50);
+
+                ellipse.setStroke((Paint)null);
+                ellipse.setFill(getSelectedColor());
+                ellipse.setOrigin(getRandomLocation(ellipse));
+
+                drawing.getCanvas().add(ellipse);
+            }
+        });
+
+        Action.getNamedActions().put("newSquare", new Action() {
+            @Override
+            public void perform() {
+                Rectangle rectangle = new Rectangle();
+                rectangle.setSize(50, 50);
+
+                rectangle.setStroke((Paint)null);
+                rectangle.setFill(getSelectedColor());
+                rectangle.setOrigin(getRandomLocation(rectangle));
+
+                drawing.getCanvas().add(rectangle);
+            }
+        });
+
+        Action.getNamedActions().put("newText", new Action() {
+            @Override
+            public void perform() {
+                Text text = new Text();
+                text.setText("ABC");
+                text.setFont("Arial BOLD 24");
+
+                text.setFill(getSelectedColor());
+                text.setOrigin(getRandomLocation(text));
+
+                drawing.getCanvas().add(text);
+            }
+        });
+    }
+
+    @Override
+    public void startup(Display display, Map&lt;String, String&gt; properties) throws Exception {
+        WTKXSerializer wtkxSerializer = new WTKXSerializer();
+        window = (Window)wtkxSerializer.readObject(this, "menu_buttons.wtkx");
+        colorListButton = (ListButton)wtkxSerializer.get("colorListButton");
+        imageView = (ImageView)wtkxSerializer.get("imageView");
+
+        drawing = new Drawing();
+
+        Rectangle borderRectangle = new Rectangle();
+        borderRectangle.setSize(MAX_X, MAX_Y);
+        borderRectangle.setStroke((Paint)null);
+        borderRectangle.setFill("#eeeeee");
+
+        drawing.getCanvas().add(borderRectangle);
+
+        imageView.setImage(drawing);
+
+        window.open(display);
+    }
+
+    @Override
+    public boolean shutdown(boolean optional) {
+        if (window != null) {
+            window.close();
+        }
+
+        return false;
+    }
+
+    @Override
+    public void suspend() {
+    }
+
+    @Override
+    public void resume() {
+    }
+
+    public Color getSelectedColor() {
+        ColorItem colorItem = (ColorItem)colorListButton.getSelectedItem();
+        return colorItem.getColor();
+    }
+
+    public Point getRandomLocation(Shape shape) {
+        Bounds bounds = shape.getBounds();
+
+        int x = (int)(Math.random() * (double)(MAX_X - bounds.width));
+        int y = (int)(Math.random() * (double)(MAX_Y - bounds.height));
+
+        return new Point(x, y);
+    }
+
+    public static void main(String[] args) {
+        DesktopApplicationContext.main(MenuButtons.class, args);
+    }
+}
+</pre>
+
+<p>Each action simply adds a particular shape to the drawing, setting its color based on the current selection in the list button. The shapes are placed at a random location that is adjusted by the shape's size to ensure that the shape remains on-screen.</p>
 
 <p>Next: <a href="table_views.html">Table Views</a></p>
 </body>

Modified: incubator/pivot/trunk/tutorials/www/panels.template.html
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/www/panels.template.html?rev=822545&r1=822544&r2=822545&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/www/panels.template.html (original)
+++ incubator/pivot/trunk/tutorials/www/panels.template.html Wed Oct  7 00:51:41 2009
@@ -43,9 +43,10 @@
     width:400,
     height:320
 };
-var parameters = {application_class_name:"org.apache.pivot.tutorials.layout.Panels",
+var parameters = {application_class_name:"org.apache.pivot.wtk.ScriptApplication",
     codebase_lookup:false,
-    java_arguments:"-Dsun.awt.noerasebackground=true -Dsun.awt.erasebackgroundonresize=true"
+    java_arguments:"-Dsun.awt.noerasebackground=true -Dsun.awt.erasebackgroundonresize=true",
+    startup_properties:"src=org/apache/pivot/tutorials/layout/panels.wtkx"
 };
 deployJava.writeAppletTag(attributes, parameters);
 </script>
@@ -91,47 +92,7 @@
 &lt;/Window&gt;
 </pre>
 
-<p>The Java source is below. It simply loads the WTKX and displays it:</p>
-
-<pre class="brush:java">
-package org.apache.pivot.tutorials.layout;
-
-import org.apache.pivot.collections.Map;
-import org.apache.pivot.wtk.Application;
-import org.apache.pivot.wtk.DesktopApplicationContext;
-import org.apache.pivot.wtk.Display;
-import org.apache.pivot.wtk.Window;
-import org.apache.pivot.wtkx.WTKXSerializer;
-
-public class Panels implements Application {
-    private Window window = null;
-
-    public void startup(Display display, Map&lt;String, String&gt; properties)
-        throws Exception {
-        WTKXSerializer wtkxSerializer = new WTKXSerializer();
-        window = (Window)wtkxSerializer.readObject(this, "panels.wtkx");
-        window.open(display);
-    }
-
-    public boolean shutdown(boolean optional) {
-        if (window != null) {
-            window.close();
-        }
-
-        return false;
-    }
-
-    public void suspend() {
-    }
-
-    public void resume() {
-    }
-
-    public static void main(String[] args) {
-        DesktopApplicationContext.main(Panels.class, args);
-    }
-}
-</pre>
+<p>Since this example contains no logic, there is no associated Java source.</p>
 
 <p>Next: <a href="navigation_containers.html">Navigation Containers</a></p>
 </body>

Modified: incubator/pivot/trunk/tutorials/www/panoramas.template.html
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/www/panoramas.template.html?rev=822545&r1=822544&r2=822545&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/www/panoramas.template.html (original)
+++ incubator/pivot/trunk/tutorials/www/panoramas.template.html Wed Oct  7 00:51:41 2009
@@ -44,9 +44,10 @@
     width:480,
     height:360
 };
-var parameters = {application_class_name:"org.apache.pivot.tutorials.navigation.Panoramas",
+var parameters = {application_class_name:"org.apache.pivot.wtk.ScriptApplication",
     codebase_lookup:false,
-    java_arguments:"-Dsun.awt.noerasebackground=true -Dsun.awt.erasebackgroundonresize=true"
+    java_arguments:"-Dsun.awt.noerasebackground=true -Dsun.awt.erasebackgroundonresize=true",
+    startup_properties:"src=org/apache/pivot/tutorials/navigation/panoramas.wtkx"
 };
 deployJava.writeAppletTag(attributes, parameters);
 </script>
@@ -72,46 +73,7 @@
 &lt;/Window&gt;
 </pre>
 
-<p>The Java source is as follows:</p>
-
-<pre class="brush:java">
-package org.apache.pivot.tutorials.navigation;
-
-import org.apache.pivot.collections.Map;
-import org.apache.pivot.wtk.Application;
-import org.apache.pivot.wtk.DesktopApplicationContext;
-import org.apache.pivot.wtk.Display;
-import org.apache.pivot.wtk.Window;
-import org.apache.pivot.wtkx.WTKXSerializer;
-
-public class Panoramas implements Application {
-    private Window window = null;
-
-    public void startup(Display display, Map&lt;String, String&gt; properties) throws Exception {
-        WTKXSerializer wtkxSerializer = new WTKXSerializer();
-        window = (Window)wtkxSerializer.readObject(this, "panoramas.wtkx");
-        window.open(display);
-    }
-
-    public boolean shutdown(boolean optional) {
-        if (window != null) {
-            window.close();
-        }
-
-        return false;
-    }
-
-    public void suspend() {
-    }
-
-    public void resume() {
-    }
-
-    public static void main(String[] args) {
-        DesktopApplicationContext.main(Panoramas.class, args);
-    }
-}
-</pre>
+<p>Since this example contains no logic, there is no associated Java source.</p>
 
 <p>Next: <a href="progress_indicators.html">Progress Indicators</a></p>
 </body>

Modified: incubator/pivot/trunk/tutorials/www/rollups.template.html
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/www/rollups.template.html?rev=822545&r1=822544&r2=822545&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/www/rollups.template.html (original)
+++ incubator/pivot/trunk/tutorials/www/rollups.template.html Wed Oct  7 00:51:41 2009
@@ -45,9 +45,10 @@
     width:220,
     height:360
 };
-var parameters = {application_class_name:"org.apache.pivot.tutorials.navigation.Rollups",
+var parameters = {application_class_name:"org.apache.pivot.wtk.ScriptApplication",
     codebase_lookup:false,
-    java_arguments:"-Dsun.awt.noerasebackground=true -Dsun.awt.erasebackgroundonresize=true"
+    java_arguments:"-Dsun.awt.noerasebackground=true -Dsun.awt.erasebackgroundonresize=true",
+    startup_properties:"src=org/apache/pivot/tutorials/navigation/rollups.wtkx"
 };
 deployJava.writeAppletTag(attributes, parameters);
 </script>
@@ -145,46 +146,7 @@
 &lt;/Window&gt;
 </pre>
 
-<p>The Java source serves only to load and display the content defined in the WTKX:</p>
-
-<pre class="brush:java">
-package org.apache.pivot.tutorials.navigation;
-
-import org.apache.pivot.collections.Map;
-import org.apache.pivot.wtk.Application;
-import org.apache.pivot.wtk.DesktopApplicationContext;
-import org.apache.pivot.wtk.Display;
-import org.apache.pivot.wtk.Window;
-import org.apache.pivot.wtkx.WTKXSerializer;
-
-public class Rollups implements Application {
-    private Window window = null;
-
-    public void startup(Display display, Map&lt;String, String&gt; properties) throws Exception {
-        WTKXSerializer wtkxSerializer = new WTKXSerializer();
-        window = (Window)wtkxSerializer.readObject(this, "rollups.wtkx");
-        window.open(display);
-    }
-
-    public boolean shutdown(boolean optional) {
-        if (window != null) {
-            window.close();
-        }
-
-        return false;
-    }
-
-    public void suspend() {
-    }
-
-    public void resume() {
-    }
-
-    public static void main(String[] args) {
-        DesktopApplicationContext.main(Rollups.class, args);
-    }
-}
-</pre>
+<p>Since this example contains no logic, there is no associated Java source.</p>
 
 <p>Next: <a href="viewports.html">Viewports</a></p>
 </body>

Modified: incubator/pivot/trunk/tutorials/www/scroll_panes.template.html
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/www/scroll_panes.template.html?rev=822545&r1=822544&r2=822545&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/www/scroll_panes.template.html (original)
+++ incubator/pivot/trunk/tutorials/www/scroll_panes.template.html Wed Oct  7 00:51:41 2009
@@ -44,9 +44,10 @@
     width:480,
     height:360
 };
-var parameters = {application_class_name:"org.apache.pivot.tutorials.navigation.ScrollPanes",
+var parameters = {application_class_name:"org.apache.pivot.wtk.ScriptApplication",
     codebase_lookup:false,
-    java_arguments:"-Dsun.awt.noerasebackground=true -Dsun.awt.erasebackgroundonresize=true"
+    java_arguments:"-Dsun.awt.noerasebackground=true -Dsun.awt.erasebackgroundonresize=true",
+    startup_properties:"src=org/apache/pivot/tutorials/navigation/scroll_panes.wtkx"
 };
 deployJava.writeAppletTag(attributes, parameters);
 </script>
@@ -83,46 +84,7 @@
 
 <p>The column header is commonly used to display a <tt>TableViewHeader</tt> component for a <tt>TableView</tt>, discussed in more detail in the <a href="table_views.html">Table Views</a> section. In this example, the header components are set to instances of a custom <tt>Ruler</tt> component that displays a tick mark every 5 pixels.</p>
 
-<p>The Java source for this example is as follows, and simply serves to load the WTKX:</p>
-
-<pre class="brush:java">
-package org.apache.pivot.tutorials.navigation;
-
-import org.apache.pivot.collections.Map;
-import org.apache.pivot.wtk.Application;
-import org.apache.pivot.wtk.DesktopApplicationContext;
-import org.apache.pivot.wtk.Display;
-import org.apache.pivot.wtk.Window;
-import org.apache.pivot.wtkx.WTKXSerializer;
-
-public class ScrollPanes implements Application {
-    private Window window = null;
-
-    public void startup(Display display, Map&lt;String, String&gt; properties) throws Exception {
-        WTKXSerializer wtkxSerializer = new WTKXSerializer();
-        window = (Window)wtkxSerializer.readObject(this, "scroll_panes.wtkx");
-        window.open(display);
-    }
-
-    public boolean shutdown(boolean optional) {
-        if (window != null) {
-            window.close();
-        }
-
-        return false;
-    }
-
-    public void suspend() {
-    }
-
-    public void resume() {
-    }
-
-    public static void main(String[] args) {
-        DesktopApplicationContext.main(ScrollPanes.class, args);
-    }
-}
-</pre>
+<p>Since this example contains no logic, there is no associated Java source.</p>
 
 <p>Next: <a href="panoramas.html">Panoramas</a></p>
 </body>

Modified: incubator/pivot/trunk/tutorials/www/separators.template.html
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/www/separators.template.html?rev=822545&r1=822544&r2=822545&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/www/separators.template.html (original)
+++ incubator/pivot/trunk/tutorials/www/separators.template.html Wed Oct  7 00:51:41 2009
@@ -43,9 +43,10 @@
     height:240,
     style:"border:solid 1px #999999"
 };
-var parameters = {application_class_name:"org.apache.pivot.tutorials.separators.Separators",
+var parameters = {application_class_name:"org.apache.pivot.wtk.ScriptApplication",
     codebase_lookup:false,
-    java_arguments:"-Dsun.awt.noerasebackground=true -Dsun.awt.erasebackgroundonresize=true"
+    java_arguments:"-Dsun.awt.noerasebackground=true -Dsun.awt.erasebackgroundonresize=true",
+    startup_properties:"src=org/apache/pivot/tutorials/separators/separators.wtkx"
 };
 deployJava.writeAppletTag(attributes, parameters);
 </script>
@@ -69,47 +70,7 @@
 &lt;/Window&gt;
 </pre>
 
-<p>The Java code simply serves to load the WTKX:</p>
-
-<pre class="brush:java">
-package org.apache.pivot.tutorials.separators;
-
-import org.apache.pivot.collections.Map;
-import org.apache.pivot.wtk.Application;
-import org.apache.pivot.wtk.DesktopApplicationContext;
-import org.apache.pivot.wtk.Display;
-import org.apache.pivot.wtk.Window;
-import org.apache.pivot.wtkx.WTKXSerializer;
-
-public class Separators implements Application {
-    private Window window = null;
-
-    public void startup(Display display, Map&lt;String, String&gt; properties)
-        throws Exception {
-        WTKXSerializer wtkxSerializer = new WTKXSerializer();
-        window = (Window)wtkxSerializer.readObject(this, "separators.wtkx");
-        window.open(display);
-    }
-
-    public boolean shutdown(boolean optional) {
-        if (window != null) {
-            window.close();
-        }
-
-        return false;
-    }
-
-    public void suspend() {
-    }
-
-    public void resume() {
-    }
-
-    public static void main(String[] args) {
-        DesktopApplicationContext.main(Separators.class, args);
-    }
-}
-</pre>
+<p>Since this example contains no logic, there is no associated Java source.</p>
 
 <p>Next: <a href="layout_containers.html">Layout Containers</a></p>
 </body>

Modified: incubator/pivot/trunk/tutorials/www/spinners.template.html
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/www/spinners.template.html?rev=822545&r1=822544&r2=822545&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/www/spinners.template.html (original)
+++ incubator/pivot/trunk/tutorials/www/spinners.template.html Wed Oct  7 00:51:41 2009
@@ -44,9 +44,10 @@
     width:160,
     height:30
 };
-var parameters = {application_class_name:"org.apache.pivot.tutorials.boundedrange.Spinners",
+var parameters = {application_class_name:"org.apache.pivot.wtk.ScriptApplication",
     codebase_lookup:false,
-    java_arguments:"-Dsun.awt.noerasebackground=true -Dsun.awt.erasebackgroundonresize=true"
+    java_arguments:"-Dsun.awt.noerasebackground=true -Dsun.awt.erasebackgroundonresize=true",
+    startup_properties:"src=org/apache/pivot/tutorials/boundedrange/spinners.wtkx"
 };
 deployJava.writeAppletTag(attributes, parameters);
 </script>
@@ -74,46 +75,7 @@
 &lt;/Window&gt;
 </pre>
 
-<p>The Java source is as follows:</p>
-
-<pre class="brush:java">
-package org.apache.pivot.tutorials.boundedrange;
-
-import org.apache.pivot.collections.Map;
-import org.apache.pivot.wtk.Application;
-import org.apache.pivot.wtk.DesktopApplicationContext;
-import org.apache.pivot.wtk.Display;
-import org.apache.pivot.wtk.Window;
-import org.apache.pivot.wtkx.WTKXSerializer;
-
-public class Spinners implements Application {
-    private Window window = null;
-
-    public void startup(Display display, Map&lt;String, String&gt; properties) throws Exception {
-        WTKXSerializer wtkxSerializer = new WTKXSerializer();
-        window = (Window)wtkxSerializer.readObject(this, "spinners.wtkx");
-        window.open(display);
-    }
-
-    public boolean shutdown(boolean optional) {
-        if (window != null) {
-            window.close();
-        }
-
-        return false;
-    }
-
-    public void suspend() {
-    }
-
-    public void resume() {
-    }
-
-    public static void main(String[] args) {
-        DesktopApplicationContext.main(Spinners.class, args);
-    }
-}
-</pre>
+<p>Since this example contains no logic, there is no associated Java source.</p>
 
 <p>Next: <a href="calendars.html">Calendars</a></p>
 </body>

Modified: incubator/pivot/trunk/tutorials/www/stack_panes.template.html
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/www/stack_panes.template.html?rev=822545&r1=822544&r2=822545&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/www/stack_panes.template.html (original)
+++ incubator/pivot/trunk/tutorials/www/stack_panes.template.html Wed Oct  7 00:51:41 2009
@@ -44,9 +44,10 @@
     width:480,
     height:360
 };
-var parameters = {application_class_name:"org.apache.pivot.tutorials.layout.StackPanes",
+var parameters = {application_class_name:"org.apache.pivot.wtk.ScriptApplication",
     codebase_lookup:false,
-    java_arguments:"-Dsun.awt.noerasebackground=true -Dsun.awt.erasebackgroundonresize=true"
+    java_arguments:"-Dsun.awt.noerasebackground=true -Dsun.awt.erasebackgroundonresize=true",
+    startup_properties:"src=org/apache/pivot/tutorials/layout/stack_panes.wtkx"
 };
 deployJava.writeAppletTag(attributes, parameters);
 </script>
@@ -69,46 +70,7 @@
 &lt;/Window&gt;
 </pre>
 
-<p>The Java code for this example doesn't really do anything interesting; it just loads the WTKX:</p>
-
-<pre class="brush:java">
-package org.apache.pivot.tutorials.layout;
-
-import org.apache.pivot.collections.Map;
-import org.apache.pivot.wtk.Application;
-import org.apache.pivot.wtk.DesktopApplicationContext;
-import org.apache.pivot.wtk.Display;
-import org.apache.pivot.wtk.Window;
-import org.apache.pivot.wtkx.WTKXSerializer;
-
-public class StackPanes implements Application {
-    private Window window = null;
-
-    public void startup(Display display, Map&lt;String, String&gt; properties) throws Exception {
-        WTKXSerializer wtkxSerializer = new WTKXSerializer();
-        window = (Window)wtkxSerializer.readObject(this, "stack_panes.wtkx");
-        window.open(display);
-    }
-
-    public boolean shutdown(boolean optional) {
-        if (window != null) {
-            window.close();
-        }
-
-        return false;
-    }
-
-    public void suspend() {
-    }
-
-    public void resume() {
-    }
-
-    public static void main(String[] args) {
-        DesktopApplicationContext.main(StackPanes.class, args);
-    }
-}
-</pre>
+<p>Since this example contains no logic, there is no associated Java source.</p>
 
 <p>Next: <a href="split_panes.html">Split Panes</a></p>
 </body>

Modified: incubator/pivot/trunk/tutorials/www/table_panes.template.html
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/www/table_panes.template.html?rev=822545&r1=822544&r2=822545&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/www/table_panes.template.html (original)
+++ incubator/pivot/trunk/tutorials/www/table_panes.template.html Wed Oct  7 00:51:41 2009
@@ -39,14 +39,14 @@
 <p>Table panes support a number of styles that allow a caller to customize the arrangement of child components:</p>
 
 <ul>
-<li><tt>padding</tt> - the amount of space the table pane reserves around the perimeter of the container.</li>
-<li><tt>horizontalSpacing</tt> - the amount of space the table pane inserts between columns.</li>
-<li><tt>verticalSpacing</tt> - the amount of space the table pane inserts between rows.</li>
-<li><tt>showHorizontalGridLines</tt> - whether horizontal grid lines will be painted in the space between rows. Note that this will be ignored if <tt>verticalSpacing</tt> is zero, as there would be no space in which to paint the grid lines.</li>
-<li><tt>showVerticalGridLines</tt> - whether vertical grid lines will be painted in the space between columns. Note that this will be ignored if <tt>horizontalSpacing</tt> is zero, as there would be no space in which to paint the grid lines.</li>
-<li><tt>horizontalGridColor</tt> - the color of the horizontal grid lines.</li>
-<li><tt>verticalGridColor</tt> - the color of the vertical grid lines.</li>
-<li><tt>highlightBackgroundColor</tt> - the background color of rows and columns whose <tt>highlighted</tt> flag is set to <tt>true</tt>.</li>
+<li>"padding" - the amount of space the table pane reserves around the perimeter of the container.</li>
+<li>"horizontalSpacing" - the amount of space the table pane inserts between columns.</li>
+<li>"verticalSpacing" - the amount of space the table pane inserts between rows.</li>
+<li>"showHorizontalGridLines" - whether horizontal grid lines will be painted in the space between rows. Note that this will be ignored if "verticalSpacing" is zero, as there would be no space in which to paint the grid lines.</li>
+<li>"showVerticalGridLines" - whether vertical grid lines will be painted in the space between columns. Note that this will be ignored if "horizontalSpacing" is zero, as there would be no space in which to paint the grid lines.</li>
+<li>"horizontalGridColor" - the color of the horizontal grid lines.</li>
+<li>"verticalGridColor" - the color of the vertical grid lines.</li>
+<li>"highlightBackgroundColor" - the background color of rows and columns whose "highlighted" flag is set to <tt>true</tt>.</li>
 </ul>
 
 <p>Below is a sample application that demonstrates a basic table pane structure and responds to mouse clicks with information about where the user clicked:</p>

Modified: incubator/pivot/trunk/tutorials/www/toggle_buttons.template.html
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/www/toggle_buttons.template.html?rev=822545&r1=822544&r2=822545&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/www/toggle_buttons.template.html (original)
+++ incubator/pivot/trunk/tutorials/www/toggle_buttons.template.html Wed Oct  7 00:51:41 2009
@@ -42,9 +42,10 @@
     height:80,
     style:"border:solid 1px #999999"
 };
-var parameters = {application_class_name:"org.apache.pivot.tutorials.buttons.ToggleButtons",
+var parameters = {application_class_name:"org.apache.pivot.wtk.ScriptApplication",
     codebase_lookup:false,
-    java_arguments:"-Dsun.awt.noerasebackground=true -Dsun.awt.erasebackgroundonresize=true"
+    java_arguments:"-Dsun.awt.noerasebackground=true -Dsun.awt.erasebackgroundonresize=true",
+    startup_properties:"src=org/apache/pivot/tutorials/buttons/toggle_buttons.wtkx"
 };
 deployJava.writeAppletTag(attributes, parameters);
 </script>
@@ -79,53 +80,14 @@
 &lt;/Window&gt;
 </pre>
 
-<p>The Java source is as follows. It simply loads the WTKX source and displays the window; there's no additional logic involved:</p>
-
-<pre class="brush:java">
-package org.apache.pivot.tutorials.buttons;
-
-import org.apache.pivot.collections.Map;
-import org.apache.pivot.wtk.Application;
-import org.apache.pivot.wtk.DesktopApplicationContext;
-import org.apache.pivot.wtk.Display;
-import org.apache.pivot.wtk.Window;
-import org.apache.pivot.wtkx.WTKXSerializer;
-
-public class ToggleButtons implements Application {
-    private Window window = null;
-
-    public void startup(Display display, Map&lt;String, String&gt; properties)
-        throws Exception {
-        WTKXSerializer wtkxSerializer = new WTKXSerializer();
-        window = (Window)wtkxSerializer.readObject(this, "toggle_buttons.wtkx");
-        window.open(display);
-    }
-
-    public boolean shutdown(boolean optional) {
-        if (window != null) {
-            window.close();
-        }
-
-        return false;
-    }
-
-    public void suspend() {
-    }
-
-    public void resume() {
-    }
-
-    public static void main(String[] args) {
-        DesktopApplicationContext.main(ToggleButtons.class, args);
-    }
-}</pre>
-
 <p>Note that the push buttons in the example display both an icon and a text label. The data for each button is specified as an instance of <tt>pivot.wtk.content.ButtonData</tt>, which defines "icon" and "text" properties. In addition to simple string data, the default button data renderer is also capable of displaying button data provided in this manner.</p>
 
 <p>Note also that the values of the "icon" attributes do not begin with an '@' symbol. In WTKX, image URLs are commonly specified with this prefix, to indicate that an image's location is relative to the WTKX source file currently being loaded. An image path without an '@' prefix, such as those in this example, is generally treated as an absolute location relative to the application's classpath.</p>
 
 <p>Finally, note that the buttons' states are all managed independently: clicking one button does not affect the selection state of the others. This is because the buttons are not part of a group. Had the buttons all been assigned to the same group, only a single button would be selected at a time, and clicking one button would automatically deselect the previously selected button.</p>
 
+<p>Because this application doesn't require any special logic, there is no Java source for this example; the example is launched using the <tt>org.apache.pivot.wtk.ScriptApplication</tt> class.</p>
+
 <p>Next: <a href="radio_buttons.html">Radio Buttons</a></p>
 </body>
 </html>