[Schmitzm-commits] r43 - in trunk: dist src/skrueger/geotools src/skrueger/i8n

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Apr 14 16:19:32 CEST 2009


Author: alfonx
Date: 2009-04-14 16:19:30 +0200 (Tue, 14 Apr 2009)
New Revision: 43

Modified:
   trunk/dist/schmitzm-src.zip
   trunk/dist/schmitzm.jar
   trunk/src/skrueger/geotools/StyledMapUtil.java
   trunk/src/skrueger/i8n/I8NUtil.java
Log:
* Some cleanup in I8NUtil
* Transition from owner=Window to owner=Component, because Java 1.6 JOptionPane can determine the parent Window itself. 

Modified: trunk/dist/schmitzm-src.zip
===================================================================
(Binary files differ)

Modified: trunk/dist/schmitzm.jar
===================================================================
(Binary files differ)

Modified: trunk/src/skrueger/geotools/StyledMapUtil.java
===================================================================
--- trunk/src/skrueger/geotools/StyledMapUtil.java	2009-04-08 00:43:53 UTC (rev 42)
+++ trunk/src/skrueger/geotools/StyledMapUtil.java	2009-04-14 14:19:30 UTC (rev 43)
@@ -11,6 +11,7 @@
 import org.geotools.map.DefaultMapLayer;
 import org.geotools.coverage.grid.GridCoverage2D;
 import org.geotools.coverage.grid.io.AbstractGridCoverage2DReader;
+import org.geotools.data.FeatureSource;
 import org.geotools.styling.ColorMap;
 import org.geotools.styling.ColorMapEntry;
 import org.geotools.styling.Style;
@@ -151,7 +152,7 @@
           title,
           style
       );
-
+    
     if ( styledObject == null )
       throw new UnsupportedOperationException("Can not create StyledMapInterface object from "+(object == null ? "null" : object.getClass()));
 

Modified: trunk/src/skrueger/i8n/I8NUtil.java
===================================================================
--- trunk/src/skrueger/i8n/I8NUtil.java	2009-04-08 00:43:53 UTC (rev 42)
+++ trunk/src/skrueger/i8n/I8NUtil.java	2009-04-14 14:19:30 UTC (rev 43)
@@ -4,7 +4,10 @@
 import java.util.Set;
 import java.util.TreeSet;
 
+import org.apache.log4j.Logger;
+
 public class I8NUtil {
+	static final Logger LOGGER = Logger.getLogger(I8NUtil.class);
 
 	private static Set<String> languageCodes = new TreeSet<String>();
 	static {
@@ -16,31 +19,6 @@
 		// }
 	}
 
-	//	
-	// /**
-	// * @Returns an ImageIcon for a given ISO code or null.
-	// * @param code ISO Country Code
-	// */
-	// public static ImageIcon getFlagIcon(String code) {
-	//		
-	// String ressourcename = "resource/flags/" + code.toUpperCase() + ".gif";
-	//		
-	// URL resourceURL = TranslationEditJPanel.class.getResource(ressourcename);
-	//		
-	// if (resourceURL != null)
-	// return new ImageIcon( resourceURL);
-	//		
-	// return new ImageIcon();
-	// }
-	//	
-	// /**
-	// * @Returns an {@link ImageIcon} flag for the language setup as
-	// Translation language
-	// */
-	// public static ImageIcon getFlagIcon() {
-	// return getFlagIcon( Translation.getActiveLang() );
-	// }
-
 	/**
 	 * @author Stefan Alfons Krüger
 	 * @param code
@@ -71,6 +49,7 @@
 				return l;
 			}
 		}
-		return null;
+		LOGGER.error("Can't create a Locale for code "+code+"! Returning the system default locale to avoid NPEs.");
+		return Locale.getDefault();
 	}
 }



More information about the Schmitzm-commits mailing list