Ignore:
Timestamp:
2020-01-19T17:33:40+01:00 (4 years ago)
Author:
simon04
Message:

see #10435, fix #18095 - MapCSS: add settings of type string/double

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java

    r15717 r15731  
    4949import org.openstreetmap.josm.gui.mappaint.StyleKeys;
    5050import org.openstreetmap.josm.gui.mappaint.StyleSetting;
    51 import org.openstreetmap.josm.gui.mappaint.StyleSetting.BooleanStyleSetting;
    5251import org.openstreetmap.josm.gui.mappaint.StyleSetting.StyleSettingGroup;
     52import org.openstreetmap.josm.gui.mappaint.StyleSettingFactory;
    5353import org.openstreetmap.josm.gui.mappaint.StyleSource;
    5454import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.KeyCondition;
     
    624624            }
    625625            Cascade c = e.getValue();
    626             String type = c.get("type", null, String.class);
    627             StyleSetting set = null;
    628             if ("boolean".equals(type)) {
    629                 set = BooleanStyleSetting.create(c, this, e.getKey());
    630             } else {
    631                 Logging.warn("Unknown setting type: {0}", type);
    632             }
     626            StyleSetting set = StyleSettingFactory.create(c, this, e.getKey());
    633627            if (set != null) {
    634628                settings.add(set);
     
    636630                String groupId = c.get("group", null, String.class);
    637631                if (groupId != null) {
    638                     settingGroups.get(settingGroups.keySet().stream().filter(g -> g.key.equals(groupId)).findAny()
    639                             .orElseThrow(() -> new IllegalArgumentException("Unknown settings group: " + groupId))).add(set);
     632                    final StyleSettingGroup group = settingGroups.keySet().stream()
     633                            .filter(g -> g.key.equals(groupId))
     634                            .findAny()
     635                            .orElseThrow(() -> new IllegalArgumentException("Unknown settings group: " + groupId));
     636                    settingGroups.get(group).add(set);
    640637                }
    641638            }
Note: See TracChangeset for help on using the changeset viewer.