Changeset 12379 in josm
- Timestamp:
- 2017-06-09T22:22:27+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Instruction.java
r12259 r12379 13 13 /** 14 14 * A MapCSS Instruction. 15 * 15 * 16 16 * For example a simple assignment like <code>width: 3;</code>, but may also 17 17 * be a set instruction (<code>set highway;</code>). … … 27 27 void execute(Environment env); 28 28 29 /** 30 * A float value that will be added to the current float value. Specified as +5 or -3 in MapCSS 31 */ 29 32 class RelativeFloat { 30 33 public final float val; … … 40 43 } 41 44 45 /** 46 * An instruction that assigns a given value to a variable on evaluation 47 */ 42 48 class AssignmentInstruction implements Instruction { 43 49 public final String key; -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSRule.java
r9371 r12379 6 6 7 7 import org.openstreetmap.josm.gui.mappaint.Environment; 8 import org.openstreetmap.josm.gui.mappaint.StyleSource; 8 9 import org.openstreetmap.josm.tools.Utils; 9 10 … … 17 18 public class MapCSSRule implements Comparable<MapCSSRule> { 18 19 20 /** 21 * The selector. If it matches, this rule should be applied 22 */ 19 23 public final Selector selector; 24 /** 25 * The instructions for this selector 26 */ 20 27 public final Declaration declaration; 21 28 29 /** 30 * A declaration is a set of {@link Instruction}s 31 */ 22 32 public static class Declaration { 33 /** 34 * The instructions in this declaration 35 */ 23 36 public final List<Instruction> instructions; 24 // declarations in the StyleSource are numbered consecutively 37 /** 38 * The index of this declaration 39 * <p> 40 * declarations in the StyleSource are numbered consecutively 41 */ 25 42 public final int idx; 26 43 44 /** 45 * Create a new {@link Declaration} 46 * @param instructions The instructions for this dectlaration 47 * @param idx The index in the {@link StyleSource} 48 */ 27 49 public Declaration(List<Instruction> instructions, int idx) { 28 50 this.instructions = instructions; -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java
r12290 r12379 76 76 "text/x-mapcss, text/mapcss, text/css; q=0.9, text/plain; q=0.8, application/zip, application/octet-stream; q=0.5"; 77 77 78 // all rules 78 /** 79 * all rules in this style file 80 */ 79 81 public final List<MapCSSRule> rules = new ArrayList<>(); 80 // rule indices, filtered by primitive type 81 public final MapCSSRuleIndex nodeRules = new MapCSSRuleIndex(); // nodes 82 public final MapCSSRuleIndex wayRules = new MapCSSRuleIndex(); // ways without tag area=no 83 public final MapCSSRuleIndex wayNoAreaRules = new MapCSSRuleIndex(); // ways with tag area=no 84 public final MapCSSRuleIndex relationRules = new MapCSSRuleIndex(); // relations that are not multipolygon relations 85 public final MapCSSRuleIndex multipolygonRules = new MapCSSRuleIndex(); // multipolygon relations 86 public final MapCSSRuleIndex canvasRules = new MapCSSRuleIndex(); // rules to apply canvas properties 82 /** 83 * Rules for nodes 84 */ 85 public final MapCSSRuleIndex nodeRules = new MapCSSRuleIndex(); 86 /** 87 * Rules for ways without tag area=no 88 */ 89 public final MapCSSRuleIndex wayRules = new MapCSSRuleIndex(); 90 /** 91 * Rules for ways with tag area=no 92 */ 93 public final MapCSSRuleIndex wayNoAreaRules = new MapCSSRuleIndex(); 94 /** 95 * Rules for relations that are not multipolygon relations 96 */ 97 public final MapCSSRuleIndex relationRules = new MapCSSRuleIndex(); 98 /** 99 * Rules for multipolygon relations 100 */ 101 public final MapCSSRuleIndex multipolygonRules = new MapCSSRuleIndex(); 102 /** 103 * rules to apply canvas properties 104 */ 105 public final MapCSSRuleIndex canvasRules = new MapCSSRuleIndex(); 87 106 88 107 private Color backgroundColorOverride; … … 670 689 } 671 690 691 /** 692 * Evaluate a supports condition 693 * @param feature The feature to evaluate for 694 * @param val The additional parameter passed to evaluate 695 * @return <code>true</code> if JSOM supports that feature 696 */ 672 697 public boolean evalSupportsDeclCondition(String feature, Object val) { 673 698 if (feature == null) return false; -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Subpart.java
r10600 r12379 12 12 @FunctionalInterface 13 13 public interface Subpart { 14 /** 15 * Gets the ID of the suppart 16 * @param env The environment to get it from 17 * @return The id 18 */ 14 19 String getId(Environment env); 15 20 21 /** 22 * The default subpart for normal rules 23 */ 16 24 Subpart DEFAULT_SUBPART = new StringSubpart("default"); 17 25
Note:
See TracChangeset
for help on using the changeset viewer.