Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 years 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 4 years ago.
Initial colors setting for mapcss
19574.style_pref_consistency.patch (893 bytes ) - added by taylor.smock 4 years ago.
Use logic from MapCSSParser to create the NamedColorProperty

Download all attachments as: .zip

Change History (10)

by taylor.smock, 4 years ago

Attachment: 10435.colors.patch added

Initial colors setting for mapcss

comment:1 by taylor.smock, 4 years ago

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 4 years ago by taylor.smock (previous) (diff)

comment:2 by stoecker, 4 years ago

Milestone: 20.08

comment:3 by simon04, 4 years ago

Resolution: fixed
Status: newclosed

In 16843/josm:

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

comment:4 by simon04, 4 years ago

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

comment:6 by Klumbumbus, 4 years ago

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 by taylor.smock, 4 years ago

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;

by taylor.smock, 4 years ago

Use logic from MapCSSParser to create the NamedColorProperty

comment:8 by Klumbumbus, 4 years ago

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