File tree 1 file changed +11
-1
lines changed
src/main/java/org/openstreetmap/josm/plugins/maproulette/gui/layer
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 35
35
import org .openstreetmap .josm .data .osm .Relation ;
36
36
import org .openstreetmap .josm .data .osm .visitor .BoundingXYVisitor ;
37
37
import org .openstreetmap .josm .data .osm .visitor .paint .StyledMapRenderer ;
38
+ import org .openstreetmap .josm .data .preferences .CachingProperty ;
39
+ import org .openstreetmap .josm .data .preferences .IntegerProperty ;
38
40
import org .openstreetmap .josm .data .preferences .NamedColorProperty ;
39
41
import org .openstreetmap .josm .gui .MainApplication ;
40
42
import org .openstreetmap .josm .gui .MapView ;
62
64
* A layer for showing task locations
63
65
*/
64
66
public class MapRouletteClusteredPointLayer extends Layer implements MouseListener {
67
+ /** The number of clicks for deselection */
68
+ private static final CachingProperty <Integer > DESELECT_CLICK_COUNT = new IntegerProperty (
69
+ "maproulette.task.deselect.mouse.click.count" , 3 ).cached ();
70
+
65
71
/**
66
72
* The style source, mostly used for preferences
67
73
*/
@@ -292,7 +298,11 @@ public void mouseClicked(MouseEvent e) {
292
298
}
293
299
}
294
300
}
295
- this .setSelected (add );
301
+ if (add .isEmpty () && e .getClickCount () >= DESELECT_CLICK_COUNT .get ()) {
302
+ this .setSelected (Collections .emptyList ());
303
+ } else if (!add .isEmpty ()) {
304
+ this .setSelected (add );
305
+ }
296
306
this .invalidate ();
297
307
}
298
308
You can’t perform that action at this time.
0 commit comments