Changeset 31922 in osm for applications/editors/josm/plugins/photoadjust/src
- Timestamp:
- 2016-01-03T15:03:35+01:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/photoadjust/src/org/openstreetmap/josm/plugins/photoadjust
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/photoadjust/src/org/openstreetmap/josm/plugins/photoadjust/PhotoAdjustPlugin.java
r30962 r31922 36 36 super(info); 37 37 GeoImageLayer.registerMenuAddition(new UntaggedGeoImageLayerAction()); 38 //new PhotoPropertyEditor(); 38 39 worker = new PhotoAdjustWorker(); 39 40 initAdapters(); … … 51 52 layers.add(imageLayer); 52 53 worker.doMousePressed(evt, layers); 54 } 55 } 56 57 @Override 58 public void mouseReleased(MouseEvent evt) { 59 if (imageLayer != null) { 60 worker.doMouseReleased(evt); 53 61 } 54 62 } -
applications/editors/josm/plugins/photoadjust/src/org/openstreetmap/josm/plugins/photoadjust/PhotoAdjustWorker.java
r31413 r31922 23 23 // the photo is moved very far. 24 24 private Point2D dragOffset = null; 25 private boolean centerViewIsDisabled = false; 26 private boolean centerViewNeedsEnable = false; 25 27 26 28 /** … … 31 33 dragLayer = null; 32 34 dragOffset = null; 35 } 36 37 /** 38 * Disable the "center view" button. The map is moved instead of the 39 * photo if the center view is enabled while a photo is moved. The method 40 * disables the center view to avoid such behavior. Call 41 * restoreCenterView() to restore the original state. 42 */ 43 public void disableCenterView() { 44 if (!centerViewIsDisabled) { 45 centerViewIsDisabled = true; 46 centerViewNeedsEnable = ImageViewerDialog.setCentreEnabled(false); 47 } 48 } 49 50 /** 51 * Restore the center view state that was active before 52 * disableCenterView() was called. 53 */ 54 public void restoreCenterView() { 55 if (centerViewIsDisabled) { 56 if (centerViewNeedsEnable) { 57 centerViewNeedsEnable = false; 58 ImageViewerDialog.setCentreEnabled(true); 59 } 60 centerViewIsDisabled = false; 61 } 33 62 } 34 63 … … 94 123 dragLayer = layer; 95 124 setDragOffset(dragPhoto, evt); 125 disableCenterView(); 96 126 break; 97 127 } … … 100 130 } 101 131 } 132 } 133 134 /** 135 * Mouse release handler. 136 * 137 * @param evt Mouse event from MouseAdapter mouseReleased(). 138 */ 139 public void doMouseReleased(MouseEvent evt) { 140 restoreCenterView(); 102 141 } 103 142 … … 114 153 } 115 154 else { 155 disableCenterView(); 116 156 movePhoto(dragPhoto, dragLayer, evt); 117 157 }
Note:
See TracChangeset
for help on using the changeset viewer.