Changeset 31277 in osm for applications/editors/josm/plugins
- Timestamp:
- 2015-06-18T15:15:47+02:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary
- Files:
-
- 1 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryImage.java
r31275 r31277 132 132 133 133 public String getDate() { 134 return getDate("dd/MM/yyyy - hh:mm:ss"); 135 } 136 137 public String getDate(String format) { 134 138 Date date = new Date(getCapturedAt()); 135 139 136 SimpleDateFormat formatter = new SimpleDateFormat( "dd/MM/yyyy - hh:mm:ss");140 SimpleDateFormat formatter = new SimpleDateFormat(format); 137 141 return formatter.format(date); 138 142 } -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryImportedImage.java
r31264 r31277 13 13 */ 14 14 protected File file; 15 public final String datetimeOriginal; 15 16 16 public MapillaryImportedImage(double lat, double lon, double ca, File file ) {17 public MapillaryImportedImage(double lat, double lon, double ca, File file, String datetimeOriginal) { 17 18 super(lat, lon, ca); 18 19 this.file = file; 20 System.out.println(datetimeOriginal); 21 this.datetimeOriginal = datetimeOriginal; 19 22 } 20 23 -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java
r31275 r31277 4 4 5 5 import org.apache.commons.jcs.access.CacheAccess; 6 import org.openstreetmap.josm.plugins.mapillary.actions.MapillaryDownloadViewAction; 6 7 import org.openstreetmap.josm.plugins.mapillary.cache.MapillaryCache; 7 8 import org.openstreetmap.josm.plugins.mapillary.downloads.MapillaryDownloader; … … 46 47 import javax.swing.Action; 47 48 import javax.swing.Icon; 49 import javax.swing.JOptionPane; 48 50 49 51 import java.util.List; … … 53 55 DataSetListener, EditLayerChangeListener, LayerChangeListener { 54 56 55 public final static int SEQUENCE_MAX_JUMP_DISTANCE = 100; 57 public final static int SEQUENCE_MAX_JUMP_DISTANCE = Main.pref.getInteger( 58 "mapillary.sequence-max-jump-distance", 100); 56 59 57 60 public static MapillaryLayer INSTANCE; … … 62 65 private final MapillaryData mapillaryData = MapillaryData.getInstance(); 63 66 64 p rivateList<Bounds> bounds;67 public List<Bounds> bounds; 65 68 66 69 private MapillaryToggleDialog mtd; … … 68 71 69 72 private MouseAdapter mouseAdapter; 70 71 int highlightPointRadius = Main.pref.getInteger("mappaint.highlight.radius", 7); 72 private int highlightStep = Main.pref.getInteger("mappaint.highlight.step", 4); 73 74 int highlightPointRadius = Main.pref.getInteger( 75 "mappaint.highlight.radius", 7); 76 private int highlightStep = Main.pref.getInteger("mappaint.highlight.step", 77 4); 73 78 74 79 public MapillaryLayer() { … … 128 133 129 134 /** 130 * Downloads all images of the area covered by the OSM data. 135 * Downloads all images of the area covered by the OSM data. This is only 136 * just for automatic download. 131 137 */ 132 138 public void download() { 139 checkBigAreas(); 140 if (Main.pref.getBoolean("mapillary.download-manually")) 141 return; 133 142 for (Bounds bounds : Main.map.mapView.getEditLayer().data 134 143 .getDataSourceBounds()) { … … 141 150 } 142 151 152 private void checkBigAreas() { 153 double area = 0; 154 for (Bounds bounds : Main.map.mapView.getEditLayer().data 155 .getDataSourceBounds()) { 156 area += bounds.getArea(); 157 } 158 if (area > MapillaryDownloadViewAction.MAX_AREA) { 159 Main.pref.put("mapillary.download-manually", true); 160 JOptionPane 161 .showMessageDialog( 162 Main.parent, 163 tr("The downloaded OSM area is too big. Download mode has been change to manual. You can change this back to automatic in preferences settings.")); 164 } 165 } 166 143 167 /** 144 168 * Returns the MapillaryData object, which acts as the database of the … … 158 182 MapillaryToggleDialog.getInstance().mapillaryImageDisplay 159 183 .setImage(null); 184 MapillaryData.getInstance().getImages().clear(); 160 185 MapillaryLayer.INSTANCE = null; 161 186 MapillaryData.INSTANCE = null; … … 252 277 } 253 278 } 254 279 255 280 /** 256 281 * Draws the highlight of the icon. 282 * 257 283 * @param g 258 284 * @param p 259 285 * @param size 260 286 */ 261 private void drawPointHighlight(Graphics2D g, Point p, int size) { 262 Color oldColor = g.getColor(); 263 Color highlightColor = PaintColors.HIGHLIGHT.get(); 264 Color highlightColorTransparent = new Color(highlightColor.getRed(), highlightColor.getGreen(), highlightColor.getBlue(), 100); 265 g.setColor(highlightColorTransparent); 266 int s = size + highlightPointRadius; 267 while(s >= size) { 268 int r = (int) Math.floor(s/2d); 269 g.fillRoundRect(p.x-r, p.y-r, s, s, r, r); 270 s -= highlightStep; 271 } 272 g.setColor(oldColor); 273 } 287 private void drawPointHighlight(Graphics2D g, Point p, int size) { 288 Color oldColor = g.getColor(); 289 Color highlightColor = PaintColors.HIGHLIGHT.get(); 290 Color highlightColorTransparent = new Color(highlightColor.getRed(), 291 highlightColor.getGreen(), highlightColor.getBlue(), 100); 292 g.setColor(highlightColorTransparent); 293 int s = size + highlightPointRadius; 294 while (s >= size) { 295 int r = (int) Math.floor(s / 2d); 296 g.fillRoundRect(p.x - r, p.y - r, s, s, r, r); 297 s -= highlightStep; 298 } 299 g.setColor(oldColor); 300 } 274 301 275 302 /** … … 305 332 } 306 333 307 308 334 @Override 309 335 public Icon getIcon() { … … 319 345 public void mergeFrom(Layer from) { 320 346 throw new UnsupportedOperationException( 321 " Notes layer does not support merging yet");347 "This layer does not support merging yet"); 322 348 } 323 349 … … 458 484 if (newLayer == this) { 459 485 if (MapillaryData.getInstance().getImages().size() > 0) 460 Main.map.statusLine.setHelpText(tr("Total images: ")461 + MapillaryData.getInstance().getImages().size());486 Main.map.statusLine.setHelpText(tr("Total images: {0}", 487 MapillaryData.getInstance().getImages().size())); 462 488 else 463 489 Main.map.statusLine.setHelpText(tr("No images found")); 464 490 } 465 466 491 } 467 492 -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryMouseAdapter.java
r31273 r31277 42 42 return; 43 43 MapillaryAbstractImage closestTemp = getClosest(e.getPoint()); 44 if (Main.map.mapView.getActiveLayer() instanceof OsmDataLayer && closestTemp != null) { 44 if (Main.map.mapView.getActiveLayer() instanceof OsmDataLayer 45 && closestTemp != null) { 45 46 this.lastClicked = this.closest; 46 47 MapillaryData.getInstance().setSelectedImage(closestTemp); … … 134 135 if (Main.map.mapView.getActiveLayer() != MapillaryLayer.getInstance()) 135 136 return; 137 138 if (!Main.pref.getBoolean("mapillary.developer")) 139 for (MapillaryAbstractImage img : MapillaryData.getInstance() 140 .getMultiSelectedImages()) { 141 if (img instanceof MapillaryImage) 142 return; 143 } 136 144 if (MapillaryData.getInstance().getSelectedImage() != null) { 137 145 if (lastButton == MouseEvent.BUTTON1 && !e.isShiftDown()) { … … 141 149 for (MapillaryAbstractImage img : MapillaryData.getInstance() 142 150 .getMultiSelectedImages()) { 151 143 152 img.move(to.getX() - from.getX(), to.getY() - from.getY()); 144 153 } -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryPlugin.java
r31275 r31277 52 52 private final MapillarySignAction signAction; 53 53 private final MapillaryZoomAction zoomAction; 54 private final MapillaryDownloadViewAction downloadViewAction; 54 55 55 56 public static JMenuItem DOWNLOAD_MENU; … … 58 59 public static JMenuItem SIGN_MENU; 59 60 public static JMenuItem ZOOM_MENU; 61 public static JMenuItem DOWNLOAD_VIEW_MENU; 60 62 61 63 public MapillaryPlugin(PluginInformation info) { … … 66 68 signAction = new MapillarySignAction(); 67 69 zoomAction = new MapillaryZoomAction(); 70 downloadViewAction = new MapillaryDownloadViewAction(); 68 71 69 72 DOWNLOAD_MENU = MainMenu.add(Main.main.menu.imageryMenu, … … 73 76 IMPORT_MENU = MainMenu.add(Main.main.menu.fileMenu, importAction, 74 77 false, 14); 75 SIGN_MENU = MainMenu 76 .add(Main.main.menu.dataMenu, signAction, false); 78 SIGN_MENU = MainMenu.add(Main.main.menu.dataMenu, signAction, false); 77 79 ZOOM_MENU = MainMenu 78 80 .add(Main.main.menu.viewMenu, zoomAction, false, 15); 79 81 DOWNLOAD_VIEW_MENU = MainMenu.add(Main.main.menu.fileMenu, 82 downloadViewAction, false, 14); 83 80 84 EXPORT_MENU.setEnabled(false); 81 85 DOWNLOAD_MENU.setEnabled(false); … … 83 87 SIGN_MENU.setEnabled(false); 84 88 ZOOM_MENU.setEnabled(false); 89 DOWNLOAD_VIEW_MENU.setEnabled(false); 85 90 86 91 MapView.addEditLayerChangeListener(this); … … 119 124 DOWNLOAD_MENU.setEnabled(true); 120 125 IMPORT_MENU.setEnabled(true); 126 DOWNLOAD_VIEW_MENU.setEnabled(true); 121 127 } else if (oldLayer != null && newLayer == null) { 122 128 DOWNLOAD_MENU.setEnabled(false); 123 129 IMPORT_MENU.setEnabled(false); 130 DOWNLOAD_VIEW_MENU.setEnabled(false); 124 131 } 125 132 } -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillarySequence.java
r31256 r31277 14 14 private final List<MapillaryImage> images; 15 15 private final String key; 16 private final intcreated_at;16 private final long created_at; 17 17 18 public MapillarySequence(String key, intcreated_at) {18 public MapillarySequence(String key, long created_at) { 19 19 this.images = new ArrayList<>(); 20 20 this.key = key; … … 31 31 } 32 32 33 public intgetCreatedAt() {33 public long getCreatedAt() { 34 34 return created_at; 35 35 } -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryDownloadAction.java
r31266 r31277 9 9 import java.awt.event.KeyEvent; 10 10 11 import org.openstreetmap.josm.gui.layer.Layer;12 11 import org.openstreetmap.josm.Main; 13 12 import org.openstreetmap.josm.actions.JosmAction; … … 23 22 */ 24 23 public class MapillaryDownloadAction extends JosmAction { 25 MapillaryLayer layer;26 24 27 25 public MapillaryDownloadAction() { … … 36 34 @Override 37 35 public void actionPerformed(ActionEvent arg0) { 38 this.layer = null; 39 for (Layer layer : Main.map.mapView.getAllLayers()) 40 if (layer instanceof MapillaryLayer) 41 this.layer = (MapillaryLayer) layer; 42 43 if (this.layer == null) { 44 layer = new MapillaryLayer(); 45 layer.download(); 46 } else { 47 if (Main.map.mapView.getActiveLayer() != layer) 48 Main.map.mapView.setActiveLayer(layer); 36 if (MapillaryLayer.INSTANCE == null) 37 MapillaryLayer.getInstance().download(); 38 else { 39 if (Main.map.mapView.getActiveLayer() != MapillaryLayer 40 .getInstance()) 41 Main.map.mapView.setActiveLayer(MapillaryLayer.getInstance()); 49 42 else 50 43 Main.map.mapView … … 52 45 } 53 46 } 47 54 48 } -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportAction.java
r31271 r31277 7 7 import java.io.File; 8 8 import java.io.IOException; 9 import java.text.SimpleDateFormat; 10 import java.util.Calendar; 9 11 10 12 import javax.swing.JFileChooser; … … 17 19 import org.apache.commons.imaging.formats.jpeg.JpegImageMetadata; 18 20 import org.apache.commons.imaging.formats.tiff.TiffField; 21 import org.apache.commons.imaging.formats.tiff.constants.ExifTagConstants; 19 22 import org.apache.commons.imaging.formats.tiff.constants.GpsTagConstants; 20 23 import org.openstreetmap.josm.Main; … … 114 117 final TiffField ca = jpegMetadata 115 118 .findEXIFValueWithExactMatch(GpsTagConstants.GPS_TAG_GPS_IMG_DIRECTION); 119 final TiffField datetimeOriginal = jpegMetadata 120 .findEXIFValueWithExactMatch(ExifTagConstants.EXIF_TAG_DATE_TIME_ORIGINAL); 121 if (lat_ref == null || lat == null || lon == null 122 || lon_ref == null) { 123 readNoTags(file); 124 } 116 125 double latValue = 0; 117 126 double lonValue = 0; … … 129 138 if (lon_ref.getValue().toString().equals("W")) 130 139 lonValue = -lonValue; 131 if ( latValue != 0 && lonValue != 0) {140 if (datetimeOriginal != null) 132 141 MapillaryData.getInstance().add( 133 142 new MapillaryImportedImage(latValue, lonValue, caValue, 134 file)); 135 } else { 136 readNoTags(file); 137 } 143 file, datetimeOriginal.getStringValue())); 144 else 145 MapillaryData.getInstance().add( 146 new MapillaryImportedImage(latValue, lonValue, caValue, 147 file, currentDate())); 138 148 } 139 149 } … … 156 166 MapillaryData.getInstance().add( 157 167 new MapillaryImportedImage(pos.lat(), pos.lon() + horDev, 0, 158 file ));168 file, currentDate())); 159 169 noTagsPics++; 160 170 } … … 171 181 / 3600; 172 182 } 183 184 private String currentDate() { 185 Calendar cal = Calendar.getInstance(); 186 187 SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd hh:mm:ss"); 188 return formatter.format(cal); 189 190 } 173 191 } -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryDownloader.java
r31259 r31277 48 48 url2 += buildParameters(hash); 49 49 url3 += buildParameters(hash); 50 System.out.println(url2); 50 51 51 52 try { 52 53 Main.info("MapillaryPlugin GET " + url2); 53 Main.worker.submit(new MapillarySquareDownloadManagerThread(url1, url2, url3 , new Bounds(minLatLon, maxLatLon)));54 Main.worker.submit(new MapillarySquareDownloadManagerThread(url1, url2, url3)); 54 55 } catch (Exception e) { 55 56 Main.error(e); 56 57 } 58 } 59 60 public void getImages(Bounds bounds) { 61 getImages(bounds.getMin(), bounds.getMax()); 57 62 } 58 63 -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryExportManager.java
r31261 r31277 35 35 ArrayBlockingQueue<MapillaryAbstractImage> queueImages; 36 36 37 final int amount; 37 38 List<MapillaryAbstractImage> images; 38 39 String path; … … 46 47 47 48 this.images = images; 49 amount = images.size(); 48 50 this.path = path; 49 51 } … … 63 65 queueImages.add(image); 64 66 } 67 amount = images.size(); 65 68 } 66 69 … … 73 76 protected void realRun() throws SAXException, IOException, 74 77 OsmTransferException { 75 76 78 // Starts a writer thread in order to write the pictures on the disk. 77 79 Thread writer = new Thread(new MapillaryExportWriterThread(path, queue, 78 queueImages, queue.size(), this.getProgressMonitor()));80 queueImages, amount, this.getProgressMonitor())); 79 81 writer.start(); 80 82 if (path == null) { -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryExportWriterThread.java
r31261 r31277 15 15 import org.apache.commons.imaging.common.RationalNumber; 16 16 import org.apache.commons.imaging.formats.jpeg.exif.ExifRewriter; 17 import org.apache.commons.imaging.formats.tiff.constants.ExifTagConstants; 17 18 import org.apache.commons.imaging.formats.tiff.constants.GpsTagConstants; 18 19 import org.apache.commons.imaging.formats.tiff.write.TiffOutputDirectory; … … 62 63 mimg = queueImages.take(); 63 64 if (path == null && mimg instanceof MapillaryImportedImage) { 64 String path = ((MapillaryImportedImage) mimg).getFile().getPath(); 65 String path = ((MapillaryImportedImage) mimg).getFile() 66 .getPath(); 65 67 finalPath = path.substring(0, path.lastIndexOf('.')); 66 } 67 else if (mimg instanceof MapillaryImage) 68 } else if (mimg instanceof MapillaryImage) 68 69 finalPath = path + "/" + ((MapillaryImage) mimg).getKey(); 69 70 else … … 76 77 // Write EXIF tags 77 78 TiffOutputSet outputSet = new TiffOutputSet(); 78 TiffOutputDirectory exifDirectory = outputSet 79 .getOrCreateGPSDirectory(); 79 TiffOutputDirectory exifDirectory = outputSet.getOrCreateExifDirectory(); 80 80 exifDirectory 81 81 .add(GpsTagConstants.GPS_TAG_GPS_IMG_DIRECTION_REF, … … 83 83 exifDirectory.add(GpsTagConstants.GPS_TAG_GPS_IMG_DIRECTION, 84 84 RationalNumber.valueOf(mimg.getCa())); 85 if (mimg instanceof MapillaryImportedImage) { 86 exifDirectory.add( 87 ExifTagConstants.EXIF_TAG_DATE_TIME_ORIGINAL, 88 ((MapillaryImportedImage) mimg).datetimeOriginal); 89 } 90 else if (mimg instanceof MapillaryImage) 91 exifDirectory.add( 92 ExifTagConstants.EXIF_TAG_DATE_TIME_ORIGINAL, 93 ((MapillaryImage) mimg).getDate("yyyy/MM/dd hh/mm/ss")); 85 94 outputSet.setGPSInDegrees(mimg.getLatLon().lon(), mimg 86 95 .getLatLon().lat()); -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySequenceDownloadThread.java
r31256 r31277 19 19 import org.openstreetmap.josm.plugins.mapillary.MapillaryData; 20 20 import org.openstreetmap.josm.plugins.mapillary.MapillaryImage; 21 import org.openstreetmap.josm.plugins.mapillary.MapillaryLayer; 21 22 import org.openstreetmap.josm.plugins.mapillary.MapillarySequence; 22 23 … … 33 34 private String url; 34 35 private ExecutorService ex; 35 private Boundsbounds;36 private List<Bounds> bounds; 36 37 37 public MapillarySequenceDownloadThread(ExecutorService ex, String url, 38 Bounds bounds) { 38 public MapillarySequenceDownloadThread(ExecutorService ex, String url) { 39 39 this.url = url; 40 40 this.ex = ex; 41 this.bounds = bounds;41 this.bounds = MapillaryLayer.getInstance().bounds; 42 42 } 43 43 … … 77 77 MapillarySequence sequence = new MapillarySequence( 78 78 jsonobj.getString("key"), jsonobj.getJsonNumber( 79 "captured_at").intValue()); 80 for (MapillaryAbstractImage mimage : MapillaryData 81 .getInstance().getImages()) 82 if (mimage instanceof MapillaryImage 83 && ((MapillaryImage) mimage).getSequence().getKey() 84 .equals(sequence.getKey())) 85 break; 79 "captured_at").longValue()); 80 86 81 int first = -1; 87 82 int last = -1; … … 91 86 // area. 92 87 for (MapillaryAbstractImage img : images) { 93 if (first == -1 && bounds.contains(img.getLatLon()))88 if (first == -1 && isInside(img)) 94 89 first = pos; 95 90 else if (first != -1 && last == -1 96 && ! bounds.contains(img.getLatLon()))91 && !isInside(img)) 97 92 last = pos; 98 else if (last != -1 && bounds.contains(img.getLatLon()))93 else if (last != -1 && isInside(img)) 99 94 last = -1; 100 95 pos++; … … 107 102 List<MapillaryImage> finalImages = images.subList(first, last); 108 103 for (MapillaryImage img : finalImages) { 104 MapillaryData.getInstance().getImages().remove(img); 109 105 img.setSequence(sequence); 110 106 } … … 118 114 } 119 115 } 116 117 private boolean isInside(MapillaryAbstractImage image) { 118 for (int i = 0; i < bounds.size(); i++) { 119 if (bounds.get(i).contains(image.getLatLon())) 120 return true; 121 } 122 return false; 123 } 120 124 } -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySignDownloaderThread.java
r31275 r31277 48 48 rects = rectversions.getJsonObject(j).getJsonArray("rects"); 49 49 for (int k = 0; k < rects.size(); k++) { 50 JsonObject data = rects.getJsonObject( j);50 JsonObject data = rects.getJsonObject(k); 51 51 for (MapillaryAbstractImage image : MapillaryData 52 52 .getInstance().getImages()) -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySquareDownloadManagerThread.java
r31275 r31277 8 8 9 9 import org.openstreetmap.josm.Main; 10 import org.openstreetmap.josm.data.Bounds;11 10 import org.openstreetmap.josm.plugins.mapillary.MapillaryData; 12 11 … … 25 24 private final String urlSequences; 26 25 private final String urlSigns; 27 private final Bounds bounds;28 26 29 27 public MapillarySquareDownloadManagerThread(String urlImages, 30 String urlSequences, String urlSigns , Bounds bounds) {28 String urlSequences, String urlSigns) { 31 29 this.urlImages = urlImages; 32 30 this.urlSequences = urlSequences; 33 31 this.urlSigns = urlSigns; 34 this.bounds = bounds;35 32 } 36 33 … … 39 36 try { 40 37 downloadSequences(); 38 Main.map.statusLine.setHelpText("Downloading image's information"); 41 39 completeImages(); 42 Main.map.statusLine.setHelpText("Downloading signs information");40 Main.map.statusLine.setHelpText("Downloading signs"); 43 41 downloadSigns(); 44 42 } catch (InterruptedException e) { … … 59 57 while (!ex.isShutdown()) { 60 58 ex.execute(new MapillarySequenceDownloadThread(ex, urlSequences 61 + "&page=" + page + "&limit=1" , bounds));59 + "&page=" + page + "&limit=1")); 62 60 while (ex.getQueue().remainingCapacity() == 0) 63 61 Thread.sleep(100); -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryImageDisplay.java
r31266 r31277 21 21 import javax.swing.JPanel; 22 22 23 import org.openstreetmap.josm.Main; 24 23 25 /** 24 26 * This object is a responsible JComponent which lets you zoom and drag. It is … … 31 33 public class MapillaryImageDisplay extends JComponent { 32 34 33 private static final int DRAG_BUTTON = 3;34 private static final int OPTION_BUTTON = 2;35 private static final int ZOOM_BUTTON = 1;35 private static final int DRAG_BUTTON = Main.pref.getInteger("mapillary.picture-drag-button", 3); 36 private static final int OPTION_BUTTON = Main.pref.getInteger("mapillary.picture-option-button", 2); 37 private static final int ZOOM_BUTTON = Main.pref.getInteger("mapillary.picture-zoom-button", 1); 36 38 37 39 /** The image currently displayed */ -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryPreferenceSetting.java
r31256 r31277 14 14 public class MapillaryPreferenceSetting implements SubPreferenceSetting { 15 15 16 private JCheckBox reverseButtons = new JCheckBox(tr("Reverse buttons position when displaying images."));; 16 private JCheckBox reverseButtons = new JCheckBox(tr("Reverse buttons position when displaying images.")); 17 private JCheckBox downloadMode = new JCheckBox(tr("Download images manually")); 18 17 19 18 20 @Override … … 26 28 27 29 reverseButtons.setSelected(Main.pref.getBoolean("mapillary.reverse-buttons")); 30 downloadMode.setSelected(Main.pref.getBoolean("mapillary.download-manually")); 28 31 32 panel.setLayout(new FlowLayout(FlowLayout.LEFT)); 29 33 panel.add(reverseButtons); 30 panel. setLayout(new FlowLayout(FlowLayout.LEFT));34 panel.add(downloadMode); 31 35 gui.getDisplayPreference().addSubTab(this, "Mapillary", panel); 32 36 } … … 36 40 boolean mod = false; 37 41 Main.pref.put("mapillary.reverse-buttons", reverseButtons.isSelected()); 42 Main.pref.put("mapillary.download-manually", downloadMode.isSelected()); 38 43 return mod; 39 44 }
Note:
See TracChangeset
for help on using the changeset viewer.