Changeset 6561 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2013-12-29T12:43:55+01:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/mappaint
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/MultiCascade.java
r5342 r6561 21 21 public MultiCascade() { 22 22 layers = new HashMap<String, Cascade>(); 23 range = new Range();23 range = Range.ZERO_TO_INFINITY; 24 24 } 25 25 -
trunk/src/org/openstreetmap/josm/gui/mappaint/Range.java
r3836 r6561 11 11 private double upper; 12 12 13 public Range() { 14 this.lower = 0; 15 this.upper = Double.POSITIVE_INFINITY; 16 } 13 public static final Range ZERO_TO_INFINITY = new Range(0.0, Double.POSITIVE_INFINITY); 17 14 18 15 public Range(double lower, double upper) { … … 77 74 return String.format("|s%s-%s", lower, upper); 78 75 } 76 77 @Override 78 public boolean equals(Object o) { 79 if (this == o) return true; 80 if (o == null || getClass() != o.getClass()) return false; 81 82 Range range = (Range) o; 83 84 if (Double.compare(range.lower, lower) != 0) return false; 85 if (Double.compare(range.upper, upper) != 0) return false; 86 87 return true; 88 } 89 90 @Override 91 public int hashCode() { 92 int result; 93 long temp; 94 temp = Double.doubleToLongBits(lower); 95 result = (int) (temp ^ (temp >>> 32)); 96 temp = Double.doubleToLongBits(upper); 97 result = 31 * result + (int) (temp ^ (temp >>> 32)); 98 return result; 99 } 79 100 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParser.jj
r6560 r6561 463 463 ( 464 464 ( 465 <SET> w() key=<IDENT> w() 466 ( <EQUAL> val=expression() )? 467 { ins.add(new Instruction.AssignmentInstruction(key.image, val == null ? true : val)); } 468 ( <RBRACE> { return ins; } | <SEMICOLON> w() ) 465 <SET> w() 466 (<FULLSTOP>)? // specification allows "set .class" to set "class". we also support "set class" 467 key=<IDENT> w() 468 ( <EQUAL> val=expression() )? 469 { ins.add(new Instruction.AssignmentInstruction(key.image, val == null ? true : val)); } 470 ( <RBRACE> { return ins; } | <SEMICOLON> w() ) 469 471 ) 470 472 | 471 473 key=<IDENT> w() <COLON> w() 472 474 ( -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java
r6538 r6561 267 267 268 268 public static class GeneralSelector extends AbstractSelector { 269 p rivateString base;270 public Range range; 271 p rivateString subpart;269 public final String base; 270 public final Range range; 271 public final String subpart; 272 272 273 273 public GeneralSelector(String base, Pair<Integer, Integer> zoom, List<Condition> conds, String subpart) { … … 279 279 if (a <= b) { 280 280 range = fromLevel(a, b); 281 } 282 } 283 if (range == null) { 284 range = new Range(); 281 } else { 282 range = Range.ZERO_TO_INFINITY; 283 } 284 } else { 285 range = Range.ZERO_TO_INFINITY; 285 286 } 286 287 this.subpart = subpart; … … 348 349 @Override 349 350 public String toString() { 350 return base + ( range == null? "" : range) + Utils.join("", conds) + (subpart != null ? ("::" + subpart) : "");351 return base + (Range.ZERO_TO_INFINITY.equals(range) ? "" : range) + Utils.join("", conds) + (subpart != null ? ("::" + subpart) : ""); 351 352 } 352 353 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/xml/AreaPrototype.java
r3836 r6561 23 23 { 24 24 priority = 0; 25 range = new Range();25 range = Range.ZERO_TO_INFINITY; 26 26 closed = false; 27 27 color = null; -
trunk/src/org/openstreetmap/josm/gui/mappaint/xml/IconPrototype.java
r6070 r6561 22 22 public void init() { 23 23 priority = 0; 24 range = new Range();24 range = Range.ZERO_TO_INFINITY; 25 25 icon = null; 26 26 annotate = null; -
trunk/src/org/openstreetmap/josm/gui/mappaint/xml/LinePrototype.java
r6248 r6561 35 35 { 36 36 priority = 0; 37 range = new Range();37 range = Range.ZERO_TO_INFINITY; 38 38 width = -1; 39 39 realWidth = null;
Note:
See TracChangeset
for help on using the changeset viewer.