Changeset 458 in josm
- Timestamp:
- 2007-11-08T06:32:34+01:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
r410 r458 6 6 7 7 import java.awt.event.ActionEvent; 8 import java.awt.event.KeyEvent; 8 9 import java.util.Collection; 9 10 … … 25 26 public static final String[] modes = { 26 27 marktr("data"), 28 marktr("layer"), 27 29 marktr("selection"), 28 marktr("layer"),29 30 marktr("conflict") 30 31 }; 31 32 private final String mode; 32 33 34 private static int getModeShortcut(String mode) { 35 int shortcut = -1; 36 37 if(mode.equals("data")) { 38 shortcut = KeyEvent.VK_1; 39 } 40 if(mode.equals("layer")) { 41 shortcut = KeyEvent.VK_2; 42 } 43 if(mode.equals("selection")) { 44 shortcut = KeyEvent.VK_3; 45 } 46 if(mode.equals("conflict")) { 47 shortcut = KeyEvent.VK_4; 48 } 49 50 return shortcut; 51 } 52 33 53 public AutoScaleAction(String mode) { 34 super(tr("Zoom to {0}", mode), "dialogs/autoscale/"+mode, tr("Zoom the view to {0}.", tr(mode)), 0, 0, true);54 super(tr("Zoom to {0}", mode), "dialogs/autoscale/"+mode, tr("Zoom the view to {0}.", tr(mode)), AutoScaleAction.getModeShortcut(mode), 0, true); 35 55 String modeHelp = Character.toUpperCase(mode.charAt(0))+mode.substring(1); 36 56 putValue("help", "Action/AutoScale/"+modeHelp);
Note:
See TracChangeset
for help on using the changeset viewer.