X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Farchaeopteryx%2Ftools%2FImageLoader.java;h=6e6b4e05b1d6b42c36d6bb70159aaf9d7d3dd57c;hb=226d82be9b70ce0c67b5b1055654d484073ea184;hp=b81cc25570be21ba9b460296130668923b06f435;hpb=fbba20dcd57f706d5bf42c4f3f157e053a24cc97;p=jalview.git diff --git a/forester/java/src/org/forester/archaeopteryx/tools/ImageLoader.java b/forester/java/src/org/forester/archaeopteryx/tools/ImageLoader.java index b81cc25..6e6b4e0 100644 --- a/forester/java/src/org/forester/archaeopteryx/tools/ImageLoader.java +++ b/forester/java/src/org/forester/archaeopteryx/tools/ImageLoader.java @@ -21,10 +21,11 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA // // Contact: phylosoft @ gmail . com -// WWW: www.phylosoft.org/forester +// WWW: https://sites.google.com/site/cmzmasek/home/software/forester package org.forester.archaeopteryx.tools; +import java.awt.color.CMMException; import java.awt.image.BufferedImage; import java.io.IOException; import java.net.MalformedURLException; @@ -52,6 +53,11 @@ public class ImageLoader implements Runnable { _tp = tp; } + @Override + public void run() { + load(); + } + private void load() { Hashtable image_map = null; if ( _tp.getImageMap() != null ) { @@ -90,12 +96,20 @@ public class ImageLoader implements Runnable { bi = ImageIO.read( uri.getValue().toURL() ); } catch ( final MalformedURLException e ) { - AptxUtil.printWarningMessage( Constants.PRG_NAME, "\"" + uri.getValue() - + "\": Malformed URL Exception: " + e.getLocalizedMessage() ); + AptxUtil.printWarningMessage( Constants.PRG_NAME, + "could not load image from \"" + uri.getValue() + + "\": Malformed URL Exception: " + + e.getLocalizedMessage() ); } catch ( final IOException e ) { - AptxUtil.printWarningMessage( Constants.PRG_NAME, "\"" + uri.getValue() - + "\": IO Exception: " + e.getLocalizedMessage() ); + AptxUtil.printWarningMessage( Constants.PRG_NAME, + "could not load image from \"" + uri.getValue() + + "\": IO Exception: " + e.getLocalizedMessage() ); + } + catch ( final CMMException e ) { + AptxUtil.printWarningMessage( Constants.PRG_NAME, + "could not load image from \"" + uri.getValue() + + "\": CMMException: " + e.getLocalizedMessage() ); } if ( bi != null ) { image_map.put( uri_str, bi ); @@ -110,9 +124,4 @@ public class ImageLoader implements Runnable { } } } - - @Override - public void run() { - load(); - } }