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

svn commit: r819352 - in /incubator/pivot/trunk/tutorials: src/org/apache/pivot/tutorials/clipboard/ src/org/apache/pivot/tutorials/dragdrop/ src/org/apache/pivot/tutorials/drawing/ www/

Author: gbrown
Date: Sun Sep 27 17:19:26 2009
New Revision: 819352

URL: http://svn.apache.org/viewvc?rev=819352&view=rev
Log:
Initial work on clipboard and drag/drop tutorials.

Added:
    incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/clipboard/
    incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/clipboard/Clipboard.java
    incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/clipboard/clipboard.wtkx
    incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/dragdrop/
    incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/dragdrop/DragDrop.java
    incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/dragdrop/drag_drop.wtkx
Modified:
    incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/drawing/rotate_line.wtkd
    incubator/pivot/trunk/tutorials/www/index.html

Added: incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/clipboard/Clipboard.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/clipboard/Clipboard.java?rev=819352&view=auto
==============================================================================
--- incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/clipboard/Clipboard.java (added)
+++ incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/clipboard/Clipboard.java Sun Sep 27 17:19:26 2009
@@ -0,0 +1,57 @@
+/*
+ * 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.
+ */
+package org.apache.pivot.tutorials.clipboard;
+
+import org.apache.pivot.collections.Map;
+import org.apache.pivot.wtk.Application;
+import org.apache.pivot.wtk.DesktopApplicationContext;
+import org.apache.pivot.wtk.Display;
+import org.apache.pivot.wtk.Window;
+import org.apache.pivot.wtkx.WTKXSerializer;
+
+public class Clipboard implements Application {
+    private Window window = null;
+
+    @Override
+    public void startup(Display display, Map<String, String> properties) throws Exception {
+        WTKXSerializer wtkxSerializer = new WTKXSerializer();
+        window = (Window)wtkxSerializer.readObject(this, "clipboard.wtkx");
+
+        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(Clipboard.class, args);
+    }
+}

Added: incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/clipboard/clipboard.wtkx
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/clipboard/clipboard.wtkx?rev=819352&view=auto
==============================================================================
--- incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/clipboard/clipboard.wtkx (added)
+++ incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/clipboard/clipboard.wtkx Sun Sep 27 17:19:26 2009
@@ -0,0 +1,103 @@
+<?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="Clipboard" maximized="true"
+    xmlns:wtkx="http://pivot.apache.org/wtkx"
+    xmlns="org.apache.pivot.wtk">
+    <content>
+        <TablePane styles="{horizontalSpacing:2}">
+            <columns>
+                <TablePane.Column width="1*"/>
+                <TablePane.Column width="1*"/>
+            </columns>
+            <rows>
+                <TablePane.Row height="1*">
+                    <Border>
+                        <content>
+                            <TablePane>
+                                <columns>
+                                    <TablePane.Column width="1*"/>
+                                </columns>
+                                <rows>
+                                    <TablePane.Row height="1*">
+                                        <CardPane wtkx:id="copyImageCardPane">
+                                            <ImageView image="org/apache/pivot/tutorials/IMG_0725_2.jpg"/>
+                                            <ImageView image="org/apache/pivot/tutorials/IMG_0735_2.jpg"/>
+                                            <ImageView image="org/apache/pivot/tutorials/IMG_0767_2.jpg"/>
+                                        </CardPane>
+                                    </TablePane.Row>
+                                    <TablePane.Row height="-1">
+                                        <BoxPane orientation="vertical" styles="{fill:true}">
+                                            <BoxPane wtkx:id="copyImageButtonBoxPane"
+                                                styles="{horizontalAlignment:'center'}">
+                                                <wtkx:define>
+                                                    <ButtonGroup wtkx:id="copyImageButtonGroup">
+                                                        <buttonGroupListeners>
+                                                            <wtkx:script>
+                                                            <![CDATA[
+                                                            function selectionChanged(buttonGroup, previousSelection) {
+                                                                var index = copyImageButtonBoxPane.indexOf(buttonGroup.getSelection());
+                                                                copyImageCardPane.setSelectedIndex(index);
+                                                            }
+                                                            ]]>
+                                                            </wtkx:script>
+                                                        </buttonGroupListeners>
+                                                    </ButtonGroup>
+                                                </wtkx:define>
+
+                                                <PushButton buttonData="IMG_0725_2.jpg" toggleButton="true"
+                                                    buttonGroup="$copyImageButtonGroup" selected="true"/>
+                                                <PushButton buttonData="IMG_0735_2.jpg" toggleButton="true"
+                                                    buttonGroup="$copyImageButtonGroup"/>
+                                                <PushButton buttonData="IMG_0767_2.jpg" toggleButton="true"
+                                                    buttonGroup="$copyImageButtonGroup"/>
+                                            </BoxPane>
+
+                                            <BoxPane styles="{horizontalAlignment:'center'}">
+                                                <PushButton wtkx:id="copyButton" buttonData="Copy"/>
+                                            </BoxPane>
+                                        </BoxPane>
+                                    </TablePane.Row>
+                                </rows>
+                            </TablePane>
+                        </content>
+                    </Border>
+                    <Border>
+                        <content>
+                            <TablePane>
+                                <columns>
+                                    <TablePane.Column width="1*"/>
+                                </columns>
+                                <rows>
+                                    <TablePane.Row height="1*">
+                                        <ImageView wtkx:id="pasteImageView"/>
+                                    </TablePane.Row>
+                                    <TablePane.Row height="-1">
+                                        <BoxPane styles="{horizontalAlignment:'center'}">
+                                            <PushButton wtkx:id="pasteButton" buttonData="Paste"/>
+                                        </BoxPane>
+                                    </TablePane.Row>
+                                </rows>
+                            </TablePane>
+                        </content>
+                    </Border>
+                </TablePane.Row>
+            </rows>
+        </TablePane>
+    </content>
+</Window>

Added: incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/dragdrop/DragDrop.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/dragdrop/DragDrop.java?rev=819352&view=auto
==============================================================================
--- incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/dragdrop/DragDrop.java (added)
+++ incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/dragdrop/DragDrop.java Sun Sep 27 17:19:26 2009
@@ -0,0 +1,57 @@
+/*
+ * 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.
+ */
+package org.apache.pivot.tutorials.dragdrop;
+
+import org.apache.pivot.collections.Map;
+import org.apache.pivot.wtk.Application;
+import org.apache.pivot.wtk.DesktopApplicationContext;
+import org.apache.pivot.wtk.Display;
+import org.apache.pivot.wtk.Window;
+import org.apache.pivot.wtkx.WTKXSerializer;
+
+public class DragDrop implements Application {
+    private Window window = null;
+
+    @Override
+    public void startup(Display display, Map<String, String> properties) throws Exception {
+        WTKXSerializer wtkxSerializer = new WTKXSerializer();
+        window = (Window)wtkxSerializer.readObject(this, "drag_drop.wtkx");
+
+        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(DragDrop.class, args);
+    }
+}

Added: incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/dragdrop/drag_drop.wtkx
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/dragdrop/drag_drop.wtkx?rev=819352&view=auto
==============================================================================
--- incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/dragdrop/drag_drop.wtkx (added)
+++ incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/dragdrop/drag_drop.wtkx Sun Sep 27 17:19:26 2009
@@ -0,0 +1,24 @@
+<?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="Drag and Drop" maximized="true"
+    xmlns:wtkx="http://pivot.apache.org/wtkx"
+    xmlns="org.apache.pivot.wtk">
+    <content>
+    </content>
+</Window>

Modified: incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/drawing/rotate_line.wtkd
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/drawing/rotate_line.wtkd?rev=819352&r1=819351&r2=819352&view=diff
==============================================================================
Binary files - no diff available.

Modified: incubator/pivot/trunk/tutorials/www/index.html
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/www/index.html?rev=819352&r1=819351&r2=819352&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/www/index.html (original)
+++ incubator/pivot/trunk/tutorials/www/index.html Sun Sep 27 17:19:26 2009
@@ -149,7 +149,7 @@
 <a href="wtkx_primer.html">WTKX Primer</a><br>
 </p>
 
-<p>Readers who want a quicker introduction to the platform may prefer to jump directly to the <a href="stock_tracker.html">final section</a>, which walks through the implementation of a simple but practical sample application called Stock Tracker. Stock Tracker demonstrates a number of key features used by many "real world" applications, including UI markup, event handling, web queries, data binding, and localization, among others. An in-depth introduction to WTKX, Pivot's UI markup language, is provided in the <a href="wtkx_primer.html">WTKX Primer</a> section.</p>
+<p>Readers who want a quicker introduction to the platform may prefer to jump directly to the <a href="stock_tracker.html">final section</a>, which walks through the implementation of a simple but practical sample application called "Stock Tracker". Stock Tracker demonstrates a number of key features used by many "real world" applications, including UI markup, event handling, web queries, data binding, and localization, among others. Readers may also find it helpful to review the <a href="wtkx_primer.html">WTKX Primer</a> section, which provides an introduction to Pivot's markup language, before browsing the tutorials themsevles.</p>
 
 <p>All source code in this tutorial is governed by the <a href="http://www.apache.org/licenses/LICENSE-2.0.html">Apache License, Version 2.0</a>.</p>