Changeset 302 in josm
- Timestamp:
- 2007-08-08T17:09:56+02:00 (17 years ago)
- Location:
- src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/actions/AboutAction.java
r298 r302 1 // 1 //License: GPL. Copyright 2007 by Immanuel Scholz and others 2 2 package org.openstreetmap.josm.actions; 3 3 … … 14 14 import java.io.InputStreamReader; 15 15 import java.net.URL; 16 import java.util.Map.Entry; 16 17 import java.util.regex.Matcher; 17 18 import java.util.regex.Pattern; 18 19 20 import javax.swing.AbstractAction; 19 21 import javax.swing.BorderFactory; 22 import javax.swing.Box; 23 import javax.swing.JButton; 20 24 import javax.swing.JLabel; 21 25 import javax.swing.JOptionPane; … … 67 71 JTextArea readme = loadFile(Main.class.getResource("/README")); 68 72 JTextArea contribution = loadFile(Main.class.getResource("/CONTRIBUTION")); 69 JTextArea plugins = loadFile(null);70 73 71 74 JPanel info = new JPanel(new GridBagLayout()); … … 81 84 info.add(new UrlLabel("http://www.opengeodata.org/?cat=17"), GBC.eol().fill(GBC.HORIZONTAL)); 82 85 83 StringBuilder pluginsStr = new StringBuilder();84 for (PluginProxy p : Main.plugins)85 pluginsStr.append(p.info.name + "\n");86 plugins.setText(pluginsStr.toString());87 plugins.setCaretPosition(0);88 89 86 about.addTab(tr("Info"), info); 90 87 about.addTab(tr("Readme"), createScrollPane(readme)); 91 88 about.addTab(tr("Revision"), createScrollPane(revision)); 92 89 about.addTab(tr("Contribution"), createScrollPane(contribution)); 93 about.addTab(tr("Plugins"), createScrollPane(plugins)); 90 91 JPanel pluginTab = new JPanel(new GridBagLayout()); 92 for (final PluginProxy p : Main.plugins) { 93 String name = p.info.name + (p.info.version != null && !p.info.version.equals("") ? " Version: "+p.info.version : ""); 94 pluginTab.add(new JLabel(name), GBC.std()); 95 pluginTab.add(Box.createHorizontalGlue(), GBC.std().fill(GBC.HORIZONTAL)); 96 pluginTab.add(new JButton(new AbstractAction(tr("Information")){ 97 public void actionPerformed(ActionEvent event) { 98 StringBuilder b = new StringBuilder(); 99 for (Entry<String,String> e : p.info.attr.entrySet()) { 100 b.append(e.getKey()); 101 b.append(": "); 102 b.append(e.getValue()); 103 b.append("\n"); 104 } 105 JTextArea a = new JTextArea(10,40); 106 a.setEditable(false); 107 a.setText(b.toString()); 108 JOptionPane.showMessageDialog(Main.parent, new JScrollPane(a)); 109 } 110 }), GBC.eol()); 111 JLabel label = new JLabel("<html><i>"+(p.info.description==null?tr("no description available"):p.info.description)+"</i></html>"); 112 label.setBorder(BorderFactory.createEmptyBorder(0,20,0,0)); 113 label.setMaximumSize(new Dimension(450,1000)); 114 pluginTab.add(label, GBC.eop().fill(GBC.HORIZONTAL)); 115 } 116 about.addTab(tr("Plugins"), pluginTab); 94 117 95 118 about.setPreferredSize(new Dimension(500,300)); … … 102 125 area.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); 103 126 area.setOpaque(false); 104 127 JScrollPane sp = new JScrollPane(area); 105 128 sp.setBorder(null); 106 129 sp.setOpaque(false); 107 108 130 return sp; 131 } 109 132 110 133 /** … … 114 137 */ 115 138 public static String checkLatestVersion() { 116 117 118 119 120 121 122 123 124 125 126 139 String latest; 140 try { 141 InputStream s = new URL("http://josm.openstreetmap.de/current").openStream(); 142 latest = new BufferedReader(new InputStreamReader(s)).readLine(); 143 s.close(); 144 } catch (IOException x) { 145 x.printStackTrace(); 146 return "UNKNOWN"; 147 } 148 return latest; 149 } 127 150 128 151 /** -
src/org/openstreetmap/josm/gui/preferences/PluginPreference.java
r300 r302 79 79 plugin.add(pluginPane, GBC.eol().fill(GBC.BOTH)); 80 80 plugin.add(GBC.glue(0,10), GBC.eol()); 81 JButton morePlugins = new JButton(tr(" Get moreplugins"));81 JButton morePlugins = new JButton(tr("Check for plugins")); 82 82 morePlugins.addActionListener(new ActionListener(){ 83 83 public void actionPerformed(ActionEvent e) { … … 201 201 202 202 pluginCheck.setToolTipText(plugin.resource != null ? plugin.resource : tr("Plugin bundled with JOSM")); 203 JLabel label = new JLabel("<html><i>"+(plugin.description==null? "no description available":plugin.description)+"</i></html>");203 JLabel label = new JLabel("<html><i>"+(plugin.description==null?tr("no description available"):plugin.description)+"</i></html>"); 204 204 label.setBorder(BorderFactory.createEmptyBorder(0,20,0,0)); 205 205 label.setMaximumSize(new Dimension(450,1000));
Note:
See TracChangeset
for help on using the changeset viewer.