Changeset 6560 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java
- Timestamp:
- 2013-12-29T12:03:21+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java
r6554 r6560 22 22 abstract public boolean applies(Environment e); 23 23 24 public static Condition create(String k, String v, Op op, Context context, boolean considerValAsKey) { 24 public static Condition createKeyValueCondition(String k, String v, Op op, Context context, boolean considerValAsKey) { 25 25 switch (context) { 26 26 case PRIMITIVE: … … 41 41 } 42 42 43 public static Condition create(String k, boolean not, KeyMatchType matchType, Context context) { 43 public static Condition createKeyCondition(String k, boolean not, KeyMatchType matchType, Context context) { 44 44 switch (context) { 45 45 case PRIMITIVE: … … 57 57 } 58 58 59 public static Condition create(String id, boolean not, Context context) { 59 public static Condition createPseudoClassCondition(String id, boolean not, Context context) { 60 60 return new PseudoClassCondition(id, not); 61 61 } 62 62 63 public static Condition create(Expression e, Context context) { 63 public static Condition createClassCondition(String id, boolean not, Context context) { 64 return new ClassCondition(id, not); 65 } 66 67 public static Condition createExpressionCondition(Expression e, Context context) { 64 68 return new ExpressionCondition(e); 65 69 } … … 275 279 } 276 280 281 public static class ClassCondition extends Condition { 282 283 public final String id; 284 public final boolean not; 285 286 public ClassCondition(String id, boolean not) { 287 this.id = id; 288 this.not = not; 289 } 290 291 @Override 292 public boolean applies(Environment env) { 293 return not ^ env.mc.getCascade(env.layer).containsKey(id); 294 } 295 296 @Override 297 public String toString() { 298 return (not ? "!" : "") + "." + id; 299 } 300 } 301 277 302 public static class PseudoClassCondition extends Condition { 278 303
Note:
See TracChangeset
for help on using the changeset viewer.
