Ignore:
Timestamp:
2019-11-02T15:27:37+01:00 (5 years ago)
Author:
donvip
Message:

fix deprecation warning

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/CommandLine/src/org/openstreetmap/josm/plugins/commandline/PointAction.java

    r34574 r35210  
    7272    }
    7373
    74     @Override public void mousePressed(MouseEvent e) {
     74    @Override
     75    public void mousePressed(MouseEvent e) {
    7576        if (e.getButton() == MouseEvent.BUTTON1) {
    7677            if (isCtrlDown) {
     
    8081                }
    8182            } else {
    82                 LatLon coor;
    83                 if (nearestNode == null)
    84                     coor = MainApplication.getMap().mapView.getLatLon(e.getX(), e.getY());
    85                 else
    86                     coor = nearestNode.getCoor();
    87                 if (coor.isOutSideWorld()) {
     83                Node node = nearestNode;
     84                if (node == null)
     85                    node = new Node(MainApplication.getMap().mapView.getEastNorth(e.getX(), e.getY()));
     86                if (node.isOutSideWorld()) {
    8887                    JOptionPane.showMessageDialog(MainApplication.getMainFrame(), tr("Can not draw outside of the world."));
    8988                    return;
    9089                }
     90                LatLon coor = node.getCoor();
    9191                String point = String.valueOf(coor.getX()) + "," + String.valueOf(coor.getY());
    9292                int maxInstances = parentPlugin.currentCommand.parameters.get(parentPlugin.currentCommand.currentParameterNum).maxInstances;
Note: See TracChangeset for help on using the changeset viewer.