Changeset 11670 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/NodeElement.java
- Timestamp:
- 2017-03-04T22:29:24+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/NodeElement.java
r11553 r11670 70 70 Cascade c = env.mc.getCascade(env.layer); 71 71 72 MapImage mapImage = createIcon(env , ICON_KEYS);72 MapImage mapImage = createIcon(env); 73 73 Symbol symbol = null; 74 74 if (mapImage == null) { 75 75 symbol = createSymbol(env); 76 76 } 77 78 RotationAngle rotationAngle = createRotationAngle(env); 79 80 // optimization: if we neither have a symbol, nor a mapImage 81 // we don't have to check for the remaining style properties and we don't 82 // have to allocate a node element style. 83 if (!allowDefault && symbol == null && mapImage == null) return null; 84 85 return new NodeElement(c, mapImage, symbol, defaultMajorZindex, rotationAngle); 86 } 87 88 /** 89 * Reads the icon-rotation property and creates a rotation angle from it. 90 * @param env The environment 91 * @return The angle 92 */ 93 public static RotationAngle createRotationAngle(Environment env) { 94 Cascade c = env.mc.getCascade(env.layer); 95 77 96 RotationAngle rotationAngle = null; 78 97 final Float angle = c.get(ICON_ROTATION, null, Float.class, true); … … 93 112 } 94 113 } 95 96 // optimization: if we neither have a symbol, nor a mapImage 97 // we don't have to check for the remaining style properties and we don't 98 // have to allocate a node element style. 99 if (!allowDefault && symbol == null && mapImage == null) return null; 100 101 return new NodeElement(c, mapImage, symbol, defaultMajorZindex, rotationAngle); 114 return rotationAngle; 115 } 116 117 public static MapImage createIcon(final Environment env) { 118 return createIcon(env, ICON_KEYS); 102 119 } 103 120
Note:
See TracChangeset
for help on using the changeset viewer.