[Schmitzm-commits] r1368 - in trunk: src/schmitzm/geotools/gui src/schmitzm/io src_junit/schmitzm/io

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Jan 14 15:08:48 CET 2011


Author: alfonx
Date: 2011-01-14 15:08:46 +0100 (Fri, 14 Jan 2011)
New Revision: 1368

Modified:
   trunk/src/schmitzm/geotools/gui/XMapPane.java
   trunk/src/schmitzm/io/IOUtil.java
   trunk/src_junit/schmitzm/io/IOUtilTest.java
Log:
Bugfix-AS: Zoom to MIN/MAX scale didn't work for non-geographic CRS
Bugfix-GP: Export only JWS doesn't need to copyAndSign the Jars

Modified: trunk/src/schmitzm/geotools/gui/XMapPane.java
===================================================================
--- trunk/src/schmitzm/geotools/gui/XMapPane.java	2011-01-14 11:33:06 UTC (rev 1367)
+++ trunk/src/schmitzm/geotools/gui/XMapPane.java	2011-01-14 14:08:46 UTC (rev 1368)
@@ -2428,6 +2428,8 @@
 	 */
 	private void addGadgets(final Graphics2D graphics, final boolean forceWait) {
 
+		// TODO Position the logo
+		
 		// Paint a logo to the bottom right if available
 		if (mapImage != null) {
 			final Rectangle visibleRect = getMapPaneSize();
@@ -3040,6 +3042,9 @@
 
 	}
 
+	/**
+	 * Converts an OGC ScaleDenominator to a Scale as retuned by {@link #getScale()}
+	 */
 	public Double calculateScaleDenominatortoScale(double scaleDenominator,
 			double width2) {
 
@@ -3047,7 +3052,7 @@
 		if (getMapArea().getCoordinateReferenceSystem() instanceof GeographicCRS) {
 			return (scaleDenominator * d) / (width2 * OGC_DEGREE_TO_METERS);
 		} else {
-			return scaleDenominator * d;
+			return scaleDenominator * d / width2;
 		}
 
 	}

Modified: trunk/src/schmitzm/io/IOUtil.java
===================================================================
--- trunk/src/schmitzm/io/IOUtil.java	2011-01-14 11:33:06 UTC (rev 1367)
+++ trunk/src/schmitzm/io/IOUtil.java	2011-01-14 14:08:46 UTC (rev 1368)
@@ -913,7 +913,7 @@
 		final String orig = filename;
 
 		// When getting URL encoded filenames, the spaces might already be
-		// converted to
+		// converted to %20 etc... So we try to treat this filename as a URL-encoded filename
 		try {
 			URL asUrl = new URL("file://localhost/" + filename);
 			filename = DataUtilities.urlToFile(asUrl).getName();

Modified: trunk/src_junit/schmitzm/io/IOUtilTest.java
===================================================================
--- trunk/src_junit/schmitzm/io/IOUtilTest.java	2011-01-14 11:33:06 UTC (rev 1367)
+++ trunk/src_junit/schmitzm/io/IOUtilTest.java	2011-01-14 14:08:46 UTC (rev 1368)
@@ -83,4 +83,11 @@
 		
 		assertEquals("/home/stefan/.m2/repository/org/geopublishing/geopublisher/gpcore/1.7-SNAPSHOT/gpcore-1.7-SNAPSHOT-tests.jar", IOUtil.getFileFromJarFileUrl(u).toString());
 	}
+
+	@Test
+	public void testCleanFilename()
+	{
+		assertEquals( "geopublisher_poster.pdf", IOUtil.cleanFilename("Geopublisher Poster.pdf"));
+		assertEquals( "geopublisher_poster.pdf", IOUtil.cleanFilename("Geopublisher%20Poster.pdf"));
+	}
 }



More information about the Schmitzm-commits mailing list