Changeset 15985 in josm for trunk


Ignore:
Timestamp:
2020-03-01T23:36:00+01:00 (4 years ago)
Author:
simon04
Message:

see #18802 - Add Selector.getConditions

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/scripts/TagInfoExtract.java

    r15984 r15985  
    5858import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSRule;
    5959import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource;
    60 import org.openstreetmap.josm.gui.mappaint.mapcss.Selector;
    6160import org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser;
    6261import org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException;
     
    343342        private List<TagInfoTag> convertStyleSheet() {
    344343            return styleSource.rules.stream()
    345                     .map(rule -> rule.selector)
    346                     .filter(Selector.GeneralSelector.class::isInstance)
    347                     .map(Selector.GeneralSelector.class::cast)
    348                     .map(Selector.AbstractSelector::getConditions)
    349                     .flatMap(Collection::stream)
     344                    .flatMap(rule -> rule.selector.getConditions().stream())
    350345                    .filter(ConditionFactory.SimpleKeyValueCondition.class::isInstance)
    351346                    .map(ConditionFactory.SimpleKeyValueCondition.class::cast)
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java

    r15959 r15985  
    3737import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.OpenEndPseudoClassCondition;
    3838import org.openstreetmap.josm.tools.CheckParameterUtil;
     39import org.openstreetmap.josm.tools.CompositeList;
    3940import org.openstreetmap.josm.tools.Geometry;
    4041import org.openstreetmap.josm.tools.Geometry.PolygonIntersection;
     
    124125     */
    125126    Selector optimizedBaseCheck();
     127
     128    /**
     129     * Returns the list of conditions.
     130     * @return the list of conditions
     131     */
     132    List<Condition> getConditions();
    126133
    127134    /**
     
    170177            this.right = b;
    171178            this.type = type;
     179        }
     180
     181        @Override
     182        public List<Condition> getConditions() {
     183            return new CompositeList<>(left.getConditions(), right.getConditions());
    172184        }
    173185
     
    643655        }
    644656
    645         /**
    646          * Returns the list of conditions.
    647          * @return the list of conditions
    648          */
     657        @Override
    649658        public List<Condition> getConditions() {
    650659            return conds;
Note: See TracChangeset for help on using the changeset viewer.