Changeset 10217 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint
- Timestamp:
- 2016-05-15T16:37:33+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/BoxTextElement.java
r9371 r10217 120 120 public static BoxTextElement create(Environment env, BoxProvider boxProvider, Rectangle box) { 121 121 initDefaultParameters(); 122 Cascade c = env.mc.getCascade(env.layer);123 122 124 123 TextLabel text = TextLabel.create(env, DEFAULT_TEXT_COLOR, false); … … 129 128 if (text.labelCompositionStrategy.compose(env.osm) == null) return null; 130 129 131 HorizontalTextAlignment hAlign = HorizontalTextAlignment.RIGHT; 132 Keyword hAlignKW = c.get(TEXT_ANCHOR_HORIZONTAL, Keyword.RIGHT, Keyword.class); 133 switch (hAlignKW.val) { 130 Cascade c = env.mc.getCascade(env.layer); 131 132 HorizontalTextAlignment hAlign; 133 switch (c.get(TEXT_ANCHOR_HORIZONTAL, Keyword.RIGHT, Keyword.class).val) { 134 134 case "left": 135 135 hAlign = HorizontalTextAlignment.LEFT; … … 137 137 case "center": 138 138 hAlign = HorizontalTextAlignment.CENTER; 139 }140 VerticalTextAlignment vAlign = VerticalTextAlignment.BOTTOM;141 Keyword vAlignKW = c.get(TEXT_ANCHOR_VERTICAL, Keyword.BOTTOM, Keyword.class);142 switch (vAlignKW.val) {143 case "bottom":144 vAlign = VerticalTextAlignment.BOTTOM;145 break;139 break; 140 case "right": 141 default: 142 hAlign = HorizontalTextAlignment.RIGHT; 143 } 144 VerticalTextAlignment vAlign; 145 switch (c.get(TEXT_ANCHOR_VERTICAL, Keyword.BOTTOM, Keyword.class).val) { 146 146 case "above": 147 147 vAlign = VerticalTextAlignment.ABOVE; … … 155 155 case "below": 156 156 vAlign = VerticalTextAlignment.BELOW; 157 break; 158 case "bottom": 159 default: 160 vAlign = VerticalTextAlignment.BOTTOM; 157 161 } 158 162
Note:
See TracChangeset
for help on using the changeset viewer.