Changeset 8643 in josm for trunk/src/org
- Timestamp:
- 2015-08-05T23:51:30+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJob.java
r8640 r8643 276 276 return false; 277 277 } 278 } else { 278 } else if (attributes.getLastModification() > 0 && 279 now - attributes.getLastModification() > DEFAULT_EXPIRE_TIME) { 279 280 // check by file modification date 280 if (now - attributes.getLastModification() > DEFAULT_EXPIRE_TIME) { 281 log.log(Level.FINE, "JCS - Object has expired, maximum file age reached {0}", getUrl()); 282 return false; 283 } 281 log.log(Level.FINE, "JCS - Object has expired, maximum file age reached {0}", getUrl()); 282 return false; 283 } else if (now - attributes.getCreateTime() > DEFAULT_EXPIRE_TIME) { 284 log.log(Level.FINE, "JCS - Object has expired, maximum time since object creation reached {0}", getUrl()); 285 return false; 284 286 } 285 287 return true; -
trunk/src/org/openstreetmap/josm/data/imagery/TMSCachedTileLoaderJob.java
r8640 r8643 188 188 } 189 189 int httpStatusCode = attributes.getResponseCode(); 190 if (!isNoTileAtZoom() && httpStatusCode >= 400 && httpStatusCode != 499) {190 if (!isNoTileAtZoom() && httpStatusCode >= 400) { 191 191 if (attributes.getErrorMessage() == null) { 192 192 tile.setError(tr("HTTP error {0} when loading tiles", httpStatusCode)); -
trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
r8636 r8643 1037 1037 private void myDrawString(Graphics g, String text, int x, int y) { 1038 1038 Color oldColor = g.getColor(); 1039 g.setColor(Color.black); 1040 g.drawString(text, x+1, y+1); 1041 g.setColor(oldColor); 1042 g.drawString(text, x, y); 1039 String textToDraw = text; 1040 if (g.getFontMetrics().stringWidth(text) > tileSource.getTileSize()) { 1041 // text longer than tile size, split it 1042 StringBuilder line = new StringBuilder(); 1043 StringBuilder ret = new StringBuilder(); 1044 for(String s: text.split(" ")) { 1045 if (g.getFontMetrics().stringWidth(line.toString() + s) > tileSource.getTileSize()) { 1046 ret.append(line).append("\n"); 1047 line.setLength(0); 1048 } 1049 line.append(s).append(" "); 1050 } 1051 ret.append(line); 1052 textToDraw = ret.toString(); 1053 } 1054 int offset = 0; 1055 for (String s: textToDraw.split("\n")) { 1056 g.setColor(Color.black); 1057 g.drawString(s, x + 1, y + offset + 1); 1058 g.setColor(oldColor); 1059 g.drawString(s, x, y + offset); 1060 offset += g.getFontMetrics().getHeight() + 3; 1061 } 1043 1062 } 1044 1063
Note:
See TracChangeset
for help on using the changeset viewer.