Ignore:
Timestamp:
2008-10-05T17:06:27+02:00 (16 years ago)
Author:
stoecker
Message:

close bug #1622. Keyboard shortcuts and specific OS handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/PasteAction.java

    r999 r1023  
    2424import org.openstreetmap.josm.data.osm.Way;
    2525import org.openstreetmap.josm.data.coor.EastNorth;
     26import org.openstreetmap.josm.tools.ShortCut;
    2627
    2728public final class PasteAction extends JosmAction {
    2829
    2930    public PasteAction() {
    30         super(tr("Paste"), "paste",
    31                         tr("Paste contents of paste buffer."),
    32                         KeyEvent.VK_V, KeyEvent.CTRL_MASK, true);
    33                 setEnabled(false);
     31        super(tr("Paste"), "paste", tr("Paste contents of paste buffer."),
     32                        ShortCut.registerShortCut("system:paste", tr("Edit: Paste"), KeyEvent.VK_V, ShortCut.GROUP_MENU), true);
     33                        setEnabled(false);
    3434    }
    3535
     
    3737                DataSet pasteBuffer = Main.pasteBuffer;
    3838
    39                 /* Find the middle of the pasteBuffer area */ 
     39                /* Find the middle of the pasteBuffer area */
    4040                double maxEast = -1E100, minEast = 1E100, maxNorth = -1E100, minNorth = 1E100;
    4141                for (Node n : pasteBuffer.nodes) {
    4242                        double east = n.eastNorth.east();
    4343                        double north = n.eastNorth.north();
    44                         if (east > maxEast) { maxEast = east; } 
    45                         if (east < minEast) { minEast = east; } 
    46                         if (north > maxNorth) { maxNorth = north; } 
    47                         if (north < minNorth) { minNorth = north; } 
     44                        if (east > maxEast) { maxEast = east; }
     45                        if (east < minEast) { minEast = east; }
     46                        if (north > maxNorth) { maxNorth = north; }
     47                        if (north < minNorth) { minNorth = north; }
    4848                }
    4949
     
    5757                double offsetEast  = mPosition.east() - (maxEast + minEast)/2.0;
    5858                double offsetNorth = mPosition.north() - (maxNorth + minNorth)/2.0;
    59                
    60                 HashMap<OsmPrimitive,OsmPrimitive> map = new HashMap<OsmPrimitive,OsmPrimitive>(); 
     59
     60                HashMap<OsmPrimitive,OsmPrimitive> map = new HashMap<OsmPrimitive,OsmPrimitive>();
    6161                  /* temporarily maps old nodes to new so we can do a true deep copy */
    62                
     62
    6363                /* do the deep copy of the paste buffer contents, leaving the pasteBuffer unchanged */
    6464                for (Node n : pasteBuffer.nodes) {
     
    9696                        map.put(r, rnew);
    9797                }
    98                
     98
    9999                /* Now execute the commands to add the dupicated contents of the paste buffer to the map */
    100100                Collection<OsmPrimitive> osms = map.values();
Note: See TracChangeset for help on using the changeset viewer.