Ticket #10812: patch10812.patch
| File patch10812.patch, 5.5 KB (added by , 11 years ago) |
|---|
-
src/org/openstreetmap/josm/gui/MainApplication.java
68 68 import org.openstreetmap.josm.tools.PlatformHookWindows; 69 69 import org.openstreetmap.josm.tools.Utils; 70 70 71 72 import org.openstreetmap.gui.jmapviewer.tilesources.BingAerialTileSource; 73 import org.openstreetmap.josm.data.imagery.ImageryInfo; 74 75 import org.openstreetmap.josm.gui.layer.TMSLayer; 76 import org.openstreetmap.gui.jmapviewer.interfaces.TileSource; 77 78 79 71 80 /** 72 81 * Main window class application. 73 82 * … … 278 287 * Main application Startup 279 288 * @param argArray Command-line arguments 280 289 */ 281 public static void main(final String[] argArray) { 290 public static void main(final String[] argArray) throws Exception { 291 292 293 282 294 I18n.init(); 283 295 Main.checkJavaVersion(); 284 296 -
src/org/openstreetmap/josm/gui/layer/TMSLayer.java
321 321 class BingAttributionData extends CacheCustomContent<IOException> { 322 322 323 323 public BingAttributionData() { 324 super("bing.attribution.xml", CacheCustomContent.INTERVAL_ HOURLY);324 super("bing.attribution.xml", CacheCustomContent.INTERVAL_NEVER); 325 325 } 326 326 327 327 @Override -
src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
15 15 import java.awt.event.MouseAdapter; 16 16 import java.awt.event.MouseEvent; 17 17 import java.awt.image.BufferedImage; 18 import java.awt.datatransfer.*; 19 import java.awt.Toolkit; 18 20 import java.beans.PropertyChangeEvent; 19 21 import java.beans.PropertyChangeListener; 20 22 import java.io.File; … … 755 757 } 756 758 } 757 759 760 public void copyCurrentPhotoPath() { 761 ImageEntry toCopy = null; 762 if (data != null && data.size() > 0 && currentPhoto >= 0 && currentPhoto < data.size()) { 763 toCopy = data.get(currentPhoto); 764 String copyString = toCopy.getFile().toString(); 765 StringSelection stringSelection = new StringSelection(copyString); 766 Clipboard clpbrd = Toolkit.getDefaultToolkit().getSystemClipboard (); 767 clpbrd.setContents (stringSelection, null); 768 } 769 } 770 758 771 /** 759 772 * Removes a photo from the list of images by index. 760 773 * @param idx Image index -
src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java
42 42 private static final String COMMAND_COLLAPSE = "collapse"; 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(); 47 48 private boolean centerView = false; … … 111 112 btnDeleteFromDisk.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scDeleteFromDisk.getKeyStroke(), ADELFROMDISK); 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 Shortcut scCopyPath = Shortcut.registerShortcut( 119 "geoimage:copypath", tr("Geoimage: {0}", tr("Copy image path")), KeyEvent.VK_C, Shortcut.CTRL_SHIFT); 120 final String ACOPYPATH = "Copy image path"; 121 Main.registerActionShortcut(copyPathAction, scCopyPath); 122 btnDeleteFromDisk.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scCopyPath.getKeyStroke(), ACOPYPATH); 123 btnDeleteFromDisk.getActionMap().put(ADELFROMDISK, copyPathAction); 124 114 125 ImageAction nextAction = new ImageAction(COMMAND_NEXT, ImageProvider.get("dialogs", "next"), tr("Next")); 115 126 btnNext = new JButton(nextAction); 116 127 btnNext.setPreferredSize(buttonDim); … … 152 163 buttons.add(Box.createRigidArea(new Dimension(14, 0))); 153 164 buttons.add(btnDelete); 154 165 buttons.add(btnDeleteFromDisk); 166 buttons.add(Box.createRigidArea(new Dimension(14, 0))); 167 buttons.add(btnCopyPath); 155 168 156 169 JPanel bottomPane = new JPanel(); 157 170 bottomPane.setLayout(new GridBagLayout()); … … 221 234 if (currentLayer != null) { 222 235 currentLayer.removeCurrentPhotoFromDisk(); 223 236 } 237 } else if (COMMAND_COPY_PATH.equals(action)) { 238 if (currentLayer != null) { 239 currentLayer.copyCurrentPhotoPath(); 240 } 224 241 } else if (COMMAND_COLLAPSE.equals(action)) { 225 242 collapseButtonClicked = true; 226 243 detachedDialog.getToolkit().getSystemEventQueue().postEvent(new WindowEvent(detachedDialog, WindowEvent.WINDOW_CLOSING));
