Hi,<br><br>First, thanks for Steve and all people involved in bringing the yahoo imagery to the project. I mapped almost 1000km of highways here in Brazil in the last two months and that would be impossible if we had to wait for enough GPS track logs.
<br><br>To improve the editing pace I have added to the code a few shortcuts:<br><br> * keys [1], [2], [3] mapped to select the editing modes "Node", "Segment" and "Move Node"<br> * dragging with the Right button "pans" the view ("Move" mode)
<br> * Mouse Wheel Up/Down zoom In/Out the view (and recenter the view on the mouse cursor position).<br><br>enjoy<br><br><br>Index: C:/prog/workspace/osm-applet-topatch/src/org/openstreetmap/processing/OsmApplet.java<br>
===================================================================<br>--- C:/prog/workspace/osm-applet-topatch/src/org/openstreetmap/processing/OsmApplet.java (revision 2269)<br>+++ C:/prog/workspace/osm-applet-topatch/src/org/openstreetmap/processing/OsmApplet.java (working copy)
<br>@@ -75,6 +75,7 @@<br> <br> import java.awt.EventQueue;<br> import java.awt.Image;<br>+import java.awt.event.MouseWheelListener;<br> import java.io.ByteArrayInputStream;<br> import java.io.ByteArrayOutputStream;<br> import
java.io.IOException;<br>@@ -451,6 +452,22 @@<br> }<br> });<br> <br>+ addMouseWheelListener(new MouseWheelListener() {<br>+ public void mouseWheelMoved(java.awt.event.MouseWheelEvent e) {
<br>+ int notches = e.getWheelRotation();<br>+ if (notches < 0) {<br>+ tiles.recenter(e.getX(), e.getY());<br>+ tiles.zoomin();<br>+ updatelinks();
<br>+ } else {<br>+ tiles.recenter(e.getX(), e.getY());<br>+ tiles.zoomout();<br>+ updatelinks();<br>+ }<br>+ };<br>+ });
<br>+<br>+<br> setStatus(BROWSEABLE);<br> noLoop();<br> redraw();<br>@@ -999,12 +1016,19 @@<br> public void mouseDragged() {<br> //debug("dragging mouse...");<br> if (getStatus() != NOT_READY) {
<br>- modeManager.mouseDragged();<br>+ if(mouseButton == RIGHT) {<br>+ moveMode.mouseDragged();<br>+ } else {<br>+ modeManager.mouseDragged();<br>+ }<br> }<br> //debug("mouse dragged.");
<br> }<br> <br> public void mousePressed() {<br>+ if(mouseButton == RIGHT) {<br>+ moveMode.mousePressed();<br>+ } else {<br> if (abortable && isOverMapGetAbort()) {<br> osm.abortMapGet();
<br> }<br>@@ -1012,18 +1036,47 @@<br> if (getStatus() != NOT_READY)<br> modeManager.mousePressed();<br> }<br>+ }<br> <br> public void mouseReleased() {<br>+ if(mouseButton == RIGHT) {<br>+ moveMode.mouseReleased
();<br>+ } else {<br> mouseDown = false;<br> if (getStatus() != NOT_READY) {<br> modeManager.mouseReleased();<br> }<br> }<br>+ }<br> <br> public void keyPressed() {<br> // print("keyPressed!");
<br> if (getStatus() != NOT_READY) {<br> switch (key) {<br>+ case '1': // nodeMode Shortcut<br>+ if (modeManager.getCurrentMode() != null) {<br>+ modeManager.getCurrentMode
().unset();<br>+ }<br>+ modeManager.setCurrentMode(nodeMode);<br>+ modeManager.getCurrentMode().set();<br>+ redraw();<br>+ break;<br>+ case '2': // lineMode Shortcut
<br>+ if (modeManager.getCurrentMode() != null) {<br>+ modeManager.getCurrentMode().unset();<br>+ }<br>+ modeManager.setCurrentMode(lineMode);<br>+ modeManager.getCurrentMode
().set();<br>+ redraw();<br>+ break;<br>+ case '3': // nodeMoveMode Shortcut<br>+ if (modeManager.getCurrentMode() != null) {<br>+ modeManager.getCurrentMode
().unset();<br>+ }<br>+ modeManager.setCurrentMode(nodeMoveMode);<br>+ modeManager.getCurrentMode().set();<br>+ redraw();<br>+ break;<br> case '[':<br>
lastmove = System.currentTimeMillis();<br> tiles.zoomin();<br>Index: C:/prog/workspace/osm-applet-topatch/src/org/openstreetmap/client/Tile.java<br>===================================================================
<br>--- C:/prog/workspace/osm-applet-topatch/src/org/openstreetmap/client/Tile.java (revision 2269)<br>+++ C:/prog/workspace/osm-applet-topatch/src/org/openstreetmap/client/Tile.java (working copy)<br>@@ -297,6 +297,12 @@
<br> applet.redraw();<br> } // drag<br> <br>+ public void recenter(int x, int y) {<br>+ long dx = x - windowWidth / 2;<br>+ long dy = windowHeight / 2 - y; <br>+ drag((int) dx, (int) dy);<br>+ }<br>
+<br> public void startDrag() {<br> skippedx = skippedy = 0;<br> }<br><br>