Modify

Opened 8 years ago

Closed 6 months 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 8 months ago.
2020-04-12-231958_476x380_scrot.png (8.5 KB) - added by simon04 8 months ago.
8352_green.png (23.3 KB) - added by Klumbumbus 8 months ago.
8352_brown.png (23.3 KB) - added by Klumbumbus 8 months ago.
8352_sort.png (6.9 KB) - added by Klumbumbus 8 months ago.
8352_frame.png (20.1 KB) - added by Klumbumbus 8 months ago.
8352_16314.gif (773.1 KB) - added by Klumbumbus 8 months ago.
Invisible_color_picker_area.png (79.2 KB) - added by Claudius 6 months 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 6 months ago.
2020-05-31-201920.png (7.4 KB) - added by simon04 6 months ago.
josm_tagsMembership_panal_color.png (13.4 KB) - added by skyper 6 months ago.
TagsMembership panel with same color as background

Download all attachments as: .zip

Change History (54)

comment:1 Changed 7 years ago by Don-vip

Keywords: color added

See also #8935

comment:2 Changed 2 years ago by simon04

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

comment:3 Changed 2 years ago by simon04

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

comment:4 Changed 8 months ago by simon04

Resolution: fixed
Status: newclosed

In 16277/josm:

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

Changed 8 months ago by simon04

comment:5 Changed 8 months ago by simon04

Milestone: 20.04


comment:6 Changed 8 months ago by skyper

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 8 months ago by skyper (previous) (diff)

comment:7 Changed 8 months ago by simon04

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

comment:8 Changed 8 months ago by Don-vip

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

comment:9 Changed 8 months ago by Don-vip

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

In 16282/josm:

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

comment:11 Changed 8 months ago by simon04

In 16283/josm:

see #8352 - PropertiesDialog: preview color as colored square


Last edited 8 months ago by simon04 (previous) (diff)

Changed 8 months ago by simon04

Changed 8 months ago by Klumbumbus

Attachment: 8352_green.png added

Changed 8 months ago by Klumbumbus

Attachment: 8352_brown.png added

Changed 8 months ago by Klumbumbus

Attachment: 8352_sort.png added

comment:12 Changed 8 months ago by Klumbumbus

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 8 months ago by simon04 (previous) (diff)

Changed 8 months ago by Klumbumbus

Attachment: 8352_frame.png added

comment:13 Changed 8 months ago by Klumbumbus

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

In 16292/josm:

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

comment:15 in reply to:  12 Changed 8 months ago by simon04

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 8 months ago by simon04 (previous) (diff)

comment:16 Changed 8 months ago by Klumbumbus

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

comment:17 Changed 8 months ago by simon04

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

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

comment:18 Changed 8 months ago by simon04

In 16293/josm:

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

comment:19 Changed 8 months ago by simon04

In 16294/josm:

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

comment:20 Changed 8 months ago by simon04

Resolution: fixed
Status: reopenedclosed

comment:21 Changed 8 months ago by Klumbumbus

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 8 months ago by Klumbumbus (previous) (diff)

comment:22 Changed 8 months ago by simon04

In 16308/josm:

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

comment:23 Changed 8 months ago by simon04

In 16309/josm:

see #8352 - Presets: use opaque color chooser button

comment:24 Changed 8 months ago by simon04

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

comment:25 in reply to:  24 ; Changed 8 months ago by Klumbumbus

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

Changed 8 months ago by Klumbumbus

Attachment: 8352_16314.gif added

comment:26 Changed 8 months ago by Klumbumbus

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

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

In 16319/josm:

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

comment:29 in reply to:  25 ; Changed 8 months ago by 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.

comment:30 in reply to:  28 Changed 8 months ago by Klumbumbus

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 7 months ago by Klumbumbus (previous) (diff)

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

comment:32 Changed 7 months ago by Klumbumbus

Milestone: 20.0420.05

Milestone renamed

comment:33 Changed 6 months ago by Claudius

  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.

Changed 6 months ago by Claudius

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

comment:34 Changed 6 months ago by simon04

In 16525/josm:

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

comment:35 Changed 6 months ago by simon04

In 16527/josm:

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

comment:36 in reply to:  33 Changed 6 months ago by Klumbumbus

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?

comment:37 in reply to:  31 Changed 6 months ago by Klumbumbus

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?

Changed 6 months ago by simon04

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

Changed 6 months ago by simon04

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

comment:38 Changed 6 months ago by simon04

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

In 16533/josm:

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

comment:40 Changed 6 months ago by Klumbumbus

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

Changed 6 months ago by skyper

TagsMembership panel with same color as background

comment:41 Changed 6 months ago by skyper

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

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 Changed 6 months ago by Don-vip

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.

Add Comment


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

 
Note: See TracTickets for help on using tickets.