@Override
public void actionPerformed(ActionEvent e) {
if (!isEnabled())
return;
LatLonDialog dialog = new LatLonDialog(Main.parent, tr("Add Node..."), ht("/Action/AddNode"));
if (textLatLon != null) {
dialog.setLatLonText(textLatLon);
}
if (textEastNorth != null) {
dialog.setEastNorthText(textEastNorth);
}
dialog.showDialog();
if (dialog.getValue() != 1)
return;
LatLon coordinates = dialog.getCoordinates();
if (coordinates == null)
return;
textLatLon = dialog.getLatLonText();
textEastNorth = dialog.getEastNorthText();
Node nnew = new Node(coordinates);
// add the node
Main.main.undoRedo.add(new AddCommand(nnew));