Ignore:
Timestamp:
13.08.2011 11:00:41 (10 months ago)
Author:
bastiK
Message:

add east/north input to 'add node' and 'move node' actions

File:
1 edited

Legend:

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

    r4191 r4314  
    1010import org.openstreetmap.josm.Main; 
    1111import org.openstreetmap.josm.command.AddCommand; 
     12import org.openstreetmap.josm.data.coor.EastNorth; 
    1213import org.openstreetmap.josm.data.coor.LatLon; 
    1314import org.openstreetmap.josm.data.osm.Node; 
     
    2122public final class AddNodeAction extends JosmAction { 
    2223    // remember input from last time 
    23     private String text; 
     24    private String textLatLon, textEastNorth; 
    2425 
    2526    public AddNodeAction() { 
    26         super(tr("Add Node..."), "addnode", tr("Add a node by entering latitude and longitude."), 
     27        super(tr("Add Node..."), "addnode", tr("Add a node by entering latitude / longitude or easting / northing."), 
    2728                Shortcut.registerShortcut("addnode", tr("Edit: {0}", tr("Add Node...")), KeyEvent.VK_D, Shortcut.GROUP_EDIT, 
    2829                        Shortcut.SHIFT_DEFAULT), true); 
     
    3637        LatLonDialog dialog = new LatLonDialog(Main.parent, tr("Add Node..."), ht("/Action/AddNode")); 
    3738 
    38         if (text != null) { 
    39             dialog.setText(text); 
     39        if (textLatLon != null) { 
     40            dialog.setLatLonText(textLatLon); 
     41        } 
     42        if (textEastNorth != null) { 
     43            dialog.setEastNorthText(textEastNorth); 
    4044        } 
    4145 
    42         dialog.setVisible(true); 
    43         if (dialog.isCanceled()) 
     46        dialog.showDialog(); 
     47         
     48        if (dialog.getValue() != 1) 
    4449            return; 
    4550 
     
    4853            return; 
    4954 
    50         text = dialog.getText(); 
     55        textLatLon = dialog.getLatLonText(); 
     56        textEastNorth = dialog.getEastNorthText(); 
    5157 
    5258        Node nnew = new Node(coordinates); 
Note: See TracChangeset for help on using the changeset viewer.