Changeset 15910 in josm for trunk/src/org/openstreetmap/josm
- Timestamp:
- 2020-02-23T11:54:23+01:00 (5 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParser.jj
r15113 r15910 20 20 import org.openstreetmap.josm.data.preferences.NamedColorProperty; 21 21 import org.openstreetmap.josm.gui.mappaint.Keyword; 22 import org.openstreetmap.josm.gui.mappaint.Range; 22 23 import org.openstreetmap.josm.gui.mappaint.mapcss.Condition; 23 24 import org.openstreetmap.josm.gui.mappaint.mapcss.Condition.Context; … … 42 43 import org.openstreetmap.josm.tools.JosmRuntimeException; 43 44 import org.openstreetmap.josm.tools.Logging; 44 import org.openstreetmap.josm.tools.Pair;45 45 import org.openstreetmap.josm.tools.Utils; 46 46 … … 728 728 Token base; 729 729 Condition c; 730 Pair<Integer, Integer> r = null;730 Range r = Range.ZERO_TO_INFINITY; 731 731 List<Condition> conditions = new ArrayList<Condition>(); 732 732 Subpart sub = null; … … 740 740 } 741 741 742 Pair<Integer, Integer>zoom() :742 Range zoom() : 743 743 { 744 744 Integer min = 0; … … 755 755 min=uint() { max = min; } 756 756 ) 757 { return new Pair<Integer, Integer>(min, max); }757 { return GeneralSelector.fromLevel(min, max); } 758 758 } 759 759 -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java
r15909 r15910 32 32 import org.openstreetmap.josm.tools.Geometry; 33 33 import org.openstreetmap.josm.tools.Logging; 34 import org.openstreetmap.josm.tools.Pair;35 34 import org.openstreetmap.josm.tools.Utils; 36 35 … … 610 609 class GeneralSelector extends OptimizedGeneralSelector { 611 610 612 public GeneralSelector(String base, Pair<Integer, Integer>zoom, List<Condition> conds, Subpart subpart) {611 public GeneralSelector(String base, Range zoom, List<Condition> conds, Subpart subpart) { 613 612 super(base, zoom, conds, subpart); 614 613 } … … 638 637 public final Subpart subpart; 639 638 640 public OptimizedGeneralSelector(String base, Pair<Integer, Integer> zoom, List<Condition> conds, Subpart subpart) {641 super(conds);642 this.base = checkBase(base);643 if (zoom != null) {644 int a = zoom.a == null ? 0 : zoom.a;645 int b = zoom.b == null ? Integer.MAX_VALUE : zoom.b;646 if (a <= b) {647 range = fromLevel(a, b);648 } else {649 range = Range.ZERO_TO_INFINITY;650 }651 } else {652 range = Range.ZERO_TO_INFINITY;653 }654 this.subpart = subpart != null ? subpart : Subpart.DEFAULT_SUBPART;655 }656 657 639 public OptimizedGeneralSelector(String base, Range range, List<Condition> conds, Subpart subpart) { 658 640 super(conds); 659 641 this.base = checkBase(base); 660 this.range = range;642 this.range = Objects.requireNonNull(range, "range"); 661 643 this.subpart = subpart != null ? subpart : Subpart.DEFAULT_SUBPART; 662 644 }
Note:
See TracChangeset
for help on using the changeset viewer.