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 |
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); |
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); |
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 |
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, |
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 |
/** |
/** |