[Schmitzm-commits] r893 - in trunk/src: schmitzm/geotools/gui skrueger/i8n

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Jun 3 21:01:54 CEST 2010


Author: alfonx
Date: 2010-06-03 21:01:53 +0200 (Thu, 03 Jun 2010)
New Revision: 893

Modified:
   trunk/src/schmitzm/geotools/gui/XMapPane.java
   trunk/src/skrueger/i8n/TranslationTool.java
Log:
Important PostGIS GUI fix.. the password was wrongly transferred recently

Modified: trunk/src/schmitzm/geotools/gui/XMapPane.java
===================================================================
--- trunk/src/schmitzm/geotools/gui/XMapPane.java	2010-06-03 12:37:11 UTC (rev 892)
+++ trunk/src/schmitzm/geotools/gui/XMapPane.java	2010-06-03 19:01:53 UTC (rev 893)
@@ -75,6 +75,7 @@
 import schmitzm.swing.SwingUtil;
 import schmitzm.swing.event.MouseInputType;
 import skrueger.geotools.RenderingExecutor;
+import sun.util.logging.resources.logging;
 
 import com.vividsolutions.jts.geom.Coordinate;
 import com.vividsolutions.jts.geom.Envelope;
@@ -2599,10 +2600,15 @@
 			// BB umrechnen von Layer-CRS in Map-CRS
 			final CoordinateReferenceSystem targetCRS = getMapContext()
 					.getCoordinateReferenceSystem();
-			final CoordinateReferenceSystem sourceCRS = layer
+			CoordinateReferenceSystem sourceCRS = layer
 					.getFeatureSource().getSchema()
 					.getCoordinateReferenceSystem();
 
+			if (sourceCRS == null) {
+				sourceCRS = layer.getFeatureSource().getSchema().getGeometryDescriptor().getCoordinateReferenceSystem();
+				LOGGER.info("CRS for "+layer.getTitle()+" could not be determined from schema, trying GeometryDescriptor results: "+sourceCRS );
+			}
+			
 			Envelope mapAreaNew;
 			if (!CRS.equalsIgnoreMetadata(sourceCRS, targetCRS)) {
 				mapAreaNew = JTSUtil.transformEnvelope(layer.getFeatureSource()

Modified: trunk/src/skrueger/i8n/TranslationTool.java
===================================================================
--- trunk/src/skrueger/i8n/TranslationTool.java	2010-06-03 12:37:11 UTC (rev 892)
+++ trunk/src/skrueger/i8n/TranslationTool.java	2010-06-03 19:01:53 UTC (rev 893)
@@ -13,34 +13,47 @@
 import java.io.File;
 import java.io.FileReader;
 import java.io.IOException;
+import java.net.URISyntaxException;
 import java.util.HashMap;
+import java.util.Locale;
 
+import schmitzm.lang.ResourceProvider;
 
+
 /**
- * This tool helps to find missing frensh translations 
+ * This tool helps to find missing french translations 
  *
  */
 public class TranslationTool {
 	
-	static File GPenglish = new File ("/home/stefan/EigeneDateien/code/atlas/trunk/Atlas-Framework/bin/skrueger/creator/resource/locales/Geopublisher.properties");
-	static File GPfrensh = new File ("/home/stefan/EigeneDateien/code/atlas/trunk/Atlas-Framework/bin/skrueger/creator/resource/locales/Geopublisher_fr.properties");
+	static File GPenglish = new File ("/home/stefan/EigeneDateien/code/atlas/trunk/Atlas-Framework/bin/skrueger/creator/resource/locales/GeopublisherTranslation.properties");
+	static File GPfrench = new File ("/home/stefan/EigeneDateien/code/atlas/trunk/Atlas-Framework/bin/skrueger/creator/resource/locales/GeopublisherTranslation_fr.properties");
 	
 	static File ASenglish = new File ("/home/stefan/EigeneDateien/code/atlas/trunk/Atlas-Framework/src/skrueger/sld/resources/locales/AtlasStylerTranslation.properties");
-	static File ASfrensh = new File ("/home/stefan/EigeneDateien/code/atlas/trunk/Atlas-Framework/src/skrueger/sld/resources/locales/AtlasStylerTranslation_fr.properties");
+	static File ASfrench = new File ("/home/stefan/EigeneDateien/code/atlas/trunk/Atlas-Framework/src/skrueger/sld/resources/locales/AtlasStylerTranslation_fr.properties");
 	
 	static File AVenglish = new File ("/home/stefan/EigeneDateien/code/atlas/trunk/Atlas-Framework/src/skrueger/atlas/resource/locales/AtlasViewerTranslation.properties");
-	static File AVfrensh = new File ("/home/stefan/EigeneDateien/code/atlas/trunk/Atlas-Framework/src/skrueger/atlas/resource/locales/AtlasViewerTranslation_fr.properties");
+	static File AVfrench = new File ("/home/stefan/EigeneDateien/code/atlas/trunk/Atlas-Framework/src/skrueger/atlas/resource/locales/AtlasViewerTranslation_fr.properties");
 	
-	
-	private static HashMap<String,String> frenshTranslations = new HashMap<String, String>();
+	private static HashMap<String,String> frenchTranslations = new HashMap<String, String>();
 
 	/**
 	 * @param args
 	 * @throws IOException 
+	 * @throws URISyntaxException 
 	 */
-	public static void main(String[] args) throws IOException {
+	public static void main(String[] args) throws IOException, URISyntaxException {
 		
+		Locale dl = Locale.getDefault();
 		
+		for (ResourceProvider p : ResourceProvider.getRegisteredResourceProvider()){
+			
+			for (Locale l : p.getAvailableLocales(false)) {
+				File propertyFile = ResourceProvider.getPropertyFile(p, l, null);
+			}
+		}
+		
+		
 		BufferedReader en_Reader; 
 		BufferedReader fr_Reader;
 		
@@ -48,17 +61,17 @@
 		
 		if (mode == 1) {
 			en_Reader = new BufferedReader(new FileReader(GPenglish));
-			fr_Reader = new BufferedReader(new FileReader(GPfrensh));
+			fr_Reader = new BufferedReader(new FileReader(GPfrench));
 		} else if (mode == 2) {
 			en_Reader = new BufferedReader(new FileReader(ASenglish));
-			fr_Reader = new BufferedReader(new FileReader(ASfrensh));
+			fr_Reader = new BufferedReader(new FileReader(ASfrench));
 		} else {
 			en_Reader = new BufferedReader(new FileReader(AVenglish));
-			fr_Reader = new BufferedReader(new FileReader(AVfrensh));
+			fr_Reader = new BufferedReader(new FileReader(AVfrench));
 		}
 		
 
-		// Read all frensh translations keys into a HashMap
+		// Read all french translations keys into a HashMap
 		String  readLine = "start";
 		while (readLine != null) {
 			readLine = fr_Reader.readLine();
@@ -67,11 +80,11 @@
 				if (indexOf == -1) continue; 
 				String key =  readLine.substring(0,indexOf).trim();
 				String value =  readLine.substring(indexOf+1).trim();
-				frenshTranslations .put(key.trim(),value.trim());
+				frenchTranslations .put(key.trim(),value.trim());
 			}
 		}
 		
-		System.out.println(frenshTranslations.size()+" frensh imported");
+		System.out.println(frenchTranslations.size()+" french imported");
 
 		readLine = "start";
 		int missing =0;
@@ -83,7 +96,7 @@
 				if (indexOf == -1) continue;
 				String key =  readLine.substring(0,indexOf).trim();
 				String value =  readLine.substring(indexOf+1).trim();
-				if (!frenshTranslations.containsKey(key)) {
+				if (!frenchTranslations.containsKey(key)) {
 					System.out.println("#"+key+"="+value+"\n");
 					missing++;
 				}



More information about the Schmitzm-commits mailing list