Changeset 32374 in osm for applications/editors/josm/plugins/mapillary/src
- Timestamp:
- 2016-06-23T01:17:42+02:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java
r32365 r32374 47 47 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeEvent; 48 48 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeListener; 49 import org.openstreetmap.josm.gui.layer.OsmDataLayer;50 49 import org.openstreetmap.josm.plugins.mapillary.cache.CacheUtils; 51 50 import org.openstreetmap.josm.plugins.mapillary.gui.MapillaryFilterDialog; -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/cache/CacheUtils.java
r31840 r32374 16 16 * 17 17 */ 18 public class CacheUtils { 18 public final class CacheUtils { 19 19 20 20 private static IgnoreDownload ignoreDownload = new IgnoreDownload(); … … 28 28 /** Both of them */ 29 29 BOTH; 30 } 31 32 private CacheUtils() { 33 // Private constructor to avoid instantiation 30 34 } 31 35 -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryFilterDialog.java
r32064 r32374 255 255 } 256 256 257 /** 258 * Destroys the unique instance of the class. 259 */ 260 public static synchronized void destroyInstance() { 261 instance = null; 262 } 263 257 264 private class DownloadCheckBoxAction extends AbstractAction { 258 265 259 266 private static final long serialVersionUID = 4672634002899519496L; 260 267 261 publicDownloadCheckBoxAction() {268 DownloadCheckBoxAction() { 262 269 putValue(NAME, tr("Downloaded images")); 263 270 } … … 273 280 private static final long serialVersionUID = -7417238601979689863L; 274 281 275 publicUpdateAction() {282 UpdateAction() { 276 283 putValue(NAME, tr("Update")); 277 284 } … … 289 296 private static final long serialVersionUID = 1178261778165525040L; 290 297 291 publicResetAction() {298 ResetAction() { 292 299 putValue(NAME, tr("Reset")); 293 300 } … … 303 310 private static final long serialVersionUID = -2937440338019185723L; 304 311 305 publicOnlySignsAction() {312 OnlySignsAction() { 306 313 putValue(NAME, tr("Only images with signs")); 307 314 } … … 322 329 private static final long serialVersionUID = 8706299665735930148L; 323 330 324 publicSignChooserAction() {331 SignChooserAction() { 325 332 putValue(NAME, tr("Choose signs")); 326 333 } … … 338 345 } 339 346 } 340 341 /**342 * Destroys the unique instance of the class.343 */344 public static synchronized void destroyInstance() {345 instance = null;346 }347 347 } -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryImageDisplay.java
r32373 r32374 36 36 private static final long serialVersionUID = 3369727203329307716L; 37 37 38 private static final int DRAG_BUTTON = Main.pref.getInteger( 39 "mapillary.picture-drag-button", 3); 40 private static final int OPTION_BUTTON = Main.pref.getInteger( 41 "mapillary.picture-option-button", 2); 42 private static final int ZOOM_BUTTON = Main.pref.getInteger( 43 "mapillary.picture-zoom-button", 1); 38 private static final int DRAG_BUTTON = Main.pref.getInteger("mapillary.picture-drag-button", 3); 39 private static final int OPTION_BUTTON = Main.pref.getInteger("mapillary.picture-option-button", 2); 40 private static final int ZOOM_BUTTON = Main.pref.getInteger("mapillary.picture-zoom-button", 1); 44 41 45 42 /** The image currently displayed */ … … 61 58 protected HyperlinkLabel hyperlink; 62 59 63 private class ImgDisplayMouseListener implements MouseListener, 64 MouseWheelListener, MouseMotionListener { 60 private class ImgDisplayMouseListener implements MouseListener, MouseWheelListener, MouseMotionListener { 65 61 private boolean mouseIsDragging; 66 62 private long lastTimeForMousePoint; … … 431 427 private final Point comp2imgCoord(Rectangle visibleRect, int xComp, int yComp) { 432 428 Rectangle drawRect = calculateDrawImageRectangle(visibleRect); 433 return new Point(visibleRect.x + ((xComp - drawRect.x) * visibleRect.width) 434 / drawRect.width, visibleRect.y 435 + ((yComp - drawRect.y) * visibleRect.height) / drawRect.height); 429 return new Point( 430 visibleRect.x + ((xComp - drawRect.x) * visibleRect.width) / drawRect.width, 431 visibleRect.y + ((yComp - drawRect.y) * visibleRect.height) / drawRect.height 432 ); 436 433 } 437 434 438 435 private static final Point getCenterImgCoord(Rectangle visibleRect) { 439 return new Point(visibleRect.x + visibleRect.width / 2, visibleRect.y 440 + visibleRect.height / 2); 436 return new Point(visibleRect.x + visibleRect.width / 2, visibleRect.y + visibleRect.height / 2); 441 437 } 442 438 443 439 private Rectangle calculateDrawImageRectangle(Rectangle visibleRect) { 444 return calculateDrawImageRectangle(visibleRect, new Rectangle(0, 0, 445 getSize().width, getSize().height)); 440 return calculateDrawImageRectangle(visibleRect, new Rectangle(0, 0, getSize().width, getSize().height)); 446 441 } 447 442 … … 482 477 Rectangle visibleRect; 483 478 synchronized (this) { 484 image = MapillaryImageDisplay.this.image;485 visibleRect = MapillaryImageDisplay.this.visibleRect;479 image = this.image; 480 visibleRect = this.visibleRect; 486 481 } 487 482 if (image == null) -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryMainDialog.java
r31972 r32374 575 575 this.buttonsPanel = new JPanel(new GridLayout(1, 1)); 576 576 if (!buttons.isEmpty() && buttons.get(0) != null) { 577 final JPanel buttonRowPanel = new JPanel(Main.pref.getBoolean( 578 "dialog.align.left", false) ? new FlowLayout(FlowLayout.LEFT) 579 : new GridLayout(1, buttons.size())); 577 final JPanel buttonRowPanel = new JPanel( 578 Main.pref.getBoolean("dialog.align.left", false) 579 ? new FlowLayout(FlowLayout.LEFT) 580 : new GridLayout(1, buttons.size()) 581 ); 580 582 this.buttonsPanel.add(buttonRowPanel); 581 583 for (SideButton button : buttons) { -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillaryDownloader.java
r32373 r32374 184 184 } 185 185 186 pr otectedstatic void tooBigErrorDialog() {186 private static void tooBigErrorDialog() { 187 187 if (SwingUtilities.isEventDispatchThread()) { 188 188 MapillaryLayer.getInstance().tempSemiautomatic = true; -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/utils/ImageUtil.java
r32034 r32374 136 136 private final byte[] magic = new byte[Math.max(JFIF_MAGIC.length, PNG_MAGIC.length)]; 137 137 138 ImageFileFilter() { }139 140 138 @Override 141 139 public synchronized boolean accept(File f) {
Note:
See TracChangeset
for help on using the changeset viewer.