You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by sm...@apache.org on 2012/01/19 01:51:42 UTC

svn commit: r1233143 [33/47] - in /pivot/site/trunk/deploy: ./ 2.0.1/ 2.0.1/docs/ 2.0.1/docs/api/ demos/ tutorials/

Modified: pivot/site/trunk/deploy/tutorials/scripting.html
URL: http://svn.apache.org/viewvc/pivot/site/trunk/deploy/tutorials/scripting.html?rev=1233143&r1=1233142&r2=1233143&view=diff
==============================================================================
--- pivot/site/trunk/deploy/tutorials/scripting.html (original)
+++ pivot/site/trunk/deploy/tutorials/scripting.html Thu Jan 19 00:51:39 2012
@@ -1,4 +1,4 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <!--
 Licensed to the Apache Software Foundation (ASF) under one or more
 contributor license agreements.  See the NOTICE file distributed with
@@ -14,334 +14,336 @@ distributed under the License is distrib
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
---><html xmlns="http://www.w3.org/1999/xhtml"><head><meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /><title>Scripting | Apache Pivot</title><link xmlns="" type="text/css" rel="stylesheet" href="/styles/pivot.css"><script xmlns="http://www.w3.org/1999/xhtml" type="text/javascript">
-                var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
-                document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
-                </script><script type="text/javascript">
-                try {
-                var pageTracker = _gat._getTracker("UA-7977275-3");
-                pageTracker._trackPageview();
-                } catch(err) {}</script></head><body><div xmlns="" id="wrapper"><div id="main"><div id="header"><div class="logo"><a href="/index.html"><img title="Apache Pivot Homepage" alt="Apache Pivot" src="/images/logo.png"></a></div><div class="tagline"><img style="visibility:hidden" alt="Rich Internet Applications in Java" src="/images/tagline.png"></div><ul class="navi"><li><a href="/demos/">Demos</a></li><li><a href="/download.cgi#2.0">Download</a></li><li><a href="/tutorials/">Tutorial</a></li><li><a href="/get-involved.html">Get Involved</a></li><li><a href="/about.html">About</a></li></ul></div><div class="group" id="contentBase"><h1>Scripting</h1><ul class="naviLeft"><li><a href="/tutorials/sample-application.html">Sample Application</a></li><li><a href="/tutorials/platform-overview.html">Platform Overview</a></li><li><a href="/tutorials/hello-world.html">Hello, World!</a></li><li><a href="/tutorials/hello-bxml.html">Hello, BXML!</a></li><li><a href="/tutorials/
 component-and-container.html">Component &amp; Container</a></li><li><a href="/tutorials/labels-and-image-views.html">Labels &amp; Image Views</a></li><li><a href="/tutorials/svg-images.html">SVG Images</a></li><li><a href="/tutorials/buttons.html">Buttons</a></li><li><a href="/tutorials/push-buttons.html">Push Buttons</a></li><li><a href="/tutorials/toggle-buttons.html">Toggle Buttons</a></li><li><a href="/tutorials/radio-buttons.html">Radio Buttons</a></li><li><a href="/tutorials/checkboxes.html">Checkboxes</a></li><li><a href="/tutorials/link-buttons.html">Link Buttons</a></li><li><a href="/tutorials/lists.html">Lists</a></li><li><a href="/tutorials/list-buttons.html">List Buttons</a></li><li><a href="/tutorials/repeatable-list-buttons.html">Repeatable List Buttons</a></li><li><a href="/tutorials/text.html">Text</a></li><li><a href="/tutorials/suggestion-popups.html">Suggestion Popups</a></li><li><a href="/tutorials/text-areas.html">Text Areas</a></li><li><a href="/tutoria
 ls/separators.html">Separators</a></li><li><a href="/tutorials/layout-containers.html">Layout Containers</a></li><li><a href="/tutorials/flow-panes.html">Flow Panes</a></li><li><a href="/tutorials/box-panes.html">Box Panes</a></li><li><a href="/tutorials/grid-panes.html">Grid Panes</a></li><li><a href="/tutorials/table-panes.html">Table Panes</a></li><li><a href="/tutorials/borders.html">Borders</a></li><li><a href="/tutorials/stack-panes.html">Stack Panes</a></li><li><a href="/tutorials/split-panes.html">Split Panes</a></li><li><a href="/tutorials/forms.html">Forms</a></li><li><a href="/tutorials/panels.html">Panels</a></li><li><a href="/tutorials/navigation-containers.html">Navigation Containers</a></li><li><a href="/tutorials/card-panes.html">Card Panes</a></li><li><a href="/tutorials/tab-panes.html">Tab Panes</a></li><li><a href="/tutorials/accordions.html">Accordions</a></li><li><a href="/tutorials/expanders.html">Expanders</a></li><li><a href="/tutorials/rollups.html">
 Rollups</a></li><li><a href="/tutorials/viewports.html">Viewports</a></li><li><a href="/tutorials/scroll-panes.html">Scroll Panes</a></li><li><a href="/tutorials/panoramas.html">Panoramas</a></li><li><a href="/tutorials/progress-indicators.html">Progress Indicators</a></li><li><a href="/tutorials/meters.html">Meters</a></li><li><a href="/tutorials/activity-indicators.html">Activity Indicators</a></li><li><a href="/tutorials/bounded-range-components.html">Bounded Range Components</a></li><li><a href="/tutorials/sliders.html">Sliders</a></li><li><a href="/tutorials/scroll-bars.html">Scroll Bars</a></li><li><a href="/tutorials/spinners.html">Spinners</a></li><li><a href="/tutorials/calendars.html">Calendars</a></li><li><a href="/tutorials/menus.html">Menus</a></li><li><a href="/tutorials/context-menus.html">Context Menus</a></li><li><a href="/tutorials/menu-bars.html">Menu Bars</a></li><li><a href="/tutorials/menu-buttons.html">Menu Buttons</a></li><li><a href="/tutorials/color
 -choosers.html">Color Choosers</a></li><li><a href="/tutorials/table-views.html">Table Views</a></li><li><a href="/tutorials/table-views.json.html">JSON-based TableView</a></li><li><a href="/tutorials/table-views.custom.html">Custom TableView</a></li><li><a href="/tutorials/tree-views.html">Tree Views</a></li><li><a href="/tutorials/file-browsing.html">File Browsing</a></li><li><a href="/tutorials/windows.html">Windows</a></li><li><a href="/tutorials/clipboard.html">Clipboard</a></li><li><a href="/tutorials/drag-and-drop.html">Drag and Drop</a></li><li><a href="/tutorials/effects.html">Effects</a></li><li><a href="/tutorials/effects.transitions.html">Transitions</a></li><li><a href="/tutorials/data-binding.html">Data Binding</a></li><li><a href="/tutorials/property-binding.html">Property Binding</a></li><li><a href="/tutorials/localization.html">Localization</a></li><li><a href="/tutorials/background-tasks.html">Background Tasks</a></li><li><a href="/tutorials/web-queries.ht
 ml">Web Queries</a></li><li><a href="/tutorials/query-servlet.html">QueryServlet</a></li><li><a href="/tutorials/scripting.html">Scripting</a></li><li><a href="/tutorials/summary.html">Summary</a></li><li><a href="/tutorials/stock-tracker.html">The "Stock Tracker" Application</a></li><li><a href="/tutorials/stock-tracker.ui.html">UI Markup Using BXML</a></li><li><a href="/tutorials/stock-tracker.events.html">Event Handling</a></li><li><a href="/tutorials/stock-tracker.web-queries.html">Web Queries</a></li><li><a href="/tutorials/stock-tracker.data-binding.html">Data Binding</a></li><li><a href="/tutorials/stock-tracker.localization.html">Localization</a></li><li><a href="/tutorials/bxml-primer.html">BXML Primer</a></li></ul><div class="content"><style type="text/css">
-            applet {
-                border: 1px solid #999999;
-            }
-        </style><!--NOTE: Syntax highlighting script is LGPL--><script src="http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js" type="text/javascript"></script><script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js" type="text/javascript"></script><script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js" type="text/javascript"></script><script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js" type="text/javascript"></script><link href="http://alexgorbatchev.com/pub/sh/current/styles/shCore.css" rel="stylesheet" type="text/css"><link href="http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css" rel="stylesheet" type="text/css"><script type="text/javascript">
-            SyntaxHighlighter.all();
-        </script><div class="section">
-        <p>
-            Because Pivot requires a minimum of Java 6 update 10, Pivot applications can take
-            advantage of the JVM scripting support provided by the <tt>javax.script</tt> package
-            included with JDK versions 1.6 and later. While these APIs can be used on their own to
-            script Pivot applications, Pivot includes platform support for easily embedding script
-            code in BXML files.
-        </p>
-
-        <p>
-            Script blocks can be defined in BXML files in three different ways:
-        </p>
-
-        <ul>
-            <li>
-                Inline in a <tt>&lt;bxml:script&gt;</tt> tag
-            </li>
-            <li>
-                As an external file included by a <tt>&lt;bxml:script&gt;</tt> with a <tt>src</tt>
-                attribute
-            </li>
-            <li>
-                In an event listener attribute
-            </li>
-            <li>
-                In a <tt>&lt;bxml:script&gt;</tt> tag defined in an event listener element
-            </li>
-        </ul>
-
-        <p>
-            Though the first and last methods may seem similar, they are actually handled slightly
-            differently. All four methods are discussed in more detail below.
-        </p>
-
-        <p>
-            The following application demonstrate's Pivot's scripting support:
-        </p>
-
-        <script src="http://java.com/js/deployJava.js" type="text/javascript"></script><script type="text/javascript">
-
-            var attributes = {
-                code:"org.apache.pivot.wtk.BrowserApplicationContext$HostApplet",
-                width:"480",
-                height:"360"
-            };
-
-
-
-
-
-            var libraries = [];
-            libraries.push("/lib/pivot-core-2.0.jar");
-                libraries.push("/lib/pivot-wtk-2.0.jar");
-                libraries.push("/lib/pivot-wtk-terra-2.0.jar");
-                libraries.push("/lib/pivot-tutorials-2.0.jar");
-
-                    libraries.push("/lib/svgSalamander-tiny.jar");
-
-
-            attributes.archive = libraries.join(",");
-
-
-            var parameters = {
-                codebase_lookup:false,
-                application_class_name:'org.apache.pivot.tutorials.scripting.Scripting'
-            };
-
-
-            var javaArguments = ["-Dsun.awt.noerasebackground=true",
-                "-Dsun.awt.erasebackgroundonresize=true"];
-
-
-
-            parameters.java_arguments = javaArguments.join(" ");
-
-
-
-
-            deployJava.runApplet(attributes, parameters, "1.6");
-        </script>
-
-        <p>
-            This application is completely contrived - it doesn't present any practical example,
-            but instead serves only to demonstrate the various means of using scripting in a BXML
-            file. The Java source code for the application is shown below:
-        </p>
-
-        <pre class="brush:java">
-
-            package org.apache.pivot.tutorials.scripting;
-
-            import org.apache.pivot.beans.BXMLSerializer;
-            import org.apache.pivot.collections.List;
-            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.DesktopApplicationContext;
-            import org.apache.pivot.wtk.Display;
-            import org.apache.pivot.wtk.Window;
-
-            public class Scripting implements Application {
-                public static class MyButtonPressListener implements ButtonPressListener {
-                    @Override
-                    public void buttonPressed(Button button) {
-                        System.out.println("[Java] A button was clicked.");
-                    }
-                }
-
-                private Window window = null;
-
-                private String foo;
-                private List&lt;?&gt; listData;
-
-                @Override
-                public void startup(Display display, Map&lt;String, String&gt; properties)
-                    throws Exception {
-                    BXMLSerializer bxmlSerializer = new BXMLSerializer();
-                    bxmlSerializer.getNamespace().put("bar", "12345");
-
-                    window = (Window)bxmlSerializer.readObject(Scripting.class, "scripting.bxml");
-                    foo = (String)bxmlSerializer.getNamespace().get("foo");
-                    listData = (List&lt;?&gt;)bxmlSerializer.getNamespace().get("listData");
-
-                    System.out.println("foo = " + foo);
-                    System.out.println("listData.getLength() = " + listData.getLength());
-
-                    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 static void main(String[] args) {
-                    DesktopApplicationContext.main(Scripting.class, args);
-                }
-            }
-
-        </pre>
-
-        <p>
-            Notice how the <tt>startup()</tt> method calls <tt>put()</tt> on the
-            <tt>BXMLSerializer</tt> instance. <tt>BXMLSerializer</tt>'s dictionary methods allow a
-            caller to manipulate the script namespace before the BXML is loaded and retrieve values
-            from it afterwards. In this example, the "bar" variable is pre-populated with the value
-            "12345", which is later written to the console by script defined in "scripting.bxml".
-            Similarly, the values of "foo" and "listData" are obtained from the serializer and
-            written to the console after the BXML file has been read.
-        </p>
-
-        <p>
-            The BXML source is shown below:
-        </p>
-
-        <pre class="brush:xml">
-
-            &lt;Window title="Scripting Demo" maximized="true"
-                WindowStateListener.windowOpened="java.lang.System.out.println('Window opened: ' + x)"
-                WindowStateListener.windowClosed="java.lang.System.out.println('Window closed: ' + y)"
-                xmlns:bxml="http://pivot.apache.org/bxml"
-                xmlns:scripting="org.apache.pivot.demos.scripting"
-                xmlns="org.apache.pivot.wtk"&gt;
-                &lt;bxml:script&gt;
-                importClass(java.lang.System);
-                importPackage(org.apache.pivot.wtk);
-                System.out.println("bar = " + bar);
-
-                var x = 10;
-                var y = 20;
-
-                function buttonClicked(button) {
-                    Prompt.prompt("y = " + y, button.window);
-                }
-                &lt;/bxml:script&gt;
-
-                &lt;bxml:script src="example.js"/&gt;
-
-                &lt;Border styles="{padding:2}"&gt;
-                    &lt;BoxPane orientation="vertical" styles="{padding:6}"&gt;
-                        &lt;PushButton buttonData="Click Me!"&gt;
-                            &lt;buttonPressListeners&gt;
-                                importPackage(org.apache.pivot.wtk);
-                                function buttonPressed(button) {
-                                    Prompt.prompt("x = " + x, button.getWindow());
-                                }
-                            &lt;/buttonPressListeners&gt;
-                        &lt;/PushButton&gt;
-
-                        &lt;PushButton buttonData="No, Click Me!"
-                            ButtonPressListener.buttonPressed="buttonClicked(arguments[0])"/&gt;
-
-                        &lt;Border styles="{color:10}"&gt;
-                            &lt;ListView listData="$listData" selectedIndex="0"/&gt;
-                        &lt;/Border&gt;
-                    &lt;/BoxPane&gt;
-                &lt;/Border&gt;
-            &lt;/Window&gt;
-
-        </pre>
-
-        <p>
-            This code demonstrates the various means by which script code can be used in BXML:
-        </p>
-
-        <ul>
-            <li>
-                <p>
-                    <i>Inline in a <tt>&lt;bxml:script&gt;</tt> tag.</i> The first
-                    <tt>&lt;bxml:script&gt;</tt> tag defines its content inline. This code is
-                    executed as it is processed by the BXML serializer. This example first outputs
-                    the "bar" value set by the application, then declares two variables
-                    (<tt>x</tt> and <tt>y</tt>) and a function (<tt>buttonClicked()</tt>. These
-                    values are visible to all other script code declared within the page.
-                </p>
-            </li>
-            <li>
-                <p>
-                    <i>As an external file included by a <tt>&lt;bxml:script&gt;</tt> with a
-                    <tt>src</tt> attribute.</i> The second <tt>&lt;bxml:script&gt;</tt> tag
-                    includes an externally defined script into the page. The contents of the script
-                    are defined in "example.js", which is shown below. Any previously defined
-                    values will be visible to the script, and any variables declared by the script
-                    will be visible to other script blocks declared by the page.
-                </p>
-            </li>
-            <li>
-                <p>
-                    <i>In an event listener attribute.</i> Event listeners can be declared in
-                    attributes, using a syntax similar to that used for static property setters.
-                    The attribute name for an event listener consists of the name of the interface
-                    that defines the event plus the name of the event, separated by a period. The
-                    BXML source contains several examples of attribute-based listeners:
-                </p>
-                <ul>
-                    <li>
-                        <tt>WindowStateListener.windowOpened</tt>
-                    </li>
-                    <li>
-                        <tt>WindowStateListener.windowClosed</tt>
-                    </li>
-                    <li>
-                        <tt>ButtonPressListener.buttonPressed</tt>
-                    </li>
-                </ul>
-            </li>
-            <li>
-                <p>
-                    <i>In a <tt>&lt;bxml:script&gt;</tt> tag defined in an event listener
-                    element.</i> Attribute-based event handlers are convenient for simple one-line
-                    listeners, but are not particuarly well suited to anything much more complex.
-                    Pivot also provides the ability to define event listeners within a listener
-                    list element. For example, the <tt>buttonPressListeners</tt> sub-element of
-                    the "Click Me!" push button defines a <tt>buttonPressed()</tt> function that
-                    is invoked when the corresponding button press event is fired by the button.
-                    Because the script for element-based listeners doesn't need to fit within a
-                    single XML attribute, more sophisticated handler code can be defined, while
-                    still maintaining proximity to the element to which the handler applies.
-                </p>
-                <p>
-                    Though it isn't obvious from this simple example, script-based event handlers
-                    are not required to provide implementations for every method defined by the
-                    listener interface. Any omitted methods are simply processed by a default no-op
-                    handler.
-                </p>
-            </li>
-        </ul>
-
-        <p>
-            Note that a special scope is created for event listener scripts that is local to the
-            listener; although all page-level variables remain visible to the listener code, any
-            variables defined within the listener (including functions) are only visible within
-            that block. This prevents listener script from "polluting" the global page namespace.
-            While this is generally not an issue for attribute-based listeners (which tend to be
-            focused and short), can easily become an issue for element-based listeners, which may
-            declare multiple functions with the same name (for example, when multiple button press
-            handlers are defined within the same page).
-        </p>
-
-        <p>
-            The "example.js" file is defined as follows:
-        </p>
-
-        <pre class="brush:jscript">
-
-            importClass(java.lang.System);
-            importPackage(org.apache.pivot.collections);
-
-            System.out.println("Executing external script block; x = " + x);
-
-            var foo = "ABCDE";
-
-            var listData = new ArrayList();
-            listData.add("One");
-            listData.add("Two");
-            listData.add("Three");
-
-        </pre>
-
-        <p>
-            This script declares the "foo" value that is later output by the Java application code,
-            and also defines the list data that is used by the example <tt>ListView</tt> defined by
-            the BXML file.
-        </p>
-    </div><p>Next: <a href="summary.html">Summary</a></p></div></div></div><div class="group" id="footer"><div class="footerLogo">Copyright (c) 1999-2011<br>The Apache Software Foundation.</div><div class="footerLinks"><ul class="footerMenuGr"><li><strong>Demos</strong><ul><li><a href="/demos/kitchen-sink.html" target="_new">"Kitchen Sink"</a></li><li><a href="/demos/component-explorer.html" target="_new">Component Explorer</a></li><li><a href="http://ixnay.biz/pivot-jfree-demos/charts_demo.html" target="_new">Charting</a></li><li><a href="/demos/">More Demos</a></li></ul></li><li><strong>Documentation</strong><ul><li><a href="/getting-started.html">Getting Started</a></li><li><a href="/tutorials/">Tutorial</a></li><li><a href="/faq.html">FAQ</a></li><li><a href="/2.0/docs/api/">Javadoc (2.0)</a></li></ul></li><li><strong>Get Involved</strong><ul><li><a href="/svn.html">SVN Repositories</a></li><li><a href="/lists.html">Mailing Lists</a></li><li><a href="http://issues.apache
 .org/jira/browse/PIVOT">Bug Database</a></li><li><a href="http://cwiki.apache.org/PIVOT/">Wiki</a></li></ul></li><li><strong>Related</strong><ul><li><a href="http://code.google.com/p/pivot-jfree/">JFreeChart Provider</a></li></ul></li><li><strong>About</strong><ul><li><a href="/who-we-are.html">Who We Are</a></li><li><a href="/contact.html">Contact</a></li><li><a href="/news.html">News</a></li><li><a href="/legal.html">Legal/License</a></li></ul></li></ul></div></div></div></body></html>
\ No newline at end of file
+--><html xmlns="http://www.w3.org/1999/xhtml"><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Scripting | Apache Pivot</title><link href="/styles/pivot.css" rel="stylesheet" type="text/css"><script type="text/javascript">
+                var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+                document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+                </script><script type="text/javascript">
+                try {
+                var pageTracker = _gat._getTracker("UA-7977275-3");
+                pageTracker._trackPageview();
+                } catch(err) {}</script></head><body><div id="wrapper"><div id="main"><div id="header"><div xmlns="" class="logo"><a href="/index.html"><img src="/images/logo.png" alt="Apache Pivot" title="Apache Pivot Homepage"></a></div><div class="tagline"><img src="/images/tagline.png" alt="Rich Internet Applications in Java" style="visibility:hidden"></div><ul class="navi"><li><a href="/demos/">Demos</a></li><li><a href="/download.cgi#2.0.1">Download</a></li><li><a href="/tutorials/">Tutorial</a></li><li><a href="/get-involved.html">Get Involved</a></li><li><a href="/about.html">About</a></li></ul></div><div id="contentBase" class="group"><h1>Scripting</h1><ul class="naviLeft"><li><a href="/tutorials/sample-application.html">Sample Application</a></li><li><a href="/tutorials/platform-overview.html">Platform Overview</a></li><li><a href="/tutorials/hello-world.html">Hello, World!</a></li><li><a href="/tutorials/hello-bxml.html">Hello, BXML!</a></li><li><a href="/tutorial
 s/component-and-container.html">Component &amp; Container</a></li><li><a href="/tutorials/labels-and-image-views.html">Labels &amp; Image Views</a></li><li><a href="/tutorials/svg-images.html">SVG Images</a></li><li><a href="/tutorials/buttons.html">Buttons</a></li><li><a href="/tutorials/push-buttons.html">Push Buttons</a></li><li><a href="/tutorials/toggle-buttons.html">Toggle Buttons</a></li><li><a href="/tutorials/radio-buttons.html">Radio Buttons</a></li><li><a href="/tutorials/checkboxes.html">Checkboxes</a></li><li><a href="/tutorials/link-buttons.html">Link Buttons</a></li><li><a href="/tutorials/lists.html">Lists</a></li><li><a href="/tutorials/list-buttons.html">List Buttons</a></li><li><a href="/tutorials/repeatable-list-buttons.html">Repeatable List Buttons</a></li><li><a href="/tutorials/text.html">Text</a></li><li><a href="/tutorials/suggestion-popups.html">Suggestion Popups</a></li><li><a href="/tutorials/text-areas.html">Text Areas</a></li><li><a href="/tutor
 ials/separators.html">Separators</a></li><li><a href="/tutorials/layout-containers.html">Layout Containers</a></li><li><a href="/tutorials/flow-panes.html">Flow Panes</a></li><li><a href="/tutorials/box-panes.html">Box Panes</a></li><li><a href="/tutorials/fill-panes.html">Fill Panes</a></li><li><a href="/tutorials/grid-panes.html">Grid Panes</a></li><li><a href="/tutorials/table-panes.html">Table Panes</a></li><li><a href="/tutorials/borders.html">Borders</a></li><li><a href="/tutorials/stack-panes.html">Stack Panes</a></li><li><a href="/tutorials/split-panes.html">Split Panes</a></li><li><a href="/tutorials/forms.html">Forms</a></li><li><a href="/tutorials/panels.html">Panels</a></li><li><a href="/tutorials/navigation-containers.html">Navigation Containers</a></li><li><a href="/tutorials/card-panes.html">Card Panes</a></li><li><a href="/tutorials/tab-panes.html">Tab Panes</a></li><li><a href="/tutorials/accordions.html">Accordions</a></li><li><a href="/tutorials/expanders.
 html">Expanders</a></li><li><a href="/tutorials/rollups.html">Rollups</a></li><li><a href="/tutorials/viewports.html">Viewports</a></li><li><a href="/tutorials/scroll-panes.html">Scroll Panes</a></li><li><a href="/tutorials/panoramas.html">Panoramas</a></li><li><a href="/tutorials/progress-indicators.html">Progress Indicators</a></li><li><a href="/tutorials/meters.html">Meters</a></li><li><a href="/tutorials/activity-indicators.html">Activity Indicators</a></li><li><a href="/tutorials/bounded-range-components.html">Bounded Range Components</a></li><li><a href="/tutorials/sliders.html">Sliders</a></li><li><a href="/tutorials/scroll-bars.html">Scroll Bars</a></li><li><a href="/tutorials/spinners.html">Spinners</a></li><li><a href="/tutorials/calendars.html">Calendars</a></li><li><a href="/tutorials/menus.html">Menus</a></li><li><a href="/tutorials/context-menus.html">Context Menus</a></li><li><a href="/tutorials/menu-bars.html">Menu Bars</a></li><li><a href="/tutorials/menu-bu
 ttons.html">Menu Buttons</a></li><li><a href="/tutorials/color-choosers.html">Color Choosers</a></li><li><a href="/tutorials/table-views.html">Table Views</a></li><li><a href="/tutorials/table-views.json.html">JSON-based TableView</a></li><li><a href="/tutorials/table-views.custom.html">Custom TableView</a></li><li><a href="/tutorials/tree-views.html">Tree Views</a></li><li><a href="/tutorials/file-browsing.html">File Browsing</a></li><li><a href="/tutorials/windows.html">Windows</a></li><li><a href="/tutorials/clipboard.html">Clipboard</a></li><li><a href="/tutorials/drag-and-drop.html">Drag and Drop</a></li><li><a href="/tutorials/effects.html">Effects</a></li><li><a href="/tutorials/effects.transitions.html">Transitions</a></li><li><a href="/tutorials/data-binding.html">Data Binding</a></li><li><a href="/tutorials/property-binding.html">Property Binding</a></li><li><a href="/tutorials/localization.html">Localization</a></li><li><a href="/tutorials/background-tasks.html">B
 ackground Tasks</a></li><li><a href="/tutorials/web-queries.html">Web Queries</a></li><li><a href="/tutorials/query-servlet.html">QueryServlet</a></li><li><a href="/tutorials/scripting.html">Scripting</a></li><li><a href="/tutorials/summary.html">Summary</a></li><li><a href="/tutorials/stock-tracker.html">The "Stock Tracker" Application</a></li><li><a href="/tutorials/stock-tracker.ui.html">UI Markup Using BXML</a></li><li><a href="/tutorials/stock-tracker.events.html">Event Handling</a></li><li><a href="/tutorials/stock-tracker.web-queries.html">Web Queries</a></li><li><a href="/tutorials/stock-tracker.data-binding.html">Data Binding</a></li><li><a href="/tutorials/stock-tracker.localization.html">Localization</a></li><li><a href="/tutorials/bxml-primer.html">BXML Primer</a></li></ul><div class="content"><style type="text/css">
+            applet {
+                border: 1px solid #999999;
+            }
+        </style><!--NOTE: Syntax highlighting script is LGPL--><script type="text/javascript" src="http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js"></script><script type="text/javascript" src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js"></script><script type="text/javascript" src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js"></script><script type="text/javascript" src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js"></script><link type="text/css" rel="stylesheet" href="http://alexgorbatchev.com/pub/sh/current/styles/shCore.css"><link type="text/css" rel="stylesheet" href="http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css"><script type="text/javascript">
+            SyntaxHighlighter.all();
+        </script><div class="section">
+        <p>
+            Because Pivot requires a minimum of Java 6 update 10, Pivot applications can take
+            advantage of the JVM scripting support provided by the <tt>javax.script</tt> package
+            included with JDK versions 1.6 and later. While these APIs can be used on their own to
+            script Pivot applications, Pivot includes platform support for easily embedding script
+            code in BXML files.
+        </p>
+
+        <p>
+            Script blocks can be defined in BXML files in three different ways:
+        </p>
+
+        <ul>
+            <li>
+                Inline in a <tt>&lt;bxml:script&gt;</tt> tag
+            </li>
+            <li>
+                As an external file included by a <tt>&lt;bxml:script&gt;</tt> with a <tt>src</tt>
+                attribute
+            </li>
+            <li>
+                In an event listener attribute
+            </li>
+            <li>
+                In a <tt>&lt;bxml:script&gt;</tt> tag defined in an event listener element
+            </li>
+        </ul>
+
+        <p>
+            Though the first and last methods may seem similar, they are actually handled slightly
+            differently. All four methods are discussed in more detail below.
+        </p>
+
+        <p>
+            The following application demonstrate's Pivot's scripting support:
+        </p>
+
+        <script type="text/javascript" src="http://java.com/js/deployJava.js"></script><script type="text/javascript">
+            
+            var attributes = {
+                code:"org.apache.pivot.wtk.BrowserApplicationContext$HostApplet",
+                width:"480",
+                height:"360"
+            };
+
+            
+            
+
+            
+            var libraries = [];
+            libraries.push("/lib/pivot-core-2.0.1.jar");
+                libraries.push("/lib/pivot-wtk-2.0.1.jar");
+                libraries.push("/lib/pivot-wtk-terra-2.0.1.jar");
+                libraries.push("/lib/pivot-tutorials-2.0.1.jar");
+                
+                    libraries.push("/lib/svgSalamander-tiny.jar");
+                
+
+            attributes.archive = libraries.join(",");
+
+            
+            var parameters = {
+                codebase_lookup:false,
+                application_class_name:'org.apache.pivot.tutorials.scripting.Scripting'
+            };
+
+            
+            var javaArguments = ["-Dsun.awt.noerasebackground=true",
+                "-Dsun.awt.erasebackgroundonresize=true"];
+
+            
+
+            parameters.java_arguments = javaArguments.join(" ");
+
+            
+            
+
+            deployJava.runApplet(attributes, parameters, "1.6");
+        </script>
+
+        <p>
+            This application is completely contrived - it doesn't present any practical example,
+            but instead serves only to demonstrate the various means of using scripting in a BXML
+            file. The Java source code for the application is shown below:
+        </p>
+
+        <pre class="brush:java">
+            
+            package org.apache.pivot.tutorials.scripting;
+
+            import org.apache.pivot.beans.BXMLSerializer;
+            import org.apache.pivot.collections.List;
+            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.DesktopApplicationContext;
+            import org.apache.pivot.wtk.Display;
+            import org.apache.pivot.wtk.Window;
+
+            public class Scripting implements Application {
+                public static class MyButtonPressListener implements ButtonPressListener {
+                    @Override
+                    public void buttonPressed(Button button) {
+                        System.out.println("[Java] A button was clicked.");
+                    }
+                }
+
+                private Window window = null;
+
+                private String foo;
+                private List&lt;?&gt; listData;
+
+                @Override
+                public void startup(Display display, Map&lt;String, String&gt; properties)
+                    throws Exception {
+                    BXMLSerializer bxmlSerializer = new BXMLSerializer();
+                    bxmlSerializer.getNamespace().put("bar", "12345");
+
+                    window = (Window)bxmlSerializer.readObject(Scripting.class, "scripting.bxml");
+                    foo = (String)bxmlSerializer.getNamespace().get("foo");
+                    listData = (List&lt;?&gt;)bxmlSerializer.getNamespace().get("listData");
+
+                    System.out.println("foo = " + foo);
+                    System.out.println("listData.getLength() = " + listData.getLength());
+
+                    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 static void main(String[] args) {
+                    DesktopApplicationContext.main(Scripting.class, args);
+                }
+            }
+            
+        </pre>
+
+        <p>
+            Notice how the <tt>startup()</tt> method calls <tt>put()</tt> on the
+            <tt>BXMLSerializer</tt> instance. <tt>BXMLSerializer</tt>'s dictionary methods allow a
+            caller to manipulate the script namespace before the BXML is loaded and retrieve values
+            from it afterwards. In this example, the "bar" variable is pre-populated with the value
+            "12345", which is later written to the console by script defined in "scripting.bxml".
+            Similarly, the values of "foo" and "listData" are obtained from the serializer and
+            written to the console after the BXML file has been read.
+        </p>
+
+        <p>
+            The BXML source is shown below:
+        </p>
+
+        <pre class="brush:xml">
+            
+            &lt;Window title="Scripting Demo" maximized="true"
+                WindowStateListener.windowOpened="java.lang.System.out.println('Window opened: ' + x)"
+                WindowStateListener.windowClosed="java.lang.System.out.println('Window closed: ' + y)"
+                xmlns:bxml="http://pivot.apache.org/bxml"
+                xmlns:scripting="org.apache.pivot.demos.scripting"
+                xmlns="org.apache.pivot.wtk"&gt;
+                &lt;bxml:script&gt;
+                importClass(java.lang.System);
+                importPackage(org.apache.pivot.wtk);
+                System.out.println("bar = " + bar);
+
+                var x = 10;
+                var y = 20;
+
+                function buttonClicked(button) {
+                    Prompt.prompt("y = " + y, button.window);
+                }
+                &lt;/bxml:script&gt;
+
+                &lt;bxml:script src="example.js"/&gt;
+
+                &lt;Border styles="{padding:2}"&gt;
+                    &lt;BoxPane orientation="vertical" styles="{padding:6}"&gt;
+                        &lt;PushButton buttonData="Click Me!"&gt;
+                            &lt;buttonPressListeners&gt;
+                                importPackage(org.apache.pivot.wtk);
+                                function buttonPressed(button) {
+                                    Prompt.prompt("x = " + x, button.getWindow());
+                                }
+                            &lt;/buttonPressListeners&gt;
+                        &lt;/PushButton&gt;
+
+                        &lt;PushButton buttonData="No, Click Me!"
+                            ButtonPressListener.buttonPressed="buttonClicked(arguments[0])"/&gt;
+
+                        &lt;Border styles="{color:10}"&gt;
+                            &lt;ListView listData="$listData" selectedIndex="0"/&gt;
+                        &lt;/Border&gt;
+                    &lt;/BoxPane&gt;
+                &lt;/Border&gt;
+            &lt;/Window&gt;
+            
+        </pre>
+
+        <p>
+            This code demonstrates the various means by which script code can be used in BXML:
+        </p>
+
+        <ul>
+            <li>
+                <p>
+                    <i>Inline in a <tt>&lt;bxml:script&gt;</tt> tag.</i> The first
+                    <tt>&lt;bxml:script&gt;</tt> tag defines its content inline. This code is
+                    executed as it is processed by the BXML serializer. This example first outputs
+                    the "bar" value set by the application, then declares two variables
+                    (<tt>x</tt> and <tt>y</tt>) and a function (<tt>buttonClicked()</tt>. These
+                    values are visible to all other script code declared within the page.
+                </p>
+            </li>
+            <li>
+                <p>
+                    <i>As an external file included by a <tt>&lt;bxml:script&gt;</tt> with a
+                    <tt>src</tt> attribute.</i> The second <tt>&lt;bxml:script&gt;</tt> tag
+                    includes an externally defined script into the page. The contents of the script
+                    are defined in "example.js", which is shown below. Any previously defined
+                    values will be visible to the script, and any variables declared by the script
+                    will be visible to other script blocks declared by the page.
+                </p>
+            </li>
+            <li>
+                <p>
+                    <i>In an event listener attribute.</i> Event listeners can be declared in
+                    attributes, using a syntax similar to that used for static property setters.
+                    The attribute name for an event listener consists of the name of the interface
+                    that defines the event plus the name of the event, separated by a period. The
+                    BXML source contains several examples of attribute-based listeners:
+                </p>
+                <ul>
+                    <li>
+                        <tt>WindowStateListener.windowOpened</tt>
+                    </li>
+                    <li>
+                        <tt>WindowStateListener.windowClosed</tt>
+                    </li>
+                    <li>
+                        <tt>ButtonPressListener.buttonPressed</tt>
+                    </li>
+                </ul>
+            </li>
+            <li>
+                <p>
+                    <i>In a <tt>&lt;bxml:script&gt;</tt> tag defined in an event listener
+                    element.</i> Attribute-based event handlers are convenient for simple one-line
+                    listeners, but are not particuarly well suited to anything much more complex.
+                    Pivot also provides the ability to define event listeners within a listener
+                    list element. For example, the <tt>buttonPressListeners</tt> sub-element of
+                    the "Click Me!" push button defines a <tt>buttonPressed()</tt> function that
+                    is invoked when the corresponding button press event is fired by the button.
+                    Because the script for element-based listeners doesn't need to fit within a
+                    single XML attribute, more sophisticated handler code can be defined, while
+                    still maintaining proximity to the element to which the handler applies.
+                </p>
+                <p>
+                    Though it isn't obvious from this simple example, script-based event handlers
+                    are not required to provide implementations for every method defined by the
+                    listener interface. Any omitted methods are simply processed by a default no-op
+                    handler.
+                </p>
+            </li>
+        </ul>
+
+        <p>
+            Note that a special scope is created for event listener scripts that is local to the
+            listener; although all page-level variables remain visible to the listener code, any
+            variables defined within the listener (including functions) are only visible within
+            that block. This prevents listener script from "polluting" the global page namespace.
+            While this is generally not an issue for attribute-based listeners (which tend to be
+            focused and short), can easily become an issue for element-based listeners, which may
+            declare multiple functions with the same name (for example, when multiple button press
+            handlers are defined within the same page).
+        </p>
+
+        <p>
+            The "example.js" file is defined as follows:
+        </p>
+
+        <pre class="brush:jscript">
+            
+            importClass(java.lang.System);
+            importPackage(org.apache.pivot.collections);
+
+            System.out.println("Executing external script block; x = " + x);
+
+            var foo = "ABCDE";
+
+            var listData = new ArrayList();
+            listData.add("One");
+            listData.add("Two");
+            listData.add("Three");
+            
+        </pre>
+
+        <p>
+            This script declares the "foo" value that is later output by the Java application code,
+            and also defines the list data that is used by the example <tt>ListView</tt> defined by
+            the BXML file.
+        </p>
+    </div><p>Next: <a href="summary.html">Summary</a></p></div></div></div><div id="footer" class="group"><div class="footerLogo">Copyright (c) 1999-2012<br>The Apache Software Foundation.</div><div class="footerLinks"><ul class="footerMenuGr"><li><strong>Demos</strong><ul><li><a href="/demos/kitchen-sink.html" target="_new">"Kitchen Sink"</a></li><li><a href="/demos/component-explorer.html" target="_new">Component Explorer</a></li><li><a href="http://cwiki.apache.org/confluence/display/PIVOT/Other+Demos" target="_new">Charting</a></li><li><a href="/demos/">More Demos</a></li></ul></li><li><strong>Documentation</strong><ul><li><a href="/getting-started.html">Getting Started</a></li><li><a href="/tutorials/">Tutorial</a></li><li><a href="/faq.html">FAQ</a></li><li><a href="/2.0.1/docs/api/">Javadoc (2.0.1)</a></li></ul></li><li><strong>Get Involved</strong><ul><li><a href="/svn.html">SVN Repositories</a></li><li><a href="/lists.html">Mailing Lists</a></li><li><a href="http://
 issues.apache.org/jira/browse/PIVOT">Bug Database</a></li><li><a href="http://cwiki.apache.org/PIVOT/">Wiki</a></li></ul></li><li><strong>Related</strong><ul><li><a href="http://code.google.com/a/apache-extras.org/p/pivot-jfree/">JFreeChart Provider</a></li><li><a href="http://code.google.com/a/apache-extras.org/p/pivot-common/">Pivot-Common</a></li><li><a href="http://code.google.com/a/apache-extras.org/p/pivot-contrib/">Pivot-Contrib</a></li><li><a href="http://code.google.com/a/apache-extras.org/p/pivot-multilang/">Pivot-Multilang</a></li></ul></li><li><strong>About</strong><ul><li><a href="/who-we-are.html">Who We Are</a></li><li><a href="/contact.html">Contact</a></li><li><a href="http://cwiki.apache.org/confluence/display/PIVOT/News">News</a></li><li><a href="/legal.html">Legal/License</a></li></ul></li></ul></div><div class="footerLinks">
+                	Apache Pivot is a trademark of the Apache Software Foundation
+                </div></div></div></body></html>
\ No newline at end of file

Modified: pivot/site/trunk/deploy/tutorials/scroll-bars.html
URL: http://svn.apache.org/viewvc/pivot/site/trunk/deploy/tutorials/scroll-bars.html?rev=1233143&r1=1233142&r2=1233143&view=diff
==============================================================================
--- pivot/site/trunk/deploy/tutorials/scroll-bars.html (original)
+++ pivot/site/trunk/deploy/tutorials/scroll-bars.html Thu Jan 19 00:51:39 2012
@@ -1,4 +1,4 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <!--
 Licensed to the Apache Software Foundation (ASF) under one or more
 contributor license agreements.  See the NOTICE file distributed with
@@ -14,205 +14,207 @@ distributed under the License is distrib
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
---><html xmlns="http://www.w3.org/1999/xhtml"><head><meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /><title>Scroll Bars | Apache Pivot</title><link xmlns="" type="text/css" rel="stylesheet" href="/styles/pivot.css"><script xmlns="http://www.w3.org/1999/xhtml" type="text/javascript">
-                var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
-                document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
-                </script><script type="text/javascript">
-                try {
-                var pageTracker = _gat._getTracker("UA-7977275-3");
-                pageTracker._trackPageview();
-                } catch(err) {}</script></head><body><div xmlns="" id="wrapper"><div id="main"><div id="header"><div class="logo"><a href="/index.html"><img title="Apache Pivot Homepage" alt="Apache Pivot" src="/images/logo.png"></a></div><div class="tagline"><img style="visibility:hidden" alt="Rich Internet Applications in Java" src="/images/tagline.png"></div><ul class="navi"><li><a href="/demos/">Demos</a></li><li><a href="/download.cgi#2.0">Download</a></li><li><a href="/tutorials/">Tutorial</a></li><li><a href="/get-involved.html">Get Involved</a></li><li><a href="/about.html">About</a></li></ul></div><div class="group" id="contentBase"><h1>Scroll Bars</h1><ul class="naviLeft"><li><a href="/tutorials/sample-application.html">Sample Application</a></li><li><a href="/tutorials/platform-overview.html">Platform Overview</a></li><li><a href="/tutorials/hello-world.html">Hello, World!</a></li><li><a href="/tutorials/hello-bxml.html">Hello, BXML!</a></li><li><a href="/tutorial
 s/component-and-container.html">Component &amp; Container</a></li><li><a href="/tutorials/labels-and-image-views.html">Labels &amp; Image Views</a></li><li><a href="/tutorials/svg-images.html">SVG Images</a></li><li><a href="/tutorials/buttons.html">Buttons</a></li><li><a href="/tutorials/push-buttons.html">Push Buttons</a></li><li><a href="/tutorials/toggle-buttons.html">Toggle Buttons</a></li><li><a href="/tutorials/radio-buttons.html">Radio Buttons</a></li><li><a href="/tutorials/checkboxes.html">Checkboxes</a></li><li><a href="/tutorials/link-buttons.html">Link Buttons</a></li><li><a href="/tutorials/lists.html">Lists</a></li><li><a href="/tutorials/list-buttons.html">List Buttons</a></li><li><a href="/tutorials/repeatable-list-buttons.html">Repeatable List Buttons</a></li><li><a href="/tutorials/text.html">Text</a></li><li><a href="/tutorials/suggestion-popups.html">Suggestion Popups</a></li><li><a href="/tutorials/text-areas.html">Text Areas</a></li><li><a href="/tutor
 ials/separators.html">Separators</a></li><li><a href="/tutorials/layout-containers.html">Layout Containers</a></li><li><a href="/tutorials/flow-panes.html">Flow Panes</a></li><li><a href="/tutorials/box-panes.html">Box Panes</a></li><li><a href="/tutorials/grid-panes.html">Grid Panes</a></li><li><a href="/tutorials/table-panes.html">Table Panes</a></li><li><a href="/tutorials/borders.html">Borders</a></li><li><a href="/tutorials/stack-panes.html">Stack Panes</a></li><li><a href="/tutorials/split-panes.html">Split Panes</a></li><li><a href="/tutorials/forms.html">Forms</a></li><li><a href="/tutorials/panels.html">Panels</a></li><li><a href="/tutorials/navigation-containers.html">Navigation Containers</a></li><li><a href="/tutorials/card-panes.html">Card Panes</a></li><li><a href="/tutorials/tab-panes.html">Tab Panes</a></li><li><a href="/tutorials/accordions.html">Accordions</a></li><li><a href="/tutorials/expanders.html">Expanders</a></li><li><a href="/tutorials/rollups.html
 ">Rollups</a></li><li><a href="/tutorials/viewports.html">Viewports</a></li><li><a href="/tutorials/scroll-panes.html">Scroll Panes</a></li><li><a href="/tutorials/panoramas.html">Panoramas</a></li><li><a href="/tutorials/progress-indicators.html">Progress Indicators</a></li><li><a href="/tutorials/meters.html">Meters</a></li><li><a href="/tutorials/activity-indicators.html">Activity Indicators</a></li><li><a href="/tutorials/bounded-range-components.html">Bounded Range Components</a></li><li><a href="/tutorials/sliders.html">Sliders</a></li><li><a href="/tutorials/scroll-bars.html">Scroll Bars</a></li><li><a href="/tutorials/spinners.html">Spinners</a></li><li><a href="/tutorials/calendars.html">Calendars</a></li><li><a href="/tutorials/menus.html">Menus</a></li><li><a href="/tutorials/context-menus.html">Context Menus</a></li><li><a href="/tutorials/menu-bars.html">Menu Bars</a></li><li><a href="/tutorials/menu-buttons.html">Menu Buttons</a></li><li><a href="/tutorials/col
 or-choosers.html">Color Choosers</a></li><li><a href="/tutorials/table-views.html">Table Views</a></li><li><a href="/tutorials/table-views.json.html">JSON-based TableView</a></li><li><a href="/tutorials/table-views.custom.html">Custom TableView</a></li><li><a href="/tutorials/tree-views.html">Tree Views</a></li><li><a href="/tutorials/file-browsing.html">File Browsing</a></li><li><a href="/tutorials/windows.html">Windows</a></li><li><a href="/tutorials/clipboard.html">Clipboard</a></li><li><a href="/tutorials/drag-and-drop.html">Drag and Drop</a></li><li><a href="/tutorials/effects.html">Effects</a></li><li><a href="/tutorials/effects.transitions.html">Transitions</a></li><li><a href="/tutorials/data-binding.html">Data Binding</a></li><li><a href="/tutorials/property-binding.html">Property Binding</a></li><li><a href="/tutorials/localization.html">Localization</a></li><li><a href="/tutorials/background-tasks.html">Background Tasks</a></li><li><a href="/tutorials/web-queries.
 html">Web Queries</a></li><li><a href="/tutorials/query-servlet.html">QueryServlet</a></li><li><a href="/tutorials/scripting.html">Scripting</a></li><li><a href="/tutorials/summary.html">Summary</a></li><li><a href="/tutorials/stock-tracker.html">The "Stock Tracker" Application</a></li><li><a href="/tutorials/stock-tracker.ui.html">UI Markup Using BXML</a></li><li><a href="/tutorials/stock-tracker.events.html">Event Handling</a></li><li><a href="/tutorials/stock-tracker.web-queries.html">Web Queries</a></li><li><a href="/tutorials/stock-tracker.data-binding.html">Data Binding</a></li><li><a href="/tutorials/stock-tracker.localization.html">Localization</a></li><li><a href="/tutorials/bxml-primer.html">BXML Primer</a></li></ul><div class="content"><style type="text/css">
-            applet {
-                border: 1px solid #999999;
-            }
-        </style><!--NOTE: Syntax highlighting script is LGPL--><script src="http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js" type="text/javascript"></script><script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js" type="text/javascript"></script><script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js" type="text/javascript"></script><script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js" type="text/javascript"></script><link href="http://alexgorbatchev.com/pub/sh/current/styles/shCore.css" rel="stylesheet" type="text/css"><link href="http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css" rel="stylesheet" type="text/css"><script type="text/javascript">
-            SyntaxHighlighter.all();
-        </script><div class="section">
-        <p>
-            Like sliders, scroll bars allow the user to interactively select from a range of values.
-            Unlike sliders, scroll bars are used to select a sub-range rather than an individual
-            value. The size of this sub-range is known as the scroll bar's "extent". The extent,
-            together with the start and end values of the outer range, comprise the scroll bar's
-            "scope", represented by the <tt>ScrollBar.Scope</tt> enum.
-        </p>
-
-        <p>
-            Visually, a scroll bar is usually presented as a scroll "handle" (sometimes called the
-            "thumb") within a larger "track", with two buttons on either end of the track to move
-            the handle. The track represents the outer range from which the user can select, and
-            the size of the handle represents the scroll bar's extent.
-        </p>
-
-        <p>
-            A scroll bar's value represents the start of the selected sub-range; its value plus its
-            extent represents the end of the sub-range. Using the visual metaphor above, the start
-            of the handle and the end of the handle represent the bounds of the selected sub-range.
-            Note that this means that the scroll bar's value plus its extend must never exceed its
-            scope; doing so would mean that the scroll bar's handle would have moved outside of the
-            track.
-        </p>
-
-        <p>
-            Finally, a scroll bar has a unit increment and a block increment. These values specify
-            how much to adjust the scroll bar's value when a user clicks on the buttons or within
-            the track, respectively.
-        </p>
-
-        <p>
-            Scroll bars are used within <a href="scroll-panes.html">scroll panes</a> and are most
-            often transparent to the application developer. However, they can be used directly just
-            like any other components. The following application uses a scroll bar to represent a
-            simple timeline.
-        </p>
-
-        <script src="http://java.com/js/deployJava.js" type="text/javascript"></script><script type="text/javascript">
-
-            var attributes = {
-                code:"org.apache.pivot.wtk.BrowserApplicationContext$HostApplet",
-                width:"550",
-                height:"200"
-            };
-
-
-
-
-
-            var libraries = [];
-            libraries.push("/lib/pivot-core-2.0.jar");
-                libraries.push("/lib/pivot-wtk-2.0.jar");
-                libraries.push("/lib/pivot-wtk-terra-2.0.jar");
-                libraries.push("/lib/pivot-tutorials-2.0.jar");
-
-                    libraries.push("/lib/svgSalamander-tiny.jar");
-
-
-            attributes.archive = libraries.join(",");
-
-
-            var parameters = {
-                codebase_lookup:false,
-                application_class_name:'org.apache.pivot.wtk.ScriptApplication'
-            };
-
-
-            var javaArguments = ["-Dsun.awt.noerasebackground=true",
-                "-Dsun.awt.erasebackgroundonresize=true"];
-
-
-
-            parameters.java_arguments = javaArguments.join(" ");
-
-
-
-                var startupProperties = [];
-
-                    startupProperties.push("src=/org/apache/pivot/tutorials/boundedrange/scroll_bars.bxml");
-
-                parameters.startup_properties = startupProperties.join("&");
-
-
-            deployJava.runApplet(attributes, parameters, "1.6");
-        </script>
-
-        <p>
-            The BXML source for this example is shown below:
-        </p>
-
-        <pre class="brush:xml">
-
-            &lt;Window title="Scroll Bars" maximized="true"
-                WindowStateListener.windowOpened="init();"
-                xmlns:bxml="http://pivot.apache.org/bxml"
-                xmlns="org.apache.pivot.wtk"&gt;
-                &lt;bxml:script src="scroll_bars.js"/&gt;
-
-                &lt;Border&gt;
-                    &lt;TablePane&gt;
-                        &lt;columns&gt;
-                            &lt;TablePane.Column width="1*"/&gt;
-                        &lt;/columns&gt;
-
-                        &lt;TablePane.Row&gt;
-                            &lt;FlowPane styles="{padding:6}"&gt;
-                                &lt;bxml:define&gt;
-                                    &lt;ButtonGroup bxml:id="ranges"
-                                        ButtonGroupListener.selectionChanged="updateRange();"/&gt;
-                                &lt;/bxml:define&gt;
-                                &lt;RadioButton bxml:id="dayButton"
-                                    buttonGroup="$ranges" buttonData="Day"/&gt;
-                                &lt;RadioButton bxml:id="weekButton"
-                                    buttonGroup="$ranges" buttonData="Week"/&gt;
-                                &lt;RadioButton bxml:id="fortnightButton"
-                                    buttonGroup="$ranges" buttonData="Fortnight"/&gt;
-                                &lt;RadioButton bxml:id="monthButton"
-                                    buttonGroup="$ranges" buttonData="Month"/&gt;
-                            &lt;/FlowPane&gt;
-                        &lt;/TablePane.Row&gt;
-                        &lt;TablePane.Row height="1*"&gt;
-                            &lt;BoxPane orientation="vertical" styles="{horizontalAlignment:'center',
-                                verticalAlignment:'center'}"&gt;
-                                &lt;Label bxml:id="label"/&gt;
-                            &lt;/BoxPane&gt;
-                        &lt;/TablePane.Row&gt;
-                        &lt;TablePane.Row&gt;
-                            &lt;ScrollBar bxml:id="scrollBar" start="0" end="60"
-                                ScrollBarListener.scopeChanged="updateLabel();"
-                                ScrollBarValueListener.valueChanged="updateLabel();"/&gt;
-                        &lt;/TablePane.Row&gt;
-                    &lt;/TablePane&gt;
-                &lt;/Border&gt;
-            &lt;/Window&gt;
-
-        </pre>
-
-        <p>
-            This example places the script code in an external JavaScript file,
-            <tt>scroll_bars.js</tt> for readability. The source of the JavaScript is as follows:
-        </p>
-
-        <pre class="brush:js">
-
-            /**
-             * Called when the main app window is opened.
-             */
-            function init() {
-                ranges.selection = weekButton;
-            }
-
-            /**
-             * Updates the scroll bar's extent and block increment based on the selected
-             * range (in the ranges button group).
-             */
-            function updateRange() {
-                var amount;
-
-                if (ranges.selection == dayButton) {
-                    amount = 1;
-                } else if (ranges.selection == weekButton) {
-                    amount = 7;
-                } else if (ranges.selection == fortnightButton) {
-                    amount = 14;
-                } else {
-                    amount = 30;
-                }
-
-                scrollBar.extent = scrollBar.unitIncrement = amount;
-                scrollBar.blockIncrement = 2 * amount;
-            }
-
-            /**
-             * Updates the "timeline" label based on the scroll bar's value and extent.
-             */
-            function updateLabel() {
-                var first = scrollBar.value + 1;
-                var last = scrollBar.value + scrollBar.extent;
-                label.setText("Days " + first + " through " + last);
-            }
-
-        </pre>
-
-        <p>
-            Since this application is written entirely in BXML and script, there is no associated
-            Java source.
-        </p>
-    </div><p>Next: <a href="spinners.html">Spinners</a></p></div></div></div><div class="group" id="footer"><div class="footerLogo">Copyright (c) 1999-2011<br>The Apache Software Foundation.</div><div class="footerLinks"><ul class="footerMenuGr"><li><strong>Demos</strong><ul><li><a href="/demos/kitchen-sink.html" target="_new">"Kitchen Sink"</a></li><li><a href="/demos/component-explorer.html" target="_new">Component Explorer</a></li><li><a href="http://ixnay.biz/pivot-jfree-demos/charts_demo.html" target="_new">Charting</a></li><li><a href="/demos/">More Demos</a></li></ul></li><li><strong>Documentation</strong><ul><li><a href="/getting-started.html">Getting Started</a></li><li><a href="/tutorials/">Tutorial</a></li><li><a href="/faq.html">FAQ</a></li><li><a href="/2.0/docs/api/">Javadoc (2.0)</a></li></ul></li><li><strong>Get Involved</strong><ul><li><a href="/svn.html">SVN Repositories</a></li><li><a href="/lists.html">Mailing Lists</a></li><li><a href="http://issues.apac
 he.org/jira/browse/PIVOT">Bug Database</a></li><li><a href="http://cwiki.apache.org/PIVOT/">Wiki</a></li></ul></li><li><strong>Related</strong><ul><li><a href="http://code.google.com/p/pivot-jfree/">JFreeChart Provider</a></li></ul></li><li><strong>About</strong><ul><li><a href="/who-we-are.html">Who We Are</a></li><li><a href="/contact.html">Contact</a></li><li><a href="/news.html">News</a></li><li><a href="/legal.html">Legal/License</a></li></ul></li></ul></div></div></div></body></html>
\ No newline at end of file
+--><html xmlns="http://www.w3.org/1999/xhtml"><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Scroll Bars | Apache Pivot</title><link href="/styles/pivot.css" rel="stylesheet" type="text/css"><script type="text/javascript">
+                var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+                document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+                </script><script type="text/javascript">
+                try {
+                var pageTracker = _gat._getTracker("UA-7977275-3");
+                pageTracker._trackPageview();
+                } catch(err) {}</script></head><body><div id="wrapper"><div id="main"><div id="header"><div xmlns="" class="logo"><a href="/index.html"><img src="/images/logo.png" alt="Apache Pivot" title="Apache Pivot Homepage"></a></div><div class="tagline"><img src="/images/tagline.png" alt="Rich Internet Applications in Java" style="visibility:hidden"></div><ul class="navi"><li><a href="/demos/">Demos</a></li><li><a href="/download.cgi#2.0.1">Download</a></li><li><a href="/tutorials/">Tutorial</a></li><li><a href="/get-involved.html">Get Involved</a></li><li><a href="/about.html">About</a></li></ul></div><div id="contentBase" class="group"><h1>Scroll Bars</h1><ul class="naviLeft"><li><a href="/tutorials/sample-application.html">Sample Application</a></li><li><a href="/tutorials/platform-overview.html">Platform Overview</a></li><li><a href="/tutorials/hello-world.html">Hello, World!</a></li><li><a href="/tutorials/hello-bxml.html">Hello, BXML!</a></li><li><a href="/tutori
 als/component-and-container.html">Component &amp; Container</a></li><li><a href="/tutorials/labels-and-image-views.html">Labels &amp; Image Views</a></li><li><a href="/tutorials/svg-images.html">SVG Images</a></li><li><a href="/tutorials/buttons.html">Buttons</a></li><li><a href="/tutorials/push-buttons.html">Push Buttons</a></li><li><a href="/tutorials/toggle-buttons.html">Toggle Buttons</a></li><li><a href="/tutorials/radio-buttons.html">Radio Buttons</a></li><li><a href="/tutorials/checkboxes.html">Checkboxes</a></li><li><a href="/tutorials/link-buttons.html">Link Buttons</a></li><li><a href="/tutorials/lists.html">Lists</a></li><li><a href="/tutorials/list-buttons.html">List Buttons</a></li><li><a href="/tutorials/repeatable-list-buttons.html">Repeatable List Buttons</a></li><li><a href="/tutorials/text.html">Text</a></li><li><a href="/tutorials/suggestion-popups.html">Suggestion Popups</a></li><li><a href="/tutorials/text-areas.html">Text Areas</a></li><li><a href="/tut
 orials/separators.html">Separators</a></li><li><a href="/tutorials/layout-containers.html">Layout Containers</a></li><li><a href="/tutorials/flow-panes.html">Flow Panes</a></li><li><a href="/tutorials/box-panes.html">Box Panes</a></li><li><a href="/tutorials/fill-panes.html">Fill Panes</a></li><li><a href="/tutorials/grid-panes.html">Grid Panes</a></li><li><a href="/tutorials/table-panes.html">Table Panes</a></li><li><a href="/tutorials/borders.html">Borders</a></li><li><a href="/tutorials/stack-panes.html">Stack Panes</a></li><li><a href="/tutorials/split-panes.html">Split Panes</a></li><li><a href="/tutorials/forms.html">Forms</a></li><li><a href="/tutorials/panels.html">Panels</a></li><li><a href="/tutorials/navigation-containers.html">Navigation Containers</a></li><li><a href="/tutorials/card-panes.html">Card Panes</a></li><li><a href="/tutorials/tab-panes.html">Tab Panes</a></li><li><a href="/tutorials/accordions.html">Accordions</a></li><li><a href="/tutorials/expander
 s.html">Expanders</a></li><li><a href="/tutorials/rollups.html">Rollups</a></li><li><a href="/tutorials/viewports.html">Viewports</a></li><li><a href="/tutorials/scroll-panes.html">Scroll Panes</a></li><li><a href="/tutorials/panoramas.html">Panoramas</a></li><li><a href="/tutorials/progress-indicators.html">Progress Indicators</a></li><li><a href="/tutorials/meters.html">Meters</a></li><li><a href="/tutorials/activity-indicators.html">Activity Indicators</a></li><li><a href="/tutorials/bounded-range-components.html">Bounded Range Components</a></li><li><a href="/tutorials/sliders.html">Sliders</a></li><li><a href="/tutorials/scroll-bars.html">Scroll Bars</a></li><li><a href="/tutorials/spinners.html">Spinners</a></li><li><a href="/tutorials/calendars.html">Calendars</a></li><li><a href="/tutorials/menus.html">Menus</a></li><li><a href="/tutorials/context-menus.html">Context Menus</a></li><li><a href="/tutorials/menu-bars.html">Menu Bars</a></li><li><a href="/tutorials/menu-
 buttons.html">Menu Buttons</a></li><li><a href="/tutorials/color-choosers.html">Color Choosers</a></li><li><a href="/tutorials/table-views.html">Table Views</a></li><li><a href="/tutorials/table-views.json.html">JSON-based TableView</a></li><li><a href="/tutorials/table-views.custom.html">Custom TableView</a></li><li><a href="/tutorials/tree-views.html">Tree Views</a></li><li><a href="/tutorials/file-browsing.html">File Browsing</a></li><li><a href="/tutorials/windows.html">Windows</a></li><li><a href="/tutorials/clipboard.html">Clipboard</a></li><li><a href="/tutorials/drag-and-drop.html">Drag and Drop</a></li><li><a href="/tutorials/effects.html">Effects</a></li><li><a href="/tutorials/effects.transitions.html">Transitions</a></li><li><a href="/tutorials/data-binding.html">Data Binding</a></li><li><a href="/tutorials/property-binding.html">Property Binding</a></li><li><a href="/tutorials/localization.html">Localization</a></li><li><a href="/tutorials/background-tasks.html"
 >Background Tasks</a></li><li><a href="/tutorials/web-queries.html">Web Queries</a></li><li><a href="/tutorials/query-servlet.html">QueryServlet</a></li><li><a href="/tutorials/scripting.html">Scripting</a></li><li><a href="/tutorials/summary.html">Summary</a></li><li><a href="/tutorials/stock-tracker.html">The "Stock Tracker" Application</a></li><li><a href="/tutorials/stock-tracker.ui.html">UI Markup Using BXML</a></li><li><a href="/tutorials/stock-tracker.events.html">Event Handling</a></li><li><a href="/tutorials/stock-tracker.web-queries.html">Web Queries</a></li><li><a href="/tutorials/stock-tracker.data-binding.html">Data Binding</a></li><li><a href="/tutorials/stock-tracker.localization.html">Localization</a></li><li><a href="/tutorials/bxml-primer.html">BXML Primer</a></li></ul><div class="content"><style type="text/css">
+            applet {
+                border: 1px solid #999999;
+            }
+        </style><!--NOTE: Syntax highlighting script is LGPL--><script type="text/javascript" src="http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js"></script><script type="text/javascript" src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js"></script><script type="text/javascript" src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js"></script><script type="text/javascript" src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js"></script><link type="text/css" rel="stylesheet" href="http://alexgorbatchev.com/pub/sh/current/styles/shCore.css"><link type="text/css" rel="stylesheet" href="http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css"><script type="text/javascript">
+            SyntaxHighlighter.all();
+        </script><div class="section">
+        <p>
+            Like sliders, scroll bars allow the user to interactively select from a range of values.
+            Unlike sliders, scroll bars are used to select a sub-range rather than an individual
+            value. The size of this sub-range is known as the scroll bar's "extent". The extent,
+            together with the start and end values of the outer range, comprise the scroll bar's
+            "scope", represented by the <tt>ScrollBar.Scope</tt> enum.
+        </p>
+
+        <p>
+            Visually, a scroll bar is usually presented as a scroll "handle" (sometimes called the
+            "thumb") within a larger "track", with two buttons on either end of the track to move
+            the handle. The track represents the outer range from which the user can select, and
+            the size of the handle represents the scroll bar's extent.
+        </p>
+
+        <p>
+            A scroll bar's value represents the start of the selected sub-range; its value plus its
+            extent represents the end of the sub-range. Using the visual metaphor above, the start
+            of the handle and the end of the handle represent the bounds of the selected sub-range.
+            Note that this means that the scroll bar's value plus its extend must never exceed its
+            scope; doing so would mean that the scroll bar's handle would have moved outside of the
+            track.
+        </p>
+
+        <p>
+            Finally, a scroll bar has a unit increment and a block increment. These values specify
+            how much to adjust the scroll bar's value when a user clicks on the buttons or within
+            the track, respectively.
+        </p>
+
+        <p>
+            Scroll bars are used within <a href="scroll-panes.html">scroll panes</a> and are most
+            often transparent to the application developer. However, they can be used directly just
+            like any other components. The following application uses a scroll bar to represent a
+            simple timeline.
+        </p>
+
+        <script type="text/javascript" src="http://java.com/js/deployJava.js"></script><script type="text/javascript">
+            
+            var attributes = {
+                code:"org.apache.pivot.wtk.BrowserApplicationContext$HostApplet",
+                width:"550",
+                height:"200"
+            };
+
+            
+            
+
+            
+            var libraries = [];
+            libraries.push("/lib/pivot-core-2.0.1.jar");
+                libraries.push("/lib/pivot-wtk-2.0.1.jar");
+                libraries.push("/lib/pivot-wtk-terra-2.0.1.jar");
+                libraries.push("/lib/pivot-tutorials-2.0.1.jar");
+                
+                    libraries.push("/lib/svgSalamander-tiny.jar");
+                
+
+            attributes.archive = libraries.join(",");
+
+            
+            var parameters = {
+                codebase_lookup:false,
+                application_class_name:'org.apache.pivot.wtk.ScriptApplication'
+            };
+
+            
+            var javaArguments = ["-Dsun.awt.noerasebackground=true",
+                "-Dsun.awt.erasebackgroundonresize=true"];
+
+            
+
+            parameters.java_arguments = javaArguments.join(" ");
+
+            
+            
+                var startupProperties = [];
+                
+                    startupProperties.push("src=/org/apache/pivot/tutorials/boundedrange/scroll_bars.bxml");
+                
+                parameters.startup_properties = startupProperties.join("&");
+            
+
+            deployJava.runApplet(attributes, parameters, "1.6");
+        </script>
+
+        <p>
+            The BXML source for this example is shown below:
+        </p>
+
+        <pre class="brush:xml">
+            
+            &lt;Window title="Scroll Bars" maximized="true"
+                WindowStateListener.windowOpened="init();"
+                xmlns:bxml="http://pivot.apache.org/bxml"
+                xmlns="org.apache.pivot.wtk"&gt;
+                &lt;bxml:script src="scroll_bars.js"/&gt;
+
+                &lt;Border&gt;
+                    &lt;TablePane&gt;
+                        &lt;columns&gt;
+                            &lt;TablePane.Column width="1*"/&gt;
+                        &lt;/columns&gt;
+
+                        &lt;TablePane.Row&gt;
+                            &lt;FlowPane styles="{padding:6}"&gt;
+                                &lt;bxml:define&gt;
+                                    &lt;ButtonGroup bxml:id="ranges"
+                                        ButtonGroupListener.selectionChanged="updateRange();"/&gt;
+                                &lt;/bxml:define&gt;
+                                &lt;RadioButton bxml:id="dayButton"
+                                    buttonGroup="$ranges" buttonData="Day"/&gt;
+                                &lt;RadioButton bxml:id="weekButton"
+                                    buttonGroup="$ranges" buttonData="Week"/&gt;
+                                &lt;RadioButton bxml:id="fortnightButton"
+                                    buttonGroup="$ranges" buttonData="Fortnight"/&gt;
+                                &lt;RadioButton bxml:id="monthButton"
+                                    buttonGroup="$ranges" buttonData="Month"/&gt;
+                            &lt;/FlowPane&gt;
+                        &lt;/TablePane.Row&gt;
+                        &lt;TablePane.Row height="1*"&gt;
+                            &lt;BoxPane orientation="vertical" styles="{horizontalAlignment:'center',
+                                verticalAlignment:'center'}"&gt;
+                                &lt;Label bxml:id="label"/&gt;
+                            &lt;/BoxPane&gt;
+                        &lt;/TablePane.Row&gt;
+                        &lt;TablePane.Row&gt;
+                            &lt;ScrollBar bxml:id="scrollBar" start="0" end="60"
+                                ScrollBarListener.scopeChanged="updateLabel();"
+                                ScrollBarValueListener.valueChanged="updateLabel();"/&gt;
+                        &lt;/TablePane.Row&gt;
+                    &lt;/TablePane&gt;
+                &lt;/Border&gt;
+            &lt;/Window&gt;
+            
+        </pre>
+
+        <p>
+            This example places the script code in an external JavaScript file,
+            <tt>scroll_bars.js</tt> for readability. The source of the JavaScript is as follows:
+        </p>
+
+        <pre class="brush:js">
+            
+            /**
+             * Called when the main app window is opened.
+             */
+            function init() {
+                ranges.selection = weekButton;
+            }
+
+            /**
+             * Updates the scroll bar's extent and block increment based on the selected
+             * range (in the ranges button group).
+             */
+            function updateRange() {
+                var amount;
+
+                if (ranges.selection == dayButton) {
+                    amount = 1;
+                } else if (ranges.selection == weekButton) {
+                    amount = 7;
+                } else if (ranges.selection == fortnightButton) {
+                    amount = 14;
+                } else {
+                    amount = 30;
+                }
+
+                scrollBar.extent = scrollBar.unitIncrement = amount;
+                scrollBar.blockIncrement = 2 * amount;
+            }
+
+            /**
+             * Updates the "timeline" label based on the scroll bar's value and extent.
+             */
+            function updateLabel() {
+                var first = scrollBar.value + 1;
+                var last = scrollBar.value + scrollBar.extent;
+                label.setText("Days " + first + " through " + last);
+            }
+            
+        </pre>
+
+        <p>
+            Since this application is written entirely in BXML and script, there is no associated
+            Java source.
+        </p>
+    </div><p>Next: <a href="spinners.html">Spinners</a></p></div></div></div><div id="footer" class="group"><div class="footerLogo">Copyright (c) 1999-2012<br>The Apache Software Foundation.</div><div class="footerLinks"><ul class="footerMenuGr"><li><strong>Demos</strong><ul><li><a href="/demos/kitchen-sink.html" target="_new">"Kitchen Sink"</a></li><li><a href="/demos/component-explorer.html" target="_new">Component Explorer</a></li><li><a href="http://cwiki.apache.org/confluence/display/PIVOT/Other+Demos" target="_new">Charting</a></li><li><a href="/demos/">More Demos</a></li></ul></li><li><strong>Documentation</strong><ul><li><a href="/getting-started.html">Getting Started</a></li><li><a href="/tutorials/">Tutorial</a></li><li><a href="/faq.html">FAQ</a></li><li><a href="/2.0.1/docs/api/">Javadoc (2.0.1)</a></li></ul></li><li><strong>Get Involved</strong><ul><li><a href="/svn.html">SVN Repositories</a></li><li><a href="/lists.html">Mailing Lists</a></li><li><a href="http:
 //issues.apache.org/jira/browse/PIVOT">Bug Database</a></li><li><a href="http://cwiki.apache.org/PIVOT/">Wiki</a></li></ul></li><li><strong>Related</strong><ul><li><a href="http://code.google.com/a/apache-extras.org/p/pivot-jfree/">JFreeChart Provider</a></li><li><a href="http://code.google.com/a/apache-extras.org/p/pivot-common/">Pivot-Common</a></li><li><a href="http://code.google.com/a/apache-extras.org/p/pivot-contrib/">Pivot-Contrib</a></li><li><a href="http://code.google.com/a/apache-extras.org/p/pivot-multilang/">Pivot-Multilang</a></li></ul></li><li><strong>About</strong><ul><li><a href="/who-we-are.html">Who We Are</a></li><li><a href="/contact.html">Contact</a></li><li><a href="http://cwiki.apache.org/confluence/display/PIVOT/News">News</a></li><li><a href="/legal.html">Legal/License</a></li></ul></li></ul></div><div class="footerLinks">
+                	Apache Pivot is a trademark of the Apache Software Foundation
+                </div></div></div></body></html>
\ No newline at end of file