Changeset 3443 in josm for trunk/src/org/openstreetmap/josm/gui
- Timestamp:
- 2010-08-15T22:04:43+02:00 (14 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MapFrame.java
r3278 r3443 214 214 } 215 215 } 216 mapView.destroy(); 216 217 } 217 218 -
trunk/src/org/openstreetmap/josm/gui/MapView.java
r3416 r3443 222 222 223 223 // listend to selection changes to redraw the map 224 DataSet.addSelectionListener(new SelectionChangedListener(){ 225 public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) { 226 repaint(); 227 } 228 }); 224 DataSet.addSelectionListener(repaintSelectionChangedListener); 229 225 230 226 //store the last mouse action … … 805 801 } 806 802 803 private SelectionChangedListener repaintSelectionChangedListener = new SelectionChangedListener(){ 804 public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) { 805 repaint(); 806 } 807 }; 808 809 public void destroy() { 810 Main.pref.removePreferenceChangeListener(this); 811 DataSet.removeSelectionListener(repaintSelectionChangedListener); 812 } 813 807 814 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/CommandStackDialog.java
r3275 r3443 12 12 import java.awt.event.KeyEvent; 13 13 import java.awt.event.MouseEvent; 14 15 14 import java.util.ArrayList; 16 15 import java.util.LinkedHashSet; … … 74 73 super(tr("Command Stack"), "commandstack", tr("Open a list of all commands (undo buffer)."), 75 74 Shortcut.registerShortcut("subwindow:commandstack", tr("Toggle: {0}", tr("Command Stack")), KeyEvent.VK_O, Shortcut.GROUP_LAYER, Shortcut.SHIFT_DEFAULT), 100, true); 76 Main.main.undoRedo.listenerCommands.add(this);77 78 75 undoTree.addMouseListener(new PopupMenuHandler()); 79 76 undoTree.setRootVisible(false); … … 212 209 listener.updateEnabledState(); 213 210 } 211 Main.main.undoRedo.listenerCommands.add(this); 214 212 } 215 213 … … 227 225 undoTreeModel.setRoot(new DefaultMutableTreeNode()); 228 226 redoTreeModel.setRoot(new DefaultMutableTreeNode()); 227 Main.main.undoRedo.listenerCommands.remove(this); 229 228 } 230 229 … … 263 262 // if one tree is empty, move selection to the other 264 263 switch (lastOperation) { 265 266 267 268 269 270 271 272 273 274 264 case UNDO: 265 if (undoCommands.isEmpty()) { 266 lastOperation = UndoRedoType.REDO; 267 } 268 break; 269 case REDO: 270 if (redoCommands.isEmpty()) { 271 lastOperation = UndoRedoType.UNDO; 272 } 273 break; 275 274 } 276 275 277 276 // select the next command to undo/redo 278 277 switch (lastOperation) { 279 280 281 282 283 284 278 case UNDO: 279 undoTree.setSelectionRow(undoTree.getRowCount()-1); 280 break; 281 case REDO: 282 redoTree.setSelectionRow(0); 283 break; 285 284 } 286 285 } … … 370 369 this.type = type; 371 370 switch (type) { 372 373 374 375 376 377 378 379 380 381 382 383 371 case UNDO: 372 tree = undoTree; 373 putValue(NAME,tr("Undo")); 374 putValue(SHORT_DESCRIPTION, tr("Undo the selected and all later commands")); 375 putValue(SMALL_ICON, ImageProvider.get("undo")); 376 break; 377 case REDO: 378 tree = redoTree; 379 putValue(NAME,tr("Redo")); 380 putValue(SHORT_DESCRIPTION, tr("Redo the selected and all earlier commands")); 381 putValue(SMALL_ICON, ImageProvider.get("redo")); 382 break; 384 383 } 385 384 } … … 397 396 // calculate the number of commands to undo/redo; then do it 398 397 switch (type) { 399 400 401 402 403 404 405 406 398 case UNDO: 399 int numUndo = ((DefaultMutableTreeNode) undoTreeModel.getRoot()).getChildCount() - idx; 400 Main.main.undoRedo.undo(numUndo); 401 break; 402 case REDO: 403 int numRedo = idx+1; 404 Main.main.undoRedo.redo(numRedo); 405 break; 407 406 } 408 407 Main.map.repaint(); -
trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java
r3416 r3443 188 188 189 189 public ShowUserInfoAction() { 190 super(false); 190 191 putValue(NAME, tr("Show info")); 191 192 putValue(SHORT_DESCRIPTION, tr("Launches a browser with information about the user")); -
trunk/src/org/openstreetmap/josm/gui/history/VersionTable.java
r3083 r3443 117 117 118 118 public ChangesetInfoAction() { 119 super(true); 119 120 putValue(NAME, tr("Changeset info")); 120 121 putValue(SHORT_DESCRIPTION, tr("Launch browser with information about the changeset"));
Note:
See TracChangeset
for help on using the changeset viewer.