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/04/03 23:08:55 UTC

svn commit: r761796 - in /incubator/pivot/trunk/tutorials/src/pivot/tutorials: layout/Borders.java layout/borders.wtkx separators/ separators/Separators.java separators/separators.wtkx

Author: gbrown
Date: Fri Apr  3 21:08:55 2009
New Revision: 761796

URL: http://svn.apache.org/viewvc?rev=761796&view=rev
Log:
Add separator and border tutorials.

Added:
    incubator/pivot/trunk/tutorials/src/pivot/tutorials/layout/Borders.java
    incubator/pivot/trunk/tutorials/src/pivot/tutorials/layout/borders.wtkx
    incubator/pivot/trunk/tutorials/src/pivot/tutorials/separators/
    incubator/pivot/trunk/tutorials/src/pivot/tutorials/separators/Separators.java
    incubator/pivot/trunk/tutorials/src/pivot/tutorials/separators/separators.wtkx

Added: incubator/pivot/trunk/tutorials/src/pivot/tutorials/layout/Borders.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/src/pivot/tutorials/layout/Borders.java?rev=761796&view=auto
==============================================================================
--- incubator/pivot/trunk/tutorials/src/pivot/tutorials/layout/Borders.java (added)
+++ incubator/pivot/trunk/tutorials/src/pivot/tutorials/layout/Borders.java Fri Apr  3 21:08:55 2009
@@ -0,0 +1,46 @@
+/*
+ * 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 pivot.tutorials.layout;
+
+import pivot.collections.Dictionary;
+import pivot.wtk.Application;
+import pivot.wtk.Component;
+import pivot.wtk.Display;
+import pivot.wtk.Window;
+import pivot.wtkx.WTKXSerializer;
+
+public class Borders implements Application {
+    private Window window = null;
+
+    public void startup(Display display, Dictionary<String, String> properties) throws Exception {
+        WTKXSerializer wtkxSerializer = new WTKXSerializer();
+        window = new Window((Component)wtkxSerializer.readObject(getClass().getResource("borders.wtkx")));
+        window.setMaximized(true);
+        window.open(display);
+    }
+
+    public boolean shutdown(boolean optional) {
+        window.close();
+        return true;
+    }
+
+    public void suspend() {
+    }
+
+    public void resume() {
+    }
+}

Added: incubator/pivot/trunk/tutorials/src/pivot/tutorials/layout/borders.wtkx
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/src/pivot/tutorials/layout/borders.wtkx?rev=761796&view=auto
==============================================================================
--- incubator/pivot/trunk/tutorials/src/pivot/tutorials/layout/borders.wtkx (added)
+++ incubator/pivot/trunk/tutorials/src/pivot/tutorials/layout/borders.wtkx Fri Apr  3 21:08:55 2009
@@ -0,0 +1,41 @@
+<?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.
+-->
+
+<TablePane styles="{horizontalSpacing:10}"
+    xmlns:wtkx="http://incubator.apache.org/pivot/wtkx/1.1" xmlns="pivot.wtk">
+    <columns>
+        <TablePane.Column width="1*"/>
+        <TablePane.Column width="1*"/>
+    </columns>
+    <rows>
+        <TablePane.Row height="1*">
+            <Border title="Border 1">
+                <content>
+                    <Label text="Default border with title"
+                        styles="{horizontalAlignment:'center', verticalAlignment:'center', wrapText:true}"/>
+                </content>
+            </Border>
+            <Border styles="{color:'#ff0000', titleColor:'#000000', thickness:10, cornerRadii:20}">
+                <content>
+                    <Label text="Custom border with 10-pixel thick red border, rounded corners, and no title"
+                        styles="{horizontalAlignment:'center', verticalAlignment:'center', wrapText:true}"/>
+                </content>
+            </Border>
+        </TablePane.Row>
+    </rows>
+</TablePane>

Added: incubator/pivot/trunk/tutorials/src/pivot/tutorials/separators/Separators.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/src/pivot/tutorials/separators/Separators.java?rev=761796&view=auto
==============================================================================
--- incubator/pivot/trunk/tutorials/src/pivot/tutorials/separators/Separators.java (added)
+++ incubator/pivot/trunk/tutorials/src/pivot/tutorials/separators/Separators.java Fri Apr  3 21:08:55 2009
@@ -0,0 +1,46 @@
+/*
+ * 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 pivot.tutorials.separators;
+
+import pivot.collections.Dictionary;
+import pivot.wtk.Application;
+import pivot.wtk.Component;
+import pivot.wtk.Display;
+import pivot.wtk.Window;
+import pivot.wtkx.WTKXSerializer;
+
+public class Separators implements Application {
+    private Window window = null;
+
+    public void startup(Display display, Dictionary<String, String> properties) throws Exception {
+        WTKXSerializer wtkxSerializer = new WTKXSerializer();
+        window = new Window((Component)wtkxSerializer.readObject(getClass().getResource("separators.wtkx")));
+        window.setMaximized(true);
+        window.open(display);
+    }
+
+    public boolean shutdown(boolean optional) {
+        window.close();
+        return true;
+    }
+
+    public void suspend() {
+    }
+
+    public void resume() {
+    }
+}

Added: incubator/pivot/trunk/tutorials/src/pivot/tutorials/separators/separators.wtkx
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/src/pivot/tutorials/separators/separators.wtkx?rev=761796&view=auto
==============================================================================
--- incubator/pivot/trunk/tutorials/src/pivot/tutorials/separators/separators.wtkx (added)
+++ incubator/pivot/trunk/tutorials/src/pivot/tutorials/separators/separators.wtkx Fri Apr  3 21:08:55 2009
@@ -0,0 +1,27 @@
+<?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.
+-->
+
+<FlowPane orientation="vertical" styles="{padding:4, spacing:10, horizontalAlignment:'justify'}"
+    xmlns:wtkx="http://incubator.apache.org/pivot/wtkx/1.1" xmlns="pivot.wtk">
+    <Separator heading="Section 1"/>
+    <Label text="This is the content of section 1."/>
+    <Separator heading="Section 2"/>
+    <Label text="This is the content of section 2."/>
+    <Separator heading="Section 3"/>
+    <Label text="This is the content of section 3."/>
+</FlowPane>