You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by tv...@apache.org on 2009/11/18 16:43:25 UTC

svn commit: r881805 - in /incubator/pivot/trunk/tutorials: src/org/apache/pivot/tutorials/treeviews/ src/org/apache/pivot/tutorials/treeviews/tree_data.wtkx src/org/apache/pivot/tutorials/treeviews/tree_views.wtkx www/tree_views.html

Author: tvolkert
Date: Wed Nov 18 15:43:24 2009
New Revision: 881805

URL: http://svn.apache.org/viewvc?rev=881805&view=rev
Log:
Added tree view tutorial app and stub web page

Added:
    incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/treeviews/
    incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/treeviews/tree_data.wtkx   (with props)
    incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/treeviews/tree_views.wtkx   (with props)
Modified:
    incubator/pivot/trunk/tutorials/www/tree_views.html

Added: incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/treeviews/tree_data.wtkx
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/treeviews/tree_data.wtkx?rev=881805&view=auto
==============================================================================
--- incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/treeviews/tree_data.wtkx (added)
+++ incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/treeviews/tree_data.wtkx Wed Nov 18 15:43:24 2009
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to you under the Apache License,
+Version 2.0 (the "License"); you may not use this file except in
+compliance with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+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.
+-->
+
+<TreeBranch xmlns="org.apache.pivot.wtk.content">
+    <TreeBranch text="Activity" icon="org/apache/pivot/tutorials/folder.png">
+        <TreeBranch text="Games" icon="org/apache/pivot/tutorials/folder.png">
+            <TreeNode text="Foosball" icon="org/apache/pivot/tutorials/page_white.png"/>
+            <TreeNode text="Ping Pong" icon="org/apache/pivot/tutorials/page_white.png"/>
+            <TreeNode text="Air Hockey" icon="org/apache/pivot/tutorials/page_white.png"/>
+        </TreeBranch>
+        <TreeBranch text="Sports" icon="org/apache/pivot/tutorials/folder.png">
+            <TreeNode text="Baseball" icon="org/apache/pivot/tutorials/page_white.png"/>
+            <TreeNode text="Basketball" icon="org/apache/pivot/tutorials/page_white.png"/>
+            <TreeNode text="Football" icon="org/apache/pivot/tutorials/page_white.png"/>
+            <TreeNode text="Ice Hockey" icon="org/apache/pivot/tutorials/page_white.png"/>
+            <TreeNode text="Soccer" icon="org/apache/pivot/tutorials/page_white.png"/>
+            <TreeNode text="Softball" icon="org/apache/pivot/tutorials/page_white.png"/>
+        </TreeBranch>
+        <TreeNode text="Camping" icon="org/apache/pivot/tutorials/page_white.png"/>
+        <TreeNode text="Skiing" icon="org/apache/pivot/tutorials/page_white.png"/>
+    </TreeBranch>
+    <TreeBranch text="Occasion" icon="org/apache/pivot/tutorials/folder.png">
+        <TreeBranch text="Holidays" icon="org/apache/pivot/tutorials/folder.png">
+            <TreeNode text="Christmas" icon="org/apache/pivot/tutorials/page_white.png"/>
+            <TreeNode text="Independence Day" icon="org/apache/pivot/tutorials/page_white.png"/>
+            <TreeNode text="Labor Day" icon="org/apache/pivot/tutorials/page_white.png"/>
+            <TreeNode text="New Year's Day" icon="org/apache/pivot/tutorials/page_white.png"/>
+            <TreeNode text="President's Day" icon="org/apache/pivot/tutorials/page_white.png"/>
+            <TreeNode text="Thanksgiving" icon="org/apache/pivot/tutorials/page_white.png"/>
+            <TreeNode text="Valentine's Day" icon="org/apache/pivot/tutorials/page_white.png"/>
+            <TreeNode text="Veteran's Day" icon="org/apache/pivot/tutorials/page_white.png"/>
+        </TreeBranch>
+        <TreeNode text="Anniversary" icon="org/apache/pivot/tutorials/page_white.png"/>
+        <TreeNode text="Birthday" icon="org/apache/pivot/tutorials/page_white.png"/>
+        <TreeNode text="Wedding" icon="org/apache/pivot/tutorials/page_white.png"/>
+    </TreeBranch>
+    <TreeBranch text="Location" icon="org/apache/pivot/tutorials/folder.png">
+        <TreeNode text="Africa" icon="org/apache/pivot/tutorials/folder.png"/>
+        <TreeNode text="Antarctica" icon="org/apache/pivot/tutorials/folder.png"/>
+        <TreeNode text="Asia" icon="org/apache/pivot/tutorials/folder.png"/>
+        <TreeNode text="Australia" icon="org/apache/pivot/tutorials/folder.png"/>
+        <TreeNode text="Europe" icon="org/apache/pivot/tutorials/folder.png"/>
+        <TreeNode text="North America" icon="org/apache/pivot/tutorials/folder.png"/>
+        <TreeBranch text="South America" icon="org/apache/pivot/tutorials/folder.png">
+            <TreeNode text="Peru" icon="org/apache/pivot/tutorials/page_white.png"/>
+        </TreeBranch>
+    </TreeBranch>
+</TreeBranch>

Propchange: incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/treeviews/tree_data.wtkx
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/treeviews/tree_data.wtkx
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/treeviews/tree_views.wtkx
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/treeviews/tree_views.wtkx?rev=881805&view=auto
==============================================================================
--- incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/treeviews/tree_views.wtkx (added)
+++ incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/treeviews/tree_views.wtkx Wed Nov 18 15:43:24 2009
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to you under the Apache License,
+Version 2.0 (the "License"); you may not use this file except in
+compliance with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+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.
+-->
+
+<Window title="Tree Views" maximized="true"
+    xmlns:wtkx="http://pivot.apache.org/wtkx"
+    xmlns="org.apache.pivot.wtk">
+    <content>
+        <SplitPane orientation="horizontal" splitRatio="0.5">
+            <left>
+                <Border>
+                    <content>
+                        <ScrollPane horizontalScrollBarPolicy="fill_to_capacity">
+                            <view>
+                                <TreeView wtkx:id="treeView">
+                                    <treeData>
+                                        <wtkx:include src="tree_data.wtkx"/>
+                                    </treeData>
+                                </TreeView>
+                            </view>
+                        </ScrollPane>
+                    </content>
+                </Border>
+            </left>
+            <right>
+                <Border styles="{padding:{top:10}}">
+                    <content>
+                        <BoxPane styles="{horizontalAlignment:'right'}">
+                            <Form styles="{horizontalSpacing:18, rightAlignLabels:true}">
+                                <sections>
+                                    <Form.Section>
+                                        <ListButton wtkx:id="selectModeListButton"
+                                            Form.label="Select Mode"
+                                            listData="['None', 'Single', 'Multi']"
+                                            selectedIndex="1"
+                                            ListButtonSelectionListener.selectedIndexChanged="treeView.setSelectMode(selectModeListButton.getSelectedItem());"/>
+                                        <BoxPane Form.label="Flags" orientation="vertical"
+                                            styles="{spacing:10}">
+                                            <Checkbox wtkx:id="checkmarksEnabledButton"
+                                                buttonData="Checkmarks Enabled"
+                                                ButtonStateListener.stateChanged="treeView.setCheckmarksEnabled(checkmarksEnabledButton.isSelected());"/>
+                                            <Checkbox wtkx:id="showMixedCheckmarkStateButton"
+                                                buttonData="Show Mixed Checkmark State"
+                                                ButtonStateListener.stateChanged="treeView.setShowMixedCheckmarkState(showMixedCheckmarkStateButton.isSelected());"/>
+                                        </BoxPane>
+                                    </Form.Section>
+                                </sections>
+                            </Form>
+                        </BoxPane>
+                    </content>
+                </Border>
+            </right>
+        </SplitPane>
+    </content>
+</Window>

Propchange: incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/treeviews/tree_views.wtkx
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/treeviews/tree_views.wtkx
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: incubator/pivot/trunk/tutorials/www/tree_views.html
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/www/tree_views.html?rev=881805&r1=881804&r2=881805&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/www/tree_views.html (original)
+++ incubator/pivot/trunk/tutorials/www/tree_views.html Wed Nov 18 15:43:24 2009
@@ -33,7 +33,85 @@
 </head>
 <body>
 <h1>Tree Views</h1>
-<p>This section is not yet complete.</p>
+
+<p>TODO</p>
+
+<script src="version.js"></script>
+<script>
+var attributes = {code:"org.apache.pivot.wtk.BrowserApplicationContext$HostApplet",
+    archive:"lib/pivot-core-" + version + ".jar"
+        + ",lib/pivot-wtk-" + version + ".jar"
+        + ",lib/pivot-wtk-" + version + ".terra.jar"
+        + ",lib/pivot-tutorials-" + version + ".jar",
+    width:320,
+    height:240
+};
+var parameters = {application_class_name:"org.apache.pivot.wtk.ScriptApplication",
+    codebase_lookup:false,
+    java_arguments:"-Dsun.awt.noerasebackground=true -Dsun.awt.erasebackgroundonresize=true",
+    startup_properties:"src=org/apache/pivot/tutorials/treeviews/tree_views.wtkx"
+};
+deployJava.writeAppletTag(attributes, parameters);
+</script>
+
+<p>The WTKX for this example is shown below:</p>
+
+<pre class="brush:xml">
+&lt;Window title="Tree Views" maximized="true"
+    xmlns:wtkx="http://pivot.apache.org/wtkx"
+    xmlns="org.apache.pivot.wtk"&gt;
+    &lt;content&gt;
+        &lt;SplitPane orientation="horizontal" splitRatio="0.5"&gt;
+            &lt;left&gt;
+                &lt;Border&gt;
+                    &lt;content&gt;
+                        &lt;ScrollPane horizontalScrollBarPolicy="fill_to_capacity"&gt;
+                            &lt;view&gt;
+                                &lt;TreeView wtkx:id="treeView"&gt;
+                                    &lt;treeData&gt;
+                                        &lt;wtkx:include src="tree_data.wtkx"/&gt;
+                                    &lt;/treeData&gt;
+                                &lt;/TreeView&gt;
+                            &lt;/view&gt;
+                        &lt;/ScrollPane&gt;
+                    &lt;/content&gt;
+                &lt;/Border&gt;
+            &lt;/left&gt;
+            &lt;right&gt;
+                &lt;Border styles="{padding:{top:10}}"&gt;
+                    &lt;content&gt;
+                        &lt;BoxPane styles="{horizontalAlignment:'right'}"&gt;
+                            &lt;Form styles="{horizontalSpacing:18, rightAlignLabels:true}"&gt;
+                                &lt;sections&gt;
+                                    &lt;Form.Section&gt;
+                                        &lt;ListButton wtkx:id="selectModeListButton"
+                                            Form.label="Select Mode"
+                                            listData="['None', 'Single', 'Multi']"
+                                            selectedIndex="1"
+                                            ListButtonSelectionListener.selectedIndexChanged="treeView.setSelectMode(selectModeListButton.getSelectedItem());"/&gt;
+                                        &lt;BoxPane Form.label="Flags" orientation="vertical"
+                                            styles="{spacing:10}"&gt;
+                                            &lt;Checkbox wtkx:id="checkmarksEnabledButton"
+                                                buttonData="Checkmarks Enabled"
+                                                ButtonStateListener.stateChanged="treeView.setCheckmarksEnabled(checkmarksEnabledButton.isSelected());"/&gt;
+                                            &lt;Checkbox wtkx:id="showMixedCheckmarkStateButton"
+                                                buttonData="Show Mixed Checkmark State"
+                                                ButtonStateListener.stateChanged="treeView.setShowMixedCheckmarkState(showMixedCheckmarkStateButton.isSelected());"/&gt;
+                                        &lt;/BoxPane&gt;
+                                    &lt;/Form.Section&gt;
+                                &lt;/sections&gt;
+                            &lt;/Form&gt;
+                        &lt;/BoxPane&gt;
+                    &lt;/content&gt;
+                &lt;/Border&gt;
+            &lt;/right&gt;
+        &lt;/SplitPane&gt;
+    &lt;/content&gt;
+&lt;/Window&gt;
+</pre>
+
+<p>Since this example is written entirely in WTKX and script, there is no associated Java source.</p>
+
 <p>Next: <a href="file_browsing.html">File Browsing</a></p>
 </body>
 </html>