Modify

Opened 10 years ago

Closed 5 years ago

Last modified 5 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@… 8 years ago.
Patch to add lassoMode
rope.png (955 bytes) - added by stoecker 8 years ago.
File from autor sent by mail
rope32.png (1.1 KB) - added by stoecker 8 years ago.
File from autor sent by mail
LassoModeAction.java (1.1 KB) - added by stoecker 8 years ago.
File from autor sent by mail
3910_v2.patch (16.9 KB) - added by simon04 7 years ago.
lassoOnS.patch (3.2 KB) - added by akks 7 years ago.
lassoOnS-5389.patch (3.1 KB) - added by Cobra 7 years ago.
updated version of akks' patch
lassoOnS-5434.patch (3.1 KB) - added by Cobra 7 years ago.
updated the patch once again.
lassoOnS-5443.patch (4.1 KB) - added by akks 7 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 7 years ago.
lassoOnS-5966.patch (4.4 KB) - added by Cobra 6 years ago.
updated the latest patch again after r5965 moving some parts around
mauszeiger3.png (1.2 KB) - added by Klumbumbus 5 years ago.

Download all attachments as: .zip

Change History (60)

comment:1 Changed 8 years ago by lothar.schiborr@…

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

comment:2 Changed 8 years ago by stoecker

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

Changed 8 years ago by oliver@…

Attachment: lassoMode.zip added

Patch to add lassoMode

comment:3 Changed 8 years ago by stoecker

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

Changed 8 years ago by stoecker

Attachment: rope.png added

File from autor sent by mail

Changed 8 years ago by stoecker

Attachment: rope32.png added

File from autor sent by mail

Changed 8 years ago by stoecker

Attachment: LassoModeAction.java added

File from autor sent by mail

comment:4 Changed 8 years ago by skyper

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

comment:5 in reply to:  4 Changed 7 years ago by simon04

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.

Changed 7 years ago by simon04

Attachment: 3910_v2.patch added

comment:6 Changed 7 years ago by 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? :-)

comment:7 in reply to:  6 Changed 7 years ago by akks

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 Changed 7 years ago by bastiK

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

comment:9 in reply to:  8 Changed 7 years ago by akks

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 Changed 7 years ago by simon04

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 Changed 7 years ago by bastiK

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

comment:12 Changed 7 years ago by simon04

In 5152/josm:

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

comment:13 Changed 7 years ago by simon04

In 5153/josm:

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

comment:14 Changed 7 years ago by simon04

In 5154/josm:

see #3910 - improve tooltip text of lasso mode

comment:15 Changed 7 years ago by simon04

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

comment:16 Changed 7 years ago by Zverikk

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

comment:17 Changed 7 years ago by Zverikk

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 Changed 7 years ago by simon04

In 5161/josm:

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

comment:19 Changed 7 years ago by 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).

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

Changed 7 years ago by akks

Attachment: lassoOnS.patch added

comment:20 in reply to:  19 Changed 7 years ago by simon04

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 Changed 7 years ago by Cobra

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 Changed 7 years ago by Cobra

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.

Changed 7 years ago by Cobra

Attachment: lassoOnS-5389.patch added

updated version of akks' patch

Changed 7 years ago by Cobra

Attachment: lassoOnS-5434.patch added

updated the patch once again.

comment:23 Changed 7 years ago by akks

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 Changed 7 years ago by bastiK

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 Changed 7 years ago by Cobra

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 Changed 7 years ago by akks

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

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

comment:27 Changed 7 years ago by Cobra

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

comment:28 Changed 7 years ago by akks

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...

Changed 7 years ago by akks

Attachment: lassoOnS-5443.patch added

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

comment:29 Changed 7 years ago by 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.
  • 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 7 years ago by Cobra (previous) (diff)

comment:30 in reply to:  29 ; Changed 7 years ago by 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.

  • 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.

Changed 7 years ago by akks

Attachment: lassoOnS-5449.patch added

comment:31 Changed 7 years ago by akks

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 7 years ago by akks (previous) (diff)

comment:32 in reply to:  30 Changed 7 years ago by Cobra

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 Changed 7 years ago by Cobra

*bump*

Y U NO APPLY?

comment:34 Changed 7 years ago by stoecker

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

comment:35 Changed 7 years ago by akks

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

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

comment:36 in reply to:  35 Changed 7 years ago by Don-vip

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 Changed 7 years ago by stoecker

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

comment:38 Changed 6 years ago by skyper

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

comment:39 Changed 6 years ago by akks

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?

Changed 6 years ago by Cobra

Attachment: lassoOnS-5966.patch added

updated the latest patch again after r5965 moving some parts around

comment:40 Changed 6 years ago by akks

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

comment:41 Changed 5 years ago by akks

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 Changed 5 years ago by akks

2 years and this is finished :)

comment:43 in reply to:  30 ; Changed 5 years ago by AlfonZ

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.

comment:44 in reply to:  43 Changed 5 years ago by akks

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 Changed 5 years ago by akks

In 7224/josm:

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

comment:46 Changed 5 years ago by Klumbumbus

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 Changed 5 years ago by akks

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.

Changed 5 years ago by Klumbumbus

Attachment: mauszeiger3.png added

comment:48 Changed 5 years ago by Klumbumbus

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 5 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.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.