Changeset 3740 in josm
- Timestamp:
- 2010-12-23T15:38:34+01:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java
r3739 r3740 145 145 private String attrTermsUrl; 146 146 private Rectangle attrImageBounds, attrToUBounds; 147 private static final Font InfoFont = new Font("sansserif", Font.BOLD, 13); 147 148 private static final Font ATTR_FONT = new Font("Arial", Font.PLAIN, 10); 148 149 private static final Font ATTR_LINK_FONT; … … 832 833 } 833 834 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 834 843 void paintTileText(TileSet ts, Tile tile, Graphics g, MapView mv, int zoom, Tile t) { 835 844 int fontHeight = g.getFontMetrics().getHeight(); … … 840 849 841 850 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); 843 852 texty += 1 + fontHeight; 844 853 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); 846 855 texty += 1 + fontHeight; 847 856 } … … 851 860 String md = tile.toString(); 852 861 if (md != null) { 853 g.drawString(md, p.x + 2, texty);862 myDrawString(g, md, p.x + 2, texty); 854 863 texty += 1 + fontHeight; 855 864 } … … 857 866 if (meta != null) { 858 867 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); 860 869 texty += 1 + fontHeight; 861 870 } … … 865 874 String tileStatus = tile.getStatus(); 866 875 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); 868 877 texty += 1 + fontHeight; 869 878 } … … 1122 1131 } 1123 1132 g.setColor(Color.red); 1133 g.setFont(InfoFont); 1124 1134 1125 1135 // The current zoom tileset is guaranteed to have all of … … 1133 1143 Font font = g.getFont(); 1134 1144 g.setFont(ATTR_LINK_FONT); 1145 g.setColor(Color.white); 1135 1146 1136 1147 // Draw terms of use text … … 1143 1154 int y = mv.getHeight() - textHeight; 1144 1155 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); 1149 1157 } 1150 1158 … … 1166 1174 int x = mv.getWidth() - (int) stringBounds.getWidth(); 1167 1175 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); 1172 1177 } 1173 1178 … … 1197 1202 g.setColor(Color.black); 1198 1203 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); 1200 1205 } 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); 1202 1207 } 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); 1204 1209 } 1205 1210 }// end of paint method
Note:
See TracChangeset
for help on using the changeset viewer.