Changeset 4863 in josm
- Timestamp:
- 2012-01-24T00:40:20+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/GettingStarted.java
r4709 r4863 10 10 import java.awt.event.KeyEvent; 11 11 import java.io.UnsupportedEncodingException; 12 import java.net.URL; 13 import java.util.regex.Matcher; 14 import java.util.regex.Pattern; 12 15 13 16 import javax.swing.JComponent; … … 122 125 EventQueue.invokeLater(new Runnable() { 123 126 public void run() { 124 lg.setText( content);127 lg.setText(fixImageLinks(content)); 125 128 // lg.moveCaretPosition(0); 126 129 } … … 133 136 new FileDrop(scroller); 134 137 } 138 139 private String fixImageLinks(String s) { 140 Matcher m = Pattern.compile("src=\"http://josm.openstreetmap.de/browser/trunk(/images/.*?\\.png)\\?format=raw\"").matcher(s); 141 StringBuffer sb = new StringBuffer(); 142 while (m.find()) { 143 String im = m.group(1); 144 URL u = getClass().getResource(im); 145 if (u == null) { 146 u = getClass().getResource("/images/data/node.png"); 147 } 148 m.appendReplacement(sb, "src=\"" + u.toString() + "\""); 149 } 150 m.appendTail(sb); 151 return sb.toString(); 152 } 135 153 }
Note:
See TracChangeset
for help on using the changeset viewer.