]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.district.maps/src/org/simantics/maps/sg/MapNode.java
Ensure ITileProviders return BufferedImages with compatible ColorModel
[simantics/district.git] / org.simantics.district.maps / src / org / simantics / maps / sg / MapNode.java
index 84338bfbc62bb4523612cd75aae93e6a4bb47ef8..952553b0ec4cb263d75d9d2bd07524cc738f225a 100644 (file)
@@ -25,8 +25,6 @@ import java.awt.geom.Point2D;
 import java.awt.geom.Rectangle2D;
 import java.awt.image.ImageObserver;
 import java.awt.image.VolatileImage;
-import java.net.MalformedURLException;
-import java.net.URISyntaxException;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -50,6 +48,8 @@ import org.simantics.maps.tile.TileCache;
 import org.simantics.maps.tile.TileKey;
 import org.simantics.scenegraph.g2d.G2DNode;
 import org.simantics.scenegraph.g2d.G2DRenderingHints;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * @author Tuukka Lehtonen
@@ -58,6 +58,8 @@ public class MapNode extends G2DNode implements ITileListener  {
 
     private static final long serialVersionUID = 2490944880914577411L;
 
+    private static final Logger LOGGER = LoggerFactory.getLogger(MapNode.class);
+
     private final double MAP_SCALE          = 1;
     private final int    MAX_TILE_LEVEL     = 19;
     private final int    TILE_PIXEL_SIZE    = 256;
@@ -210,14 +212,8 @@ public class MapNode extends G2DNode implements ITileListener  {
 
             this.tileCache = new TileCache(job);
             this.tileCache.addTileListener(this);
-        } catch (MalformedURLException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        } catch (URISyntaxException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
         } catch(Exception e ) {
-            e.printStackTrace();
+            LOGGER.error("Failed to initialize MapNode", e);
         }
     }