[Schmitzm-commits] r632 - in branches/2.0-RC2/src: schmitzm/geotools/gui skrueger/geotools

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Jan 28 15:35:45 CET 2010


Author: alfonx
Date: 2010-01-28 15:35:45 +0100 (Thu, 28 Jan 2010)
New Revision: 632

Added:
   branches/2.0-RC2/src/skrueger/geotools/XMapPaneMouseListener.java
Modified:
   branches/2.0-RC2/src/schmitzm/geotools/gui/SelectableXMapPane.java
   branches/2.0-RC2/src/skrueger/geotools/XMapPane.java
Log:


Modified: branches/2.0-RC2/src/schmitzm/geotools/gui/SelectableXMapPane.java
===================================================================
--- branches/2.0-RC2/src/schmitzm/geotools/gui/SelectableXMapPane.java	2010-01-28 14:33:34 UTC (rev 631)
+++ branches/2.0-RC2/src/schmitzm/geotools/gui/SelectableXMapPane.java	2010-01-28 14:35:45 UTC (rev 632)
@@ -191,11 +191,11 @@
 		this(null, null);
 	}
 
-	/**
-	 * This {@link MouseListener} is managing all selection related tasks
-	 */
-	protected final SelectXMapPaneMouseListener selectMapPaneMouseListener = new SelectXMapPaneMouseListener(
-			this);
+//	/**
+//	 * This {@link MouseListener} is managing all selection related tasks
+//	 */
+//	protected final SelectXMapPaneMouseListener selectMapPaneMouseListener = new SelectXMapPaneMouseListener(
+//			this);
 
 	/**
 	 * Erzeugt ein neues MapPane.
@@ -288,12 +288,12 @@
 		// mapLayerSelectable.remove(e.getLayer());
 		// }
 		// });
-		/**
-		 * Adding the #selectionMapPaneMouseListener
-		 */
-		this.addMouseListener(selectMapPaneMouseListener);
-		this.addMouseMotionListener(selectMapPaneMouseListener);
-		this.addMouseWheelListener(selectMapPaneMouseListener);
+//		/**
+//		 * Adding the #selectionMapPaneMouseListener
+//		 */
+//		this.addMouseListener(selectMapPaneMouseListener);
+//		this.addMouseMotionListener(selectMapPaneMouseListener);
+//		this.addMouseWheelListener(selectMapPaneMouseListener);
 
 		setState(ZOOM_IN);
 
@@ -429,18 +429,18 @@
 		return getMapContext().getLayerCount() > 0 ? getMapContext().getLayer(0)
 				: null;
 	}
+//
+//	/**
+//	 * @param state
+//	 *            Modus fuer Window-Selektion
+//	 */
+//	public void setState(final int state) {
+//		selectMapPaneMouseListener.setEnabled((state == SELECT_ALL
+//				|| state == SELECT_ONE_FROM_TOP || state == SELECT_TOP));
+//		super.setState(state);
+//	}
 
 	/**
-	 * @param state
-	 *            Modus fuer Window-Selektion
-	 */
-	public void setState(final int state) {
-		selectMapPaneMouseListener.setEnabled((state == SELECT_ALL
-				|| state == SELECT_ONE_FROM_TOP || state == SELECT_TOP));
-		super.setState(state);
-	}
-
-	/**
 	 * Ermittelt die Raster-Werte, die an einem Punkt liegen und erzeugt
 	 * entsprechende {@link GridCoverageValueSelectedEvent
 	 * GridCoverageValueSelectedEvents}. Beim Modus {@link #SELECT_TOP} wird nur

Modified: branches/2.0-RC2/src/skrueger/geotools/XMapPane.java
===================================================================
--- branches/2.0-RC2/src/skrueger/geotools/XMapPane.java	2010-01-28 14:33:34 UTC (rev 631)
+++ branches/2.0-RC2/src/skrueger/geotools/XMapPane.java	2010-01-28 14:35:45 UTC (rev 632)
@@ -69,6 +69,7 @@
 import schmitzm.lang.LangUtil;
 import schmitzm.swing.JPanel;
 import schmitzm.swing.SwingUtil;
+import schmitzm.swing.event.MouseInputType;
 
 import com.vividsolutions.jts.geom.Coordinate;
 import com.vividsolutions.jts.geom.Envelope;
@@ -107,6 +108,7 @@
 
 	private final static Logger LOGGER = Logger.getLogger(XMapPane.class);
 
+	/** A flag indicating whether the {@link XMapPane} is accepting repaints from the EDT. @see {@link XMapPane#setPainting(boolean)) **/
 	private boolean acceptsRepaintCalls = true;
 
 	/**
@@ -560,7 +562,7 @@
 
 	/**
 	 * The default state is ZOOM_IN, hence by default the
-	 * {@link #zoomMapPaneMouseListener} is also enabled.
+	 * {@link #xMapPaneMouseListener} is also enabled.
 	 **/
 	private int state = ZOOM_IN;
 
@@ -572,11 +574,17 @@
 
 	private AffineTransform worldToScreen;
 
+//	/**
+//	 * This {@link MouseListener} is managing all zoom related tasks
+//	 */
+//	private final ZoomXMapPaneMouseListener zoomMapPaneMouseListener = new ZoomXMapPaneMouseListener(
+//			this);
+	
 	/**
 	 * This {@link MouseListener} is managing all zoom related tasks
 	 */
-	public final ZoomXMapPaneMouseListener zoomMapPaneMouseListener = new ZoomXMapPaneMouseListener(
-			this);
+	private final XMapPaneMouseListener xMapPaneMouseListener = new XMapPaneMouseListener(this);
+	
 
 	/** Is set if a renderer has an error **/
 	protected ArrayList<Exception> renderingErrors = new ArrayList<Exception>();
@@ -617,9 +625,9 @@
 		/**
 		 * Adding the #zoomMapPaneMouseListener
 		 */
-		this.addMouseListener(zoomMapPaneMouseListener);
-		this.addMouseMotionListener(zoomMapPaneMouseListener);
-		this.addMouseWheelListener(zoomMapPaneMouseListener);
+		this.addMouseListener(xMapPaneMouseListener);
+		this.addMouseMotionListener(xMapPaneMouseListener);
+		this.addMouseWheelListener(xMapPaneMouseListener);
 
 		/*
 		 * We use a Timer object to avoid rendering delays and flickering when
@@ -974,8 +982,8 @@
 		// Remove all mapPaneListeners that have registered with us
 		mapPaneListeners.clear();
 
-		removeMouseMotionListener(zoomMapPaneMouseListener);
-		removeMouseListener(zoomMapPaneMouseListener);
+		removeMouseMotionListener(xMapPaneMouseListener);
+		removeMouseListener(xMapPaneMouseListener);
 
 		if (localContext != null)
 			getMapContext().clearLayerList();
@@ -1962,15 +1970,22 @@
 	 * 
 	 * @param state
 	 */
+	@Deprecated
 	public void setState(final int state) {
 		this.state = state;
+		
+		throw new RuntimeException("Old concept.. migrate to new concept!");
 
-		zoomMapPaneMouseListener.setEnabled((state == ZOOM_IN
-				|| state == ZOOM_OUT || state == PAN));
+//		xMapPaneMouseListener.setEnabled((state == ZOOM_IN
+//				|| state == ZOOM_OUT || state == PAN));
 
 		// Je nach Aktion den Cursor umsetzen
-		updateCursor();
+//		updateCursor();
 	}
+	
+	public void configureMouse(MouseInputType type, XMapPaneAction action){
+		
+	}
 
 	/**
 	 * Standardmaessig wird der Cursor automatisch je nach MapPane-Aktion (Zoom,

Added: branches/2.0-RC2/src/skrueger/geotools/XMapPaneMouseListener.java
===================================================================
--- branches/2.0-RC2/src/skrueger/geotools/XMapPaneMouseListener.java	2010-01-28 14:33:34 UTC (rev 631)
+++ branches/2.0-RC2/src/skrueger/geotools/XMapPaneMouseListener.java	2010-01-28 14:35:45 UTC (rev 632)
@@ -0,0 +1,10 @@
+package skrueger.geotools;
+
+import schmitzm.swing.event.SelectiveMouseAdapter;
+
+public class XMapPaneMouseListener extends SelectiveMouseAdapter {
+
+	public XMapPaneMouseListener(XMapPane xMapPane) {
+	}
+
+}


Property changes on: branches/2.0-RC2/src/skrueger/geotools/XMapPaneMouseListener.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