[Schmitzm-commits] r627 - branches/2.0-RC2/src/skrueger/geotools

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Jan 28 12:47:42 CET 2010


Author: alfonx
Date: 2010-01-28 12:47:42 +0100 (Thu, 28 Jan 2010)
New Revision: 627

Modified:
   branches/2.0-RC2/src/skrueger/geotools/SelectXMapPaneMouseListener.java
   branches/2.0-RC2/src/skrueger/geotools/ZoomXMapPaneMouseListener.java
Log:
Removed last dead code from *XMapPaneMouseListener .... ready to transform them back to JEditPane compatibility.

Modified: branches/2.0-RC2/src/skrueger/geotools/SelectXMapPaneMouseListener.java
===================================================================
--- branches/2.0-RC2/src/skrueger/geotools/SelectXMapPaneMouseListener.java	2010-01-28 11:44:00 UTC (rev 626)
+++ branches/2.0-RC2/src/skrueger/geotools/SelectXMapPaneMouseListener.java	2010-01-28 11:47:42 UTC (rev 627)
@@ -70,11 +70,7 @@
 
 		xMapPane.setCursor(Cursor
 				.getPredefinedCursor(Cursor.WAIT_CURSOR));
-		//		
-		// int clickX = e.getX();
-		// int clickY = e.getY();
-		// selectionPerformed(clickX, clickY, clickX, clickY);}
-		//		
+
 		int state = xMapPane.getState();
 
 		/**
@@ -217,16 +213,12 @@
 			xMapPane.performPan();
 		} else if (xMapPane.getState() == XMapPane.SELECT_ALL
 				|| xMapPane.getState() == XMapPane.SELECT_TOP
-//				|| xMapPane.getState() == XMapPane.SELECT_ONE_FROM_TOP
 				) {
 			
 			Point mp = event.getPoint();
 
-			// keine wirkliche Selektion, sondern nur ein Klick
-			if (startPos.x == mp.x || startPos.y == mp.y) {
-//				mouseClicked(event);
-//				return;
-			} else {
+			// Ist es eine wirkliche Selektion, oder etwas nur ein Klick?
+			if (startPos.x != mp.x && startPos.y != mp.y) {
 				xMapPane.drawRectangle(xMapPane.getGraphics(), startPos, event
 						.getPoint());
 			}

Modified: branches/2.0-RC2/src/skrueger/geotools/ZoomXMapPaneMouseListener.java
===================================================================
--- branches/2.0-RC2/src/skrueger/geotools/ZoomXMapPaneMouseListener.java	2010-01-28 11:44:00 UTC (rev 626)
+++ branches/2.0-RC2/src/skrueger/geotools/ZoomXMapPaneMouseListener.java	2010-01-28 11:47:42 UTC (rev 627)
@@ -194,27 +194,6 @@
 		if (state == XMapPane.PAN)
 			return;
 
-		// double zoomFactor = 1.;
-		//		
-		// final Envelope mapArea = xMapPane.getMapArea();
-		// if (mapArea == null)
-		// return;
-		//
-		// final Rectangle bounds = xMapPane.getVisibleRect();
-		//
-		// final double x = (double) (e.getX());
-		// final double y = (double) (e.getY());
-		// final double width = mapArea.getWidth();
-		// final double height = mapArea.getHeight();
-		// final double width2 = width / 2.0;
-		// final double height2 = height / 2.0;
-		// final double mapX = ((x * width) / (double) bounds.width)
-		// + mapArea.getMinX();
-		// final double mapY = (((bounds.getHeight() - y) * height) / (double)
-		// bounds.height)
-		// + mapArea.getMinY();
-		// double zlevel = 1.0;
-		//		
 		if (state == XMapPane.ZOOM_IN && e.getButton() == MouseEvent.BUTTON1) {
 			xMapPane.zoomTo(e.getPoint(), 1 / 2.);
 		} else if (state == XMapPane.ZOOM_IN
@@ -222,17 +201,7 @@
 				|| state == XMapPane.ZOOM_OUT) {
 			xMapPane.zoomTo(e.getPoint(), 2.);
 		}
-		//
-		// final Coordinate ll = new Coordinate(mapX - (width2 / zlevel), mapY
-		// - (height2 / zlevel));
-		// final Coordinate ur = new Coordinate(mapX + (width2 / zlevel), mapY
-		// + (height2 / zlevel));
-		// final Envelope newMapArea = new Envelope(ll, ur);
-		//
-		// xMapPane.setMapArea(newMapArea);
 
-		// xMapPane.repaint();
-
 	}
 
 	/**



More information about the Schmitzm-commits mailing list