Changeset 1169 in josm for trunk/src/org/openstreetmap/josm/actions/AddNodeAction.java
- Timestamp:
- 23.12.2008 15:07:05 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AddNodeAction.java
r1138 r1169 41 41 42 42 /** 43 * This action displays a dialog where the user can enter a latitude and longitude, 43 * This action displays a dialog where the user can enter a latitude and longitude, 44 44 * and when ok is pressed, a new node is created at the specified position. 45 45 */ … … 47 47 48 48 public AddNodeAction() { 49 super(tr("Add Node"), "addnode", tr("Add a node by entering latitude and longitude."),50 Shortcut.registerShortcut("addnode", tr("Edit: {0}", tr("Add Node")), KeyEvent.VK_D, Shortcut.GROUP_EDIT,51 Shortcut.SHIFT_DEFAULT), true);49 super(tr("Add Node"), "addnode", tr("Add a node by entering latitude and longitude."), 50 Shortcut.registerShortcut("addnode", tr("Edit: {0}", tr("Add Node")), KeyEvent.VK_D, Shortcut.GROUP_EDIT, 51 Shortcut.SHIFT_DEFAULT), true); 52 52 } 53 53 54 public void actionPerformed(ActionEvent e) { 54 public void actionPerformed(ActionEvent e) { 55 55 JPanel p = new JPanel(new GridBagLayout()); 56 56 p.add(new JLabel("<html>"+ 57 tr("Enter the coordinates for the new node.") + 58 "<br>" + tr("Use decimal degrees.") + 59 "<br>" + tr("Negative values denote Western/Southern hemisphere.")), 57 tr("Enter the coordinates for the new node.") + 58 "<br>" + tr("Use decimal degrees.") + 59 "<br>" + tr("Negative values denote Western/Southern hemisphere.")), 60 60 GBC.eol()); 61 61 62 62 p.add(new JLabel(tr("Latitude")), GBC.std().insets(0,10,5,0)); 63 63 final JTextField lat = new JTextField(12); … … 65 65 p.add(new JLabel(tr("Longitude")), GBC.std().insets(0,0,5,10)); 66 66 final JTextField lon = new JTextField(12); 67 p.add(lon, GBC.eol().insets(0,0,0,10)); 68 67 p.add(lon, GBC.eol().insets(0,0,0,10)); 68 69 69 Node nnew = null; 70 70 … … 79 79 } catch (Exception ex) { } 80 80 } 81 82 /* Now execute the commands to add the dupicated contents of the paste buffer to the map */83 84 Main.main.undoRedo.add(new AddCommand(nnew));85 Main.ds.setSelected(nnew);86 Main.map.mapView.repaint();81 82 /* Now execute the commands to add the dupicated contents of the paste buffer to the map */ 83 84 Main.main.undoRedo.add(new AddCommand(nnew)); 85 Main.ds.setSelected(nnew); 86 Main.map.mapView.repaint(); 87 87 } 88 88 }
Note: See TracChangeset
for help on using the changeset viewer.
