Changeset 116 in josm for src/org/openstreetmap/josm/actions


Ignore:
Timestamp:
2006-07-20T00:43:51+02:00 (19 years ago)
Author:
imi
Message:
  • added color for scale bar
  • fixed scale bar in EPSG:4236 projection
  • added annotation preset system
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/org/openstreetmap/josm/actions/AboutAction.java

    r104 r116  
    3737public class AboutAction extends JosmAction {
    3838
     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       
    3956        public AboutAction() {
    4057                super(tr("About"), "about",tr("Display the about screen."), KeyEvent.VK_A);
     
    4562               
    4663                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);
    5164
    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                
    5765                JPanel info = new JPanel(new GridBagLayout());
    5866                info.add(new JLabel(tr("Java OpenStreetMap Editor Version {0}",version)), GBC.eop());
     
    8088         * @return      An read-only text area with the content of "resource"
    8189         */
    82         private JTextArea loadFile(URL resource) {
     90        private static JTextArea loadFile(URL resource) {
    8391                JTextArea area = new JTextArea(tr("File could not be found."));
    8492                area.setEditable(false);
Note: See TracChangeset for help on using the changeset viewer.