Changeset 17631 in josm


Ignore:
Timestamp:
2021-03-21T22:14:56+01:00 (4 years ago)
Author:
simon04
Message:

fix #19527 - Download Dialog: Bounding Box: copy bounds to clipboard

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/download/BoundingBoxSelection.java

    r15756 r17631  
    2929import org.openstreetmap.josm.data.coor.LatLon;
    3030import org.openstreetmap.josm.data.coor.conversion.DecimalDegreesCoordinateFormat;
     31import org.openstreetmap.josm.gui.datatransfer.ClipboardUtils;
    3132import org.openstreetmap.josm.gui.widgets.JosmTextArea;
    3233import org.openstreetmap.josm.gui.widgets.JosmTextField;
    3334import org.openstreetmap.josm.tools.GBC;
     35import org.openstreetmap.josm.tools.ImageProvider;
     36import org.openstreetmap.josm.tools.ImageProvider.ImageSizes;
    3437import org.openstreetmap.josm.tools.JosmDecimalFormatSymbolsProvider;
    3538import org.openstreetmap.josm.tools.Logging;
     
    108111            latlonPanel.add(panel, positions[i]);
    109112        }
    110         dlg.add(latlonPanel, GBC.eop().insets(0, 20, 0, 0));
     113        dlg.add(latlonPanel, GBC.std().insets(0, 20, 0, 0));
     114        final JButton btnCopy = new JButton(tr("Copy bounds"), ImageProvider.get("copy", ImageSizes.SMALLICON));
     115        btnCopy.addMouseListener(new MouseAdapter() {
     116            @Override
     117            public void mouseClicked(MouseEvent arg0) {
     118                ClipboardUtils.copyString(gui.currentBounds.encodeAsString(","));
     119            }
     120        });
     121        dlg.add(btnCopy, GBC.eop().insets(20, 20, 0, 0));
    111122
    112123        final JButton btnClear = new JButton(tr("Clear textarea"));
     
    118129        });
    119130        dlg.add(btnClear, GBC.eol().insets(10, 20, 0, 0));
    120 
    121131        dlg.add(new JLabel(tr("URL from www.openstreetmap.org (you can paste an URL here to download the area)")),
    122132                GBC.eol().insets(10, 5, 5, 0));
Note: See TracChangeset for help on using the changeset viewer.