Changeset 31219 in osm for applications/editors/josm/plugins/mapillary
- Timestamp:
- 2015-06-04T21:22:06+02:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/mapillary
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapillary/.classpath
r31214 r31219 3 3 <classpathentry kind="src" path="src"/> 4 4 <classpathentry combineaccessrules="false" kind="src" path="/JOSM"/> 5 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> 6 <classpathentry combineaccessrules="false" kind="src" path="/JOSM-commons-imaging"/> 5 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> 7 6 <classpathentry kind="lib" path="/home/nokutu/josm/dist/commons-imaging.jar"/> 8 7 <classpathentry kind="output" path="bin"/> -
applications/editors/josm/plugins/mapillary/build.xml
r31211 r31219 10 10 <property name="plugin.description" value="Enables user to work with pictures hosted at mapillary.com"/> 11 11 <property name="plugin.icon" value="images/icon24.png"/> 12 < !-- <property name="plugin.link" value="..."/>-->12 <property name="plugin.link" value="https://wiki.openstreetmap.org/wiki/JOSM/Plugins/Mapillary"/> 13 13 <!--<property name="plugin.early" value="..."/>--> 14 14 <property name="plugin.requires" value="commons-imaging"/> -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryImage.java
r31218 r31219 30 30 /** Temporal direction of the picture until it is uplaoded */ 31 31 private double tempCa; 32 /** 33 * When the object direction is being moved in the map, the temporal 34 * direction is stored here 35 */ 36 private double movingCa; 32 37 33 38 /** … … 46 51 this.key = key; 47 52 this.latLon = new LatLon(lat, lon); 48 this.tempLatLon = new LatLon(lat, lon);49 this.movingLatLon = new LatLon(lat, lon);53 this.tempLatLon = this.latLon; 54 this.movingLatLon = this.latLon; 50 55 this.ca = ca; 51 56 this.tempCa = ca; 57 this.movingCa = ca; 52 58 } 53 59 … … 87 93 */ 88 94 public void turn(double ca) { 89 this. tempCa =ca;95 this.movingCa = this.tempCa + ca; 90 96 this.isModified = true; 91 97 } … … 97 103 public void stopMoving() { 98 104 this.tempLatLon = this.movingLatLon; 105 this.tempCa = this.movingCa; 99 106 } 100 107 … … 104 111 * @return The direction of the image (0 means north and goes clockwise). 105 112 */ 106 public Double getCa() { 113 public double getCa() { 114 return movingCa; 115 } 116 117 /** 118 * Returns the last fixed direction of the object. 119 * @return 120 */ 121 public double getTempCa() { 107 122 return tempCa; 108 123 } … … 148 163 } 149 164 165 @Override 166 public int hashCode() { 167 return this.key.hashCode(); 168 } 169 150 170 /** 151 171 * If the MapillaryImage belongs to a MapillarySequence, returns the next -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java
r31218 r31219 35 35 import java.awt.event.MouseAdapter; 36 36 import java.awt.event.MouseEvent; 37 import java.awt.event.MouseListener;38 import java.awt.event.MouseMotionAdapter;39 37 import java.awt.geom.AffineTransform; 40 38 import java.awt.image.AffineTransformOp; … … 45 43 import javax.swing.Action; 46 44 import javax.swing.Icon; 47 import javax.swing.SwingUtilities;48 45 49 46 import java.util.List; … … 110 107 private Point start; 111 108 private int lastButton; 109 private MapillaryImage closest; 112 110 113 111 @Override … … 119 117 .getInstance()) 120 118 return; 121 Point clickPoint = e.getPoint(); 119 if (e.getClickCount() == 2 && mapillaryData.getSelectedImage() != null) { 120 for (MapillaryImage img : mapillaryData.getSelectedImage().getSequence().getImages()) { 121 mapillaryData.addMultiSelectedImage(img); 122 } 123 } 124 MapillaryImage closest = getClosest(e.getPoint()); 125 this.start = e.getPoint(); 126 this.closest = closest; 127 if (mapillaryData.getMultiSelectedImages().contains(closest)) 128 return; 129 if (e.getModifiers() == (MouseEvent.BUTTON1_MASK | MouseEvent.CTRL_MASK)) 130 mapillaryData.addMultiSelectedImage(closest); 131 else 132 mapillaryData.setSelectedImage(closest); 133 } 134 135 private MapillaryImage getClosest(Point clickPoint){ 122 136 double snapDistance = 10; 123 137 double minDistance = Double.MAX_VALUE; … … 135 149 } 136 150 } 137 start = e.getPoint(); 138 if (mapillaryData.getMultiSelectedImages().contains(closest)) 139 return; 140 if (e.getModifiers() == (MouseEvent.BUTTON1_MASK | MouseEvent.CTRL_MASK)) 141 mapillaryData.addMultiSelectedImage(closest); 142 else 143 mapillaryData.setSelectedImage(closest); 151 return closest; 144 152 } 145 153 … … 160 168 } else if (lastButton == MouseEvent.BUTTON1 161 169 && e.isShiftDown()) { 170 this.closest.turn(Math.toDegrees(Math.atan2( 171 (e.getX() - start.x), -(e.getY() - start.y))) - closest.getTempCa()); 162 172 for (MapillaryImage img : MapillaryData.getInstance() 163 173 .getMultiSelectedImages()) { 164 174 img.turn(Math.toDegrees(Math.atan2( 165 (e.getX() - start.x), -(e.getY() - start.y))) );175 (e.getX() - start.x), -(e.getY() - start.y))) - closest.getTempCa()); 166 176 } 167 177 Main.map.repaint(); -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillarySequence.java
r31196 r31219 117 117 } 118 118 119 public boolean equals(MapillarySequence sequence) { 120 return this.getKey() == sequence.getKey(); 119 @Override 120 public boolean equals(Object obj) { 121 if (obj instanceof MapillarySequence) 122 return this.getKey().equals(((MapillarySequence) obj).getKey()); 123 return false; 124 } 125 126 @Override 127 public int hashCode() { 128 return this.key.hashCode(); 121 129 } 122 130 } -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryToggleDialog.java
r31215 r31219 13 13 import java.io.IOException; 14 14 import java.util.Arrays; 15 import java.util.Collection;16 15 import java.util.List; 17 16 … … 26 25 27 26 import javax.imageio.ImageIO; 28 import javax.swing.BoxLayout;29 import javax.swing.JButton;30 import javax.swing.JScrollPane;31 27 import javax.swing.SwingUtilities; 32 28 import javax.swing.AbstractAction; -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySequenceDownloadThread.java
r31201 r31219 79 79 MapillarySequence sequence = new MapillarySequence(jsonobj.getString("key"), jsonobj.getJsonNumber("captured_at").intValue()); 80 80 for (MapillaryImage mimage : MapillaryData.getInstance().getImages()) 81 if (mimage.getSequence().getKey() == sequence.getKey())81 if (mimage.getSequence().getKey().equals(sequence.getKey())) 82 82 break; 83 83 int first = -1;
Note:
See TracChangeset
for help on using the changeset viewer.