1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.gui.mappaint;
|
---|
3 |
|
---|
4 | import static org.openstreetmap.josm.tools.Utils.equal;
|
---|
5 |
|
---|
6 | import java.awt.BasicStroke;
|
---|
7 | import java.awt.Color;
|
---|
8 | import java.awt.Image;
|
---|
9 | import java.awt.Stroke;
|
---|
10 |
|
---|
11 | import javax.swing.GrayFilter;
|
---|
12 | import javax.swing.ImageIcon;
|
---|
13 |
|
---|
14 | import org.openstreetmap.josm.Main;
|
---|
15 | import org.openstreetmap.josm.data.osm.Node;
|
---|
16 | import org.openstreetmap.josm.data.osm.OsmPrimitive;
|
---|
17 | import org.openstreetmap.josm.data.osm.Relation;
|
---|
18 | import org.openstreetmap.josm.data.osm.visitor.paint.MapPaintSettings;
|
---|
19 | import org.openstreetmap.josm.data.osm.visitor.paint.MapPainter;
|
---|
20 | import org.openstreetmap.josm.data.osm.visitor.paint.PaintColors;
|
---|
21 | import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.IconReference;
|
---|
22 | import org.openstreetmap.josm.tools.CheckParameterUtil;
|
---|
23 | import org.openstreetmap.josm.tools.Pair;
|
---|
24 | import org.openstreetmap.josm.tools.Utils;
|
---|
25 |
|
---|
26 | /**
|
---|
27 | * applies for Nodes and turn restriction relations
|
---|
28 | */
|
---|
29 | public class NodeElemStyle extends ElemStyle {
|
---|
30 | public ImageIcon icon;
|
---|
31 | public int iconAlpha;
|
---|
32 | public Symbol symbol;
|
---|
33 | public NodeTextElement text;
|
---|
34 |
|
---|
35 | private ImageIcon disabledIcon;
|
---|
36 |
|
---|
37 | public enum SymbolShape { SQUARE, CIRCLE, TRIANGLE, PENTAGON, HEXAGON, HEPTAGON, OCTAGON, NONAGON, DECAGON }
|
---|
38 | public enum HorizontalTextAlignment { LEFT, CENTER, RIGHT }
|
---|
39 | public enum VerticalTextAlignment { ABOVE, TOP, CENTER, BOTTOM, BELOW }
|
---|
40 |
|
---|
41 | public static class Symbol {
|
---|
42 | public SymbolShape symbol;
|
---|
43 | public int size;
|
---|
44 | public Stroke stroke;
|
---|
45 | public Color strokeColor;
|
---|
46 | public Color fillColor;
|
---|
47 |
|
---|
48 | public Symbol(SymbolShape symbol, int size, Stroke stroke, Color strokeColor, Color fillColor) {
|
---|
49 | if (stroke != null && strokeColor == null)
|
---|
50 | throw new IllegalArgumentException();
|
---|
51 | if (stroke == null && fillColor == null)
|
---|
52 | throw new IllegalArgumentException();
|
---|
53 | this.symbol = symbol;
|
---|
54 | this.size = size;
|
---|
55 | this.stroke = stroke;
|
---|
56 | this.strokeColor = strokeColor;
|
---|
57 | this.fillColor = fillColor;
|
---|
58 | }
|
---|
59 |
|
---|
60 | @Override
|
---|
61 | public boolean equals(Object obj) {
|
---|
62 | if (obj == null || getClass() != obj.getClass())
|
---|
63 | return false;
|
---|
64 | final Symbol other = (Symbol) obj;
|
---|
65 | return symbol == other.symbol &&
|
---|
66 | size == other.size &&
|
---|
67 | equal(stroke, other.stroke) &&
|
---|
68 | equal(strokeColor, other.strokeColor) &&
|
---|
69 | equal(fillColor, other.fillColor);
|
---|
70 | }
|
---|
71 |
|
---|
72 | @Override
|
---|
73 | public int hashCode() {
|
---|
74 | int hash = 7;
|
---|
75 | hash = 67 * hash + symbol.hashCode();
|
---|
76 | hash = 67 * hash + size;
|
---|
77 | hash = 67 * hash + (stroke != null ? stroke.hashCode() : 0);
|
---|
78 | hash = 67 * hash + (strokeColor != null ? strokeColor.hashCode() : 0);
|
---|
79 | hash = 67 * hash + (fillColor != null ? fillColor.hashCode() : 0);
|
---|
80 | return hash;
|
---|
81 | }
|
---|
82 |
|
---|
83 | @Override
|
---|
84 | public String toString() {
|
---|
85 | return "symbol=" + symbol + " size=" + size +
|
---|
86 | (stroke != null ? (" stroke=" + stroke + " strokeColor=" + strokeColor) : "") +
|
---|
87 | (fillColor != null ? (" fillColor=" + fillColor) : "");
|
---|
88 | }
|
---|
89 | }
|
---|
90 |
|
---|
91 | public static class NodeTextElement extends TextElement {
|
---|
92 | public HorizontalTextAlignment hAlign;
|
---|
93 | public VerticalTextAlignment vAlign;
|
---|
94 |
|
---|
95 | public NodeTextElement(TextElement text, HorizontalTextAlignment hAlign, VerticalTextAlignment vAlign) {
|
---|
96 | super(text);
|
---|
97 | CheckParameterUtil.ensureParameterNotNull(hAlign);
|
---|
98 | CheckParameterUtil.ensureParameterNotNull(vAlign);
|
---|
99 | this.hAlign = hAlign;
|
---|
100 | this.vAlign = vAlign;
|
---|
101 | }
|
---|
102 |
|
---|
103 | @Override
|
---|
104 | public boolean equals(Object obj) {
|
---|
105 | if (!super.equals(obj))
|
---|
106 | return false;
|
---|
107 | if (obj == null || getClass() != obj.getClass())
|
---|
108 | return false;
|
---|
109 | final NodeTextElement other = (NodeTextElement) obj;
|
---|
110 | return hAlign == other.hAlign &&
|
---|
111 | vAlign == other.vAlign;
|
---|
112 | }
|
---|
113 |
|
---|
114 | @Override
|
---|
115 | public int hashCode() {
|
---|
116 | int hash = super.hashCode();
|
---|
117 | hash = 97 * hash + hAlign.hashCode();
|
---|
118 | hash = 97 * hash + vAlign.hashCode();
|
---|
119 | return hash;
|
---|
120 | }
|
---|
121 |
|
---|
122 | @Override
|
---|
123 | public String toString() {
|
---|
124 | return "NodeTextElement{" + toStringImpl() + '}';
|
---|
125 | }
|
---|
126 |
|
---|
127 | @Override
|
---|
128 | protected String toStringImpl() {
|
---|
129 | return super.toStringImpl() + " hAlign=" + hAlign + " vAlign=" + vAlign;
|
---|
130 | }
|
---|
131 | }
|
---|
132 |
|
---|
133 | public static final NodeElemStyle SIMPLE_NODE_ELEMSTYLE;
|
---|
134 | static {
|
---|
135 | MultiCascade mc = new MultiCascade();
|
---|
136 | Cascade c = mc.getOrCreateCascade("default");
|
---|
137 | c.put("text", Keyword.AUTO);
|
---|
138 | SIMPLE_NODE_ELEMSTYLE = create(new Environment(null, mc, "default", null), true);
|
---|
139 | }
|
---|
140 |
|
---|
141 | protected NodeElemStyle(Cascade c, ImageIcon icon, Integer iconAlpha, Symbol symbol, NodeTextElement text) {
|
---|
142 | super(c, 1000f);
|
---|
143 | this.icon = icon;
|
---|
144 | this.iconAlpha = iconAlpha == null ? 0 : iconAlpha;
|
---|
145 | this.symbol = symbol;
|
---|
146 | this.text = text;
|
---|
147 | }
|
---|
148 |
|
---|
149 | public static NodeElemStyle create(Environment env) {
|
---|
150 | return create(env, false);
|
---|
151 | }
|
---|
152 |
|
---|
153 | /*
|
---|
154 | * Caches the default text color from the preferences.
|
---|
155 | *
|
---|
156 | * FIXME: the cache isn't updated if the user changes the preference during a JOSM
|
---|
157 | * session. There should be preference listener updating this cache.
|
---|
158 | */
|
---|
159 | static private Color DEFAULT_TEXT_COLOR = null;
|
---|
160 | static private void initDefaultParameters() {
|
---|
161 | if (DEFAULT_TEXT_COLOR != null) return;
|
---|
162 | DEFAULT_TEXT_COLOR = PaintColors.TEXT.get();
|
---|
163 | }
|
---|
164 |
|
---|
165 | private static NodeElemStyle create(Environment env, boolean allowOnlyText) {
|
---|
166 | initDefaultParameters();
|
---|
167 | Cascade c = env.mc.getCascade(env.layer);
|
---|
168 |
|
---|
169 | Pair<ImageIcon, Integer> icon = createIcon(env);
|
---|
170 | Symbol symbol = null;
|
---|
171 | if (icon == null) {
|
---|
172 | symbol = createSymbol(env);
|
---|
173 | }
|
---|
174 |
|
---|
175 | NodeTextElement text = null;
|
---|
176 | TextElement te = TextElement.create(c, DEFAULT_TEXT_COLOR, symbol == null && icon == null);
|
---|
177 | // optimization: if we neither have a symbol, nor an icon, nor a text element
|
---|
178 | // we don't have to check for the remaining style properties and we don't
|
---|
179 | // have to allocate a node element style.
|
---|
180 | if (symbol == null && icon == null && te == null) return null;
|
---|
181 |
|
---|
182 | if (te != null) {
|
---|
183 | HorizontalTextAlignment hAlign = HorizontalTextAlignment.RIGHT;
|
---|
184 | Keyword hAlignKW = c.get("text-anchor-horizontal", Keyword.RIGHT, Keyword.class);
|
---|
185 | if (equal(hAlignKW.val, "left")) {
|
---|
186 | hAlign = HorizontalTextAlignment.LEFT;
|
---|
187 | } else if (equal(hAlignKW.val, "center")) {
|
---|
188 | hAlign = HorizontalTextAlignment.CENTER;
|
---|
189 | } else if (equal(hAlignKW.val, "right")) {
|
---|
190 | hAlign = HorizontalTextAlignment.RIGHT;
|
---|
191 | }
|
---|
192 | VerticalTextAlignment vAlign = VerticalTextAlignment.BOTTOM;
|
---|
193 | String vAlignStr = c.get("text-anchor-vertical", Keyword.BOTTOM, Keyword.class).val;
|
---|
194 | if (equal(vAlignStr, "above")) {
|
---|
195 | vAlign = VerticalTextAlignment.ABOVE;
|
---|
196 | } else if (equal(vAlignStr, "top")) {
|
---|
197 | vAlign = VerticalTextAlignment.TOP;
|
---|
198 | } else if (equal(vAlignStr, "center")) {
|
---|
199 | vAlign = VerticalTextAlignment.CENTER;
|
---|
200 | } else if (equal(vAlignStr, "bottom")) {
|
---|
201 | vAlign = VerticalTextAlignment.BOTTOM;
|
---|
202 | } else if (equal(vAlignStr, "below")) {
|
---|
203 | vAlign = VerticalTextAlignment.BELOW;
|
---|
204 | }
|
---|
205 | text = new NodeTextElement(te, hAlign, vAlign);
|
---|
206 | }
|
---|
207 |
|
---|
208 | return new NodeElemStyle(c,
|
---|
209 | icon == null ? null : icon.a,
|
---|
210 | icon == null ? null : icon.b,
|
---|
211 | symbol,
|
---|
212 | text);
|
---|
213 | }
|
---|
214 |
|
---|
215 | private static Pair<ImageIcon, Integer> createIcon(Environment env) {
|
---|
216 | Cascade c = env.mc.getCascade(env.layer);
|
---|
217 | Cascade c_def = env.mc.getCascade("default");
|
---|
218 |
|
---|
219 | IconReference iconRef = c.get("icon-image", null, IconReference.class);
|
---|
220 | if (iconRef == null)
|
---|
221 | return null;
|
---|
222 |
|
---|
223 | ImageIcon icon = null;
|
---|
224 | int iconAlpha = 0;
|
---|
225 |
|
---|
226 | icon = MapPaintStyles.getIcon(iconRef, false);
|
---|
227 | if (icon == null)
|
---|
228 | return new Pair<ImageIcon, Integer>(MapPaintStyles.getNoIcon_Icon(iconRef.source, false), 255);
|
---|
229 | else {
|
---|
230 | Float sizeOnDefault = c_def.get("icon-size", null, Float.class);
|
---|
231 | if (sizeOnDefault != null && sizeOnDefault <= 0) {
|
---|
232 | sizeOnDefault = null;
|
---|
233 | }
|
---|
234 | Float sizeF = getWidth(c, "icon-size", sizeOnDefault);
|
---|
235 |
|
---|
236 | if (sizeF != null) {
|
---|
237 | if (sizeF <= 0)
|
---|
238 | return null;
|
---|
239 | int size = Math.round(sizeF);
|
---|
240 | int width = icon.getIconWidth();
|
---|
241 | int height = icon.getIconHeight();
|
---|
242 | if (Math.max(width, height) != size) {
|
---|
243 | if (width >= height) {
|
---|
244 | width = size;
|
---|
245 | height = -1;
|
---|
246 | } else {
|
---|
247 | width = -1;
|
---|
248 | height = size;
|
---|
249 | }
|
---|
250 | icon.setImage(icon.getImage().getScaledInstance(width, height, Image.SCALE_SMOOTH));
|
---|
251 | }
|
---|
252 | }
|
---|
253 | iconAlpha = Math.min(255, Math.max(0, Integer.valueOf(Main.pref.getInteger("mappaint.icon-image-alpha", 255))));
|
---|
254 | Integer pAlpha = Utils.color_float2int(c.get("icon-opacity", null, float.class));
|
---|
255 | if (pAlpha != null) {
|
---|
256 | iconAlpha = pAlpha;
|
---|
257 | }
|
---|
258 |
|
---|
259 | return new Pair<ImageIcon, Integer>(icon, iconAlpha);
|
---|
260 | }
|
---|
261 | }
|
---|
262 |
|
---|
263 | private static Symbol createSymbol(Environment env) {
|
---|
264 | Cascade c = env.mc.getCascade(env.layer);
|
---|
265 | Cascade c_def = env.mc.getCascade("default");
|
---|
266 |
|
---|
267 | SymbolShape shape;
|
---|
268 | Keyword shapeKW = c.get("symbol-shape", null, Keyword.class);
|
---|
269 | if (shapeKW == null)
|
---|
270 | return null;
|
---|
271 | if (equal(shapeKW.val, "square")) {
|
---|
272 | shape = SymbolShape.SQUARE;
|
---|
273 | } else if (equal(shapeKW.val, "circle")) {
|
---|
274 | shape = SymbolShape.CIRCLE;
|
---|
275 | } else if (equal(shapeKW.val, "triangle")) {
|
---|
276 | shape = SymbolShape.TRIANGLE;
|
---|
277 | } else if (equal(shapeKW.val, "pentagon")) {
|
---|
278 | shape = SymbolShape.PENTAGON;
|
---|
279 | } else if (equal(shapeKW.val, "hexagon")) {
|
---|
280 | shape = SymbolShape.HEXAGON;
|
---|
281 | } else if (equal(shapeKW.val, "heptagon")) {
|
---|
282 | shape = SymbolShape.HEPTAGON;
|
---|
283 | } else if (equal(shapeKW.val, "octagon")) {
|
---|
284 | shape = SymbolShape.OCTAGON;
|
---|
285 | } else if (equal(shapeKW.val, "nonagon")) {
|
---|
286 | shape = SymbolShape.NONAGON;
|
---|
287 | } else if (equal(shapeKW.val, "decagon")) {
|
---|
288 | shape = SymbolShape.DECAGON;
|
---|
289 | } else
|
---|
290 | return null;
|
---|
291 |
|
---|
292 | Float sizeOnDefault = c_def.get("symbol-size", null, Float.class);
|
---|
293 | if (sizeOnDefault != null && sizeOnDefault <= 0) {
|
---|
294 | sizeOnDefault = null;
|
---|
295 | }
|
---|
296 | Float size = getWidth(c, "symbol-size", sizeOnDefault);
|
---|
297 |
|
---|
298 | if (size == null) {
|
---|
299 | size = 10f;
|
---|
300 | }
|
---|
301 |
|
---|
302 | if (size <= 0)
|
---|
303 | return null;
|
---|
304 |
|
---|
305 | Float strokeWidthOnDefault = getWidth(c_def, "symbol-stroke-width", null);
|
---|
306 | Float strokeWidth = getWidth(c, "symbol-stroke-width", strokeWidthOnDefault);
|
---|
307 |
|
---|
308 | Color strokeColor = c.get("symbol-stroke-color", null, Color.class);
|
---|
309 |
|
---|
310 | if (strokeWidth == null && strokeColor != null) {
|
---|
311 | strokeWidth = 1f;
|
---|
312 | } else if (strokeWidth != null && strokeColor == null) {
|
---|
313 | strokeColor = Color.ORANGE;
|
---|
314 | }
|
---|
315 |
|
---|
316 | Stroke stroke = null;
|
---|
317 | if (strokeColor != null) {
|
---|
318 | float strokeAlpha = c.get("symbol-stroke-opacity", 1f, Float.class);
|
---|
319 | strokeColor = new Color(strokeColor.getRed(), strokeColor.getGreen(),
|
---|
320 | strokeColor.getBlue(), Utils.color_float2int(strokeAlpha));
|
---|
321 | stroke = new BasicStroke(strokeWidth);
|
---|
322 | }
|
---|
323 |
|
---|
324 | Color fillColor = c.get("symbol-fill-color", null, Color.class);
|
---|
325 | if (stroke == null && fillColor == null) {
|
---|
326 | fillColor = Color.BLUE;
|
---|
327 | }
|
---|
328 |
|
---|
329 | if (fillColor != null) {
|
---|
330 | float fillAlpha = c.get("symbol-fill-opacity", 1f, Float.class);
|
---|
331 | fillColor = new Color(fillColor.getRed(), fillColor.getGreen(),
|
---|
332 | fillColor.getBlue(), Utils.color_float2int(fillAlpha));
|
---|
333 | }
|
---|
334 |
|
---|
335 | return new Symbol(shape, Math.round(size), stroke, strokeColor, fillColor);
|
---|
336 | }
|
---|
337 |
|
---|
338 | @Override
|
---|
339 | public void paintPrimitive(OsmPrimitive primitive, MapPaintSettings settings, MapPainter painter, boolean selected, boolean member) {
|
---|
340 | if (primitive instanceof Node) {
|
---|
341 | Node n = (Node) primitive;
|
---|
342 | if (icon != null && painter.isShowIcons()) {
|
---|
343 | painter.drawNodeIcon(n, (painter.isInactiveMode() || n.isDisabled()) ? getDisabledIcon() : icon,
|
---|
344 | Utils.color_int2float(iconAlpha), selected, member, text);
|
---|
345 | } else if (symbol != null) {
|
---|
346 | Color fillColor = symbol.fillColor;
|
---|
347 | if (fillColor != null) {
|
---|
348 | if (n.isHighlighted()) {
|
---|
349 | fillColor = settings.getHighlightColor();
|
---|
350 | } else {
|
---|
351 | if (painter.isInactiveMode() || n.isDisabled()) {
|
---|
352 | fillColor = settings.getInactiveColor();
|
---|
353 | } else if (selected) {
|
---|
354 | fillColor = settings.getSelectedColor(fillColor.getAlpha());
|
---|
355 | } else if (member) {
|
---|
356 | fillColor = settings.getRelationSelectedColor(fillColor.getAlpha());
|
---|
357 | }
|
---|
358 | }
|
---|
359 | }
|
---|
360 | Color strokeColor = symbol.strokeColor;
|
---|
361 | if (strokeColor != null) {
|
---|
362 | if (n.isHighlighted()) {
|
---|
363 | strokeColor = settings.getHighlightColor();
|
---|
364 | } else {
|
---|
365 | if (painter.isInactiveMode() || n.isDisabled()) {
|
---|
366 | strokeColor = settings.getInactiveColor();
|
---|
367 | } else if (selected) {
|
---|
368 | strokeColor = settings.getSelectedColor(strokeColor.getAlpha());
|
---|
369 | } else if (member) {
|
---|
370 | strokeColor = settings.getRelationSelectedColor(strokeColor.getAlpha());
|
---|
371 | }
|
---|
372 | }
|
---|
373 | }
|
---|
374 | painter.drawNodeSymbol(n, symbol, fillColor, strokeColor, text);
|
---|
375 | } else {
|
---|
376 | if (n.isHighlighted()) {
|
---|
377 | painter.drawNode(n, settings.getHighlightColor(), settings.getSelectedNodeSize(), settings.isFillSelectedNode(), text);
|
---|
378 | } else {
|
---|
379 | Color color;
|
---|
380 | boolean isConnection = n.isConnectionNode();
|
---|
381 |
|
---|
382 | if (painter.isInactiveMode() || n.isDisabled()) {
|
---|
383 | color = settings.getInactiveColor();
|
---|
384 | } else if (selected) {
|
---|
385 | color = settings.getSelectedColor();
|
---|
386 | } else if (member) {
|
---|
387 | color = settings.getRelationSelectedColor();
|
---|
388 | } else if (isConnection) {
|
---|
389 | if (n.isTagged()) {
|
---|
390 | color = settings.getTaggedConnectionColor();
|
---|
391 | } else {
|
---|
392 | color = settings.getConnectionColor();
|
---|
393 | }
|
---|
394 | } else {
|
---|
395 | if (n.isTagged()) {
|
---|
396 | color = settings.getTaggedColor();
|
---|
397 | } else {
|
---|
398 | color = settings.getNodeColor();
|
---|
399 | }
|
---|
400 | }
|
---|
401 |
|
---|
402 | final int size = Utils.max((selected ? settings.getSelectedNodeSize() : 0),
|
---|
403 | (n.isTagged() ? settings.getTaggedNodeSize() : 0),
|
---|
404 | (isConnection ? settings.getConnectionNodeSize() : 0),
|
---|
405 | settings.getUnselectedNodeSize());
|
---|
406 |
|
---|
407 | final boolean fill = (selected && settings.isFillSelectedNode()) ||
|
---|
408 | (n.isTagged() && settings.isFillTaggedNode()) ||
|
---|
409 | (isConnection && settings.isFillConnectionNode()) ||
|
---|
410 | settings.isFillUnselectedNode();
|
---|
411 |
|
---|
412 | painter.drawNode(n, color, size, fill, text);
|
---|
413 | }
|
---|
414 | }
|
---|
415 | } else if (primitive instanceof Relation && icon != null) {
|
---|
416 | painter.drawRestriction((Relation) primitive, this);
|
---|
417 | }
|
---|
418 | }
|
---|
419 |
|
---|
420 | public ImageIcon getDisabledIcon() {
|
---|
421 | if (disabledIcon != null)
|
---|
422 | return disabledIcon;
|
---|
423 | if (icon == null)
|
---|
424 | return null;
|
---|
425 | return disabledIcon = new ImageIcon(GrayFilter.createDisabledImage(icon.getImage()));
|
---|
426 | }
|
---|
427 |
|
---|
428 | @Override
|
---|
429 | public int hashCode() {
|
---|
430 | int hash = super.hashCode();
|
---|
431 | hash = 17 * hash + (icon != null ? icon.getImage().hashCode() : 0);
|
---|
432 | hash = 17 * hash + iconAlpha;
|
---|
433 | hash = 17 * hash + (symbol != null ? symbol.hashCode() : 0);
|
---|
434 | hash = 17 * hash + (text != null ? text.hashCode() : 0);
|
---|
435 | return hash;
|
---|
436 | }
|
---|
437 |
|
---|
438 | @Override
|
---|
439 | public boolean equals(Object obj) {
|
---|
440 | if (obj == null || getClass() != obj.getClass())
|
---|
441 | return false;
|
---|
442 | if (!super.equals(obj))
|
---|
443 | return false;
|
---|
444 |
|
---|
445 | final NodeElemStyle other = (NodeElemStyle) obj;
|
---|
446 | // we should get the same image object due to caching
|
---|
447 | if (icon != other.icon && (icon == null || other.icon == null || icon.getImage() != other.icon.getImage()))
|
---|
448 | return false;
|
---|
449 | if (this.iconAlpha != other.iconAlpha)
|
---|
450 | return false;
|
---|
451 | if (!equal(symbol, other.symbol))
|
---|
452 | return false;
|
---|
453 | if (!equal(text, other.text))
|
---|
454 | return false;
|
---|
455 | return true;
|
---|
456 | }
|
---|
457 |
|
---|
458 |
|
---|
459 | @Override
|
---|
460 | public String toString() {
|
---|
461 | StringBuilder s = new StringBuilder("NodeElemStyle{");
|
---|
462 | s.append(super.toString());
|
---|
463 | if (icon != null) {
|
---|
464 | s.append(" icon=" + icon + " iconAlpha=" + iconAlpha);
|
---|
465 | }
|
---|
466 | if (symbol != null) {
|
---|
467 | s.append(" symbol=[" + symbol + "]");
|
---|
468 | }
|
---|
469 | if (text != null) {
|
---|
470 | s.append(" text=[" + text.toStringImpl() + "]");
|
---|
471 | }
|
---|
472 | s.append('}');
|
---|
473 | return s.toString();
|
---|
474 | }
|
---|
475 | }
|
---|