- Timestamp:
- 2014-12-11T14:43:25+01:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/layer/geoimage
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
r7784 r7788 16 16 import java.awt.event.MouseEvent; 17 17 import java.awt.image.BufferedImage; 18 import java.awt.datatransfer.Clipboard; 19 import java.awt.datatransfer.StringSelection; 20 import java.awt.Toolkit; 18 21 import java.beans.PropertyChangeEvent; 19 22 import java.beans.PropertyChangeListener; … … 757 760 } 758 761 762 public void copyCurrentPhotoPath() { 763 ImageEntry toCopy = null; 764 if (data != null && data.size() > 0 && currentPhoto >= 0 && currentPhoto < data.size()) { 765 toCopy = data.get(currentPhoto); 766 String copyString = toCopy.getFile().toString(); 767 Utils.copyToClipboard(copyString); 768 } 769 } 770 759 771 /** 760 772 * Removes a photo from the list of images by index. -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java
r7660 r7788 43 43 private static final String COMMAND_FIRST = "first"; 44 44 private static final String COMMAND_LAST = "last"; 45 private static final String COMMAND_COPY_PATH = "copypath"; 45 46 46 47 private ImageDisplay imgDisplay = new ImageDisplay(); … … 112 113 btnDeleteFromDisk.getActionMap().put(ADELFROMDISK, delFromDiskAction); 113 114 115 ImageAction copyPathAction = new ImageAction(COMMAND_COPY_PATH, ImageProvider.get("copy"), tr("Copy image path")); 116 JButton btnCopyPath = new JButton(copyPathAction); 117 btnCopyPath.setPreferredSize(buttonDim); 118 final String ACOPYPATH = "Copy image path"; 119 btnCopyPath.getActionMap().put(ACOPYPATH, copyPathAction); 120 114 121 ImageAction nextAction = new ImageAction(COMMAND_NEXT, ImageProvider.get("dialogs", "next"), tr("Next")); 115 122 btnNext = new JButton(nextAction); … … 147 154 buttons.add(btnPrevious); 148 155 buttons.add(btnNext); 149 buttons.add(Box.createRigidArea(new Dimension( 14, 0)));156 buttons.add(Box.createRigidArea(new Dimension(7, 0))); 150 157 buttons.add(tbCentre); 151 158 buttons.add(btnZoomBestFit); 152 buttons.add(Box.createRigidArea(new Dimension( 14, 0)));159 buttons.add(Box.createRigidArea(new Dimension(7, 0))); 153 160 buttons.add(btnDelete); 154 161 buttons.add(btnDeleteFromDisk); 162 buttons.add(Box.createRigidArea(new Dimension(7, 0))); 163 buttons.add(btnCopyPath); 155 164 156 165 JPanel bottomPane = new JPanel(); … … 222 231 currentLayer.removeCurrentPhotoFromDisk(); 223 232 } 233 } else if (COMMAND_COPY_PATH.equals(action)) { 234 if (currentLayer != null) { 235 currentLayer.copyCurrentPhotoPath(); 236 } 224 237 } else if (COMMAND_COLLAPSE.equals(action)) { 225 238 collapseButtonClicked = true;
Note:
See TracChangeset
for help on using the changeset viewer.