/[schmitzm]/trunk/src/skrueger/geotools/XMapPane.java
ViewVC logotype

Diff of /trunk/src/skrueger/geotools/XMapPane.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 652 by alfonx, Fri Jan 29 08:37:34 2010 UTC revision 653 by alfonx, Mon Feb 1 15:09:18 2010 UTC
# Line 301  public class XMapPane extends JPanel { Line 301  public class XMapPane extends JPanel {
301                          final MapLayer layer = event.getLayer();                          final MapLayer layer = event.getLayer();
302                          layer.addMapLayerListener(bgMapLayerListener);                          layer.addMapLayerListener(bgMapLayerListener);
303                          requestStartRendering();                          requestStartRendering();
   
304                  }                  }
305    
306                  @Override                  @Override
# Line 640  public class XMapPane extends JPanel { Line 639  public class XMapPane extends JPanel {
639                                  XMapPaneAction.ZOOM_IN);                                  XMapPaneAction.ZOOM_IN);
640    
641                  xMapPaneMouseListener.actions.put(MouseInputType.RClick,                  xMapPaneMouseListener.actions.put(MouseInputType.RClick,
642                                  XMapPaneAction.ZOOM_OUT);                                  XMapPaneAction.SELECT_ALL);
643    
644                  xMapPaneMouseListener.actions.put(MouseInputType.RDrag,                  xMapPaneMouseListener.actions.put(MouseInputType.RDrag,
645                                  XMapPaneAction.PAN);                                  XMapPaneAction.PAN);
# Line 1387  public class XMapPane extends JPanel { Line 1386  public class XMapPane extends JPanel {
1386           */           */
1387          public void pan(final int dX, final int dY) {          public void pan(final int dX, final int dY) {
1388    
                 // if ((getState() == XMapPane.PAN)  
                 // || ((event.getModifiersEx() & InputEvent.BUTTON3_DOWN_MASK) != 0)) {  
   
1389                  // Panning needs a panning coursor                  // Panning needs a panning coursor
1390                  if (getCursor() != SwingUtil.PANNING_CURSOR) {                  if (getCursor() != SwingUtil.PANNING_CURSOR) {
1391                          setCursor(SwingUtil.PANNING_CURSOR);                          setCursor(SwingUtil.PANNING_CURSOR);
# Line 1954  public class XMapPane extends JPanel { Line 1950  public class XMapPane extends JPanel {
1950    
1951          // /** Stored the time used for the last real rendering in ms. **/          // /** Stored the time used for the last real rendering in ms. **/
1952          private long lastRenderingDuration = 1000;          private long lastRenderingDuration = 1000;
1953            private XMapPaneTool tool = XMapPaneTool.INFO;
1954    
1955          /**          /**
1956           * Set the minimum (nearest) allowed zoom scale. This is the bigger number           * Set the minimum (nearest) allowed zoom scale. This is the bigger number
# Line 2007  public class XMapPane extends JPanel { Line 2004  public class XMapPane extends JPanel {
2004          public void configureMouse(MouseInputType type, XMapPaneAction action) {          public void configureMouse(MouseInputType type, XMapPaneAction action) {
2005                  xMapPaneMouseListener.actions.put(type, action);                  xMapPaneMouseListener.actions.put(type, action);
2006          }          }
2007            
2008            public void setTool(XMapPaneTool tool) {
2009                    this.tool = tool;
2010                    xMapPaneMouseListener.configure(tool);
2011                    setCursor(tool.cursor);
2012            }
2013    
2014          /**          /**
2015           * Standardmaessig wird der Cursor automatisch je nach MapPane-Aktion (Zoom,           * Standardmaessig wird der Cursor automatisch je nach MapPane-Aktion (Zoom,
# Line 2164  public class XMapPane extends JPanel { Line 2167  public class XMapPane extends JPanel {
2167                                  repaint();                                  repaint();
2168                          }                          }
2169                  }                  }
2170                    
2171    //
2172                  // wenn manueller Cursor gesetzt ist, dann diesen verwenden (unabhaengig                  // wenn manueller Cursor gesetzt ist, dann diesen verwenden (unabhaengig
2173                  // von der aktuellen Aktion                  // von der aktuellen Aktion
2174                  if (this.staticCursor != null) {                  if (this.staticCursor != null) {
2175                          setCursor(staticCursor);                          setCursor(staticCursor);
2176                          return;                          return;
2177                  }                  }
2178                    
2179                  if (getCursor() == SwingUtil.PANNING_CURSOR) {                  if (getCursor() == SwingUtil.PANNING_CURSOR) {
2180                          // This cursor will reset itself                          // This cursor will reset itself
2181                          return;                          return;
2182                  }                  }
2183                    
2184                  // Set the cursor depending on what tool is in use...                  setCursor(tool.cursor);
2185                  switch (state) {  //
2186                  case SELECT_TOP:  //              // Set the cursor depending on what tool is in use...
2187                  case SELECT_ONE_FROM_TOP:  //              switch (state) {
2188                  case SELECT_ALL:  //              case SELECT_TOP:
2189                          setCursor(SwingUtil.CROSSHAIR_CURSOR);  //              case SELECT_ONE_FROM_TOP:
2190                          break;  //              case SELECT_ALL:
2191                  case ZOOM_IN:  //                      setCursor(SwingUtil.CROSSHAIR_CURSOR);
2192                          setCursor(SwingUtil.ZOOMIN_CURSOR);  //                      break;
2193                          break;  //              case ZOOM_IN:
2194                  case ZOOM_OUT:  //                      setCursor(SwingUtil.ZOOMIN_CURSOR);
2195                          setCursor(SwingUtil.ZOOMOUT_CURSOR);  //                      break;
2196                          break;  //              case ZOOM_OUT:
2197                  case PAN:  //                      setCursor(SwingUtil.ZOOMOUT_CURSOR);
2198                          setCursor(SwingUtil.PAN_CURSOR);  //                      break;
2199                          break;  //              case PAN:
2200                  default:  //                      setCursor(SwingUtil.PAN_CURSOR);
2201                          setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));  //                      break;
2202                          break;  //              default:
2203                  }  //                      setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
2204    //                      break;
2205    //              }
2206          }          }
2207    
2208          /**          /**

Legend:
Removed from v.652  
changed lines
  Added in v.653

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26