Changeset 31454 in osm
- Timestamp:
- 2015-08-05T11:46:28+02:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/mapillary
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryDownloader.java
r31451 r31454 157 157 private static boolean isAreaTooBig() { 158 158 double area = 0; 159 System.out.println(Main.map.mapView.getLayersOfType(OsmDataLayer.class));160 159 for (Bounds bounds : Main.map.mapView.getEditLayer().data 161 160 .getDataSourceBounds()) { -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/HyperlinkLabel.java
r31445 r31454 5 5 import java.awt.AWTEvent; 6 6 import java.awt.Cursor; 7 import java.awt.Toolkit; 8 import java.awt.datatransfer.Clipboard; 9 import java.awt.datatransfer.StringSelection; 7 10 import java.awt.event.ActionEvent; 8 11 import java.awt.event.ActionListener; … … 14 17 15 18 import javax.swing.JLabel; 19 import javax.swing.JMenuItem; 20 import javax.swing.JPopupMenu; 16 21 import javax.swing.SwingConstants; 17 22 18 23 import org.openstreetmap.josm.Main; 24 import org.openstreetmap.josm.plugins.mapillary.MapillaryImage; 19 25 20 26 import java.awt.Desktop; … … 84 90 */ 85 91 @Override 86 protected void processMouseEvent(MouseEvent evt) { 87 super.processMouseEvent(evt); 88 if (evt.getID() == MouseEvent.MOUSE_CLICKED) 89 fireActionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, 90 getNormalText())); 92 protected void processMouseEvent(MouseEvent e) { 93 super.processMouseEvent(e); 94 if (e.getID() == MouseEvent.MOUSE_CLICKED) { 95 if (e.getButton() == MouseEvent.BUTTON1) 96 fireActionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, 97 getNormalText())); 98 if (e.getButton() == MouseEvent.BUTTON3) { 99 LinkPopUp menu = new LinkPopUp(); 100 menu.show(e.getComponent(), e.getX(), e.getY()); 101 } 102 } 103 } 104 105 /** 106 * PopUp shown when right click on the label. 107 * 108 * @author nokutu 109 * 110 */ 111 private class LinkPopUp extends JPopupMenu { 112 113 private static final long serialVersionUID = 1384054752970921552L; 114 115 JMenuItem copy; 116 117 public LinkPopUp() { 118 this.copy = new JMenuItem("Copy key"); 119 this.copy.addActionListener(new copyAction()); 120 add(this.copy); 121 } 122 123 private class copyAction implements ActionListener { 124 125 @Override 126 public void actionPerformed(ActionEvent arg0) { 127 StringSelection stringSelection = new StringSelection( 128 ((MapillaryImage) MapillaryMainDialog.getInstance().getImage()) 129 .getKey()); 130 Clipboard clpbrd = Toolkit.getDefaultToolkit().getSystemClipboard(); 131 clpbrd.setContents(stringSelection, null); 132 } 133 134 } 91 135 } 92 136 -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryMainDialog.java
r31452 r31454 510 510 }); 511 511 } else if (data != null && result == LoadResult.SUCCESS) { 512 System.out.println(attributes.getMetadata());513 512 try { 514 513 BufferedImage img = ImageIO.read(new ByteArrayInputStream(data -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/oauth/OAuthUtils.java
r31449 r31454 167 167 HttpResponse response = httpClient.execute(httpPost); 168 168 if (response.getStatusLine().toString().contains("204")) { 169 System.out.println("Succesfully uploaded image");170 169 PluginState.imageUploaded(); 171 170 } … … 234 233 } 235 234 236 private static File updateFile(MapillaryImportedImage image) 235 /** 236 * Returns a file containing the picture and an updated version of the EXIF 237 * tags. 238 * 239 * @param image 240 * @return A File object containing the picture and an updated version of the 241 * EXIF tags. 242 * @throws ImageReadException 243 * @throws IOException 244 * @throws ImageWriteException 245 */ 246 public static File updateFile(MapillaryImportedImage image) 237 247 throws ImageReadException, IOException, ImageWriteException { 238 248 TiffOutputSet outputSet = null; -
applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/MapillarySequenceDownloadThreadTest.java
r31453 r31454 10 10 import java.util.concurrent.Executors; 11 11 12 import org.junit.Before;13 12 import org.junit.Test; 14 13 import org.openstreetmap.josm.data.Bounds; … … 16 15 import org.openstreetmap.josm.plugins.mapillary.downloads.MapillaryDownloader; 17 16 import org.openstreetmap.josm.plugins.mapillary.downloads.MapillarySequenceDownloadThread; 18 import org.openstreetmap.josm.plugins.mapillary.util.TestUtil;19 17 20 18 /**
Note:
See TracChangeset
for help on using the changeset viewer.