Ignore:
Timestamp:
2010-12-23T15:38:34+01:00 (13 years ago)
Author:
Upliner
Message:

Make TMS info text more clearly visible

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java

    r3739 r3740  
    145145    private String attrTermsUrl;
    146146    private Rectangle attrImageBounds, attrToUBounds;
     147    private static final Font InfoFont = new Font("sansserif", Font.BOLD, 13);
    147148    private static final Font ATTR_FONT = new Font("Arial", Font.PLAIN, 10);
    148149    private static final Font ATTR_LINK_FONT;
     
    832833    }
    833834
     835    void myDrawString(Graphics g, String text, int x, int y) {
     836        Color oldColor = g.getColor();
     837        g.setColor(Color.black);
     838        g.drawString(text,x+1,y+1);
     839        g.setColor(oldColor);
     840        g.drawString(text,x,y);
     841    }
     842
    834843    void paintTileText(TileSet ts, Tile tile, Graphics g, MapView mv, int zoom, Tile t) {
    835844        int fontHeight = g.getFontMetrics().getHeight();
     
    840849
    841850        if (PROP_DRAW_DEBUG.get()) {
    842             g.drawString("x=" + t.getXtile() + " y=" + t.getYtile() + " z=" + zoom + "", p.x + 2, texty);
     851            myDrawString(g, "x=" + t.getXtile() + " y=" + t.getYtile() + " z=" + zoom + "", p.x + 2, texty);
    843852            texty += 1 + fontHeight;
    844853            if ((t.getXtile() % 32 == 0) && (t.getYtile() % 32 == 0)) {
    845                 g.drawString("x=" + t.getXtile() / 32 + " y=" + t.getYtile() / 32 + " z=7", p.x + 2, texty);
     854                myDrawString(g, "x=" + t.getXtile() / 32 + " y=" + t.getYtile() / 32 + " z=7", p.x + 2, texty);
    846855                texty += 1 + fontHeight;
    847856            }
     
    851860            String md = tile.toString();
    852861            if (md != null) {
    853                 g.drawString(md, p.x + 2, texty);
     862                myDrawString(g, md, p.x + 2, texty);
    854863                texty += 1 + fontHeight;
    855864            }
     
    857866            if (meta != null) {
    858867                for (Map.Entry<String, String> entry : meta.entrySet()) {
    859                     g.drawString(entry.getKey() + ": " + entry.getValue(), p.x + 2, texty);
     868                    myDrawString(g, entry.getKey() + ": " + entry.getValue(), p.x + 2, texty);
    860869                    texty += 1 + fontHeight;
    861870                }
     
    865874        String tileStatus = tile.getStatus();
    866875        if (!tile.isLoaded() && PROP_DRAW_DEBUG.get()) {
    867             g.drawString(tr("image " + tileStatus), p.x + 2, texty);
     876            myDrawString(g, tr("image " + tileStatus), p.x + 2, texty);
    868877            texty += 1 + fontHeight;
    869878        }
     
    11221131        }
    11231132        g.setColor(Color.red);
     1133        g.setFont(InfoFont);
    11241134
    11251135        // The current zoom tileset is guaranteed to have all of
     
    11331143            Font font = g.getFont();
    11341144            g.setFont(ATTR_LINK_FONT);
     1145            g.setColor(Color.white);
    11351146
    11361147            // Draw terms of use text
     
    11431154                int y = mv.getHeight() - textHeight;
    11441155                attrToUBounds = new Rectangle(x, y, textWidth, textHeight);
    1145                 g.setColor(Color.black);
    1146                 g.drawString("Background Terms of Use", x+1, y+1);
    1147                 g.setColor(Color.white);
    1148                 g.drawString("Background Terms of Use", x, y);
     1156                myDrawString(g, "Background Terms of Use", x, y);
    11491157            }
    11501158
     
    11661174                int x = mv.getWidth() - (int) stringBounds.getWidth();
    11671175                int y = mv.getHeight() - textHeight;
    1168                 g.setColor(Color.black);
    1169                 g.drawString(attributionText, x+1, y+1);
    1170                 g.setColor(Color.white);
    1171                 g.drawString(attributionText, x, y);
     1176                myDrawString(g, attributionText, x, y);
    11721177            }
    11731178
     
    11971202        g.setColor(Color.black);
    11981203        if (ts.insane()) {
    1199             g.drawString("zoom in to load any tiles", 120, 120);
     1204            myDrawString(g, "zoom in to load any tiles", 120, 120);
    12001205        } else if (ts.tooLarge()) {
    1201             g.drawString("zoom in to load more tiles", 120, 120);
     1206            myDrawString(g, "zoom in to load more tiles", 120, 120);
    12021207        } else if (ts.tooSmall()) {
    1203             g.drawString("increase zoom level to see more detail", 120, 120);
     1208            myDrawString(g, "increase zoom level to see more detail", 120, 120);
    12041209        }
    12051210    }// end of paint method
Note: See TracChangeset for help on using the changeset viewer.