Changeset 3992 in josm
- Timestamp:
- 2011-03-14T00:27:46+01:00 (14 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/mappaint
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/AreaElemStyle.java
r3967 r3992 80 80 Keyword textPos = c.get("text-position", null, Keyword.class); 81 81 if (textPos == null || Utils.equal(textPos.val, "center")) { 82 text = TextElement.create(c, PaintColors.AREA_TEXT.get() );82 text = TextElement.create(c, PaintColors.AREA_TEXT.get(), true); 83 83 } 84 84 -
trunk/src/org/openstreetmap/josm/gui/mappaint/LineElemStyle.java
r3967 r3992 185 185 Keyword textPos = c.get("text-position", null, Keyword.class); 186 186 if (textPos == null || equal(textPos.val, "line")) { 187 text = TextElement.create(c, PaintColors.TEXT.get() );187 text = TextElement.create(c, PaintColors.TEXT.get(), false); 188 188 } 189 189 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/NodeElemStyle.java
r3987 r3992 177 177 } 178 178 179 if (icon == null && symbol == null && !allowOnlyText)180 return null;181 182 179 NodeTextElement text = null; 183 TextElement te = TextElement.create(c, DEFAULT_TEXT_COLOR );180 TextElement te = TextElement.create(c, DEFAULT_TEXT_COLOR, symbol == null && icon == null); 184 181 // optimization: if we neither have a symbol, nor an icon, nor a text element 185 182 // we don't have to check for the remaining style properties and we don't -
trunk/src/org/openstreetmap/josm/gui/mappaint/TextElement.java
r3987 r3992 80 80 * @return the label composition strategy 81 81 */ 82 protected static LabelCompositionStrategy buildLabelCompositionStrategy(Cascade c ){82 protected static LabelCompositionStrategy buildLabelCompositionStrategy(Cascade c, boolean defaultAnnotate){ 83 83 Keyword textKW = c.get("text", null, Keyword.class, true); 84 84 if (textKW == null) { 85 85 String textKey = c.get("text", null, String.class); 86 if (textKey == null) return null; 86 if (textKey == null) 87 return defaultAnnotate ? AUTO_LABEL_COMPOSITION_STRATEGY : null; 87 88 return new TagLookupCompositionStrategy(textKey); 88 89 } else if (textKW.val.equals("auto")) … … 102 103 * @throws IllegalArgumentException thrown if {@code defaultTextColor} is null 103 104 */ 104 public static TextElement create(Cascade c, Color defaultTextColor ) throws IllegalArgumentException{105 public static TextElement create(Cascade c, Color defaultTextColor, boolean defaultAnnotate) throws IllegalArgumentException{ 105 106 CheckParameterUtil.ensureParameterNotNull(defaultTextColor); 106 107 107 LabelCompositionStrategy strategy = buildLabelCompositionStrategy(c );108 LabelCompositionStrategy strategy = buildLabelCompositionStrategy(c, defaultAnnotate); 108 109 Font font = ElemStyle.getFont(c); 109 110
Note:
See TracChangeset
for help on using the changeset viewer.