[Schmitzm-commits] r891 - in trunk: src/schmitzm/lang src/skrueger/geotools src_junit/schmitzm src_junit/schmitzm/lang

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Jun 3 14:20:13 CEST 2010


Author: alfonx
Date: 2010-06-03 14:20:11 +0200 (Thu, 03 Jun 2010)
New Revision: 891

Added:
   trunk/src_junit/schmitzm/lang/
   trunk/src_junit/schmitzm/lang/ResourceProviderTest.java
Modified:
   trunk/src/schmitzm/lang/ResourceProvider.java
   trunk/src/skrueger/geotools/MapPaneToolBar.java
Log:
New software languagetranslation dialog seem to work...

Modified: trunk/src/schmitzm/lang/ResourceProvider.java
===================================================================
--- trunk/src/schmitzm/lang/ResourceProvider.java	2010-06-03 12:11:01 UTC (rev 890)
+++ trunk/src/schmitzm/lang/ResourceProvider.java	2010-06-03 12:20:11 UTC (rev 891)
@@ -791,9 +791,15 @@
 			prefix += ".";
 
 		// Keys mit Dummy-Werten in Datei schreiben
-		for (String key : provider.getKeys())
+		for (String key : provider.getKeys()) {
+			
+			// Some spacial characters have to be escaped, e.g. Newline \n
+			String originalString = provider.getString(key);
+			originalString = originalString.replaceAll("\\n", "\\\\n");
+			
 			out.println(prefix + key + "=?" + l.toString() + "? "
-					+ provider.getString(key));
+					+ originalString);
+		}
 		out
 				.println("# ----------------------------------------------------------------------------------");
 		out.flush();

Modified: trunk/src/skrueger/geotools/MapPaneToolBar.java
===================================================================
--- trunk/src/skrueger/geotools/MapPaneToolBar.java	2010-06-03 12:11:01 UTC (rev 890)
+++ trunk/src/skrueger/geotools/MapPaneToolBar.java	2010-06-03 12:20:11 UTC (rev 891)
@@ -301,17 +301,10 @@
 	 * super.initTools()}.
 	 */
 	protected void initToolsAndActions() {
-		// Panning
-//		addTool(new MapPaneToolBarAction(TOOL_PAN, this, "", new ImageIcon(
-//				MapView.class.getResource("resource/icons/pan.png")),
-//				R("MapPaneButtons.Pan.TT")), false);
-
+		// Pan
 		addTool(new MapPaneToolBarAction(TOOL_PAN, this, XMapPaneTool.PAN), false);
 		
 		// Info
-//		addTool(new MapPaneToolBarAction(TOOL_INFO, this, "", new ImageIcon(
-//				MapView.class.getResource("resource/icons/info.png")),
-//				R("MapPaneButtons.Info.TT")), false);
 		addTool(new MapPaneToolBarAction(TOOL_INFO, this, XMapPaneTool.INFO), false);
 
 		// Zoom in
@@ -320,19 +313,6 @@
 		// Zoom out
 		addTool(new MapPaneToolBarAction(TOOL_ZOOMOUT, this, XMapPaneTool.ZOOM_OUT), false);
 		
-		
-//		// Zoom in
-//		addTool(new MapPaneToolBarAction(TOOL_ZOOMIN, this, "", new ImageIcon(
-//				MapView.class.getResource("resource/icons/zoom_in.png")),
-//				R("MapPaneButtons.ZoomIn.TT")), false);
-//		
-//		// Zoom out
-//		addTool(new MapPaneToolBarAction(TOOL_ZOOMOUT, this, "", new ImageIcon(
-//				MapView.class.getResource("resource/icons/zoom_out.png")),
-//				R("MapPaneButtons.ZoomOut.TT")), false);
-		
-		
-
 		// Action button to revert the last zoom
 		addAction(new MapPaneToolBarAction(ACTION_ZOOM_BACK, this, "",
 				new ImageIcon(MapView.class
@@ -362,10 +342,6 @@
 	 * the tool bar.
 	 */
 	public void initToolBar() {
-		// setOpaque(true);
-		//		
-		// setAlignmentY(1f);
-		// setAlignmentX(0.5f);
 		removeAll();
 
 		// // Separator to the left of the tool actions to start
@@ -408,16 +384,6 @@
 		repaint();
 	}
 
-	// Space between tool buttons and action buttons
-	// SK: Seperators are now als manages like actions and tools
-	// Dimension dimension2 = new Dimension( 10,10);
-	// this.addSeparator(dimension2);
-
-	// // Action buttons
-	// for (JButton b : actionButtons.values())
-	// add(b);
-	// }
-
 	/**
 	 * Performs the activation of a tool.
 	 * 
@@ -434,35 +400,18 @@
 
 		switch (tool) {
 		case TOOL_PAN:
-			// Set the mouse tool to "Panning"
-//			mapPane.setState(SelectableXMapPane.PAN);
 			mapPane.setTool(XMapPaneTool.PAN);
-//			mapPane.setNormalCursor(SwingUtil.PAN_CURSOR);
 			break;
 		case TOOL_INFO:
-			// Set the mouse tool to "Info"
 			mapPane.setTool(XMapPaneTool.INFO);
-//			mapPane.setState(SelectableXMapPane.SELECT_ONE_FROM_TOP); 
-//			mapPane.setNormalCursor(SwingUtil.CROSSHAIR_CURSOR);
 			break;
 		case TOOL_ZOOMIN:
-			// Set the mouse tool to "Zoom in"
 			mapPane.setTool(XMapPaneTool.ZOOM_IN);
-//			mapPane.setNormalCursor(SwingUtil.ZOOMIN_CURSOR);
 			break;
 		case TOOL_ZOOMOUT:
-			// Set the mouse tool to "Zoom out"
 			mapPane.setTool(XMapPaneTool.ZOOM_OUT);
-//			mapPane.setState(SelectableXMapPane.ZOOM_OUT);
-//			mapPane.setNormalCursor(SwingUtil.ZOOMOUT_CURSOR);
 			break;
-//		default:
-			// Set map actions to default
-//			mapPane.setState(SelectableXMapPane.NONE);
-//			mapPane.setNormalCursor(null);
-//			break;
 		}
-//		mapPane.updateCursorAndRepaintTimer();
 	}
 
 	/**
@@ -536,7 +485,6 @@
 		}
 		JToggleButton button = new SmallToggleButton(buttonAction);
 		
-//		button.setBorder(BorderFactory.createRaisedBevelBorder());
 		toolButtonGroup.add(button);
 		toolAndActionButtons.put(buttonAction.getID(), button);
 		if (resetToolBar)
@@ -573,7 +521,6 @@
 			return;
 		}
 		JButton button = new SmallButton(buttonAction);
-//		button.setBorder(BorderFactory.createRaisedBevelBorder());
 		toolAndActionButtons.put(buttonAction.getID(), button);
 		if (resetToolBar)
 			initToolBar();

Added: trunk/src_junit/schmitzm/lang/ResourceProviderTest.java
===================================================================
--- trunk/src_junit/schmitzm/lang/ResourceProviderTest.java	2010-06-03 12:11:01 UTC (rev 890)
+++ trunk/src_junit/schmitzm/lang/ResourceProviderTest.java	2010-06-03 12:20:11 UTC (rev 891)
@@ -0,0 +1,16 @@
+package schmitzm.lang;
+
+import static org.junit.Assert.assertFalse;
+
+import org.junit.Test;
+
+public class ResourceProviderTest {
+
+	@Test
+	public void testCreatePropertyFile() {
+		String before = "A\nB\nC";
+		String after = before.replaceAll("\\n", "\\\\n");
+		assertFalse(before.equals(after));
+	}
+
+}


Property changes on: trunk/src_junit/schmitzm/lang/ResourceProviderTest.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Id URL
Name: svn:eol-style
   + native



More information about the Schmitzm-commits mailing list