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/06/25 16:09:04 UTC

svn commit: r788361 - in /incubator/pivot/trunk: demos/src/org/apache/pivot/demos/itunes/ tutorials/src/org/apache/pivot/tutorials/ tutorials/src/org/apache/pivot/tutorials/lists/ wtk/src/org/apache/pivot/wtk/ wtk/src/org/apache/pivot/wtk/content/ wtk/...

Author: gbrown
Date: Thu Jun 25 14:09:04 2009
New Revision: 788361

URL: http://svn.apache.org/viewvc?rev=788361&view=rev
Log:
Throw TaskExecutionException from Image.load().

Modified:
    incubator/pivot/trunk/demos/src/org/apache/pivot/demos/itunes/SearchDemo.java
    incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/CustomTableRow.java
    incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/KitchenSink.java
    incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/lists/ListButtons.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Accordion.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/ImageView.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/TabPane.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Window.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ButtonData.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListItem.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewHeaderData.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeNode.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeViewFileRenderer.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/effects/WatermarkDecorator.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/media/Image.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTheme.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/text/ImageNode.java

Modified: incubator/pivot/trunk/demos/src/org/apache/pivot/demos/itunes/SearchDemo.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/demos/src/org/apache/pivot/demos/itunes/SearchDemo.java?rev=788361&r1=788360&r2=788361&view=diff
==============================================================================
--- incubator/pivot/trunk/demos/src/org/apache/pivot/demos/itunes/SearchDemo.java (original)
+++ incubator/pivot/trunk/demos/src/org/apache/pivot/demos/itunes/SearchDemo.java Thu Jun 25 14:09:04 2009
@@ -65,7 +65,7 @@
     public static final String MEDIA = "all";
     public static final int LIMIT = 100;
 
-    public SearchDemo() {
+    public SearchDemo() throws Exception {
         searchImage = Image.load(getClass().getResource("magnifier.png"));
         cancelImage = Image.load(getClass().getResource("cancel.png"));
     }

Modified: incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/CustomTableRow.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/CustomTableRow.java?rev=788361&r1=788360&r2=788361&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/CustomTableRow.java (original)
+++ incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/CustomTableRow.java Thu Jun 25 14:09:04 2009
@@ -18,6 +18,7 @@
 
 import java.net.URL;
 
+import org.apache.pivot.util.concurrent.TaskExecutionException;
 import org.apache.pivot.wtk.ApplicationContext;
 import org.apache.pivot.wtk.media.Image;
 
@@ -46,7 +47,12 @@
         Image b = (Image)ApplicationContext.getResourceCache().get(bURL);
 
         if (b == null) {
-            b = Image.load(bURL);
+            try {
+                b = Image.load(bURL);
+            } catch (TaskExecutionException exception) {
+                throw new RuntimeException(exception);
+            }
+
             ApplicationContext.getResourceCache().put(bURL, b);
         }
 

Modified: incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/KitchenSink.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/KitchenSink.java?rev=788361&r1=788360&r2=788361&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/KitchenSink.java (original)
+++ incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/KitchenSink.java Thu Jun 25 14:09:04 2009
@@ -30,6 +30,7 @@
 import org.apache.pivot.serialization.SerializationException;
 import org.apache.pivot.util.CalendarDate;
 import org.apache.pivot.util.Vote;
+import org.apache.pivot.util.concurrent.TaskExecutionException;
 import org.apache.pivot.wtk.Action;
 import org.apache.pivot.wtk.ActivityIndicator;
 import org.apache.pivot.wtk.Alert;
@@ -290,7 +291,12 @@
                         Image image = (Image)ApplicationContext.getResourceCache().get(imageURL);
 
                         if (image == null) {
-                            image = Image.load(imageURL);
+                            try {
+                                image = Image.load(imageURL);
+                            } catch (TaskExecutionException exception) {
+                                throw new RuntimeException(exception);
+                            }
+
                             ApplicationContext.getResourceCache().put(imageURL, image);
                         }
 

Modified: incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/lists/ListButtons.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/lists/ListButtons.java?rev=788361&r1=788360&r2=788361&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/lists/ListButtons.java (original)
+++ incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/lists/ListButtons.java Thu Jun 25 14:09:04 2009
@@ -19,6 +19,7 @@
 import java.net.URL;
 import org.apache.pivot.collections.Map;
 import org.apache.pivot.util.ThreadUtilities;
+import org.apache.pivot.util.concurrent.TaskExecutionException;
 import org.apache.pivot.wtk.Application;
 import org.apache.pivot.wtk.ApplicationContext;
 import org.apache.pivot.wtk.DesktopApplicationContext;
@@ -54,7 +55,12 @@
                 Image image = (Image)ApplicationContext.getResourceCache().get(imageURL);
 
                 if (image == null) {
-                    image = Image.load(imageURL);
+                    try {
+                        image = Image.load(imageURL);
+                    } catch (TaskExecutionException exception) {
+                        throw new RuntimeException(exception);
+                    }
+
                     ApplicationContext.getResourceCache().put(imageURL, image);
                 }
 

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Accordion.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Accordion.java?rev=788361&r1=788360&r2=788361&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Accordion.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Accordion.java Thu Jun 25 14:09:04 2009
@@ -25,6 +25,7 @@
 import org.apache.pivot.util.ListenerList;
 import org.apache.pivot.util.ThreadUtilities;
 import org.apache.pivot.util.Vote;
+import org.apache.pivot.util.concurrent.TaskExecutionException;
 import org.apache.pivot.wtk.media.Image;
 
 
@@ -332,7 +333,12 @@
         Image iconImage = (Image)ApplicationContext.getResourceCache().get(icon);
 
         if (iconImage == null) {
-            iconImage = Image.load(icon);
+            try {
+                iconImage = Image.load(icon);
+            } catch (TaskExecutionException exception) {
+                throw new IllegalArgumentException(exception);
+            }
+
             ApplicationContext.getResourceCache().put(icon, iconImage);
         }
 

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/ImageView.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/ImageView.java?rev=788361&r1=788360&r2=788361&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/ImageView.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/ImageView.java Thu Jun 25 14:09:04 2009
@@ -20,6 +20,7 @@
 
 import org.apache.pivot.util.ListenerList;
 import org.apache.pivot.util.ThreadUtilities;
+import org.apache.pivot.util.concurrent.TaskExecutionException;
 import org.apache.pivot.wtk.media.Image;
 
 
@@ -98,7 +99,11 @@
         }
 
         // TODO Support asynchronous loading?
-        setImage(Image.load(image));
+        try {
+            setImage(Image.load(image));
+        } catch (TaskExecutionException exception) {
+            throw new IllegalArgumentException(exception);
+        }
     }
 
     /**

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/TabPane.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/TabPane.java?rev=788361&r1=788360&r2=788361&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/TabPane.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/TabPane.java Thu Jun 25 14:09:04 2009
@@ -25,6 +25,7 @@
 import org.apache.pivot.util.ListenerList;
 import org.apache.pivot.util.ThreadUtilities;
 import org.apache.pivot.util.Vote;
+import org.apache.pivot.util.concurrent.TaskExecutionException;
 import org.apache.pivot.wtk.media.Image;
 
 
@@ -387,7 +388,12 @@
         Image iconImage = (Image)ApplicationContext.getResourceCache().get(icon);
 
         if (iconImage == null) {
-            iconImage = Image.load(icon);
+            try {
+                iconImage = Image.load(icon);
+            } catch (TaskExecutionException exception) {
+                throw new IllegalArgumentException(exception);
+            }
+
             ApplicationContext.getResourceCache().put(icon, iconImage);
         }
 

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Window.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Window.java?rev=788361&r1=788360&r2=788361&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Window.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Window.java Thu Jun 25 14:09:04 2009
@@ -26,6 +26,7 @@
 import org.apache.pivot.util.ListenerList;
 import org.apache.pivot.util.ThreadUtilities;
 import org.apache.pivot.util.Vote;
+import org.apache.pivot.util.concurrent.TaskExecutionException;
 import org.apache.pivot.wtk.media.Image;
 
 
@@ -581,7 +582,11 @@
             throw new IllegalArgumentException("icon is null.");
         }
 
-        setIcon(Image.load(icon));
+        try {
+            setIcon(Image.load(icon));
+        } catch (TaskExecutionException exception) {
+            throw new IllegalArgumentException(exception);
+        }
     }
 
     /**

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ButtonData.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ButtonData.java?rev=788361&r1=788360&r2=788361&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ButtonData.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ButtonData.java Thu Jun 25 14:09:04 2009
@@ -19,6 +19,7 @@
 import java.net.URL;
 
 import org.apache.pivot.util.ThreadUtilities;
+import org.apache.pivot.util.concurrent.TaskExecutionException;
 import org.apache.pivot.wtk.ApplicationContext;
 import org.apache.pivot.wtk.media.Image;
 
@@ -61,7 +62,12 @@
         Image icon = (Image)ApplicationContext.getResourceCache().get(iconURL);
 
         if (icon == null) {
-            icon = Image.load(iconURL);
+            try {
+                icon = Image.load(iconURL);
+            } catch (TaskExecutionException exception) {
+                throw new IllegalArgumentException(exception);
+            }
+
             ApplicationContext.getResourceCache().put(iconURL, icon);
         }
 

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListItem.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListItem.java?rev=788361&r1=788360&r2=788361&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListItem.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListItem.java Thu Jun 25 14:09:04 2009
@@ -19,6 +19,7 @@
 import java.net.URL;
 
 import org.apache.pivot.util.ThreadUtilities;
+import org.apache.pivot.util.concurrent.TaskExecutionException;
 import org.apache.pivot.wtk.ApplicationContext;
 import org.apache.pivot.wtk.media.Image;
 
@@ -61,7 +62,12 @@
         Image icon = (Image)ApplicationContext.getResourceCache().get(iconURL);
 
         if (icon == null) {
-            icon = Image.load(iconURL);
+            try {
+                icon = Image.load(iconURL);
+            } catch (TaskExecutionException exception) {
+                throw new IllegalArgumentException(exception);
+            }
+
             ApplicationContext.getResourceCache().put(iconURL, icon);
         }
 

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewHeaderData.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewHeaderData.java?rev=788361&r1=788360&r2=788361&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewHeaderData.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewHeaderData.java Thu Jun 25 14:09:04 2009
@@ -19,6 +19,7 @@
 import java.net.URL;
 
 import org.apache.pivot.util.ThreadUtilities;
+import org.apache.pivot.util.concurrent.TaskExecutionException;
 import org.apache.pivot.wtk.ApplicationContext;
 import org.apache.pivot.wtk.media.Image;
 
@@ -61,7 +62,12 @@
         Image icon = (Image)ApplicationContext.getResourceCache().get(iconURL);
 
         if (icon == null) {
-            icon = Image.load(iconURL);
+            try {
+                icon = Image.load(iconURL);
+            } catch (TaskExecutionException exception) {
+                throw new IllegalArgumentException(exception);
+            }
+
             ApplicationContext.getResourceCache().put(iconURL, icon);
         }
 

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeNode.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeNode.java?rev=788361&r1=788360&r2=788361&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeNode.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeNode.java Thu Jun 25 14:09:04 2009
@@ -19,6 +19,7 @@
 import java.net.URL;
 
 import org.apache.pivot.util.ThreadUtilities;
+import org.apache.pivot.util.concurrent.TaskExecutionException;
 import org.apache.pivot.wtk.ApplicationContext;
 import org.apache.pivot.wtk.media.Image;
 
@@ -61,7 +62,12 @@
         Image icon = (Image)ApplicationContext.getResourceCache().get(iconURL);
 
         if (icon == null) {
-            icon = Image.load(iconURL);
+            try {
+                icon = Image.load(iconURL);
+            } catch (TaskExecutionException exception) {
+                throw new IllegalArgumentException(exception);
+            }
+
             ApplicationContext.getResourceCache().put(iconURL, icon);
         }
 

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeViewFileRenderer.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeViewFileRenderer.java?rev=788361&r1=788360&r2=788361&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeViewFileRenderer.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeViewFileRenderer.java Thu Jun 25 14:09:04 2009
@@ -21,6 +21,7 @@
 import java.io.File;
 
 import org.apache.pivot.io.Folder;
+import org.apache.pivot.util.concurrent.TaskExecutionException;
 import org.apache.pivot.wtk.FlowPane;
 import org.apache.pivot.wtk.HorizontalAlignment;
 import org.apache.pivot.wtk.ImageView;
@@ -42,10 +43,17 @@
     public static final int ICON_WIDTH = 16;
     public static final int ICON_HEIGHT = 16;
 
-    private static final Image folderImage =
-        Image.load(TreeViewFileRenderer.class.getResource("folder.png"));
-    private static final Image fileImage =
-        Image.load(TreeViewFileRenderer.class.getResource("page_white.png"));
+    public static final Image FOLDER_IMAGE;
+    public static final Image FILE_IMAGE;
+
+    static {
+        try {
+            FOLDER_IMAGE = Image.load(TreeViewFileRenderer.class.getResource("folder.png"));
+            FILE_IMAGE = Image.load(TreeViewFileRenderer.class.getResource("page_white.png"));
+        } catch (TaskExecutionException exception) {
+            throw new RuntimeException(exception);
+        }
+    }
 
     public TreeViewFileRenderer() {
         super();
@@ -105,7 +113,7 @@
             File file = (File)node;
 
             // Update the image view
-            Image icon = (file instanceof Folder) ? folderImage : fileImage;
+            Image icon = (file instanceof Folder) ? FOLDER_IMAGE : FILE_IMAGE;
 
             imageView.setImage(icon);
             imageView.getStyles().put("opacity",

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/effects/WatermarkDecorator.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/effects/WatermarkDecorator.java?rev=788361&r1=788360&r2=788361&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/effects/WatermarkDecorator.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/effects/WatermarkDecorator.java Thu Jun 25 14:09:04 2009
@@ -23,6 +23,7 @@
 import java.net.URL;
 
 import org.apache.pivot.util.ThreadUtilities;
+import org.apache.pivot.util.concurrent.TaskExecutionException;
 import org.apache.pivot.wtk.Bounds;
 import org.apache.pivot.wtk.Component;
 import org.apache.pivot.wtk.FlowPane;
@@ -188,7 +189,11 @@
             throw new IllegalArgumentException("image is null.");
         }
 
-        setImage(Image.load(image));
+        try {
+            setImage(Image.load(image));
+        } catch (TaskExecutionException exception) {
+            throw new IllegalArgumentException(exception);
+        }
     }
 
     /**

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/media/Image.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/media/Image.java?rev=788361&r1=788360&r2=788361&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/media/Image.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/media/Image.java Thu Jun 25 14:09:04 2009
@@ -18,10 +18,12 @@
 
 import java.awt.image.BufferedImage;
 import java.io.BufferedInputStream;
+import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
 
 import org.apache.pivot.io.IOTask;
+import org.apache.pivot.serialization.SerializationException;
 import org.apache.pivot.util.ListenerList;
 import org.apache.pivot.util.concurrent.Dispatcher;
 import org.apache.pivot.util.concurrent.TaskExecutionException;
@@ -104,7 +106,9 @@
                         inputStream.close();
                     }
                 }
-            } catch(Exception exception) {
+            } catch (IOException exception) {
+                throw new TaskExecutionException(exception);
+            } catch (SerializationException exception) {
                 throw new TaskExecutionException(exception);
             }
 
@@ -122,17 +126,9 @@
         return imageListeners;
     }
 
-    public static Image load(URL url) {
+    public static Image load(URL url) throws TaskExecutionException {
         LoadTask loadTask = new LoadTask(url);
-
-        Image image = null;
-        try {
-            image = loadTask.execute();
-        } catch(TaskExecutionException exception) {
-            throw new RuntimeException(exception);
-        }
-
-        return image;
+        return loadTask.execute();
     }
 
     public static Image.LoadTask load(URL url, TaskListener<Image> loadListener) {

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTheme.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTheme.java?rev=788361&r1=788360&r2=788361&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTheme.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTheme.java Thu Jun 25 14:09:04 2009
@@ -26,6 +26,7 @@
 import org.apache.pivot.collections.Map;
 import org.apache.pivot.serialization.JSONSerializer;
 import org.apache.pivot.serialization.SerializationException;
+import org.apache.pivot.util.concurrent.TaskExecutionException;
 import org.apache.pivot.wtk.Accordion;
 import org.apache.pivot.wtk.ActivityIndicator;
 import org.apache.pivot.wtk.Alert;
@@ -304,7 +305,12 @@
             messageIcon = (Image)ApplicationContext.getResourceCache().get(location);
 
             if (messageIcon == null) {
-                messageIcon = Image.load(location);
+                try {
+                    messageIcon = Image.load(location);
+                } catch (TaskExecutionException exception) {
+                    throw new RuntimeException(exception);
+                }
+
                 ApplicationContext.getResourceCache().put(location, messageIcon);
             }
         }
@@ -357,7 +363,12 @@
             smallMessageIcon = (Image)ApplicationContext.getResourceCache().get(location);
 
             if (smallMessageIcon == null) {
-                smallMessageIcon = Image.load(location);
+                try {
+                    smallMessageIcon = Image.load(location);
+                } catch (TaskExecutionException exception) {
+                    throw new RuntimeException(exception);
+                }
+
                 ApplicationContext.getResourceCache().put(location, smallMessageIcon);
             }
         }

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/text/ImageNode.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/text/ImageNode.java?rev=788361&r1=788360&r2=788361&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/text/ImageNode.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/text/ImageNode.java Thu Jun 25 14:09:04 2009
@@ -20,6 +20,7 @@
 
 import org.apache.pivot.util.ListenerList;
 import org.apache.pivot.util.ThreadUtilities;
+import org.apache.pivot.util.concurrent.TaskExecutionException;
 import org.apache.pivot.wtk.media.Image;
 
 
@@ -81,7 +82,11 @@
             throw new IllegalArgumentException("image is null.");
         }
 
-        setImage(Image.load(image));
+        try {
+            setImage(Image.load(image));
+        } catch (TaskExecutionException exception) {
+            throw new IllegalArgumentException(exception);
+        }
     }
 
     public void setImage(String image) {