Changeset 6629 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java
- Timestamp:
- 2014-01-05T12:03:37+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java
r6611 r6629 9 9 10 10 import org.openstreetmap.josm.data.osm.Node; 11 import org.openstreetmap.josm.data.osm.OsmUtils;12 11 import org.openstreetmap.josm.data.osm.Relation; 13 12 import org.openstreetmap.josm.data.osm.Tag; … … 15 14 import org.openstreetmap.josm.gui.mappaint.Cascade; 16 15 import org.openstreetmap.josm.gui.mappaint.Environment; 16 import org.openstreetmap.josm.tools.CheckParameterUtil; 17 17 import org.openstreetmap.josm.tools.Predicates; 18 18 import org.openstreetmap.josm.tools.Utils; … … 58 58 59 59 public static Condition createPseudoClassCondition(String id, boolean not, Context context) { 60 return new PseudoClassCondition(id, not );60 return new PseudoClassCondition(id, not, context); 61 61 } 62 62 … … 305 305 public final boolean not; 306 306 307 public PseudoClassCondition(String id, boolean not ) {307 public PseudoClassCondition(String id, boolean not, Context context) { 308 308 this.id = id; 309 309 this.not = not; 310 CheckParameterUtil.ensureThat(!"sameTags".equals(id) || Context.LINK.equals(context), "sameTags only supported in LINK context"); 310 311 } 311 312 … … 322 323 return true; 323 324 return false; 324 } else if (equal(id, "modified")) 325 } else if (equal(id, "modified")) { 325 326 return e.osm.isModified() || e.osm.isNewOrUndeleted(); 326 else if (equal(id, "new"))327 } else if (equal(id, "new")) { 327 328 return e.osm.isNew(); 328 else if (equal(id, "connection") && (e.osm instanceof Node))329 } else if (equal(id, "connection") && (e.osm instanceof Node)) { 329 330 return ((Node) e.osm).isConnectionNode(); 330 else if (equal(id, "tagged"))331 } else if (equal(id, "tagged")) { 331 332 return e.osm.isTagged(); 333 } else if ("sameTags".equals(id)) { 334 return e.osm.hasSameInterestingTags(Utils.firstNonNull(e.child, e.parent)); 335 } 332 336 return true; 333 337 }
Note:
See TracChangeset
for help on using the changeset viewer.