Changeset 1592 in josm
- Timestamp:
- 2009-05-15T10:05:37+02:00 (16 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r1523 r1592 87 87 */ 88 88 public static DataSet pasteBuffer = new DataSet(); 89 public static Layer pasteSource; 89 90 /** 90 91 * The projection method used. … … 348 349 new javax.swing.JLabel(tr("There are unsaved changes. Discard the changes and continue?")+msg), 349 350 new String[] {tr("Save and Exit"), tr("Discard and Exit"), tr("Cancel")}, 350 new String[] {"save.png", "exit.png", "cancel.png"}).getValue(); 351 new String[] {"save.png", "exit.png", "cancel.png"}).getValue(); 351 352 352 353 // Save before exiting -
trunk/src/org/openstreetmap/josm/actions/CopyAction.java
r1523 r1592 48 48 49 49 Main.pasteBuffer = copyData(); 50 Main.pasteSource = Main.main.editLayer(); 50 51 Main.main.menu.paste.setEnabled(true); /* now we have a paste buffer we can make paste available */ 51 52 -
trunk/src/org/openstreetmap/josm/actions/PasteAction.java
r1351 r1592 24 24 import org.openstreetmap.josm.data.osm.Way; 25 25 import org.openstreetmap.josm.data.coor.EastNorth; 26 import org.openstreetmap.josm.gui.layer.Layer; 26 27 import org.openstreetmap.josm.tools.Shortcut; 27 28 … … 35 36 36 37 public void actionPerformed(ActionEvent e) { 37 pasteData(Main.pasteBuffer, e);38 pasteData(Main.pasteBuffer, Main.pasteSource, e); 38 39 } 39 40 public static void pasteData(DataSet pasteBuffer, ActionEvent e) {40 41 public static void pasteData(DataSet pasteBuffer, Layer source, ActionEvent e) { 41 42 /* Find the middle of the pasteBuffer area */ 42 43 double maxEast = -1E100, minEast = 1E100, maxNorth = -1E100, minNorth = 1E100; … … 52 53 EastNorth mPosition; 53 54 if((e.getModifiers() & ActionEvent.CTRL_MASK) ==0){ 55 /* adjust the coordinates to the middle of the visible map area */ 54 56 mPosition = Main.map.mapView.getCenter(); 55 57 } else { … … 67 69 Node nnew = new Node(n); 68 70 nnew.id = 0; 69 /* adjust the coordinates to the middle of the visible map area */ 70 nnew.eastNorth = new EastNorth(nnew.eastNorth.east() + offsetEast, nnew.eastNorth.north() + offsetNorth); 71 nnew.coor = Main.proj.eastNorth2latlon(nnew.eastNorth); 71 if (Main.main.editLayer() == source) { 72 nnew.eastNorth = new EastNorth(nnew.eastNorth.east() + offsetEast, nnew.eastNorth.north() + offsetNorth); 73 nnew.coor = Main.proj.eastNorth2latlon(nnew.eastNorth); 74 } 72 75 map.put(n, nnew); 73 76 }
Note:
See TracChangeset
for help on using the changeset viewer.