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 2010/10/28 21:22:21 UTC

svn commit: r1028440 [2/2] - in /pivot/trunk: tests/src/org/apache/pivot/tests/ tutorials/src/org/apache/pivot/tutorials/ tutorials/src/org/apache/pivot/tutorials/buttons/ tutorials/src/org/apache/pivot/tutorials/clipboard/ tutorials/src/org/apache/piv...

Modified: pivot/trunk/tutorials/www/tab-panes.xml
URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/www/tab-panes.xml?rev=1028440&r1=1028439&r2=1028440&view=diff
==============================================================================
--- pivot/trunk/tutorials/www/tab-panes.xml (original)
+++ pivot/trunk/tutorials/www/tab-panes.xml Thu Oct 28 19:22:19 2010
@@ -93,7 +93,7 @@ limitations under the License.
 
                                     <BoxPane styles="{horizontalAlignment:'center', verticalAlignment:'center'}">
                                         <TabPane.tabData>
-                                            <content:ButtonData icon="org/apache/pivot/tutorials/bell.png"
+                                            <content:ButtonData icon="/org/apache/pivot/tutorials/bell.png"
                                                 text="Bell"/>
                                         </TabPane.tabData>
                                         <Border styles="{padding:2}">
@@ -104,7 +104,7 @@ limitations under the License.
 
                                     <BoxPane styles="{horizontalAlignment:'center', verticalAlignment:'center'}">
                                         <TabPane.tabData>
-                                            <content:ButtonData icon="org/apache/pivot/tutorials/clock.png"
+                                            <content:ButtonData icon="/org/apache/pivot/tutorials/clock.png"
                                                 text="Clock"/>
                                         </TabPane.tabData>
                                         <Border styles="{padding:2}">
@@ -115,7 +115,7 @@ limitations under the License.
 
                                     <BoxPane styles="{horizontalAlignment:'center', verticalAlignment:'center'}">
                                         <TabPane.tabData>
-                                            <content:ButtonData icon="org/apache/pivot/tutorials/house.png"
+                                            <content:ButtonData icon="/org/apache/pivot/tutorials/house.png"
                                                 text="House"/>
                                         </TabPane.tabData>
                                         <Border styles="{padding:2}">
@@ -126,7 +126,7 @@ limitations under the License.
 
                                     <BoxPane enabled="false">
                                         <TabPane.tabData>
-                                            <content:ButtonData icon="org/apache/pivot/tutorials/star.png"
+                                            <content:ButtonData icon="/org/apache/pivot/tutorials/star.png"
                                                 text="Star"/>
                                         </TabPane.tabData>
 

Modified: pivot/trunk/tutorials/www/text-areas.xml
URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/www/text-areas.xml?rev=1028440&r1=1028439&r2=1028440&view=diff
==============================================================================
--- pivot/trunk/tutorials/www/text-areas.xml (original)
+++ pivot/trunk/tutorials/www/text-areas.xml Thu Oct 28 19:22:19 2010
@@ -29,7 +29,7 @@ limitations under the License.
             The following application demonstrates the use of <tt>TextArea</tt>:
         </p>
 
-        <application class="org.apache.pivot.wtk.ScriptApplication" width="420" height="420">
+        <application class="org.apache.pivot.wtk.ScriptApplication" width="400" height="400">
             <libraries>
                 <library>core</library>
                 <library>wtk</library>

Modified: pivot/trunk/tutorials/www/text.xml
URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/www/text.xml?rev=1028440&r1=1028439&r2=1028440&view=diff
==============================================================================
--- pivot/trunk/tutorials/www/text.xml (original)
+++ pivot/trunk/tutorials/www/text.xml Thu Oct 28 19:22:19 2010
@@ -72,7 +72,7 @@ limitations under the License.
             The BXML source for this example is quite short, consisting of only a <tt>BoxPane</tt>,
             <tt>Label</tt>, and <tt>TextInput</tt>. Most of the demo's functionality is defined in
             the Java source, shown below. The application's constructor first establishes a sorted
-            list of state names. In <tt>startup()</tt>, the application attaches a
+            list of state names. In <tt>initialize()</tt>, the application attaches a
             <tt>TextInputCharacterListener</tt> to the text input. In the listener's
             <tt>charactersInserted()</tt> method, the handler attempts to identify the state whose
             name matches the entered text. If found, it is set as the text property of the text

Modified: pivot/trunk/tutorials/www/toggle-buttons.xml
URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/www/toggle-buttons.xml?rev=1028440&r1=1028439&r2=1028440&view=diff
==============================================================================
--- pivot/trunk/tutorials/www/toggle-buttons.xml (original)
+++ pivot/trunk/tutorials/www/toggle-buttons.xml Thu Oct 28 19:22:19 2010
@@ -52,13 +52,13 @@ limitations under the License.
                 <BoxPane styles="{padding:4, horizontalAlignment:'center',
                     verticalAlignment:'center'}">
                     <PushButton toggleButton="true">
-                        <content:ButtonData text="Anchor" icon="org/apache/pivot/tutorials/anchor.png"/>
+                        <content:ButtonData text="Anchor" icon="/org/apache/pivot/tutorials/anchor.png"/>
                     </PushButton>
                     <PushButton toggleButton="true">
-                        <content:ButtonData text="Cup" icon="org/apache/pivot/tutorials/cup.png"/>
+                        <content:ButtonData text="Cup" icon="/org/apache/pivot/tutorials/cup.png"/>
                     </PushButton>
                     <PushButton toggleButton="true">
-                        <content:ButtonData text="Star" icon="org/apache/pivot/tutorials/star.png"/>
+                        <content:ButtonData text="Star" icon="/org/apache/pivot/tutorials/star.png"/>
                     </PushButton>
                 </BoxPane>
             </Window>
@@ -74,11 +74,10 @@ limitations under the License.
         </p>
 
         <p>
-            Note also that the values of the "icon" attributes do not begin with an '@' symbol. In
-            BXML, image URLs are commonly specified with this prefix, to indicate that an image's
-            location is relative to the BXML source file currently being loaded. An image path
-            without an '@' prefix, such as those in this example, is generally treated as an
-            absolute location relative to the application's classpath.
+            Also note that the values of the "icon" attributes begin with a slash. This represents
+            a location relative to the application's classpath. If the file name began with an
+            '@' symbol instead, the value would represent a location relative to the BXML file
+            currently being loaded.
         </p>
 
         <p>

Modified: pivot/trunk/tutorials/www/tree-views.xml
URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/www/tree-views.xml?rev=1028440&r1=1028439&r2=1028440&view=diff
==============================================================================
--- pivot/trunk/tutorials/www/tree-views.xml (original)
+++ pivot/trunk/tutorials/www/tree-views.xml Thu Oct 28 19:22:19 2010
@@ -77,47 +77,47 @@ limitations under the License.
         <source type="xml" location="org/apache/pivot/tutorials/treeviews/tree_data.bxml">
             <![CDATA[
             <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 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 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"/>
+                    <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 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"/>
+                    <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 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>

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/ApplicationContext.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/ApplicationContext.java?rev=1028440&r1=1028439&r2=1028440&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/ApplicationContext.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/ApplicationContext.java Thu Oct 28 19:22:19 2010
@@ -1522,7 +1522,7 @@ public abstract class ApplicationContext
     public static void applyStylesheet(String resourceName) {
         ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
 
-        URL stylesheetLocation = classLoader.getResource(resourceName);
+        URL stylesheetLocation = classLoader.getResource(resourceName.substring(1));
         if (stylesheetLocation == null) {
             throw new RuntimeException("Unable to locate style sheet resource \"" + resourceName + "\".");
         }

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/ImageView.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/ImageView.java?rev=1028440&r1=1028439&r2=1028440&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/ImageView.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/ImageView.java Thu Oct 28 19:22:19 2010
@@ -272,7 +272,7 @@ public class ImageView extends Component
         }
 
         ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
-        setImage(classLoader.getResource(imageName));
+        setImage(classLoader.getResource(imageName.substring(1)));
     }
 
     /**

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/Keyboard.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/Keyboard.java?rev=1028440&r1=1028439&r2=1028440&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/Keyboard.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/Keyboard.java Thu Oct 28 19:22:19 2010
@@ -95,19 +95,19 @@ public final class Keyboard {
         public String toString() {
             int awtModifiers = 0x00;
 
-            if (isPressed(Modifier.META)) {
+            if (((modifiers & Modifier.META.getMask()) > 0)) {
                 awtModifiers |= KeyEvent.META_DOWN_MASK;
             }
 
-            if (isPressed(Modifier.CTRL)) {
+            if (((modifiers & Modifier.CTRL.getMask()) > 0)) {
                 awtModifiers |= KeyEvent.CTRL_DOWN_MASK;
             }
 
-            if (isPressed(Modifier.ALT)) {
+            if (((modifiers & Modifier.ALT.getMask()) > 0)) {
                 awtModifiers |= KeyEvent.ALT_DOWN_MASK;
             }
 
-            if (isPressed(Modifier.SHIFT)) {
+            if (((modifiers & Modifier.SHIFT.getMask()) > 0)) {
                 awtModifiers |= KeyEvent.SHIFT_DOWN_MASK;
             }
 

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/Window.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/Window.java?rev=1028440&r1=1028439&r2=1028440&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/Window.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/Window.java Thu Oct 28 19:22:19 2010
@@ -791,7 +791,7 @@ public class Window extends Container {
         }
 
         ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
-        setIcon(classLoader.getResource(iconName));
+        setIcon(classLoader.getResource(iconName.substring(1)));
     }
 
     public Component getContent() {

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ButtonData.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ButtonData.java?rev=1028440&r1=1028439&r2=1028440&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ButtonData.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ButtonData.java Thu Oct 28 19:22:19 2010
@@ -100,7 +100,7 @@ public class ButtonData {
         }
 
         ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
-        setIcon(classLoader.getResource(iconName));
+        setIcon(classLoader.getResource(iconName.substring(1)));
     }
 
     public String getText() {

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListItem.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListItem.java?rev=1028440&r1=1028439&r2=1028440&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListItem.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListItem.java Thu Oct 28 19:22:19 2010
@@ -100,7 +100,7 @@ public class ListItem {
         }
 
         ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
-        setIcon(classLoader.getResource(iconName));
+        setIcon(classLoader.getResource(iconName.substring(1)));
     }
 
     public String getText() {

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewHeaderData.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewHeaderData.java?rev=1028440&r1=1028439&r2=1028440&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewHeaderData.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewHeaderData.java Thu Oct 28 19:22:19 2010
@@ -99,7 +99,7 @@ public class TableViewHeaderData {
         }
 
         ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
-        setIcon(classLoader.getResource(iconName));
+        setIcon(classLoader.getResource(iconName.substring(1)));
     }
 
     public String getText() {

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeNode.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeNode.java?rev=1028440&r1=1028439&r2=1028440&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeNode.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeNode.java Thu Oct 28 19:22:19 2010
@@ -111,7 +111,7 @@ public class TreeNode {
         }
 
         ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
-        setIcon(classLoader.getResource(iconName));
+        setIcon(classLoader.getResource(iconName.substring(1)));
     }
 
     public String getText() {

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/effects/WatermarkDecorator.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/effects/WatermarkDecorator.java?rev=1028440&r1=1028439&r2=1028440&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/effects/WatermarkDecorator.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/effects/WatermarkDecorator.java Thu Oct 28 19:22:19 2010
@@ -239,7 +239,7 @@ public class WatermarkDecorator implemen
         }
 
         ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
-        setImage(classLoader.getResource(imageName));
+        setImage(classLoader.getResource(imageName.substring(1)));
     }
 
     /**

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/text/ImageNode.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/text/ImageNode.java?rev=1028440&r1=1028439&r2=1028440&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/text/ImageNode.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/text/ImageNode.java Thu Oct 28 19:22:19 2010
@@ -118,7 +118,7 @@ public class ImageNode extends Node {
         }
 
         ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
-        setImage(classLoader.getResource(imageName));
+        setImage(classLoader.getResource(imageName.substring(1)));
     }
 
     @Override