| | 444 | /** |
| | 445 | * Displays text at specified position including its halo, if applicable. |
| | 446 | * |
| | 447 | * @param gv Text's glyphs to display. If {@code null}, use text from {@code s} instead. |
| | 448 | * @param s text to display if {@code gv} is {@code null} |
| | 449 | * @param x X position |
| | 450 | * @param y Y position |
| | 451 | * @param disabled {@code true} if element is disabled (filtered out) |
| | 452 | * @param text text style to use |
| | 453 | */ |
| | 454 | private void displayText(GlyphVector gv, String s, int x, int y, boolean disabled, TextElement text) { |
| | 455 | if (isInactiveMode || disabled) { |
| | 456 | g.setColor(inactiveColor); |
| | 457 | if (gv != null) { |
| | 458 | g.drawGlyphVector(gv, x, y); |
| | 459 | } else { |
| | 460 | g.setFont(text.font); |
| | 461 | g.drawString(s, x, y); |
| | 462 | } |
| | 463 | } else if (text.haloRadius != null) { |
| | 464 | g.setStroke(new BasicStroke(2*text.haloRadius, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND)); |
| | 465 | g.setColor(text.haloColor); |
| | 466 | if (gv == null) { |
| | 467 | FontRenderContext frc = g.getFontRenderContext(); |
| | 468 | gv = text.font.createGlyphVector(frc, s); |
| | 469 | } |
| | 470 | Shape textOutline = gv.getOutline(x, y); |
| | 471 | g.draw(textOutline); |
| | 472 | g.setStroke(new BasicStroke()); |
| | 473 | g.setColor(text.color); |
| | 474 | g.fill(textOutline); |
| | 475 | } else { |
| | 476 | g.setColor(text.color); |
| | 477 | if (gv != null) { |
| | 478 | g.drawGlyphVector(gv, x, y); |
| | 479 | } else { |
| | 480 | g.setFont(text.font); |
| | 481 | g.drawString(s, x, y); |
| | 482 | } |
| | 483 | } |
| | 484 | } |
| | 485 | |
| 590 | | if (isInactiveMode || n.isDisabled()) { |
| 591 | | g.setColor(inactiveColor); |
| 592 | | } else { |
| 593 | | g.setColor(text.color); |
| 594 | | } |
| 595 | | if (text.haloRadius != null) { |
| 596 | | g.setStroke(new BasicStroke(2*text.haloRadius, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND)); |
| 597 | | g.setColor(text.haloColor); |
| 598 | | FontRenderContext frc = g.getFontRenderContext(); |
| 599 | | GlyphVector gv = text.font.createGlyphVector(frc, s); |
| 600 | | Shape textOutline = gv.getOutline(x, y); |
| 601 | | g.draw(textOutline); |
| 602 | | g.setStroke(new BasicStroke()); |
| 603 | | g.setColor(text.color); |
| 604 | | g.fill(textOutline); |
| 605 | | } else { |
| 606 | | g.drawString(s, x, y); |
| 607 | | } |
| | 626 | displayText(null, s, x, y, n.isDisabled(), text); |
| 1153 | | if (text.haloRadius != null) { |
| 1154 | | Shape textOutline = gv.getOutline(); |
| 1155 | | g.setStroke(new BasicStroke(2*text.haloRadius, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND)); |
| 1156 | | g.setColor(text.haloColor); |
| 1157 | | g.draw(textOutline); |
| 1158 | | g.setStroke(new BasicStroke()); |
| 1159 | | g.setColor(text.color); |
| 1160 | | g.fill(textOutline); |
| 1161 | | } else { |
| 1162 | | g.setColor(text.color); |
| 1163 | | g.drawGlyphVector(gv, 0, 0); |
| 1164 | | } |
| | 1172 | displayText(gv, null, 0, 0, way.isDisabled(), text); |