Modify

Opened 11 years ago

Closed 4 years ago

#8352 closed enhancement (fixed)

Color picker for presets, color viewer for tag toolbox

Reported by: !i! Owned by: team
Priority: normal Milestone: 20.05
Component: Core Version:
Keywords: color preset-ui Cc: AndreasHae

Description

As esp. 3D with OSM lifes from *:colour=* attributes to make objects looking natural, I recommend to embedd an color-viewer in the tags toolbox and allow it to click it to open an colour picker.

Maybe this simplifies for people to bring the rainbow to OSM ;)

Attachments (11)

2020-04-12-170330_468x707_scrot.png (18.7 KB ) - added by simon04 4 years ago.
2020-04-12-231958_476x380_scrot.png (8.5 KB ) - added by simon04 4 years ago.
8352_green.png (23.3 KB ) - added by Klumbumbus 4 years ago.
8352_brown.png (23.3 KB ) - added by Klumbumbus 4 years ago.
8352_sort.png (6.9 KB ) - added by Klumbumbus 4 years ago.
8352_frame.png (20.1 KB ) - added by Klumbumbus 4 years ago.
8352_16314.gif (773.1 KB ) - added by Klumbumbus 4 years ago.
Invisible_color_picker_area.png (79.2 KB ) - added by Claudius 4 years ago.
Grey area right hand side of colour dropdown is missing indicator that it is clickable
2020-05-31-201708.png (7.5 KB ) - added by simon04 4 years ago.
2020-05-31-201920.png (7.4 KB ) - added by simon04 4 years ago.
josm_tagsMembership_panal_color.png (13.4 KB ) - added by skyper 4 years ago.
TagsMembership panel with same color as background

Download all attachments as: .zip

Change History (54)

comment:1 by Don-vip, 11 years ago

Keywords: color added

See also #8935

comment:2 by simon04, 5 years ago

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

comment:3 by simon04, 5 years ago

Cc: AndreasHae added
Keywords: preset-ui added
Summary: Color pickerColor picker for presets, color viewer for tag toolbox

comment:4 by simon04, 4 years ago

Resolution: fixed
Status: newclosed

In 16277/josm:

fix #8352 - Presets: add color chooser for <combo>

by simon04, 4 years ago

comment:5 by simon04, 4 years ago

Milestone: 20.04


comment:6 by skyper, 4 years ago

Nice, thanks.
Does it work automatically for *colour* or what is to be done ?
Could you, please, add it to the documentation at TaggingPresets. Thanks

Last edited 4 years ago by skyper (previous) (diff)

comment:7 by simon04, 4 years ago

Done: TaggingPresets?action=diff&version=167 (your question is answered there as well)

comment:8 by Don-vip, 4 years ago

Do you think it could be added to the properties dialog too?

comment:9 by Don-vip, 4 years ago

It broke org.openstreetmap.josm.gui.tagging.presets.items.ComboTest.testAddToPanel

java.lang.NullPointerException
	at org.openstreetmap.josm.gui.tagging.presets.items.Combo.addToPanelAnchor(Combo.java:103)
	at org.openstreetmap.josm.gui.tagging.presets.items.ComboMultiSelect.addToPanel(ComboMultiSelect.java:392)
	at org.openstreetmap.josm.gui.tagging.presets.items.ComboTest.testAddToPanel(ComboTest.java:36)

comment:10 by simon04, 4 years ago

In 16282/josm:

see #8352, see #19075 - Presets: fix unit tests

comment:11 by simon04, 4 years ago

In 16283/josm:

see #8352 - PropertiesDialog: preview color as colored square

Version 0, edited 4 years ago by simon04 (next)

by simon04, 4 years ago

by Klumbumbus, 4 years ago

Attachment: 8352_green.png added

by Klumbumbus, 4 years ago

Attachment: 8352_brown.png added

by Klumbumbus, 4 years ago

Attachment: 8352_sort.png added

comment:12 by Klumbumbus, 4 years ago

Resolution: fixed
Status: closedreopened

This is a great feature, but it still has some bugs for me.

URL:https://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2020-04-12 23:55:52 +0200 (Sun, 12 Apr 2020)
Build-Date:2020-04-13 01:30:46
Revision:16284
Relative:URL: ^/trunk

Identification: JOSM/1.5 (16284 de) Windows 10 64-Bit
OS Build number: Windows 10 Pro 1909 (18363)
Memory Usage: 802 MB / 1820 MB (288 MB allocated, but free)
Java version: 1.8.0_241-b07, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Screen: \Display0 1680x1050
Maximum Screen Size: 1680x1050
...
Last edited 4 years ago by simon04 (previous) (diff)

by Klumbumbus, 4 years ago

Attachment: 8352_frame.png added

comment:13 by Klumbumbus, 4 years ago

If I use hex code instead of color names, I see a thin colored frame in the preset dialog, see attachment:8352_frame.png

comment:14 by simon04, 4 years ago

In 16292/josm:

see #8352 - PropertiesDialog: consider table sorting for color preview

in reply to:  12 comment:15 by simon04, 4 years ago

Replying to Klumbumbus:

Java's support for color names is very limited: "Black" "Silver" "Gray" "White" "Maroon" "Red" "Purple" "Fuchsia" "Green" "Lime" "Olive" "Yellow" "Navy" "Blue" "Teal" "Aqua" "Orange" (taken from javax.swing.text.html.CSS#stringToColor) – those correspond to the basic list from https://www.w3.org/TR/css3-color/#html4

It seems that we'll have to compile the color list from https://www.w3.org/TR/css-color-3/#svg-color into our ColourHelper

EDIT: We can reuse the ColorTable from svgSalamander – com.kitfox.svg.xml.ColorTable

Last edited 4 years ago by simon04 (previous) (diff)

comment:16 by Klumbumbus, 4 years ago

OK, I took that statement from wiki:/Help/Styles/MapCSSImplementation#Propertyvaluesexplanations "named color as found in this list"

comment:17 by simon04, 4 years ago

Ah, nice – we're shipping the colors twice:

  • org.openstreetmap.josm.gui.mappaint.mapcss.CSSColors
  • com.kitfox.svg.xml.ColorTable

comment:18 by simon04, 4 years ago

In 16293/josm:

see #8352 - PropertiesDialog/Presets: evaluate CSS color names

comment:19 by simon04, 4 years ago

In 16294/josm:

see #8352 - Presets: remove border from color chooser button

comment:20 by simon04, 4 years ago

Resolution: fixed
Status: reopenedclosed

comment:21 by Klumbumbus, 4 years ago

Resolution: fixed
Status: closedreopened

The box in the preset still shows no color for me. Also the properties dialog doesn't display the actual value of the colour key. E.g. when the value is "green", it shows "#008000", thats not nice.

URL:https://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2020-04-14 21:56:05 +0200 (Tue, 14 Apr 2020)
Build-Date:2020-04-15 01:30:44
Revision:16301
Relative:URL: ^/trunk

Identification: JOSM/1.5 (16301 de) Windows 10 64-Bit
OS Build number: Windows 10 Pro 1909 (18363)
Memory Usage: 636 MB / 1820 MB (413 MB allocated, but free)
Java version: 1.8.0_251-b08, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Screen: \Display0 1680x1050
Maximum Screen Size: 1680x1050
VM arguments: [-Djava.security.manager, -Djava.security.policy=file:<java.home>\lib\security\javaws.policy, -DtrustProxy=true, -Djnlpx.home=<java.home>\bin, -Djnlpx.origFilenameArg=C:\Program Files (x86)\josm-latest.jnlp, -Djnlpx.remove=false, -Djava.util.Arrays.useLegacyMergeSort=true, -Djnlpx.heapsize=NULL,2048m, -Djnlpx.splashport=60168, -Djnlpx.jvm=<java.home>\bin\javaw.exe]
Dataset consistency test: No problems found
Last edited 4 years ago by Klumbumbus (previous) (diff)

comment:22 by simon04, 4 years ago

In 16308/josm:

see #8352 - PropertiesDialog: do not replace CSS color name with HEX code

comment:23 by simon04, 4 years ago

In 16309/josm:

see #8352 - Presets: use opaque color chooser button

comment:24 by simon04, 4 years ago

Klumbumbus, thanks for summarizing the outstanding issues. Both should be addressed in r16308+r16309.

in reply to:  24 ; comment:25 by Klumbumbus, 4 years ago

The string display in properties dialog is fixed, but:

  • regarding the square in the properties dialog, green works but red not
  • the box in the preset still doesn't work

see 8352_16314.gif

URL:https://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2020-04-15 23:44:38 +0200 (Wed, 15 Apr 2020)
Build-Date:2020-04-16 01:30:46
Revision:16314
Relative:URL: ^/trunk

Identification: JOSM/1.5 (16314 de) Windows 10 64-Bit
OS Build number: Windows 10 Pro 1909 (18363)
Memory Usage: 835 MB / 1820 MB (266 MB allocated, but free)
Java version: 1.8.0_251-b08, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Screen: \Display0 1680x1050
Maximum Screen Size: 1680x1050
VM arguments: [-Djava.security.manager, -Djava.security.policy=file:<java.home>\lib\security\javaws.policy, -DtrustProxy=true, -Djnlpx.home=<java.home>\bin, -Djnlpx.origFilenameArg=C:\Program Files (x86)\josm-latest.jnlp, -Djnlpx.remove=false, -Djava.util.Arrays.useLegacyMergeSort=true, -Djnlpx.heapsize=NULL,2048m, -Djnlpx.splashport=50146, -Djnlpx.jvm=<java.home>\bin\javaw.exe]
Dataset consistency test: No problems found

by Klumbumbus, 4 years ago

Attachment: 8352_16314.gif added

comment:26 by Klumbumbus, 4 years ago

In 16315/josm:

see #8352 - reuse string from ../core/src/org/openstreetmap/josm/gui/layer/CustomizeColor.java:78 and ../core/src/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityAction.java:144

comment:27 by simon04, 4 years ago

Err, "red" matched "red".length() == 3 in trunk/src/org/openstreetmap/josm/tools/ColorHelper.java?rev=+16293#L25, and "rreedd" is an unknown color name.

comment:28 by simon04, 4 years ago

In 16319/josm:

see #8352 - PropertiesDialog: fix 3-char CSS color names such as "red"

in reply to:  25 ; comment:29 by simon04, 4 years ago

Replying to Klumbumbus:

  • the box in the preset still doesn't work

see 8352_16314.gif

Maybe someone having a Windows system can debug/fix this issue. Doesn't affect Arch Linux / MetalLookAndFeel.

in reply to:  28 comment:30 by Klumbumbus, 4 years ago

Replying to simon04:

In 16319/josm:

see #8352 - PropertiesDialog: fix 3-char CSS color names such as "red"

"red" works now but there is still a bug. "#FFF" and "#FFFFFF" should both be interpreted as white, but "#FFF" shows a blue square.

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

in reply to:  29 ; comment:31 by Klumbumbus, 4 years ago

Replying to simon04:

Replying to Klumbumbus:

  • the box in the preset still doesn't work

see 8352_16314.gif

Maybe someone having a Windows system can debug/fix this issue. Doesn't affect Arch Linux / MetalLookAndFeel.

I just tested all the other Look and Feels and it works for all except for the default "windows" look and feel.

comment:32 by Klumbumbus, 4 years ago

Milestone: 20.0420.05

Milestone renamed

comment:33 by Claudius, 4 years ago

  1. I would also expect the color viewer to work for localized color names. Currently it only works for English ones as you can also see in see 8352_16314.gif

E.g. if a German user selects "Blau" from a colour dropdown the colour preview for the actual tag value "blue" should show.

  1. Also when no colour has been selected yet there is no indication that the colour picker area is actually clickable. At least on the Mac OS X look and feel the area just blends in tone in tone with the background. Maybe adding at least an outline frame to this field or even a colour palette / pipette icon would help indicate this invokes a colour picker dialog.

by Claudius, 4 years ago

Grey area right hand side of colour dropdown is missing indicator that it is clickable

comment:34 by simon04, 4 years ago

In 16525/josm:

see #8352 - PropertiesDialog: use non-localized color name

comment:35 by simon04, 4 years ago

In 16527/josm:

see #8352 - PropertiesDialog: show hand cursor for color button

in reply to:  33 comment:36 by Klumbumbus, 4 years ago

Replying to Claudius:

Also when no colour has been selected yet there is no indication that the colour picker area is actually clickable. At least on the Mac OS X look and feel the area just blends in tone in tone with the background. Maybe adding at least an outline frame to this field or even a colour palette / pipette icon would help indicate this invokes a colour picker dialog.

Maybe reverting r16294 helps here?

in reply to:  31 comment:37 by Klumbumbus, 4 years ago

Replying to Klumbumbus:

Replying to simon04:

Replying to Klumbumbus:

  • the box in the preset still doesn't work

see 8352_16314.gif

Maybe someone having a Windows system can debug/fix this issue. Doesn't affect Arch Linux / MetalLookAndFeel.

I just tested all the other Look and Feels and it works for all except for the default "windows" look and feel.

If we chan't get it fixed before the 20.05 release maybe a workaround could be to add ▉ (U+2589) as label of the button and colorize this text?

by simon04, 4 years ago

Attachment: 2020-05-31-201708.png added

by simon04, 4 years ago

Attachment: 2020-05-31-201920.png added

comment:38 by simon04, 4 years ago

I cannot reproduce the Windows LaF problem:

Revision:16530
Is-Local-Build:true
Build-Date:2020-05-31 17:49:11

Identification: JOSM/1.5 (16530 SVN en_GB) Windows 10 64-Bit
OS Build number: Windows 10 Pro 1909 (18363)
Memory Usage: 141 MB / 2046 MB (55 MB allocated, but free)
Java version: 14+36, AdoptOpenJDK, OpenJDK 64-Bit Server VM
Screen: \Display0 1920x1200
Maximum Screen Size: 1920x1200
Dataset consistency test: No problems found

comment:39 by simon04, 4 years ago

In 16533/josm:

see #8352 - PropertiesDialog: add unit test for color tags

comment:40 by Klumbumbus, 4 years ago

I just tested with another computer see below and there it works. So it is probably either due to oracle vs. openjdk or java8 vs. java9+

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2020-05-29 21:11:25 +0200 (Fri, 29 May 2020)
Revision:16523
Build-Date:2020-05-30 01:30:48
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (16523 en) Windows 10 64-Bit
OS Build number: Windows 10 Pro 1909 (18363)
Memory Usage: 364 MB / 2026 MB (182 MB allocated, but free)
Java version: 11.0.2+9-LTS, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Screen: \Display0 2160x1440
Maximum Screen Size: 2160x1440
Dataset consistency test: No problems found

by skyper, 4 years ago

TagsMembership panel with same color as background

comment:41 by skyper, 4 years ago

I still have problems if the color is the same as the background in Tags/Membership panel. Think we need some box around the color.

TagsMembership panel with same color as background

comment:42 by simon04, 4 years ago

To summarize the open problems:

Those two issues should be addressed eventually. However, I don't think they block the upcoming 20.05 release.

comment:43 by Don-vip, 4 years ago

Resolution: fixed
Status: reopenedclosed

Please create a new ticket affected to 20.06 milestone for the remaining things. I just released 20.05 as r16538

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.