Changeset 292 in josm for src/org/openstreetmap/josm/actions
- Timestamp:
- 2007-07-19T23:19:21+02:00 (18 years ago)
- Location:
- src/org/openstreetmap/josm/actions
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/actions/AboutAction.java
r288 r292 23 23 import javax.swing.JTabbedPane; 24 24 import javax.swing.JTextArea; 25 import javax.swing.SwingUtilities;26 25 27 26 import org.openstreetmap.josm.Main; … … 70 69 71 70 JPanel info = new JPanel(new GridBagLayout()); 72 info.add(new JLabel(tr("Java OpenStreetMap Editor Version {0}",version)), GBC.eol()); 73 info.add(new JLabel(tr("last change at {0}",time)), GBC.eol()); 74 info.add(new JLabel(tr("Java Version {0}",System.getProperty("java.version"))), GBC.eol()); 75 info.add(new JLabel(tr("Latest Version on JOSM homepage is")), GBC.std().insets(0,0,5,0)); 76 final JLabel checkVersionLabel = new JLabel("<html><em>"+tr("checking...")+"</em></html>"); 77 info.add(checkVersionLabel, GBC.eol()); 78 new Thread(){ 79 @Override public void run() { 80 final String version = checkLatestVersion(); 81 try { 82 if (version == null) 83 throw new NullPointerException(); 84 SwingUtilities.invokeAndWait(new Runnable(){ 85 public void run() { 86 checkVersionLabel.setText(version); 87 } 88 }); 89 } catch (Exception e) { 90 checkVersionLabel.setText("failed."); 91 } 92 } 93 }.start(); 94 71 info.add(new JLabel(tr("Java OpenStreetMap Editor Version {0}",version)), GBC.eol().fill(GBC.HORIZONTAL)); 72 info.add(new JLabel(tr("last change at {0}",time)), GBC.eol().fill(GBC.HORIZONTAL)); 73 info.add(new JLabel(tr("Java Version {0}",System.getProperty("java.version"))), GBC.eol().fill(GBC.HORIZONTAL)); 95 74 info.add(GBC.glue(0,10), GBC.eol()); 96 97 75 info.add(new JLabel(tr("Homepage")), GBC.std().insets(0,0,10,0)); 98 info.add(new UrlLabel("http://josm.openstreetmap.de"), GBC.eol()); 76 info.add(new UrlLabel("http://josm.openstreetmap.de"), GBC.eol().fill(GBC.HORIZONTAL)); 99 77 info.add(new JLabel(tr("Bug Reports")), GBC.std().insets(0,0,10,0)); 100 info.add(new UrlLabel("http://josm.openstreetmap.de/newticket"), GBC.eol()); 78 info.add(new UrlLabel("http://josm.openstreetmap.de/newticket"), GBC.eol().fill(GBC.HORIZONTAL)); 101 79 info.add(new JLabel(tr("News about JOSM")), GBC.std().insets(0,0,10,0)); 102 info.add(new UrlLabel("http://www.opengeodata.org/?cat=17"), GBC.eol()); 80 info.add(new UrlLabel("http://www.opengeodata.org/?cat=17"), GBC.eol().fill(GBC.HORIZONTAL)); 103 81 104 82 StringBuilder pluginsStr = new StringBuilder(); -
src/org/openstreetmap/josm/actions/AutoScaleAction.java
r214 r292 29 29 30 30 public AutoScaleAction(String mode) { 31 super(tr(mode), "dialogs/autoscale/"+mode, tr("Zoom the view to {0}."), 0, 0, true); 31 super(tr("Zoom to {0}", mode), "dialogs/autoscale/"+mode, tr("Zoom the view to {0}.", tr(mode)), 0, 0, true); 32 32 String modeHelp = Character.toUpperCase(mode.charAt(0))+mode.substring(1); 33 33 putValue("help", "Action/AutoScale/"+modeHelp); -
src/org/openstreetmap/josm/actions/ExitAction.java
r178 r292 5 5 import java.awt.event.ActionEvent; 6 6 import java.awt.event.KeyEvent; 7 8 import org.openstreetmap.josm.Main; 7 9 8 10 /** … … 18 20 super(tr("Exit"), "exit", tr("Exit the application."), KeyEvent.VK_Q, KeyEvent.CTRL_DOWN_MASK, true); 19 21 } 20 22 21 23 public void actionPerformed(ActionEvent e) { 22 System.exit(0); 24 if (!Main.breakBecauseUnsavedChanges()) 25 System.exit(0); 23 26 } 24 27 } -
src/org/openstreetmap/josm/actions/JosmAction.java
r208 r292 27 27 super(name, ImageProvider.get(iconName)); 28 28 setHelpId(); 29 putValue(SHORT_DESCRIPTION, "<html>"+tooltip+" <font size='-2'>"+ShortCutLabel.name(shortCut, modifier)+"</font> </html>"); 30 this.shortCut = KeyStroke.getKeyStroke(shortCut, modifier); 31 Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(this.shortCut, name); 32 Main.contentPane.getActionMap().put(name, this); 29 String scl = ShortCutLabel.name(shortCut, modifier); 30 putValue(SHORT_DESCRIPTION, "<html>"+tooltip+" <font size='-2'>"+scl+"</font>"+(scl.equals("")?"":" ")+"</html>"); 31 if (shortCut != 0) { 32 this.shortCut = KeyStroke.getKeyStroke(shortCut, modifier); 33 Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(this.shortCut, name); 34 Main.contentPane.getActionMap().put(name, this); 35 } 33 36 putValue("toolbar", iconName); 34 37 if (register) … … 37 40 38 41 public void destroy() { 39 Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).remove(shortCut); 40 Main.contentPane.getActionMap().remove(shortCut); 42 if (shortCut != null) { 43 Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).remove(shortCut); 44 Main.contentPane.getActionMap().remove(shortCut); 45 } 41 46 } 42 47 -
src/org/openstreetmap/josm/actions/mapmode/ZoomAction.java
r113 r292 44 44 */ 45 45 public ZoomAction(MapFrame mapFrame) { 46 super(tr("Zoom"), "zoom", tr("Zoom in by dragging. (Ctrl+up,left,down,right, +,-)"), KeyEvent.VK_Z, mapFrame, ImageProvider.getCursor("normal", "zoom"));46 super(tr("Zoom"), "zoom", tr("Zoom in by dragging. (Ctrl+up,left,down,right,',','.')"), KeyEvent.VK_Z, mapFrame, ImageProvider.getCursor("normal", "zoom")); 47 47 mv = mapFrame.mapView; 48 48 selectionManager = new SelectionManager(this, true, mv);
Note:
See TracChangeset
for help on using the changeset viewer.