Modify

Opened 15 years ago

Closed 10 years ago

Last modified 10 years ago

#3910 closed enhancement (fixed)

[patch] Selection tool: Lasso

Reported by: Ldp Owned by: team
Priority: normal Milestone:
Component: Core Version:
Keywords: lasso selection Cc:

Description (last modified by stoecker)

Request for a new selection tool, in addition to the current rectangular selection. Having a 'lasso' selection tool would allow to select objects with more freedom, in less time than is currently possible.

For instance: If I want to select a city block, especially in the old world with its complex non-grid structures, I have to make lots of smaller rectangular selections, and click on objects on the border, just to get all of them selected. Being able to go into 'lasso' mode and draw a selection line around the objects, would be a huge help.

Attachments (12)

lassoMode.zip (4.4 KB ) - added by oliver@… 13 years ago.
Patch to add lassoMode
rope.png (955 bytes ) - added by stoecker 13 years ago.
File from autor sent by mail
rope32.png (1.1 KB ) - added by stoecker 13 years ago.
File from autor sent by mail
LassoModeAction.java (1.1 KB ) - added by stoecker 13 years ago.
File from autor sent by mail
3910_v2.patch (16.9 KB ) - added by simon04 13 years ago.
lassoOnS.patch (3.2 KB ) - added by akks 13 years ago.
lassoOnS-5389.patch (3.1 KB ) - added by Cobra 12 years ago.
updated version of akks' patch
lassoOnS-5434.patch (3.1 KB ) - added by Cobra 12 years ago.
updated the patch once again.
lassoOnS-5443.patch (4.1 KB ) - added by akks 12 years ago.
in this patch, repeated S switching is enabled by default, do we need checkbox in preferences?
lassoOnS-5449.patch (4.5 KB ) - added by akks 12 years ago.
lassoOnS-5966.patch (4.4 KB ) - added by Cobra 11 years ago.
updated the latest patch again after r5965 moving some parts around
mauszeiger3.png (1.2 KB ) - added by Klumbumbus 10 years ago.

Download all attachments as: .zip

Change History (60)

comment:1 by lothar.schiborr@…, 13 years ago

Ich schließe mich dem Wunsch an. Wäre eine wichtige Funktion zum Überarbeiten.

comment:2 by stoecker, 13 years ago

Ticket #6303 has been marked as a duplicate of this ticket.

by oliver@…, 13 years ago

Attachment: lassoMode.zip added

Patch to add lassoMode

comment:3 by stoecker, 13 years ago

Description: modified (diff)
Summary: Selection tool: Lasso[patch] Selection tool: Lasso

by stoecker, 13 years ago

Attachment: rope.png added

File from autor sent by mail

by stoecker, 13 years ago

Attachment: rope32.png added

File from autor sent by mail

by stoecker, 13 years ago

Attachment: LassoModeAction.java added

File from autor sent by mail

comment:4 by skyper, 13 years ago

This would also be an nice selction mode for the download dialog.

in reply to:  4 comment:5 by simon04, 13 years ago

Replying to skyper:

This would also be an nice selction mode for the download dialog.

AFAIK the API does not allow non-rectangular bboxes. Therefore, this idea cannot be realized at the moment.

by simon04, 13 years ago

Attachment: 3910_v2.patch added

comment:6 by simon04, 13 years ago

I tested and reworked the patch (added i18n, install lasso as separate mapmode, cleaned up indention, …). As far as I can see, this works nicely, now. Do we have a spare shortcut? :-)

in reply to:  6 comment:7 by akks, 13 years ago

Replying to simon04:

I tested and reworked the patch (added i18n, install lasso as separate mapmode, cleaned up indention, …). As far as I can see, this works nicely, now. Do we have a spare shortcut? :-)

I propose S - S. Second press of S now does not do anything - it can cycle through all selection modes :)

(I am going to move angle shaping to A-A the same way)

comment:8 by bastiK, 13 years ago

I would suggest another icon: https://github.com/goblin/gimp/raw/master/themes/Default/images/tools/stock-tool-free-select-22.png

in reply to:  8 comment:9 by akks, 13 years ago

Replying to bastiK:

I would suggest another icon: https://github.com/goblin/gimp/raw/master/themes/Default/images/tools/stock-tool-free-select-22.png

Good one :)

comment:10 by simon04, 13 years ago

Shall we commit this new map mode? I'd change the icon as bastiK suggested. For simplicity, I'd let open the shortcut mapping for a later improvement.

comment:11 by bastiK, 13 years ago

Haven't tested the patch, but if it works as advertised, I'd say yes.

comment:12 by simon04, 13 years ago

In 5152/josm:

see #3910 - original patch by Oliver Raupach - add lasso selection mode

comment:13 by simon04, 13 years ago

In 5153/josm:

see #3910 - resize icon to 24x24 for correct appearance

comment:14 by simon04, 13 years ago

In 5154/josm:

see #3910 - improve tooltip text of lasso mode

comment:15 by simon04, 13 years ago

Summary: [patch] Selection tool: LassoSelection tool: Lasso

comment:16 by Zverikk, 13 years ago

Please check #7571 — it's a small flaw in Lasso tool usability.

comment:17 by Zverikk, 13 years ago

Lasso tool is hard to select.

  1. Open JOSM.
  2. Load a map.
  3. Click on Lasso tool.

It's not chosen (the default selection tool is), there is "true" in the console windows.

  1. Click on Lasso tool again.

Only now it becomes chosen. Also, when you select another tool, a "false" appears in the console. This debug output should be removed.

comment:18 by simon04, 13 years ago

In 5161/josm:

see #3910 - remove debugging output, make lasso mode work correctly

comment:19 by akks, 13 years ago

What about activating lasso mode on switching back to Select mode by S button?

Here is the patch. The reenterMode function is added to MapMode class that is called on repeated activation attemps.
(I hope it it clean enough not to add bugs).

Last edited 13 years ago by akks (previous) (diff)

by akks, 13 years ago

Attachment: lassoOnS.patch added

in reply to:  19 comment:20 by simon04, 12 years ago

Replying to akks:

What about activating lasso mode on switching back to Select mode by S button?

Here is the patch. The reenterMode function is added to MapMode class that is called on repeated activation attemps.
(I hope it it clean enough not to add bugs).

Nice patch. Then we should make the lasso mode non-expert to avoid confusion when pressing [S] multiple times.

comment:21 by Cobra, 12 years ago

see #7790 for a ticket with regard to this usability issue. akks' patch could be used if there are no objections.

BTW, this ticket should be closed. The desired functionality is implemented.

comment:22 by Cobra, 12 years ago

I updated akks' patch to the current svn version (context of one hunk has changed). There haven't been any other ideas on how to do this, so I think we should use this solution.

by Cobra, 12 years ago

Attachment: lassoOnS-5389.patch added

updated version of akks' patch

by Cobra, 12 years ago

Attachment: lassoOnS-5434.patch added

updated the patch once again.

comment:23 by akks, 12 years ago

Sorry - I almost forgot about this patch myself :)

@ All: should it be included? If S-S is too radical, I can introduce preference key to activate this behavior and disable it by default. Other (exotic) option - make switching by pressing S twice: S - (box)-SS-(lasso)-SS-(box).

comment:24 by bastiK, 12 years ago

I would prefer a normal shortcut (Shift+? or Ctrl+?). The mapmodes have highest priority for shortcuts, so we shouldn't be too stingy. The behaviour from the patch may be good for experienced users, but it is almost certainly not what you'd expect from the beginning.

comment:25 by Cobra, 12 years ago

pressing 's' twice for switching modes is _really_ unexpected behaviour, we shouldn't do this.

bastiK, may I remind you of drawing mode? Pressing 'a' again while in drawing mode toggles angle locking. I think this is quite the same pattern.

The toggling could be explained by the help text in the status bar. Can we get the current shortcut key(s) for the help text? Hard-coding by "press s again to switch to lasso|rectangular mode" wouldn't be nice imho.
BTW, help texts are still missing in this patch.

I like the idea of using the same key for very related actions, and 's' for "select" is easy to remember. (see drawing mode with and without angle locking)

comment:26 by akks, 12 years ago

SelectAction is changed again :) So I'll add configuration parameter to the patch, disabling switching by default (for now) and commit later?

Last edited 12 years ago by akks (previous) (diff)

comment:27 by Cobra, 12 years ago

So you're preparing an "opt-in 's' toggles rectangluar/lasso mode" solution?

comment:28 by akks, 12 years ago

Will it be OK? I am not sure about default. For me, lasso and box are not too different to make switching harder...

Moreover, lasso mode is not independent, it is more like an option of Select mode...

by akks, 12 years ago

Attachment: lassoOnS-5443.patch added

in this patch, repeated S switching is enabled by default, do we need checkbox in preferences?

comment:29 by Cobra, 12 years ago

I applied lassoOnS-5443.patch to r5449​ and continued testing. I noticed 2 issues:

  • major: after settting mappaint.select.toggle-lasso-on-repeated-S to false and then resetting it to true again, toggling is still disabled. Only a restart of josm makes it work again.
  • minor: the cursor isn't changed immediately like in all the others modes. To reproduce, don't move your mouse at all. Then repeatedly press 's'. The recangle will disappear, but the lasso won't appear. This will only happen when the mouse is moved a little bit. The other way round (lasso to rectangular) changes the cursor immediately.
Last edited 12 years ago by Cobra (previous) (diff)

in reply to:  29 ; comment:30 by akks, 12 years ago

Replying to Cobra:

I applied lassoOnS-5443.patch to r5449​ and continued testing. I noticed 2 issues:

  • major: after settting mappaint.select.toggle-lasso-on-repeated-S to false and then resetting it to true again, toggling is still disabled. Only a restart of josm makes it work again.

Switching select mode on and off (A-S for example) should work too.

  • minor: the cursor isn't changed immediately like in all the others modes. To reproduce, don't move your mouse at all. Then repeatedly press 's'. The recangle will disappear, but the lasso won't appear. This will only happen when the mouse is moved a little bit. The other way round (lasso to rectangular) changes the cursor immediately.

Yes, that was confusing, fixed. Small update of the patch follows.

by akks, 12 years ago

Attachment: lassoOnS-5449.patch added

comment:31 by akks, 12 years ago

Jar Build 5449+patch for simpler testing:
https://dl.dropbox.com/u/63393258/josm-custom.jar

By the way, do we really have two (pseudo-)different mapmodes for selection?

Last edited 12 years ago by akks (previous) (diff)

in reply to:  30 comment:32 by Cobra, 12 years ago

Replying to akks:

Replying to Cobra:

I applied lassoOnS-5443.patch to r5449​ and continued testing. I noticed 2 issues:

  • major: after settting mappaint.select.toggle-lasso-on-repeated-S to false and then resetting it to true again, toggling is still disabled. Only a restart of josm makes it work again.

Switching select mode on and off (A-S for example) should work too.

Oh, right. How could I forget to try this? m)

Imho this patch can be applied now.

comment:33 by Cobra, 12 years ago

*bump*

Y U NO APPLY?

comment:34 by stoecker, 12 years ago

Summary: Selection tool: Lasso[patch] Selection tool: Lasso

comment:35 by akks, 12 years ago

Any extra positive opinion and I'll apply it :)
One of current problem: if user holds S button, modes are switched randomly.

Last edited 12 years ago by akks (previous) (diff)

in reply to:  35 comment:36 by Don-vip, 12 years ago

Replying to akks:

One of current problem: if user holds S button, modes are switched randomly.

We should fix it before applying the patch then :) Any idea right now ?

comment:37 by stoecker, 12 years ago

Ticket #7790 has been marked as a duplicate of this ticket.

comment:38 by skyper, 11 years ago

This ticket has already a vote result of plus two ATM. Was this patch totally forgotten ?

comment:39 by akks, 11 years ago

I did not manage to fix button-holding issue. While holding the button, mode entering commands repeat. We do not want one more buggy AWTlistener with timer, do not we?

by Cobra, 11 years ago

Attachment: lassoOnS-5966.patch added

updated the latest patch again after r5965 moving some parts around

comment:40 by akks, 11 years ago

Does anyone know how to get rif of infinite switching when user holds S button?

comment:41 by akks, 10 years ago

Resolution: fixed
Status: newclosed

In 7218/josm:

fix #3910: toggle lasso mode on repeating S key
can be turned of with mappaint.select.toggle-lasso-on-repeated-S

comment:42 by akks, 10 years ago

2 years and this is finished :)

in reply to:  30 ; comment:43 by AlfonZ, 10 years ago

Replying to akks:

Replying to Cobra:

  • minor: the cursor isn't changed immediately like in all the others modes. To reproduce, don't move your mouse at all. Then repeatedly press 's'. The recangle will disappear, but the lasso won't appear. This will only happen when the mouse is moved a little bit. The other way round (lasso to rectangular) changes the cursor immediately.

Yes, that was confusing, fixed. Small update of the patch follows.

The lasso cursor appears only after moving the mouse on my JOSM/1.5 (7219 SVN en) Windows XP 32-Bit.

in reply to:  43 comment:44 by akks, 10 years ago

Replying to AlfonZ:

The lasso cursor appears only after moving the mouse on my JOSM/1.5 (7219 SVN en) Windows XP 32-Bit.

Thank you for noticing! Fixing...

comment:45 by akks, 10 years ago

In 7224/josm:

see #3910: show lasso mode cursor immediately when entering the mode

comment:46 by Klumbumbus, 10 years ago

Currently the button in the edit toolbar shows the lasso and the cursor the rope. Wouldn't it be better if they both show the same icon (lasso)?

comment:47 by akks, 10 years ago

Icon on the toolbar is too big to be a cursor and a cursor is too simple to be a toolbar button. We have the same difference for normal selection mode. If someone creates a good icon similar to cursor (or vice versa), it can be used.

by Klumbumbus, 10 years ago

Attachment: mauszeiger3.png added

comment:48 by Klumbumbus, 10 years ago

I mean this way:

(The lasso icon is this one, resized to 20px. I don't know what the correct size would be.)

Last edited 10 years ago by Klumbumbus (previous) (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.