Changeset 10001 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint
- Timestamp:
- 2016-03-17T01:50:12+01:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/mappaint
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/CSSColors.java
r7509 r10001 9 9 private static final Map<String, Color> CSS_COLORS = new HashMap<>(); 10 10 static { 11 Object[][] CSSCOLORS_INIT =new Object[][] {11 for (Object[] pair : new Object[][] { 12 12 {"aliceblue", 0xf0f8ff}, 13 13 {"antiquewhite", 0xfaebd7}, … … 157 157 {"yellow", 0xffff00}, 158 158 {"yellowgreen", 0x9acd32} 159 }; 160 for (Object[] pair : CSSCOLORS_INIT) { 159 }) { 161 160 CSS_COLORS.put((String) pair[0], new Color((Integer) pair[1])); 162 161 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java
r9983 r10001 149 149 } 150 150 151 float test _float;151 float testFloat; 152 152 try { 153 test _float = Float.parseFloat(testString);153 testFloat = Float.parseFloat(testString); 154 154 } catch (NumberFormatException e) { 155 155 return false; 156 156 } 157 float prototype _float = Float.parseFloat(prototypeString);157 float prototypeFloat = Float.parseFloat(prototypeString); 158 158 159 159 switch (this) { 160 160 case GREATER_OR_EQUAL: 161 return test _float >= prototype_float;161 return testFloat >= prototypeFloat; 162 162 case GREATER: 163 return test _float > prototype_float;163 return testFloat > prototypeFloat; 164 164 case LESS_OR_EQUAL: 165 return test _float <= prototype_float;165 return testFloat <= prototypeFloat; 166 166 case LESS: 167 return test _float < prototype_float;167 return testFloat < prototypeFloat; 168 168 default: 169 169 throw new AssertionError(); -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/LineElement.java
r9371 r10001 56 56 public final float defaultMajorZIndex; 57 57 58 LineType(String prefix, float default _major_z_index) {58 LineType(String prefix, float defaultMajorZindex) { 59 59 this.prefix = prefix; 60 this.defaultMajorZIndex = default _major_z_index;61 } 62 } 63 64 protected LineElement(Cascade c, float default _major_z_index, BasicStroke line, Color color, BasicStroke dashesLine,60 this.defaultMajorZIndex = defaultMajorZindex; 61 } 62 } 63 64 protected LineElement(Cascade c, float defaultMajorZindex, BasicStroke line, Color color, BasicStroke dashesLine, 65 65 Color dashesBackground, float offset, float realWidth, boolean wayDirectionArrows) { 66 super(c, default _major_z_index);66 super(c, defaultMajorZindex); 67 67 this.line = line; 68 68 this.color = color; … … 104 104 private static LineElement createImpl(Environment env, LineType type) { 105 105 Cascade c = env.mc.getCascade(env.layer); 106 Cascade c _def = env.mc.getCascade("default");106 Cascade cDef = env.mc.getCascade("default"); 107 107 Float width; 108 108 switch (type) { 109 109 case NORMAL: 110 width = getWidth(c, WIDTH, getWidth(c _def, WIDTH, null));110 width = getWidth(c, WIDTH, getWidth(cDef, WIDTH, null)); 111 111 break; 112 112 case CASING: 113 113 Float casingWidth = c.get(type.prefix + WIDTH, null, Float.class, true); 114 114 if (casingWidth == null) { 115 RelativeFloat rel _casingWidth = c.get(type.prefix + WIDTH, null, RelativeFloat.class, true);116 if (rel _casingWidth != null) {117 casingWidth = rel _casingWidth.val / 2;115 RelativeFloat relCasingWidth = c.get(type.prefix + WIDTH, null, RelativeFloat.class, true); 116 if (relCasingWidth != null) { 117 casingWidth = relCasingWidth.val / 2; 118 118 } 119 119 } 120 120 if (casingWidth == null) 121 121 return null; 122 width = getWidth(c, WIDTH, getWidth(c _def, WIDTH, null));122 width = getWidth(c, WIDTH, getWidth(cDef, WIDTH, null)); 123 123 if (width == null) { 124 124 width = 0f; … … 162 162 case LEFT_CASING: 163 163 case RIGHT_CASING: 164 Float baseWidthOnDefault = getWidth(c _def, WIDTH, null);164 Float baseWidthOnDefault = getWidth(cDef, WIDTH, null); 165 165 Float baseWidth = getWidth(c, WIDTH, baseWidthOnDefault); 166 166 if (baseWidth == null || baseWidth < 2f) { -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/NodeElement.java
r9371 r10001 93 93 BoxTextElement.SIMPLE_NODE_TEXT_ELEMSTYLE); 94 94 95 protected NodeElement(Cascade c, MapImage mapImage, Symbol symbol, float default _major_z_index, RotationAngle rotationAngle) {96 super(c, default _major_z_index);95 protected NodeElement(Cascade c, MapImage mapImage, Symbol symbol, float defaultMajorZindex, RotationAngle rotationAngle) { 96 super(c, defaultMajorZindex); 97 97 this.mapImage = mapImage; 98 98 this.symbol = symbol; … … 104 104 } 105 105 106 private static NodeElement create(Environment env, float default _major_z_index, boolean allowDefault) {106 private static NodeElement create(Environment env, float defaultMajorZindex, boolean allowDefault) { 107 107 Cascade c = env.mc.getCascade(env.layer); 108 108 … … 138 138 if (!allowDefault && symbol == null && mapImage == null) return null; 139 139 140 return new NodeElement(c, mapImage, symbol, default _major_z_index, rotationAngle);140 return new NodeElement(c, mapImage, symbol, defaultMajorZindex, rotationAngle); 141 141 } 142 142 … … 148 148 return null; 149 149 150 Cascade c _def = env.mc.getCascade("default");151 152 Float widthOnDefault = c _def.get(keys[ICON_WIDTH_IDX], null, Float.class);150 Cascade cDef = env.mc.getCascade("default"); 151 152 Float widthOnDefault = cDef.get(keys[ICON_WIDTH_IDX], null, Float.class); 153 153 if (widthOnDefault != null && widthOnDefault <= 0) { 154 154 widthOnDefault = null; … … 156 156 Float widthF = getWidth(c, keys[ICON_WIDTH_IDX], widthOnDefault); 157 157 158 Float heightOnDefault = c _def.get(keys[ICON_HEIGHT_IDX], null, Float.class);158 Float heightOnDefault = cDef.get(keys[ICON_HEIGHT_IDX], null, Float.class); 159 159 if (heightOnDefault != null && heightOnDefault <= 0) { 160 160 heightOnDefault = null; … … 189 189 private static Symbol createSymbol(Environment env) { 190 190 Cascade c = env.mc.getCascade(env.layer); 191 Cascade c _def = env.mc.getCascade("default");191 Cascade cDef = env.mc.getCascade("default"); 192 192 193 193 SymbolShape shape; … … 216 216 return null; 217 217 218 Float sizeOnDefault = c _def.get("symbol-size", null, Float.class);218 Float sizeOnDefault = cDef.get("symbol-size", null, Float.class); 219 219 if (sizeOnDefault != null && sizeOnDefault <= 0) { 220 220 sizeOnDefault = null; … … 229 229 return null; 230 230 231 Float strokeWidthOnDefault = getWidth(c _def, "symbol-stroke-width", null);231 Float strokeWidthOnDefault = getWidth(cDef, "symbol-stroke-width", null); 232 232 Float strokeWidth = getWidth(c, "symbol-stroke-width", strokeWidthOnDefault); 233 233 -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/StyleElement.java
r9371 r10001 35 35 public boolean defaultSelectedHandling; 36 36 37 public StyleElement(float major _z_index, float z_index, float object_z_index, boolean isModifier, boolean defaultSelectedHandling) {38 this.majorZIndex = major _z_index;39 this.zIndex = z _index;40 this.objectZIndex = object _z_index;37 public StyleElement(float majorZindex, float zIndex, float objectZindex, boolean isModifier, boolean defaultSelectedHandling) { 38 this.majorZIndex = majorZindex; 39 this.zIndex = zIndex; 40 this.objectZIndex = objectZindex; 41 41 this.isModifier = isModifier; 42 42 this.defaultSelectedHandling = defaultSelectedHandling; 43 43 } 44 44 45 protected StyleElement(Cascade c, float default _major_z_index) {46 majorZIndex = c.get(MAJOR_Z_INDEX, default _major_z_index, Float.class);45 protected StyleElement(Cascade c, float defaultMajorZindex) { 46 majorZIndex = c.get(MAJOR_Z_INDEX, defaultMajorZindex, Float.class); 47 47 zIndex = c.get(Z_INDEX, 0f, Float.class); 48 48 objectZIndex = c.get(OBJECT_Z_INDEX, 0f, Float.class); … … 86 86 return (float) MapPaintSettings.INSTANCE.getDefaultSegmentWidth(); 87 87 if (relativeTo != null) { 88 RelativeFloat width _rel = c.get(key, null, RelativeFloat.class, true);89 if (width _rel != null)90 return relativeTo + width _rel.val;88 RelativeFloat widthRel = c.get(key, null, RelativeFloat.class, true); 89 if (widthRel != null) 90 return relativeTo + widthRel.val; 91 91 } 92 92 }
Note:
See TracChangeset
for help on using the changeset viewer.