Modify

Opened 2 months ago

Closed 8 weeks ago

Last modified 7 weeks ago

#19574 closed enhancement (fixed)

[PATCH] Add a color setting for MapCSS

Reported by: taylor.smock Owned by: team
Priority: normal Milestone: 20.08
Component: Core mappaint Version:
Keywords: Cc:

Description (last modified by taylor.smock)

Subpart of #10435.

Possibly significant modifications for plugins:

  • NamedColorProperty extends AbstractToStringProperty<Color>. I'm waiting for a find to get all the instances of NamedColorProperty in plugins, but it is taking awhile (find . -name '*.java' -exec grep -li "NamedColorProperty" {} \;). I don't know if this will require a recompile of any plugins.

Notes:

  • Overrode storeDefaultValue to avoid an NPE. This is required since required final variables are not yet set (a different fix would be to make them non-final).
  • Color boxes are not in the same column as the check marks (I'm not certain this is possible without a lot of work, or even desirable -- there might be a case for a colorboolean setting in the future, for example).

Attachments (2)

10435.colors.patch (7.0 KB) - added by taylor.smock 2 months ago.
Initial colors setting for mapcss
19574.style_pref_consistency.patch (893 bytes) - added by taylor.smock 8 weeks ago.
Use logic from MapCSSParser to create the NamedColorProperty

Download all attachments as: .zip

Change History (10)

Changed 2 months ago by taylor.smock

Attachment: 10435.colors.patch added

Initial colors setting for mapcss

comment:1 Changed 2 months ago by taylor.smock

Description: modified (diff)

It looks like there are no binary compatibility issues. Or the published Mapillary/UtilsPlugin2 jars didn't throw errors anyway.

Plugins that use NamedColorProperty:

  • splinex
  • FastDraw
  • Mapillary
  • graphview
  • CommandLine
  • cadastre-fr
  • mapwithai
  • utilsplugin2
  • routing
  • buildings_tools
  • MicrosoftStreetside
  • livegps
  • improveway
Last edited 2 months ago by taylor.smock (previous) (diff)

comment:2 Changed 2 months ago by stoecker

Milestone: 20.08

comment:3 Changed 8 weeks ago by simon04

Resolution: fixed
Status: newclosed

In 16843/josm:

fix #19574 - Add a color setting for MapCSS (patch by taylor.smock)

comment:4 Changed 8 weeks ago by simon04

@taylor.smock, can you please update Help/Styles/MapCSSImplementation#Stylesettings – thanks!

comment:6 Changed 8 weeks ago by Klumbumbus

By a color setting a key is created in the color preferences in the format:
"Paint style" + file name + key used for displaying

Could it use the same format as the "traditional" colors of mappaint styles, i.e. the style name from the preferences instead of the file name?
"Paint style" + style name + key used for displaying

comment:7 Changed 8 weeks ago by taylor.smock

I've copied the logic from https://josm.openstreetmap.de/browser/josm/trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParser.jj?rev=16843#L1165 (mostly). I'm doing a null check on the title variable (SourceEntry may initialize title as null -- this.title = "".equals(title) ? null : title;

Changed 8 weeks ago by taylor.smock

Use logic from MapCSSParser to create the NamedColorProperty

comment:8 Changed 7 weeks ago by Klumbumbus

In 16857/josm:

see #19574 - MapCSS color setting: Use logic from MapCSSParser to create the NamedColorProperty (patch by taylor.smock)

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.