Changeset 116 in josm for src/org/openstreetmap/josm/actions
- Timestamp:
- 2006-07-20T00:43:51+02:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/actions/AboutAction.java
r104 r116 37 37 public class AboutAction extends JosmAction { 38 38 39 public static final String version; 40 41 private static JTextArea revision; 42 private static String time; 43 44 static { 45 JTextArea revision = loadFile(Main.class.getResource("/REVISION")); 46 47 Pattern versionPattern = Pattern.compile(".*?Revision: ([0-9]*).*", Pattern.CASE_INSENSITIVE|Pattern.DOTALL); 48 Matcher match = versionPattern.matcher(revision.getText()); 49 version = match.matches() ? match.group(1) : "UNKNOWN"; 50 51 Pattern timePattern = Pattern.compile(".*?Last Changed Date: ([^\n]*).*", Pattern.CASE_INSENSITIVE|Pattern.DOTALL); 52 match = timePattern.matcher(revision.getText()); 53 time = match.matches() ? match.group(1) : "UNKNOWN"; 54 } 55 39 56 public AboutAction() { 40 57 super(tr("About"), "about",tr("Display the about screen."), KeyEvent.VK_A); … … 45 62 46 63 JTextArea readme = loadFile(Main.class.getResource("/README")); 47 JTextArea revision = loadFile(Main.class.getResource("/REVISION"));48 49 Pattern versionPattern = Pattern.compile(".*?Revision: ([0-9]*).*", Pattern.CASE_INSENSITIVE|Pattern.DOTALL);50 Pattern timePattern = Pattern.compile(".*?Last Changed Date: ([^\n]*).*", Pattern.CASE_INSENSITIVE|Pattern.DOTALL);51 64 52 Matcher match = versionPattern.matcher(revision.getText());53 String version = match.matches() ? match.group(1) : "UNKNOWN";54 match = timePattern.matcher(revision.getText());55 String time = match.matches() ? match.group(1) : "UNKNOWN";56 57 65 JPanel info = new JPanel(new GridBagLayout()); 58 66 info.add(new JLabel(tr("Java OpenStreetMap Editor Version {0}",version)), GBC.eop()); … … 80 88 * @return An read-only text area with the content of "resource" 81 89 */ 82 private JTextArea loadFile(URL resource) { 90 private static JTextArea loadFile(URL resource) { 83 91 JTextArea area = new JTextArea(tr("File could not be found.")); 84 92 area.setEditable(false);
Note:
See TracChangeset
for help on using the changeset viewer.