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/05/12 23:12:57 UTC

svn commit: r774091 - in /incubator/pivot/trunk/tutorials/src/pivot/tutorials: Demo.java demo.wtkx

Author: tvolkert
Date: Tue May 12 21:12:57 2009
New Revision: 774091

URL: http://svn.apache.org/viewvc?rev=774091&view=rev
Log:
Made tutorial demo include thw window in the WTKX file

Modified:
    incubator/pivot/trunk/tutorials/src/pivot/tutorials/Demo.java
    incubator/pivot/trunk/tutorials/src/pivot/tutorials/demo.wtkx

Modified: incubator/pivot/trunk/tutorials/src/pivot/tutorials/Demo.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/src/pivot/tutorials/Demo.java?rev=774091&r1=774090&r2=774091&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/src/pivot/tutorials/Demo.java (original)
+++ incubator/pivot/trunk/tutorials/src/pivot/tutorials/Demo.java Tue May 12 21:12:57 2009
@@ -362,6 +362,22 @@
 
             return Vote.APPROVE;
         }
+
+        private void initializeNumericSpinner(Spinner numericSpinner) {
+            NumericSpinnerData numericSpinnerData = new NumericSpinnerData(0, 256, 4);
+            numericSpinner.setSpinnerData(numericSpinnerData);
+            numericSpinner.setSelectedIndex(0);
+        }
+
+        private void initializeDateSpinner(Spinner dateSpinner) {
+            CalendarDate lowerBound = new CalendarDate(2008, 0, 0);
+            CalendarDate upperBound = new CalendarDate(2019, 11, 30);
+            CalendarDateSpinnerData spinnerData = new CalendarDateSpinnerData(lowerBound, upperBound);
+
+            CalendarDate today = new CalendarDate();
+            dateSpinner.setSpinnerData(spinnerData);
+            dateSpinner.setSelectedItem(today);
+        }
     }
 
     private class TablesRollupStateHandler extends RollupStateHandler {
@@ -660,22 +676,21 @@
     }
 
     private Display display = null;
-    private Window window = null;
 
-    @Load(name="demo.wtkx") private Component content;
-    @Bind(property="content") private Rollup buttonsRollup;
-    @Bind(property="content") private Rollup listsRollup;
-    @Bind(property="content") private Rollup textRollup;
-    @Bind(property="content") private Rollup calendarsRollup;
-    @Bind(property="content") private Rollup navigationRollup;
-    @Bind(property="content") private Rollup splittersRollup;
-    @Bind(property="content") private Rollup menusRollup;
-    @Bind(property="content") private Rollup metersRollup;
-    @Bind(property="content") private Rollup spinnersRollup;
-    @Bind(property="content") private Rollup tablesRollup;
-    @Bind(property="content") private Rollup treesRollup;
-    @Bind(property="content") private Rollup dragDropRollup;
-    @Bind(property="content") private Rollup alertsRollup;
+    @Load(name="demo.wtkx") private Window window;
+    @Bind(property="window") private Rollup buttonsRollup;
+    @Bind(property="window") private Rollup listsRollup;
+    @Bind(property="window") private Rollup textRollup;
+    @Bind(property="window") private Rollup calendarsRollup;
+    @Bind(property="window") private Rollup navigationRollup;
+    @Bind(property="window") private Rollup splittersRollup;
+    @Bind(property="window") private Rollup menusRollup;
+    @Bind(property="window") private Rollup metersRollup;
+    @Bind(property="window") private Rollup spinnersRollup;
+    @Bind(property="window") private Rollup tablesRollup;
+    @Bind(property="window") private Rollup treesRollup;
+    @Bind(property="window") private Rollup dragDropRollup;
+    @Bind(property="window") private Rollup alertsRollup;
 
     public static void main(String[] args) {
         DesktopApplicationContext.main(Demo.class, args);
@@ -709,13 +724,9 @@
         dragDropRollup.getRollupStateListeners().add(new DragDropRollupStateHandler());
         alertsRollup.getRollupStateListeners().add(new AlertsRollupStateHandler());
 
-        window = new Window();
-        window.setTitle("Pivot Demo");
-        window.setMaximized(true);
-        window.setContent(content);
-
         window.open(display);
 
+        // Start with the "Buttons" rollup expanded
         ApplicationContext.scheduleCallback(new Runnable() {
             public void run() {
                 buttonsRollup.setExpanded(true);
@@ -723,23 +734,6 @@
         }, 0);
     }
 
-
-    private void initializeNumericSpinner(Spinner numericSpinner) {
-        NumericSpinnerData numericSpinnerData = new NumericSpinnerData(0, 256, 4);
-        numericSpinner.setSpinnerData(numericSpinnerData);
-        numericSpinner.setSelectedIndex(0);
-    }
-
-    private void initializeDateSpinner(Spinner dateSpinner) {
-        CalendarDate lowerBound = new CalendarDate(2008, 0, 0);
-        CalendarDate upperBound = new CalendarDate(2019, 11, 30);
-        CalendarDateSpinnerData spinnerData = new CalendarDateSpinnerData(lowerBound, upperBound);
-
-        CalendarDate today = new CalendarDate();
-        dateSpinner.setSpinnerData(spinnerData);
-        dateSpinner.setSelectedItem(today);
-    }
-
     public boolean shutdown(boolean optional) throws Exception {
         window.close();
         return true;

Modified: incubator/pivot/trunk/tutorials/src/pivot/tutorials/demo.wtkx
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/src/pivot/tutorials/demo.wtkx?rev=774091&r1=774090&r2=774091&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/src/pivot/tutorials/demo.wtkx (original)
+++ incubator/pivot/trunk/tutorials/src/pivot/tutorials/demo.wtkx Tue May 12 21:12:57 2009
@@ -16,87 +16,92 @@
 limitations under the License.
 -->
 
-<Border styles="{backgroundColor:10, thickness:0, padding:8}"
+<Window title="Pivot Demo"
+    maximized="true"
     xmlns:wtkx="http://incubator.apache.org/pivot/wtkx/1.1"
     xmlns:effects="pivot.wtk.effects"
     xmlns="pivot.wtk">
     <content>
-        <Border styles="{padding:0}">
+        <Border styles="{backgroundColor:10, thickness:0, padding:8}">
             <content>
-                <ScrollPane wtkx:id="scrollPane" styles="{backgroundColor:11}"
-                    horizontalScrollBarPolicy="auto"
-                    verticalScrollBarPolicy="auto">
-                    <view>
-                        <FlowPane orientation="vertical" styles="{padding:6}">
-                            <Rollup wtkx:id="buttonsRollup">
-                                <heading>
-                                    <Label text="Buttons" styles="{fontBold:true, fontSize:12, color:13}"/>
-                                </heading>
-                            </Rollup>
-                            <Rollup wtkx:id="listsRollup">
-                                <heading>
-                                    <Label text="Lists" styles="{fontBold:true, fontSize:12, color:13}"/>
-                                </heading>
-                            </Rollup>
-                            <Rollup wtkx:id="textRollup">
-                                <heading>
-                                    <Label text="Text" styles="{fontBold:true, fontSize:12, color:13}"/>
-                                </heading>
-                            </Rollup>
-                            <Rollup wtkx:id="calendarsRollup">
-                                <heading>
-                                    <Label text="Calendars" styles="{fontBold:true, fontSize:12, color:13}"/>
-                                </heading>
-                            </Rollup>
-                            <Rollup wtkx:id="navigationRollup">
-                                <heading>
-                                    <Label text="Navigation" styles="{fontBold:true, fontSize:12, color:13}"/>
-                                </heading>
-                            </Rollup>
-                            <Rollup wtkx:id="splittersRollup">
-                                <heading>
-                                    <Label text="Splitters" styles="{fontBold:true, fontSize:12, color:13}"/>
-                                </heading>
-                            </Rollup>
-                            <Rollup wtkx:id="menusRollup">
-                                <heading>
-                                    <Label text="Menus" styles="{fontBold:true, fontSize:12, color:13}"/>
-                                </heading>
-                            </Rollup>
-                            <Rollup wtkx:id="metersRollup">
-                                <heading>
-                                    <Label text="Meters &amp; Activity Indicators" styles="{fontBold:true, fontSize:12, color:13}"/>
-                                </heading>
-                            </Rollup>
-                            <Rollup wtkx:id="spinnersRollup">
-                                <heading>
-                                    <Label text="Spinners &amp; Sliders" styles="{fontBold:true, fontSize:12, color:13}"/>
-                                </heading>
-                            </Rollup>
-                            <Rollup wtkx:id="tablesRollup">
-                                <heading>
-                                    <Label text="Tables" styles="{fontBold:true, fontSize:12, color:13}"/>
-                                </heading>
-                            </Rollup>
-                            <Rollup wtkx:id="treesRollup">
-                                <heading>
-                                    <Label text="Trees" styles="{fontBold:true, fontSize:12, color:13}"/>
-                                </heading>
-                            </Rollup>
-                            <Rollup wtkx:id="dragDropRollup">
-                                <heading>
-                                    <Label text="Drag &amp; Drop" styles="{fontBold:true, fontSize:12, color:13}"/>
-                                </heading>
-                            </Rollup>
-                            <Rollup wtkx:id="alertsRollup">
-                                <heading>
-                                    <Label text="Alerts &amp; Prompts" styles="{fontBold:true, fontSize:12, color:13}"/>
-                                </heading>
-                            </Rollup>
-                        </FlowPane>
-                    </view>
-                </ScrollPane>
+                <Border styles="{padding:0}">
+                    <content>
+                        <ScrollPane wtkx:id="scrollPane" styles="{backgroundColor:11}"
+                            horizontalScrollBarPolicy="auto"
+                            verticalScrollBarPolicy="auto">
+                            <view>
+                                <FlowPane orientation="vertical" styles="{padding:6}">
+                                    <Rollup wtkx:id="buttonsRollup">
+                                        <heading>
+                                            <Label text="Buttons" styles="{fontBold:true, fontSize:12, color:13}"/>
+                                        </heading>
+                                    </Rollup>
+                                    <Rollup wtkx:id="listsRollup">
+                                        <heading>
+                                            <Label text="Lists" styles="{fontBold:true, fontSize:12, color:13}"/>
+                                        </heading>
+                                    </Rollup>
+                                    <Rollup wtkx:id="textRollup">
+                                        <heading>
+                                            <Label text="Text" styles="{fontBold:true, fontSize:12, color:13}"/>
+                                        </heading>
+                                    </Rollup>
+                                    <Rollup wtkx:id="calendarsRollup">
+                                        <heading>
+                                            <Label text="Calendars" styles="{fontBold:true, fontSize:12, color:13}"/>
+                                        </heading>
+                                    </Rollup>
+                                    <Rollup wtkx:id="navigationRollup">
+                                        <heading>
+                                            <Label text="Navigation" styles="{fontBold:true, fontSize:12, color:13}"/>
+                                        </heading>
+                                    </Rollup>
+                                    <Rollup wtkx:id="splittersRollup">
+                                        <heading>
+                                            <Label text="Splitters" styles="{fontBold:true, fontSize:12, color:13}"/>
+                                        </heading>
+                                    </Rollup>
+                                    <Rollup wtkx:id="menusRollup">
+                                        <heading>
+                                            <Label text="Menus" styles="{fontBold:true, fontSize:12, color:13}"/>
+                                        </heading>
+                                    </Rollup>
+                                    <Rollup wtkx:id="metersRollup">
+                                        <heading>
+                                            <Label text="Meters &amp; Activity Indicators" styles="{fontBold:true, fontSize:12, color:13}"/>
+                                        </heading>
+                                    </Rollup>
+                                    <Rollup wtkx:id="spinnersRollup">
+                                        <heading>
+                                            <Label text="Spinners &amp; Sliders" styles="{fontBold:true, fontSize:12, color:13}"/>
+                                        </heading>
+                                    </Rollup>
+                                    <Rollup wtkx:id="tablesRollup">
+                                        <heading>
+                                            <Label text="Tables" styles="{fontBold:true, fontSize:12, color:13}"/>
+                                        </heading>
+                                    </Rollup>
+                                    <Rollup wtkx:id="treesRollup">
+                                        <heading>
+                                            <Label text="Trees" styles="{fontBold:true, fontSize:12, color:13}"/>
+                                        </heading>
+                                    </Rollup>
+                                    <Rollup wtkx:id="dragDropRollup">
+                                        <heading>
+                                            <Label text="Drag &amp; Drop" styles="{fontBold:true, fontSize:12, color:13}"/>
+                                        </heading>
+                                    </Rollup>
+                                    <Rollup wtkx:id="alertsRollup">
+                                        <heading>
+                                            <Label text="Alerts &amp; Prompts" styles="{fontBold:true, fontSize:12, color:13}"/>
+                                        </heading>
+                                    </Rollup>
+                                </FlowPane>
+                            </view>
+                        </ScrollPane>
+                    </content>
+                </Border>
             </content>
         </Border>
     </content>
-</Border>
+</Window>