- Timestamp:
- 2011-08-27T11:52:16+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
r4333 r4350 182 182 } 183 183 184 private final Shortcut[] visibilityToggleShortcuts = new Shortcut[10]; 185 private final ToggleLayerIndexVisibility[] visibilityToggleActions = new ToggleLayerIndexVisibility[10]; 184 186 /** 185 187 * registers (shortcut to toggle right hand side toggle dialogs)+(number keys) shortcuts … … 191 193 KeyEvent.VK_9, KeyEvent.VK_0 }; 192 194 193 for(int i=1; i <= 10; i++) { 194 Main.registerActionShortcut( 195 new ToggleLayerIndexVisibility(i), 196 Shortcut.registerShortcut("subwindow:layers:toggleLayer" + i, 197 tr("Toggle visibility of layer: {0}", i), 198 k[i-1], 199 Shortcut.GROUP_LAYER)); 195 for(int i=0; i < 10; i++) { 196 visibilityToggleShortcuts[i] = Shortcut.registerShortcut( 197 "subwindow:layers:toggleLayer" + (i+1), 198 tr("Toggle visibility of layer: {0}", (i+1)), 199 k[i], 200 Shortcut.GROUP_LAYER); 201 visibilityToggleActions[i] = new ToggleLayerIndexVisibility(i); 202 Main.registerActionShortcut(visibilityToggleActions[i], visibilityToggleShortcuts[i]); 200 203 } 201 204 } … … 338 341 @Override 339 342 public void destroy() { 343 for(int i=0; i < 10; i++) { 344 Main.unregisterActionShortcut(visibilityToggleActions[i], visibilityToggleShortcuts[i]); 345 } 340 346 super.destroy(); 341 347 instance = null;
Note:
See TracChangeset
for help on using the changeset viewer.